On 2017-02-28, Enrico Forestieri wrote: > On Mon, Feb 27, 2017 at 10:39:25PM +0000, Guenter Milde wrote: >> On 2017-02-27, Enrico Forestieri wrote:
>> >> > At this point we have two simple alternatives. Either the above one or >> >> > https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg198615.html >> >> Both have serious drawbacks. See #10543. >> > TL;DR >> Sorry, but forcing a simple but insufficient patch to a complex problem >> because the description is too long is not the right thing. > You make it complex. We output latex and thus should follow latex rules. ... > Since ever LyX was outputting -- and --- and nobody was complaining > (I am not speaking about text or html output, which are different). >From the lyx-users list 2014: >https://marc.info/?l=lyx-users&m=140982011101908&w=2 In LaTeX, and therefore also in LyX, there are two types of en dash (and also two types of em dash). In LaTeX the first is entered by -- and the second is entered with \textendash. In LyX the first is entered with -- and the second is entered by putting the unicode en dash in (in my reply to Rich I listed three ways to do this, and Jerry's Mac technique is doing the same thing). It's not quite clear to me which is the "correct" way to do this. -- is older, and \textendash was introduced so that it can work with more fonts (or something like that). But as Jerry has noticed, they also have different line breaking properties. It sounds like the ability of -- to create a line break was just a side effect of its implementation rather than intended. Maybe it was suppressed from \textendash because it's so easy to turn back on when needed. Unfortunately, during the 2.1->2.2 change the differences between the two representations were not taken into consideration. As a result, there is now only one representation in the LyX source files. > Now LyX outputs \textendash and \textemdash and this is causing problems. > What is the conclusion? Outputting -- and --- would solve some problems and create new ones: A literal EM DASH allows hyphenation in the word before the dash Three alkali metals are the usual sub- stituents—sodium, potassium, and lithium. while the ligature prevents hyphenation in the word before the dash: Three alkali metals are the usual substituents— sodium, potassium, and lithium. See also https://www.lyx.org/trac/raw-attachment/ticket/10543/dash-problems.lyx https://www.lyx.org/trac/raw-attachment/ticket/10543/dash-problems-non-tex-fonts.lyx You get the same problem -- overfull lines -- with both approaches. So while curing some documents you break others. OtOH, with EM DASH + ZWSP, hyphenation in the preceding word is allowed as are line breaks after the dash. Günter