On 2015-10-28, Scott Kostyshak wrote:
> On Mon, Oct 26, 2015 at 10:59:05AM +0000, Guenter Milde wrote:
>> On 2015-10-26, Scott Kostyshak wrote:
>> > On Sun, Oct 25, 2015 at 11:17:15AM +0100, Georg Baum wrote:
>> >> Scott Kostyshak wrote:

...

>> >> If some features of a document are implemented in a babel specific way
>> >> (even if the feature would in theory not need babel), then we should
>> >> rather declare that explicitly like in 78c60de9bb IMHO, than to
>> >> pretend that polyglossia can be used, but silently change the output.

>> > Ah this is a good point. Dang it. In this case I think it makes even
>> > more sense now to remove the babel-specific preamble code, which there
>> > seems to be support for from others as well. 

>> In this case, I would rather not remove the code but change it to be usable
>> without babel:

>> * if there is only one language in the document (or if the autrefname can be
>>   the same in all used languages), do the (r)definitions directly:

>> * if there is more than one language and autoreferencenames must be language
>>   speecific, define them for both, babel and polyglossia.


>> > I would prefer to leave the babel conditional in because of my reason
>> > above, until we come to a decision and action on whether the
>> > babel-specific code should be removed (e.g. fixing #9817?). That said, I
>> > do understand that two wrongs doesn't make a right so let me know if you
>> > believe strongly that I should revert.

I believe, the babel conditional should only stay, if the file with this
conditional not only compiles but also the result is OK.

* Math.lyx uses packages that either fail to compile or produce wrong output
  with XeTeX/LuaTeX (with both, TeX fonts and non-TeX fonts) in any language
  (e.g. mhchem)
  Also, some accents (e.g. \t) in "mathematical text" are missing in the
  output.
  
  -> invert all */Math.lyx tests with XeTeX and LuaTeX.
  -> don't add partial fixes (they may be outdated once the real problem is
     solved).
  -> consider a safeguard in LyX against using Xe/LuaTeX with non-compatible
     packages.
  
* fr/UserGuide.lyx compiles but has wrong output for LuaTeX with TeX fonts:
  Eg. the ToC is called "Table des matiÃĺres" (should be "Table des matières").
  This is a bug in Babel (or frenchb.ldf), where detecting
  XeTeX/LuaTeX assumes that non-TeX fonts are used and the encoding is utf8. 
  (It affects other Babel languages as well.)

  -> invert all doc/fr/*.lyx tests with XeTeX/LuaTeX and TeX fonts.
  -> don't add partial fixes.
  -> consider a safeguard in LyX against using Xe/LuaTeX with non-compatible
     packages.

* es/Customization.lyx
  Same problem with LuaTeX and TeX fonts: ToC becomes "ÃŊndice general".

  -> invert all doc/es/*.lyx tests with XeTeX/LuaTeX and TeX fonts.
  ...
  
>> I believe it would be better to suspend testing the problematic files
>> with "non-TeX fonts" until the issues are solved.

> Ideally code changes would not be committed before broken tests are
> fixed or the regressions caused by the commits are fixed. That should
> all be done in one commit.

We cannot expect this for cases where there are several reasons for failure
affecting a large number of documents. (Just consider the size of a single
commit fixing all cases of "missing character".)

-> We need a framework to handle such "generic" problems like "Xe/LuaTeX
   with TeX fonts".

   Suggestion:

   * Code changes/commits that break tests with the default export method of
     important documents require immediate action.
     
   * Problems with other export routes can be handled later (but should not
     be forgotten).
     
Also, not every developer should be expected to run the export tests for
every small commit - however, there should be a commitment to fix
problems introduced by ones changes.


>> Fixing problems in the Manuals found by automatic testing is a good thing.
>> Modifying the Manuals "somehow" just to please automatic testing is not.

> I agree. I think that in most cases fixing the manuals to compile to
> multiple formats improves the documents and forces us to have clean
> preamble code.

In this case, the preamble code got more complicated, not cleaner.
Also, it takes time to agree on a best praxis.


For the test with non-TeX fonts, the preamble code involving lmodern.sty
must be changed, otherwise 8-bit fonts are used with wrong font encoding!

One possibility would be to remove the special casing altogether,
possibly selecting a better font in the GUI (but this was rejected some
years ago).

Another option is the following patch (similar in all places where this
preamble code is used):

--- a/lib/doc/fr/UserGuide.lyx
+++ b/lib/doc/fr/UserGuide.lyx
@@ -15,11 +15,11 @@
 % email: lyx-d...@lists.lyx.org
 
 \usepackage{ifpdf} % part of the hyperref bundle
-\ifpdf % if pdflatex is used
-
+\ifpdf % if pdflatex or xelatex or lualatex is used
+\@ifpackageloaded{fontspec}{}{% non-tex-fonts default to LModern
  % set fonts for nicer pdf view
  \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{}
-
+}
 \fi % end if pdflatex is used
 
 % for correct jump positions whe clicking on a link to a float


Günter

Reply via email to