[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    Re: Annoying But Not Problematic LaTeX Export Glitch
From:       Cyrille Artho <c.artho () aist ! go ! jp>
Date:       2011-01-28 3:47:35
Message-ID: 4D423C57.9030700 () aist ! go ! jp
[Download RAW message or body]

Handling extra whitespace at editing time would be a good fix, I think. 
If someone wants to emphasize leading or trailing whitespace 
intentionally, protected space can be used. This would be consistent 
with other aspects of the behavior of LyX's GUI. For example, hitting 
the space bar twice will not give you two spaces; this can also be 
considered a case of trimming extra whitespace.

Ensuring the consistency of markup generated by LyX extends beyond the 
main text editor; for example, the math editor shows similar problems.

If you
(1) write "test" in math mode, then
(2) highlight "tes" and change the font to "mathit", then
(3) highlight the final "t" and change the font to "mathit" as well,
you get two separate instance of mathit (for "tes" and "t").

$\mathit{tes}\mathit{t}$

The math editor behaves a bit differently in the sense that such font 
attributes are not toggled; selecting the same attribute multiple times 
results in no visible effect. Instead, redundant nested LaTeX tags (such 
as \mathit{...}) are generated each time that option is selected.

In math mode, there is also another issue: Choosing, for example, 
"mathit" for some text, and then "mathrm", results in 
$\mathit{\mathrm{test}}$. The outer tag seems to have no effect but 
should definitely be removed, as otherwise the math editor will end 
generating more and more redundant tags with each selection, which may 
be a serious problem when submitting a paper for printing.


Georg Baum wrote:
> Jean-Marc Lasgouttes wrote:
>
>> Le 27/01/2011 02:25, Cyrille Artho a écrit :
>>> Are there any languages where it is correct to typeset \emph{ word }
>>> including white space around the word?
>>>
>>> If not, it may be better to trim the part inside \emph{...}.
>>>
>>> As an alternative, one could also either (a) trim any white-space-only
>>> \emph argument when emphasis is toggled, or (b) remove such artifacts
>>> when exporting code to LaTeX.
>>
>> I thought we had some code doing that. Did this got removed after a
>> cleanup?
>
> Yes. The latest bits of that were done for file format 259, but IIRC it
> started earlier. The reason is very simple: The export logic was too
> complicated, and the feature also had bugs. Handling this properly in
> tex2lyx would have been a nightmare too.
>
> Therefore, all magic that might be needed should be done at editing time,
> e.g. solution (a) mentioned above or something more clever. Once a
> particular piece of text is marked with a particular font property it gets
> exported to LaTeX as-is.
>
>
> Georg
>
>

-- 
Regards,
Cyrille Artho - http://artho.com/
The cost of freedom is eternal vigilance.
		-- Thomas Jefferson
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic