Martin Vermeer wrote:
On Tue, Nov 06, 2007 at 01:39:40AM +0200, Dov Feldstern wrote:
Martin Vermeer wrote:
On Mon, Nov 05, 2007 at 11:13:34PM +0200, Dov Feldstern wrote:
This is not accurate. It's true for URL, for example, but not for ERT. I
agree with Abdel that ideally, in ERT we should allow any encoding the
user wants, and it should be up to the user to make sure that any
necessary commands are included in the ERT for letting latex know about
the encoding changes. Why? Because the point of ERT is to as much as
possible let the user do whatever he wants, just as if he had the .tex
file and could now touch it up however he likes.
Actually I believe you can do that now. Insert your own encoding
commands, and insert, e.g., Hebrew byte sequences, by copy/paste from
the surrounding text. Yes, they will display wrong, but hey, it's ERT,
and it comes out right in print. And if that's what you want to do, it's
really easier to do outside ERT, which is meant for code, not language.
I just played around with this, and realized that the problem is with
the *encoding* of the text inside the ERT into the latex file. See above...
Actually I think you should never have any reason to _want_ to do this.
It's elegant, yes, and I agree philosophically with Abdel. But _in
practice_ the user can already output whatever he wants, by alternating
pieces of ERT with non-ERT. Precisely because ERT is "naked", and you
can set the language attribute for the ERT inset location in the
containing text too.
I believe ERT (as opposed to, e.g., Listings) should indeed be "naked"
and never used for anything but outputting TeX-executable stuff.
Well, I agree _pragmatically_ with you ;-) but how does that work in
practice? I agree we should not allow two different encodings nor two
different language within a same ERT. But imagine you want to input an
hebrew word in ERT; then you want to see it display correctly within LyX
and that is RTL. I proposed sometimes ago that the text direction (at
least within a word) should be decided upon the unicode code point only,
not upon the language; I still believe this is the right thing to do.
But right now how can we make the hebrew word display in RTL? I see two
solution:
1) The ERT inherit the language of the surrounding text: this seems like
counter to the idea that ERT should be naked.
2) We provide a dialog (or context menu) for ERT to enforce (optionally)
the text direction within the ERT. I actually think this last solution
should be generalized to all text insets.
What do you think?
Abdel.