From 92e84768b850a3722b7586e62ee8a05bc333840b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 27 May 2015 12:22:55 -0700 Subject: [PATCH] LaTeX template: move hyperref before polyglossia. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids a warning: “Package bidi Error: Oops! you have loaded package hyperref after bidi package. Please load package hyperref before bidi package, and then try to run xelatex on your document again.” Closes #96. --- default.latex | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/default.latex b/default.latex index d92ff2c4a..09a55acb4 100644 --- a/default.latex +++ b/default.latex @@ -49,6 +49,23 @@ $endif$ $if(geometry)$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$ +\ifxetex + \usepackage[setpagesize=false, % page size defined by xetex + unicode=false, % unicode breaks when used with xetex + xetex]{hyperref} +\else + \usepackage[unicode=true]{hyperref} +\fi +\hypersetup{breaklinks=true, + bookmarks=true, + pdfauthor={$author-meta$}, + pdftitle={$title-meta$}, + colorlinks=true, + citecolor=$if(citecolor)$$citecolor$$else$blue$endif$, + urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$, + linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$, + pdfborder={0 0 0}} +\urlstyle{same} % don't use monospace font for urls $if(lang)$ \ifxetex \usepackage{polyglossia} @@ -95,23 +112,6 @@ $if(graphics)$ % using explicit options in \includegraphics[width, height, ...]{} \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} $endif$ -\ifxetex - \usepackage[setpagesize=false, % page size defined by xetex - unicode=false, % unicode breaks when used with xetex - xetex]{hyperref} -\else - \usepackage[unicode=true]{hyperref} -\fi -\hypersetup{breaklinks=true, - bookmarks=true, - pdfauthor={$author-meta$}, - pdftitle={$title-meta$}, - colorlinks=true, - citecolor=$if(citecolor)$$citecolor$$else$blue$endif$, - urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$, - linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$, - pdfborder={0 0 0}} -\urlstyle{same} % don't use monospace font for urls $if(links-as-notes)$ % Make links footnotes instead of hotlinks: \renewcommand{\href}[2]{#2\footnote{\url{#1}}}