On 2015-06-02, Richard Heck wrote:
> On 06/02/2015 01:21 PM, Jean-Marc Lasgouttes wrote:
>> Le 02/06/2015 18:35, Guenter Milde a écrit :
>>> Dear LyX developers,

>>> I am planning to improve/fix the "textgreek" feature of the Unicode ->
>>> LaTeX export.

>>> The current implementation of “textgreek” makes LyX insert
>>> “\DeclareTextSymbol{\~}{LGR}{126}” into the LaTeX preamble.

>>> This was a workaround for missing accent definitions in LGR before the
>>> upcoming of the “greek-fontenc” package (May 2013). It is no longer
>>> required and stands in the way - preventing proper accent placement for
>>> non-standard accent-letter-combinations.

>> Is it possible to test whether this package is available and act on that?

> I was going to suggest the same strategy: test for it in configure, and
> then do the new thing if it is available. If that can be done.

In this case the new thing is "do not insert the ugly workaround".

However, it may be simpler to move the detection to the LaTeX compilation:
make the workaround more conservative:

diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index d5b8b2f..619d2fc 100644
@@ -189,7 +189,7 @@ static docstring const textgreek_def = from_ascii(
        "  \\fontencoding{LGR}\\selectfont\\def\\encodingdefault{LGR}}\n"
        "\\DeclareRobustCommand{\\textgreek}[1]{\\leavevmode{\\greektext #1}}\n"
        "\\DeclareFontEncoding{LGR}{}{}\n"
-       "\\DeclareTextSymbol{\\~}{LGR}{126}");
+       "\\ProvideTextCommand{\\~}{LGR}{\\char126}");
 
 static docstring const textcyr_def = from_ascii(
        "\\DeclareRobustCommand{\\cyrtext}{%\n"


The \ProvideTextCommand macro ony kicks in, if \~ had no local definition in
in the LGR font encoding.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

For the second part of my plan (LICR macros instead of the Latin
transcription for Greek characters in "unicodesymbols"), this would be a
novum: up to now, conversion with "unicodesymbols" does not test for
availability of required features.

We would have to consider:

* How to provide/define alternatives (the file syntax is already very
  complex)?

* It may be the conversion is done for export and later compilation on another
  machine with different package configuration.

* Do we want this at all?

* ...

I'd leave it for now.


Günter

Reply via email to