I have looked into this glitch, and it seems to be an issue of the GUI doing exactly what the user does, which is not always what the user wants. In particular, it comes from the fact that one may not always select parts of a text with exact consistency (regarding whitespace).

This issue does not happen when one double-clicks on a word to be emphasized, or selects it consistently (always up to the word boundary, without its surrounding space).

However, the following actions reproduce it:

(0) Create a new document.

(1) Enter "This is not pretty".

(2) Select " not " including spaces.

(3) Select "emphasize"; the LaTeX source is updated to

    This is\emph{ not }pretty.

IMO this is already wrong here, as the \emph markup should be trimmed not to include leading or trailing white space (although other non-alphanumeric characters such as punctuation must be included).

(4) Double-click "not", selecting just the word (w/o spaces).
    Select "emphasize" again, and the code becomes even worse:

    This is\emph{ }not\emph{ }pretty.

I think the issue should be fixed at step (3), not at step (4) or as post-processing. What do you think? Should I file a bug report to make the issue more easily trackable?

Richard Heck wrote:

It's annoying mostly when one has to export to LaTeX for journals and
such, namely, that it is easy to get things like:
This is\emph{ }not\emph{ }pretty.
If "not" had been emphasized and now isn't, that can happen.

Where would one look to fix this?

Richard



--
Regards,
Cyrille Artho - http://artho.com/
The easiest way to get shot is to carry a gun.
                -- Atticus Finch

Reply via email to