commit 2b1b233bc01ffa63fa749d0fc34eae6f4ebc00b4
Author: Scott Kostyshak <[email protected]>
Date: Fri Oct 23 18:11:19 2015 -0400
Fix polyglossia exports for docs with babel cmds
Many of our documents have babel-specific preamble code. By putting
this code in a \@ifpackageloaded{babel}{}{} conditional, XeTeX and
LuaTeX compilation with polyglossia now works. This fixes some
LuaTeX tests that were broken by edd37de8 and also allows us to
uninvert some XeTeX tests.
Note that in some of the files although the preambles were fixed to
allow for polyglossia, they still do not compile without errors:
es/Math.lyx
es/Customization.lyx
de/Customization.lyx
Similar fixes might be desired in other manuals but these at least
fix regressions in the tests.
diff --git a/development/autotests/revertedTests
b/development/autotests/revertedTests
index 80c81fd..db06480 100644
--- a/development/autotests/revertedTests
+++ b/development/autotests/revertedTests
@@ -42,12 +42,10 @@ export/doc/uk/Intro_dvi3_systemF
# it is unlikely that a user would want to use system fonts to view LyX's
# documents, fixing these would provide further tests for LyX's handling of
# XeTeX/LuaTeX with system fonts.
-export/doc/(|de/|es/|fr/)Customization_pdf4_systemF
+export/doc/(de/|es/|fr/)Customization_pdf4_systemF
export/doc/(es/|fr/)Math_dvi3_systemF
-export/doc/(|de/|es/)Math_pdf4_systemF
-# es would be in here also but it is set to "always babel".
-export/doc/de/EmbeddedObjects_pdf4_systemF
-export/doc/(de|es|fr|id)/UserGuide_pdf4_systemF
+export/doc/(es/)Math_pdf4_systemF
+export/doc/(es|fr|id)/UserGuide_pdf4_systemF
export/doc/es/Tutorial_pdf4_systemF
export/doc/gl/Tutorial_dvi3_systemF
export/doc/(nb|sk)/Intro_pdf4_systemF
diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 60b76b3..95a1bb9 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -1,5 +1,5 @@
#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 497
+\lyxformat 498
\begin_document
\begin_header
\origin /systemlyxdir/doc/
@@ -35,12 +35,14 @@
% increase link area for cross-references and autoname them,
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
\@ifundefined{extrasenglish}{\usepackage[english]{babel}}{}
-\addto\extrasenglish{%
- \renewcommand*{\equationautorefname}[1]{}%
- \renewcommand{\sectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
-}
+\@ifpackageloaded{babel}{
+ \addto\extrasenglish{%
+ \renewcommand*{\equationautorefname}[1]{}%
+ \renewcommand{\sectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
+ }
+}{}
\end_preamble
\options
fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
\use_default_options false
diff --git a/lib/doc/Math.lyx b/lib/doc/Math.lyx
index 04249eb..b1767d6 100644
--- a/lib/doc/Math.lyx
+++ b/lib/doc/Math.lyx
@@ -34,12 +34,14 @@
% increase link area for cross-references and autoname them,
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
\@ifundefined{extrasenglish}{\usepackage[english]{babel}}{}
-\addto\extrasenglish{%
- \renewcommand*{\equationautorefname}[1]{}%
- \renewcommand{\sectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
-}
+\@ifpackageloaded{babel}{
+ \addto\extrasenglish{%
+ \renewcommand*{\equationautorefname}[1]{}%
+ \renewcommand{\sectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
+ }
+}{}
% don't load packages twice
% see first footnote in sec. 9.3
diff --git a/lib/doc/de/Customization.lyx b/lib/doc/de/Customization.lyx
index 84550e0..2eab2d4 100644
--- a/lib/doc/de/Customization.lyx
+++ b/lib/doc/de/Customization.lyx
@@ -1,5 +1,5 @@
#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 497
+\lyxformat 498
\begin_document
\begin_header
\origin /systemlyxdir/doc/de/
@@ -36,14 +36,16 @@
\myTOC
\mainmatter }
-% Linkfläche für Querverweise vergrößern und automatisch benennen,
-\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
-\addto\extrasngerman{%
- \renewcommand*{\equationautorefname}[1]{}%
- \renewcommand{\sectionautorefname}{Kap.\negthinspace}%
- \renewcommand{\subsectionautorefname}{Kap.\negthinspace}%
- \renewcommand{\subsubsectionautorefname}{Kap.\negthinspace}%
-}
+\@ifpackageloaded{babel}{
+ % Linkfläche für Querverweise vergrößern und automatisch benennen,
+ \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
+ \addto\extrasngerman{%
+ \renewcommand*{\equationautorefname}[1]{}%
+ \renewcommand{\sectionautorefname}{Kap.\negthinspace}%
+ \renewcommand{\subsectionautorefname}{Kap.\negthinspace}%
+ \renewcommand{\subsubsectionautorefname}{Kap.\negthinspace}%
+ }
+}{}
\end_preamble
\options
fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
\use_default_options false
diff --git a/lib/doc/de/EmbeddedObjects.lyx b/lib/doc/de/EmbeddedObjects.lyx
index 7784403..fd2f094 100644
--- a/lib/doc/de/EmbeddedObjects.lyx
+++ b/lib/doc/de/EmbeddedObjects.lyx
@@ -1,5 +1,5 @@
#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 497
+\lyxformat 498
\begin_document
\begin_header
\origin /systemlyxdir/doc/de/
@@ -160,8 +160,10 @@
\setboolean{diagbox}{true}}
{\setboolean{diagbox}{false}}
-% Damit der Index den Namen "Stichwortverzeichnis" erhält
-\addto\captionsngerman{\renewcommand{\indexname}{Stichwortverzeichnis}}
+\@ifpackageloaded{babel}{
+ % Damit der Index den Namen "Stichwortverzeichnis" erhält
+ \addto\captionsngerman{\renewcommand{\indexname}{Stichwortverzeichnis}}
+}{}
\end_preamble
\options
bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading,usenames,dvipsnames,table
\use_default_options false
diff --git a/lib/doc/de/Math.lyx b/lib/doc/de/Math.lyx
index b342c0a..819ea05 100644
--- a/lib/doc/de/Math.lyx
+++ b/lib/doc/de/Math.lyx
@@ -35,12 +35,14 @@
% Linkfläche für Querverweise vergrößern und automatisch benennen,
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
-\addto\extrasngerman{%
- \renewcommand*{\equationautorefname}[1]{}%
- \renewcommand{\sectionautorefname}{Kap.\negthinspace}%
- \renewcommand{\subsectionautorefname}{Kap.\negthinspace}%
- \renewcommand{\subsubsectionautorefname}{Kap.\negthinspace}%
-}
+\@ifpackageloaded{babel}{
+ \addto\extrasngerman{%
+ \renewcommand*{\equationautorefname}[1]{}%
+ \renewcommand{\sectionautorefname}{Kap.\negthinspace}%
+ \renewcommand{\subsectionautorefname}{Kap.\negthinspace}%
+ \renewcommand{\subsubsectionautorefname}{Kap.\negthinspace}%
+ }
+}{}
% Makros damit Pakete nicht doppelt geladen werden.
% siehe erste Fußnote in Kap. 9.3
@@ -97,10 +99,12 @@
% Beispielmakro aus Kap. 19.4
%\def\tagform@#1{\maketag@@@{|#1|}}
-% Damit der Index einen anderen Namen erhält.
-\addto\captionsngerman
-{\renewcommand{\indexname}
-{Stichwort- und Befehlsverzeichnis}}
+\@ifpackageloaded{babel}{
+ % Damit der Index einen anderen Namen erhält.
+ \addto\captionsngerman
+ {\renewcommand{\indexname}
+ {Stichwort- und Befehlsverzeichnis}}
+}{}
% ------------------------------------
diff --git a/lib/doc/de/UserGuide.lyx b/lib/doc/de/UserGuide.lyx
index fd16414..e55e288 100644
--- a/lib/doc/de/UserGuide.lyx
+++ b/lib/doc/de/UserGuide.lyx
@@ -1,5 +1,5 @@
#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 497
+\lyxformat 498
\begin_document
\begin_header
\origin /systemlyxdir/doc/de/
@@ -34,8 +34,10 @@
\myTOC
\mainmatter }
-% Damit der Index den Namen "Stichwortverzeichnis" erhält
-\addto\captionsngerman{\renewcommand{\indexname}{Stichwortverzeichnis}}
+\@ifpackageloaded{babel}{
+ % Damit der Index den Namen "Stichwortverzeichnis" erhält
+ \addto\captionsngerman{\renewcommand{\indexname}{Stichwortverzeichnis}}
+}{}
% macro for italic page numbers in the index
\newcommand{\IndexDef}[1]{\textit{#1}}
diff --git a/lib/doc/es/Customization.lyx b/lib/doc/es/Customization.lyx
index 59de75e..3c0b53a 100644
--- a/lib/doc/es/Customization.lyx
+++ b/lib/doc/es/Customization.lyx
@@ -32,14 +32,16 @@
\myTOC
\mainmatter }
-% increase link area for cross-references and autoname them,
-\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
-\addto\extrasspanish{%
- \renewcommand*{\equationautorefname}[1]{}%
- \renewcommand{\sectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
-}
+\@ifpackageloaded{babel}{
+ % increase link area for cross-references and autoname them,
+ \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
+ \addto\extrasspanish{%
+ \renewcommand*{\equationautorefname}[1]{}%
+ \renewcommand{\sectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
+ }
+}{}
\end_preamble
\options
fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
\use_default_options false
diff --git a/lib/doc/es/Math.lyx b/lib/doc/es/Math.lyx
index 4ed96db..a5152b2 100644
--- a/lib/doc/es/Math.lyx
+++ b/lib/doc/es/Math.lyx
@@ -33,14 +33,16 @@
\renewcommand{\l@subsection}{\@dottedtocline{2}{1.5em}{2.8em}}
\renewcommand{\l@subsubsection}{\@dottedtocline{3}{4.3em}{3.6em}}
-% increase link area for cross-references and autoname them,
-\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
-\addto\extrasspanish{%
- \renewcommand*{\equationautorefname}[1]{}%
- \renewcommand{\sectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
-}
+\@ifpackageloaded{babel}{
+ % increase link area for cross-references and autoname them,
+ \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
+ \addto\extrasspanish{%
+ \renewcommand*{\equationautorefname}[1]{}%
+ \renewcommand{\sectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
+ }
+}{}
% don't load packages twice
% see first footnote in sec. 9.3
diff --git a/lib/doc/fr/Customization.lyx b/lib/doc/fr/Customization.lyx
index 5104588..a63071b 100644
--- a/lib/doc/fr/Customization.lyx
+++ b/lib/doc/fr/Customization.lyx
@@ -31,14 +31,16 @@
\myTOC
\mainmatter }
-% increase link area for cross-references and autoname them,
-\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
-\addto\extrasfrench{%
- \renewcommand*{\equationautorefname}[1]{}%
- \renewcommand{\sectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
-}
+\@ifpackageloaded{babel}{
+ % increase link area for cross-references and autoname them,
+ \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
+ \addto\extrasfrench{%
+ \renewcommand*{\equationautorefname}[1]{}%
+ \renewcommand{\sectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
+ }
+}{}
\end_preamble
\options
fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
\use_default_options false
diff --git a/lib/examples/colored-boxes.lyx b/lib/examples/colored-boxes.lyx
index fb2475d..620f594 100644
--- a/lib/examples/colored-boxes.lyx
+++ b/lib/examples/colored-boxes.lyx
@@ -15,15 +15,17 @@
\fi % end if pdflatex is used
-% increase link area for cross-references and autoname them,
-\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
-\@ifundefined{extrasenglish}{\usepackage[english]{babel}}{}
-\addto\extrasenglish{%
- \renewcommand*{\equationautorefname}[1]{}%
- \renewcommand{\sectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
- \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
-}
+\@ifpackageloaded{babel}{
+ % increase link area for cross-references and autoname them,
+ \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
+ \@ifundefined{extrasenglish}{\usepackage[english]{babel}}{}
+ \addto\extrasenglish{%
+ \renewcommand*{\equationautorefname}[1]{}%
+ \renewcommand{\sectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsectionautorefname}{sec.\negthinspace}%
+ \renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
+ }
+}{}
\end_preamble
\options BCOR8mm, most, usenames, dvipsnames
\use_default_options false
@@ -1234,7 +1236,6 @@ Default Value
\end_layout
\begin_layout New Color Box Type
-
\begin_inset Argument 2
status open
@@ -1413,7 +1414,6 @@ Box
\end_layout
\begin_layout New Color Box Type
-
\begin_inset Argument 1
status open
@@ -1652,7 +1652,6 @@ More Color Box Options
\end_layout
\begin_layout New Color Box Type
-
\begin_inset Argument 1
status open