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.
This commit is contained in:
Scott Kostyshak 2015-10-23 18:11:19 -04:00
parent efa78b22fc
commit 2b1b233bc0
11 changed files with 96 additions and 79 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}}
}{}
% ------------------------------------

View File

@ -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}}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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