On Mon, Oct 29, 2007 at 12:45:22AM +0200, Dov Feldstern wrote:

... 
 
 
> >(And out of interest, does the workaround
> >
> >abc \R{[DEF \L{{url}} GHI]} jkl
> >
> >work, with [...] being, e.g., a branch inset?)
> >
> 
> Interesting... Yes, it does work. But I don't want to have to do this 
> every time I switch languages. And I don't want every language switch to 
> be in an inset, even if it were to happen automatically. But we've been 
> through this already...

I just wanted to check that my analysis is correct.
 
> >(A workaround for your problem -- almost a solution -- would indeed be
> >defining an URL flex inset for use with Hebrew textclasses, and adding
> >and using a Language parameter for insetlayouts, to be used for forcing
> >latex_language. Then, for Hebrew docs, you sacrifice the option of
> >having Hebrew stuff in an URL -- which you don't have anyway because of
> >LaTeX. Does that sound like an idea? Actually such an inset would
> >currently be fine for non-Hebrew too.)
> 
> Well, yes. Let me just make sure I understand you: what you mean is, we 
> define two new properties of a layout: Language (or does this one 
> already exist?) and ForceLTR (well, you didn't say that, but I'm saying 
> this ;) ). Now, for any custom inset I can set Language to xxxx, which 
> forces that language in the custom inset, and doesn't allow you to 
> switch it (much as happens today for ERT insets). And by setting 
> ForceLTR, we can activate the mechanism in 
> http://www.lyx.org/trac/browser/lyx-devel/trunk/src/Paragraph.cpp?rev=21230#L719
>  
> for embedding another level of LTR for the inset, inside the surrounding 
> RTL. Now, I can define a separate custom URL inset for Hebrew documents, in 
> which I set Language to latex_language and ForceLTR to true, and then I get 
> the behavior I want.

This is awful code... do I have to tinker with this too? 
 
Shouldn't it be enough to have just one property, Language, and set it to
latex_language?

> So yes, this is the solution I would like to see. And as you say, I 
> don't see any reason to have a separate inset for Hebrew, since the same 
> exact settings will work just as well for other languages, at least as 
> long as the underlying \url command doesn't support language/encoding 
> switching. When the underlying \url command supports language/encoding 
> switches, then we just switch off these two layout parameters, and we're 
> set.
> 
> >BTW I do believe we should (also) allow language changes inside verbatim
> >insets, even if in the case of URL they don't propagate to LaTeX: 1) to
> >allow the spell checker to work in there, and 2) because for other
> >verbatim insets (Listings, at some point?) this might make sense. Think
> >Hebrew comments in a Java listing.
> 
> Certainly I would like to be able to do this. In practice, though, you 
> need latex's cooperation, and we don't currently have that. And while we 
> don't have that, I think (though I'm not 100% sure about this) that I'd 
> rather not let the user do something which will cause latex errors.

Not a problem for URL... you'll just get nicely typeset LaTeX commands,
not errors.

- Martin

Reply via email to