]> git.lyx.org Git - features.git/commitdiff
thesis.lyx: change preamble code as proposed by Jürgen
authorUwe Stöhr <uwestoehr@lyx.org>
Sun, 2 Dec 2012 18:37:05 +0000 (19:37 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Sun, 2 Dec 2012 18:37:05 +0000 (19:37 +0100)
no change of functionality except that for pure English documents the loading of babel can be avoided.

lib/templates/thesis/thesis.lyx

index 82f26ac7990f3d990a2d3c6d9118cfd37f321b08..506e75c63b3a03b6fe42366e8229bddf62a88e79 100644 (file)
@@ -7,9 +7,10 @@
 % increases link area for cross-references and autoname them
 % if you change the document language to e.g. French
 % you must change "extrasenglish" to "extrasfrench"
-\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
-\@ifundefined{extrasenglish}{\usepackage[english]{babel}}{}
-\addto\extrasenglish{%
+\AtBeginDocument{%
+ \renewcommand{\ref}[1]{\mbox{\autoref{#1}}}
+}
+\def\refnamechanges{%
  \renewcommand*{\equationautorefname}[1]{}
  \renewcommand{\sectionautorefname}{sec.\negthinspace}
  \renewcommand{\subsectionautorefname}{sec.\negthinspace}
@@ -17,6 +18,7 @@
  \renewcommand{\figureautorefname}{Fig.\negthinspace}
  \renewcommand{\tableautorefname}{Tab.\negthinspace}
 }
+\@ifpackageloaded{babel}{\addto\extrasenglish{\refnamechanges}}{\refnamechanges}
 
 % in case somebody want to have the label "Equation"
 %\renewcommand{\eqref}[1]{Equation~(\negthinspace\autoref{#1})}