Use polyglossia also with DVI (LuaTeX).

Simplify the logic for language package selection and make it more consistent:

Use polyglossia with non-TeX fonts (system fonts/Unicode fonts) for all
export flavours (XeTeX, LuaTeX, DVI-LuaTeX), if the language package setting
is "auto" and there is no language not supported by Babel and no package
providing Babel.

This solves some Babel-related autotest cases and leads to some new failures
due to the polyglossia language nesting problem.
This commit is contained in:
Günter Milde 2016-01-08 22:51:58 +01:00
parent f35ed0c168
commit 3a70340a95
4 changed files with 17 additions and 42 deletions

View File

@ -48,8 +48,8 @@ export/doc/(es|fr)/UserGuide_pdf4_texF
export/examples/uk/splash_(dvi3|pdf[45])_texF export/examples/uk/splash_(dvi3|pdf[45])_texF
# missing commands (polyglossia?) # missing commands (polyglossia?)
# Explore! (works with dvi3 or language_package==babel) # Explore! (works with language_package==babel)
export/doc/fr/UserGuide_pdf[45]_systemF export/doc/fr/UserGuide_.*_systemF
# Bug in Babel-Spanish with Xe/LuaTeX and Unicode fonts: # Bug in Babel-Spanish with Xe/LuaTeX and Unicode fonts:
# #
@ -58,19 +58,11 @@ export/doc/fr/UserGuide_pdf[45]_systemF
# Workaround: add a line to the user-preamble # Workaround: add a line to the user-preamble
# \@ifpackageloaded{fontspec}{\unaccentedoperators}{} # \@ifpackageloaded{fontspec}{\unaccentedoperators}{}
export/doc/es/UserGuide_.*_systemF export/doc/es/UserGuide_.*_systemF
#
# Export with DVI (luatex) uses Babel instead of Polyglossia.
# Don't use the above workaround here - these documents don't require Babel
# problem should be solved by fixing auto-selection of language package.
export/examples/es/ejemplo_con_lyx_dvi3_systemF
# Galician shares some code with Babel-Spanish (including the bug).
export/doc/gl/Tutorial_dvi3_systemF
export/examples/gl/exemplo_lyxificado_dvi3_systemF
# Missing characters (U+0361, U+1E61) in LM, # Missing characters (U+0361, U+1E61) in LM,
# set different system font in the source? # set different system font in the source?
# + language nesting problem (may disappear after completed translation) # + language nesting problem (may disappear after completed translation)
export/doc/(de/|es/|fr/)Customization_pdf[45]_systemF export/doc/(de/|es/|fr/)Customization_.*_systemF
# Probably language mess # Probably language mess
export/export/ja/wrong_auto_encoding_(dvi|pdf(|3)) export/export/ja/wrong_auto_encoding_(dvi|pdf(|3))
@ -84,14 +76,6 @@ export/export/ja/wrong_auto_encoding_(dvi|pdf(|3))
# \c e -> 0229 LATIN SMALL LETTER E WITH CEDILLA # \c e -> 0229 LATIN SMALL LETTER E WITH CEDILLA
export/doc/(|de/|es/|fr/)Math.*systemF export/doc/(|de/|es/|fr/)Math.*systemF
# 1.) Unknown Japanese char in section if previous
# paragraph ended in non-Japaneese language
# This is the same error as in export/export/ja/wrong_auto_encoding (unreliableTests)
# 2.) unknown chars üß in selected encoding in 'This is a German word: Tschüß'
#
# Both reasons invalid since the commit 6b0632eea288348b912f98b79bc871830b6a3d98
#export/doc/ja/EmbeddedObjects_(dvi|pdf|pdf3)
# missing character: There is no ^^A in font [lmroman12-regular] # missing character: There is no ^^A in font [lmroman12-regular]
# and all the line down to ^^Z and beyond... # and all the line down to ^^Z and beyond...
# XeTeX artifact? works with LuaTeX, explore: # XeTeX artifact? works with LuaTeX, explore:
@ -125,22 +109,20 @@ Sublabel: lyxbugs
# LyX bugs with a Trac number. # LyX bugs with a Trac number.
# Language nesting and polyglossia #9633 # Language nesting and polyglossia #9633
export/doc/(nb|sk)/Intro_pdf[45]_systemF export/doc/(nb|sk)/Intro.*systemF
# language nesting (may disappear after completed translation) # language nesting (may disappear after completed translation)
export/examples/fr/linguistics_.*_systemF export/examples/fr/linguistics_.*_systemF
export/doc/(de/|es/|fr/)Customization_pdf[45]_systemF export/doc/(de/|es/|fr/)Customization_.*_systemF
# use LuaTeX-compatible language names #9910 # use LuaTeX-compatible language names #9910
# Wrong language name for LuaTeX # Wrong language name for LuaTeX (with Babel, no error with Polyglossia)
# After LyX 2.1 is released, apply the patch and remove these # After LyX 2.1 is released, apply the patch and remove these
# See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181595.html # See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181595.html
# ! LuaTeX error ...e/2015/texmf-dist/tex/luatex/hyph-utf8/luatex-hyphen.lua:53: luatex-hyphen: no entry in language.dat.lua for this language: bahasa # ! LuaTeX error ...e/2015/texmf-dist/tex/luatex/hyph-utf8/luatex-hyphen.lua:53: luatex-hyphen: no entry in language.dat.lua for this language: bahasa
export/doc/attic/id_UserGuide_dvi3.* export/doc/attic/id_UserGuide_dvi3.*
export/doc/attic/id_UserGuide_pdf5.* export/doc/attic/id_UserGuide_pdf5.*
export/(doc|examples)/id/.*_dvi3.* export/(doc|examples)/id/.*_(dvi3|pdf5)_texF
export/(doc|examples)/id/.*_pdf5_texF export/.*/hu/.*(dvi3|pdf5)_texF
export/.*/hu/.*dvi3_.*
export/.*/hu/.*pdf5_texF
# documents requiring pre-processing fail with Japanese #8823 # documents requiring pre-processing fail with Japanese #8823
export/examples/ja/(knitr|lilypond|sweave)_(dvi|pdf3?) export/examples/ja/(knitr|lilypond|sweave)_(dvi|pdf3?)
@ -189,12 +171,6 @@ export/.*/he/.*pdf4_texF
export/doc/ru/(Intro|Tutorial)_(dvi3|pdf[45])_texF export/doc/ru/(Intro|Tutorial)_(dvi3|pdf[45])_texF
export/examples/ru/splash_(dvi3|pdf[45])_texF export/examples/ru/splash_(dvi3|pdf[45])_texF
# dvi3 uses Babel. Autostrings use Cyrillic LICRs,
# however these are missing in xunicode.sty. 2 solutions:
# LuX: use polyglossia also with dvi3 (LuaTeX) and non-TeX fonts,
# LaTeX: define Cyrillic LICRs for EU1 and EU2 (similar to greek-euenc.def)
export/doc/uk/Intro_dvi3_systemF
# LuaTeX fails for an \mbox in an index, e.g. $a_{\mbox{a}}$. # LuaTeX fails for an \mbox in an index, e.g. $a_{\mbox{a}}$.
# This construct appears in the included bib file biblioExample.bib in # This construct appears in the included bib file biblioExample.bib in
# the entry Eisenstein2005. Error message is # the entry Eisenstein2005. Error message is
@ -212,7 +188,8 @@ export/examples/fr/exemple-powerdot_pdf[25].*
# Gives the following error: # Gives the following error:
# # ! Package hpstatement Error: H or P statement "H251" # # ! Package hpstatement Error: H or P statement "H251"
# # (hpstatement) is not defined. # # (hpstatement) is not defined.
export/examples/H-P-statements_pdf[45]_systemF # seems to be polyglossia-related (dvi3 worked with babel)
export/examples/H-P-statements_.*_systemF
# requires jss.cls (not on CTAN) # requires jss.cls (not on CTAN)
# "All documents need to be processed by pdflatex" [jss.pdf] # "All documents need to be processed by pdflatex" [jss.pdf]
@ -230,7 +207,8 @@ Sublabel: multilingual
# No problem with inserted German (or other foreign language) text # No problem with inserted German (or other foreign language) text
# No problem if the table is Slovak too # No problem if the table is Slovak too
# Seems to be a problem with Check and Slovak Babel support. File a bug there. # Seems to be a problem with Check and Slovak Babel support. File a bug there.
export/export/TableErrorIfSlovakTextInserted_(dvi|pdf|pdf[23]|pdf[45]_texF|dvi3_.*F) # All exports using babel fail:
export/export/TableErrorIfSlovakTextInserted_(dvi|pdf[23]?|.*_texF)
Sublabel: attic Sublabel: attic

View File

@ -13,7 +13,7 @@ Sublabel: nonstandard
export/templates/IUCr-article_(dvi|pdf).* export/templates/IUCr-article_(dvi|pdf).*
export/templates/ja_beamer-conference-ornate-20min_(pdf2|pdf[45]_(texF|systemF)) export/templates/ja_beamer-conference-ornate-20min_(pdf2|pdf[45]_(texF|systemF))
export/templates/es_beamer-conference-ornate-20min_(pdf2|pdf[45]_(texF|systemF)) export/templates/es_beamer-conference-ornate-20min_(pdf2|pdf[45]_(texF|systemF))
export/templates/kluwer_pdf[45]_systemF export/templates/kluwer_.*_systemF
export/examples/modernCV_pdf4_(tex|system)F export/examples/modernCV_pdf4_(tex|system)F
export/templates/ectaart_(dvi3|pdf5)_(tex|system)F export/templates/ectaart_(dvi3|pdf5)_(tex|system)F

View File

@ -1399,11 +1399,8 @@ void BufferParams::validate(LaTeXFeatures & features) const
} }
// some languages are only available via polyglossia // some languages are only available via polyglossia
if ((features.runparams().flavor == OutputParams::XETEX if (features.hasPolyglossiaExclusiveLanguages())
|| features.runparams().flavor == OutputParams::LUATEX) features.require("polyglossia");
&& (features.hasPolyglossiaExclusiveLanguages()
|| useNonTeXFonts))
features.require("polyglossia");
if (useNonTeXFonts && fontsMath() != "auto") if (useNonTeXFonts && fontsMath() != "auto")
features.require("unicode-math"); features.require("unicode-math");

View File

@ -382,14 +382,14 @@ LaTeXFeatures::LangPackage LaTeXFeatures::langPackage() const
if (local_lp == "none") if (local_lp == "none")
return LANG_PACK_NONE; return LANG_PACK_NONE;
/* If "auto" is selected, we load polyglossia if required, /* If "auto" is selected, we load polyglossia with non-TeX fonts,
* else we select babel. * else we select babel.
* If babel is selected (either directly or via the "auto" * If babel is selected (either directly or via the "auto"
* mechanism), we really do only require it if we have * mechanism), we really do only require it if we have
* a language that needs it. * a language that needs it.
*/ */
bool const polyglossia_required = bool const polyglossia_required =
isRequired("polyglossia") params_.useNonTeXFonts
&& isAvailable("polyglossia") && isAvailable("polyglossia")
&& !isProvided("babel") && !isProvided("babel")
&& this->hasOnlyPolyglossiaLanguages(); && this->hasOnlyPolyglossiaLanguages();