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

List:       lyx-devel
Subject:    lyx2lyx dash fixes
From:       Guenter Milde <milde () users ! sf ! net>
Date:       2017-08-30 21:27:49
Message-ID: oo7akl$pnr$1 () blaine ! gmane ! org
[Download RAW message or body]

On 2017-08-26, Enrico Forestieri wrote:
> On Fri, Aug 25, 2017 at 09:38:11PM +0000, Guenter Milde wrote:

>> The list of caveats and incompatibilities may be shortened if we fix them.

>> >> +* If you used literal em- and en-dashes in pre-2.2 documents, you must
>> >> +  manually unselect
>> >> +  "Document->Settings->Fonts->Output em- and en-dash as ligatures" to
>> >> +  ensure unchanged line break behaviour.

>> This can be avoided when setting the setting based on document content.

See patch below.

> And what when both types are present? This is unfeasible.

This is a generic problem with the "buffer setting approach". The
RELEASE NOTES say:

  It is no longer possible to differentiate dashes with/without optional
  line break using --- and -- vs. literal dashes. Either convert one sort to
  ERT or insert optional line break characters.

and all we can do in lyx2lyx is adding a warning (to stderr or as a note in
the document).


The "reversion" fix provides backwards and round-trip compatibility with 2.1
and older: 

* If the "ligature dashes" setting is true, dashes are converted to
  \twohyphens and \threehyphens when exporting to 2.2 and to -- and ---
  when exporting to 2.1.

* Opening back-converted files in 2.3 restores the previous
  use_dash_ligatures value.

It also solves the two points:

  lyx2lyx deletes ZWSP characters following literal em- and en-dashes when
  converting to 2.3 format. If you used literal ZWSP characters (u200b) as
  optional line breaks after dashes, convert them to 0dd wide space insets
  before opening your document with LyX 2.3 or the optional line breaks will
  be lost!

* If using TeX fonts and en- and em-dashes are output as font ligatures,
  when exporting documents containing en- and em-dashes to the format of
  LyX 2.0 or earlier, the following line has to be manually added to the
  unicodesymbols file of that LyX version:<br>
  0x200b "\\hspace{0pt}" "" "" "" "" # ZERO WIDTH SPACE<br>
  This avoids "uncodable character" issues if the document is actually
  loaded by that LyX version. LyX 2.1 and later versions already have the
  necessary definition in their unicodesymbols file.

The downside is that the optional line break after dashes is missing if
files are opened in 2.2 unless a workaround is added either in 2.2 or 
lyx2lyx.

Günter

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

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