On 2017-01-25, Enrico Forestieri wrote:

> I think the attached is all is needed here to please everyone.
> The appearance on screen is the same but we always output "--" and
> "---", except on text exports where the unicode characters are output.
> This should ensure maximum compatibility without cluttering the
> preamble with strange constructs. After all, what matters is the
> final pdf output and I very much prefer to have "--" and "---" in
> the latex code rather than \textendash and \textemdash.

The effect of this patch is the same as "forcing" the conversion to the
ligatures in lib/unicodesymbols (see below).

+2 traditional TeX constructs for em- and en-dash in the *.tex file
   * familiar look
   * no change to line breaking behaviour

+1 simple, no preamble code required

-1 hard to configure (a macro can be redefined, a font ligature not).

-0 inserting ----- stays as difficult as inserting 5 spaces in a row
   (needs a "literal" layout).

+1 index sorting problem solved (Ticket #10490)


with the differences

-1 additional code vs. 2 changed lines.
-2 hard-coded replacements:
    * inconsistent handling of Unicode characters
      (Paragraph.cpp vs. lib/unicodesymbols)
    * not configurable (not even by a power user).

I recommend the lib/unicodesymbols patch below as simple fix for the line
wrapping problem.

This would still not enable input of a line of hyphen characters in
"normal" text, though but maybe pressing CTRL-M (or CTRL-P C) *before*
the input is an acceptable workaround.

With an LFUN instead of the hard-coded binding to "-" for the input
convention, a user can turn off the auto-dash feature without need for
an new special setting. Then, also the input of ----------------- becomes
easy --- at the expense of more complicated input of the dashes.


Günter


--- a/lib/unicodesymbols
+++ b/lib/unicodesymbols
@@ -1737,8 +1737,8 @@
 0x2010 "-"                        "" "force=utf8x,notermination=text" "" "" # 
HYPHEN # identic in LaTeX to FIGURE DASH
 0x2011 "\\nobreakdash-"           "amsmath" "notermination=text" "" "" # 
NON-BREAKING HYPHEN
 0x2012 "-"                        "" "force=utf8x,notermination=text" "" "" # 
FIGURE DASH
-0x2013 "\\textendash"             "" "" # EN DASH
-0x2014 "\\textemdash"             "" "force=armscii8" # EM DASH
+0x2013 "--"                       "" "force,notermination=text" # EN DASH
+0x2014 "---"                      "" "force,notermination=text" # EM DASH
 # use the following macro for the character HORIZONTAL BAR
 0x2015 "\\LyXbar" "\\newcommand*\\LyXbar{\\rule[0.585ex]{1.2em}{0.25pt}}" 
"force"
 0x2016 "\\textbardbl"             "textcomp" 
"force=utf8x,notermination=math,tipashortcut=\\textdoublevertline{}" "\\|" "" # 
DOUBLE VERTICAL LINE


Reply via email to