Dear LyX developers,

The following patch brings RELEASE_NOTES and UserGuide up to the current
state of dash handling in lyx. (The UserGuide was still at 2.1 behaviour.)

GĂĽnter

From 69a3f093bf2a2fb060e0f1bc4daf1cd6dc6c8754 Mon Sep 17 00:00:00 2001
From: @qšŃh <ĐŃŞŚV>
Date: Tue, 29 Aug 2017 21:52:31 +0200
Subject: [PATCH] Update documentation regarding em- and en-dashes.

---
 lib/RELEASE-NOTES     |  36 +++++++++++++++++++++++++++++++-----
 lib/doc/UserGuide.lyx | 586 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 606 insertions(+), 16 deletions(-)

diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index 591fcae..d328953 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -13,11 +13,13 @@
   be safely dissolved, as it will be automatically inserted at export time
   if needed, as usual.
 
-* LyX now outputs en- and em-dashes as -- and --- ligatures when exporting to
-  latex using TeX fonts, as done in version 2.1 and earlier. In version 2.2
-  they were instead output as the macros \textendash and \textemdash, causing
-  changed output with old documents and bugs. The 2.2 behavior can be restored
-  by don't allowing using dash ligatures in Document->Settings->Fonts.
+* The new setting
+  "Document->Settings->Fonts->Output em- and en-dash as ligatures" forces
+  output of en- and em-dashes as -- and --- when exporting to LaTeX.
+  It is is "true" by default but "false" when opening documents edited
+  with LyX 2.2.
+  See chapter 3.9.1.1 "Dashes and line breaks" of the User Guide and
+  "Caveats when upgrading from earlier versions to 2.3.x" below.
 
 * The following UI translations were dropped, because the lack of translation
   maintenance:  Russian, Danish, Greek, Serbian, Galician, Catalan, Romanian,
@@ -154,6 +156,30 @@
   the external_templates file, you will have to move the modifications to
   the respective *.xtemplate file manually.
 
+* Since version 2.2, -- and --- in the LyX source are output as -{}- and
+  -{}-{}- to prevent conversion to en- and em-dashes by TeX.
+  Occurences in pre-2.2 documents are converted to literal Unicode dashes.
+  In some cases this leads to different line breaks, as:
+  + there is an optional line break after hyphens (also -- and ---) but not
+    after literal dashes, and
+  + hyphenation is suppressed in words following hyphens but allowed after
+    literal dashes.
+
+  LyX 2.3 exports literal dashes as -- and --- by default. 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 behaviour.
+
+  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.
+
+  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
diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx
index d37fbdc..49f87f2 100644
--- a/lib/doc/UserGuide.lyx
+++ b/lib/doc/UserGuide.lyx
@@ -69,7 +69,7 @@ enumitem
 \font_sf_scale 100 100
 \font_tt_scale 100 100
 \use_microtype false
-\use_dash_ligatures true
+\use_dash_ligatures false
 \graphics default
 \default_output_format pdf2
 \output_sync 0
@@ -140,11 +140,12 @@ enumitem
 \papercolumns 1
 \papersides 2
 \paperpagestyle default
-\tracking_changes false
+\tracking_changes true
 \output_changes false
 \html_math_output 0
 \html_css_as_file 0
 \html_be_strict true
+\author 986154928 "Gnter Milde"
 \end_header
 
 \begin_body
@@ -12844,7 +12845,19 @@ Default
 Default,
 \family default
  the font that is preset by the current document class is used.
- In most cases, this will be the standard \SpecialChar TeX
+ 
+\change_inserted 986154928 1503765997
+With LyX's default font encoding
+\change_deleted 986154928 1503766002
+In most cases
+\change_unchanged
+, this 
+\change_inserted 986154928 1503766035
+is a lookalike of
+\change_deleted 986154928 1503766038
+will be
+\change_unchanged
+ the standard \SpecialChar TeX
  font, known as 
 \begin_inset Quotes eld
 \end_inset
@@ -12865,7 +12878,23 @@ Modern
 \family typewriter
 cm
 \family default
-) or 
+)
+\change_inserted 986154928 1503766057
+: either 
+\begin_inset Quotes eld
+\end_inset
+
+CM-Super
+\begin_inset Quotes erd
+\end_inset
+
+
+\change_unchanged
+ or 
+\change_inserted 986154928 1503766067
+the bitmap font 
+\change_unchanged
+
 \begin_inset Quotes eld
 \end_inset
 
@@ -12881,25 +12910,72 @@ European Computer Modern
 \family typewriter
 ec
 \family default
-), but some classes preset different default fonts.
+)
+\change_inserted 986154928 1503766075
+.
+\change_deleted 986154928 1503766073
+,
+\change_unchanged
+ 
+\change_deleted 986154928 1503766086
+but
+\change_inserted 986154928 1503766132
+However,
+\change_unchanged
+ some classes 
+\change_deleted 986154928 1503766097
+pre
+\change_unchanged
+set different default fonts.
 \end_layout
 
 \begin_layout Standard
 As 
+\change_deleted 986154928 1503766148
+
 \family typewriter
 cm
 \family default
- and 
+ and
+\change_unchanged
+ 
 \family typewriter
 ec
 \family default
- are bitmap fonts, they often look pixelated in PDF output, especially when
- you read the PDF in a zoomed size.
+ 
+\change_inserted 986154928 1503766179
+is 
+\change_unchanged
+a
+\change_deleted 986154928 1503766171
+re
+\change_unchanged
+ bitmap font
+\change_deleted 986154928 1503766192
+s
+\change_unchanged
+, 
+\change_deleted 986154928 1503766205
+they often
+\change_inserted 986154928 1503766207
+it
+\change_unchanged
+ look
+\change_inserted 986154928 1503766208
+s
+\change_unchanged
+ pixelated in PDF output, especially when you read the PDF in a zoomed size.
 \begin_inset Foot
 status collapsed
 
 \begin_layout Plain Layout
-This problem does not appear if you read PDFs in 
+This problem 
+\change_deleted 986154928 1503766226
+does not appear
+\change_inserted 986154928 1503766228
+is less severe
+\change_unchanged
+ if you read PDFs in 
 \family typewriter
 Adobe
 \begin_inset space ~
@@ -12928,12 +13004,22 @@ Modern
 \family default
  fonts, which is the recommended choice if you want to keep the look of
  
+\change_inserted 986154928 1503766401
+
 \family typewriter
+Computer
+\begin_inset space ~
+\end_inset
+
+Modern
+\change_deleted 986154928 1503766382
 cm
 \family default
 /
 \family typewriter
 ec
+\change_unchanged
+
 \family default
 .
  
@@ -12974,9 +13060,13 @@ One difference is improved kerning.
 \end_inset
 
 
+\change_deleted 986154928 1503766263
+
 \end_layout
 
 \begin_layout Itemize
+
+\change_deleted 986154928 1503766263
 or select the 
 \family sans
 AE
@@ -13127,6 +13217,8 @@ rève
 \end_inset
 
 .
+\change_unchanged
+
 \end_layout
 
 \begin_layout Itemize
@@ -16352,14 +16444,27 @@ en dash
 
 \begin_layout Plain Layout
 
+\change_inserted 986154928 1503767080
+\begin_inset Quotes eld
+\end_inset
+
+--
+\begin_inset Quotes erd
+\end_inset
+
+ in tex
 \family sans
+t
+\change_deleted 986154928 1503767710
 Insert\SpecialChar menuseparator
 Special
 \begin_inset space ~
 \end_inset
 
 Character\SpecialChar menuseparator
 Symbols
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -16389,14 +16494,27 @@ em dash
 
 \begin_layout Plain Layout
 
+\change_inserted 986154928 1503767977
+\begin_inset Quotes eld
+\end_inset
+
+---
+\begin_inset Quotes erd
+\end_inset
+
+ in tex
 \family sans
+t
+\change_deleted 986154928 1503767719
 Insert\SpecialChar menuseparator
 Special
 \begin_inset space ~
 \end_inset
 
 Character\SpecialChar menuseparator
 Symbols
+\change_unchanged
+
 \end_layout
 
 \end_inset
@@ -16457,6 +16575,71 @@ minus sign
 \end_layout
 
 \begin_layout Standard
+
+\change_inserted 986154928 1504004423
+Alternative input methods are system-wide key combinations
+\begin_inset Foot
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 986154928 1503767780
+On a Mac, the n-dash is entered with Option-hyphen and the m-dash with Shift-Opt
+ion-hyphen, some Linux keymaps bind AltGr+
+\begin_inset Quotes erd
+\end_inset
+
+-
+\begin_inset Quotes erd
+\end_inset
+
+ to the en-dash.
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+, 
+\family sans
+Insert\SpecialChar menuseparator
+Special
+\begin_inset space ~
+\end_inset
+
+Character\SpecialChar menuseparator
+Symbols,
+\family default
+ or the 
+\begin_inset Quotes eld
+\end_inset
+
+unicode-insert
+\begin_inset Quotes erd
+\end_inset
+
+ function with argument 2013 for the em-dash and 2014 for the en-dash.
+ The latter can also be bound to keys in Tools
+\family sans
+\SpecialChar menuseparator
+
+\family default
+Preferences
+\family sans
+\SpecialChar menuseparator
+
+\family default
+Editing
+\family sans
+\SpecialChar menuseparator
+
+\family default
+Shortcuts.
+\end_layout
+
+\begin_layout Standard
+
+\change_deleted 986154928 1503767103
 You can alternatively generate the en and em dash by inserting the 
 \begin_inset Quotes eld
 \end_inset
@@ -16502,6 +16685,8 @@ You can alternatively generate the en and em dash by inserting the
 \end_inset
 
  a em dash.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Standard
@@ -16524,6 +16709,10 @@ hyphen
 
 \begin_layout Enumerate
 From A–Z
+\change_inserted 986154928 1503767510
+; pages 369–378
+\change_unchanged
+
 \begin_inset space \hfill{}
 \end_inset
 
@@ -16559,6 +16748,339 @@ em dash
 minus sign
 \emph default
 )
+\change_inserted 986154928 1503937275
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 986154928 1503942361
+See also the 
+\begin_inset CommandInset href
+LatexCommand href
+name "Wikipedia entry on dashes"
+target "https://en.wikipedia.org/wiki/Dash";
+literal "false"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsubsection
+
+\change_inserted 986154928 1503938327
+Dashes and line breaks
+\begin_inset CommandInset label
+LatexCommand label
+name "subsec:Dashes-and-line-breaks"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 986154928 1504003971
+The setting
+\family sans
+ Document\SpecialChar menuseparator
+Settings\SpecialChar menuseparator
+Fonts\SpecialChar menuseparator
+Output en- and em-dashes as ligatures 
+\family default
+forces output of en- and em-dashes as 
+\begin_inset Quotes eld
+\end_inset
+
+--
+\begin_inset Quotes erd
+\end_inset
+
+ and 
+\begin_inset Quotes eld
+\end_inset
+
+---
+\begin_inset Quotes erd
+\end_inset
+
+ when exporting to LaTeX.
+ The TeX font ligature mechanism convertes them to dash characters followed
+ by an optional line break.
+ The setting is on by default but unselected when opening documents edited
+ with LyX 2.2 As with all settings, the default for new documents can be
+ configured via templates.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 986154928 1504003320
+Select it, if you want optional line breaks after 
+\series bold
+all
+\series default
+ en- and em-dashes.
+ Caveats:
+\change_unchanged
+
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 986154928 1504003737
+Line breaks in range specifications or between a dash and a non-breaking
+ space must be prevented by wrapping in a makebox:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+
+\change_inserted 986154928 1504013640
+No line breaks are allowed in ranges of values like 
+\begin_inset Quotes eld
+\end_inset
+
+see pages 
+\begin_inset Box Frameless
+position "t"
+hor_pos "c"
+has_inner_box 1
+inner_pos "t"
+use_parbox 0
+use_makebox 1
+width ""
+special "none"
+height "1in"
+height_special "totalheight"
+thickness "0.4pt"
+separation "3pt"
+shadowsize "4pt"
+framecolor "black"
+backgroundcolor "none"
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 986154928 1504013627
+369–378
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 986154928 1504003755
+In French and Spanish, dashes 
+\begin_inset Box Frameless
+position "t"
+hor_pos "c"
+has_inner_box 1
+inner_pos "t"
+use_parbox 0
+use_makebox 1
+width ""
+special "none"
+height "1in"
+height_special "totalheight"
+thickness "0.4pt"
+separation "3pt"
+shadowsize "4pt"
+framecolor "black"
+backgroundcolor "none"
+status open
+
+\begin_layout Plain Layout
+
+\change_inserted 986154928 1504003281
+–
+\begin_inset space ~
+\end_inset
+
+used like quotes
+\begin_inset space ~
+\end_inset
+
+–
+\end_layout
+
+\end_inset
+
+ must stay close to the enclosed content.
+ Line breaks are not allowed on the 
+\begin_inset Quotes eld
+\end_inset
+
+inner side
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 986154928 1504003823
+(See also section 
+\emph on
+Prevent Hyphenation
+\emph default
+ of the 
+\emph on
+Embedded
+\begin_inset space ~
+\end_inset
+
+Objects
+\emph default
+ manual.)
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+
+\change_inserted 986154928 1504012609
+The setting is ignored for documents using non-TeX fonts.
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+
+\change_inserted 986154928 1504012842
+XeTeX provides the 
+\family typewriter
+
+\backslash
+XeTeXdashbreakstate
+\family default
+ setting.
+ The default, 
+\family typewriter
+
+\backslash
+XeTeXdashbreakstate=1
+\family default
+, causes literal dashes to behave like 
+\begin_inset Quotes eld
+\end_inset
+
+ligature dashes
+\begin_inset Quotes erd
+\end_inset
+
+.
+\change_unchanged
+
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+
+\change_inserted 986154928 1504004044
+Em-dashes in 
+\family typewriter
+typewriter
+\family default
+ (monospaced) fonts end up as en-dash+hyphen or three hyphens in the output.
+\change_unchanged
+
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 986154928 1504003612
+Hyphenation is suppressed in words adjacent to hyphens and 
+\begin_inset Quotes eld
+\end_inset
+
+ligature dashes
+\begin_inset Quotes erd
+\end_inset
+
+.
+ 
+\end_layout
+
+\begin_layout Standard
+
+\change_inserted 986154928 1504012986
+Alternatively, leave this setting off (with XeTeX, insert 
+\family typewriter
+
+\backslash
+XeTeXdashbreakstate=0
+\family default
+ in 
+\family sans
+Document\SpecialChar menuseparator
+Settings\SpecialChar menuseparator
+LaTeX Preamble
+\family default
+) and insert optional line breaks with 
+\family sans
+Insert\SpecialChar menuseparator
+Formatting\SpecialChar menuseparator
+Optional line break
+\family default
+:
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 986154928 1504013036
+In English, line breaks after em-dashes—\SpecialChar allowbreak
+inserted without spaces—\SpecialChar allowbreak
+should be
+ allowed.
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 986154928 1504003205
+No line break are allowed in ranges of values like 1975–1982
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 986154928 1504004187
+In French and Spanish, dashes –
+\begin_inset space ~
+\end_inset
+
+used like quotes
+\begin_inset space ~
+\end_inset
+
+– must stay close to the enclosed content.
+ Line breaks are not allowed on the 
+\begin_inset Quotes eld
+\end_inset
+
+inner side
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted 986154928 1504004245
+Em-dashes also work as expected in 
+\family typewriter
+typewriter
+\family default
+ (monospaced) fonts: 
+\family typewriter
+Oh — there's a dash.
 \end_layout
 
 \begin_layout Subsection
@@ -16661,8 +17183,17 @@ A-b c
 
  as a hyphenation possibility.
  Hyphenating at this point would look ugly.
- To prevent the shortcut from being hyphenated, you can put it into a makebox
- as described in section 
+ To prevent the shortcut from being hyphenated, you can
+\change_inserted 986154928 1504001674
+ use a protected hyphen (
+\family sans
+Insert\SpecialChar menuseparator
+Formatting\SpecialChar menuseparator
+Protected Hyphen
+\family default
+) or
+\change_unchanged
+ put it into a makebox as described in section 
 \emph on
 Prevent Hyphenation
 \emph default
@@ -38381,6 +38912,39 @@ reference "subsec:Ligatures"
 \end_inset
 
 .
+\change_inserted 986154928 1503938048
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted 986154928 1503938353
+Optional
+\begin_inset space ~
+\end_inset
+
+Line
+\begin_inset space ~
+\end_inset
+
+Break Inserts a line break point (ZWSP) that is invisible in the output.
+ See section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "subsec:Dashes-and-line-breaks"
+plural "false"
+caps "false"
+noprefix "false"
+
+\end_inset
+
+ for a usage example.
+\change_unchanged
+
 \end_layout
 
 \begin_layout Description
--
libgit2 0.24.6

Reply via email to