@@ -112,20 +112,6 @@ $endif$
112$if(geometry)$
112$if(geometry)$
113\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
113\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
116−\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
117− \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
118−$if(babel-newcommands)$
122− \usepackage{polyglossia}
123− \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
124−$for(polyglossia-otherlangs)$
125− \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
129$if(natbib)$
115$if(natbib)$
130\usepackage{natbib}
116\usepackage{natbib}
131\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
117\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
@@ -191,6 +177,21 @@ $else$
191\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
177\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
181+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
182+ \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
183+$if(babel-newcommands)$
187+ % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
188+ \usepackage{polyglossia}
189+ \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
190+$for(polyglossia-otherlangs)$
191+ \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
196 % load bidi as late as possible as it modifies e.g. graphicx
197 % load bidi as late as possible as it modifies e.g. graphicx