X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeXFeatures.cpp;h=55db95350386506ffdbb6673b4f19ef90854dbcf;hb=c1ee1bc0baf00a64734ec5eb345884c057e4d9c1;hp=e19e771dd8fd2968a41311fa3d97bbc069dba691;hpb=73ccee113e2b1586a569904e964b935d22439f86;p=lyx.git diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index e19e771dd8..55db953503 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -79,6 +79,15 @@ static docstring const lyxarrow_def = from_ascii( "{\\leavevmode\\,$\\triangleleft$\\,\\allowbreak}\n" "{\\leavevmode\\,$\\triangleright$\\,\\allowbreak}}"); +// ZERO WIDTH SPACE (ZWSP) is actually not a space character +// but marks a line break opportunity. Several commands provide a +// line break opportunity. They differ in side-effects: +// \allowbreak prevents hyphenation after hyphen or dash + ZWSP +// \linebreak[] takes an optional argument denoting "urgency". +// The \LyXZeroWidthSpace wrapper allows customization in the preamble. +static docstring const lyxZWSP_def = from_ascii( + "\\newcommand*\\LyXZeroWidthSpace{\\hspace{0pt}}"); + // for quotes without babel. This does not give perfect results, but // anybody serious about non-english quotes should use babel (JMarc). @@ -1317,6 +1326,9 @@ TexString LaTeXFeatures::getMacros() const if (mustProvide("lyxarrow")) macros << lyxarrow_def << '\n'; + if (mustProvide("lyxzerowidthspace")) + macros << lyxZWSP_def << '\n'; + if (!usePolyglossia() && mustProvide("textgreek")) { // ensure LGR font encoding is defined also if fontenc is not loaded by LyX if (params_.main_font_encoding() == "default")