## LaTeX forum ⇒ Theses, Books, Title pages ⇒ Legrand Orange Book: title page out of alignment with XeTeX Topic is solved

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
kdelwat
Posts: 4
Joined: Wed Feb 15, 2017 1:21 am

### Legrand Orange Book: title page out of alignment with XeTeX

Hi everyone,

Using the Legrand Orange Book template from http://www.latextemplates.com/template/the-legrand-orange-book, I have run into a problem with the title page. When using pdflatex to compile the document, the title page is correctly aligned, but using xelatex the center box (containing the title and author) is smaller and out of alignment. Any help fixing this problem would be very appreciated!

The box is drawn by Tikz, but I can't find the problem with the relevant code:

\begingroup\thispagestyle{empty}\begin{tikzpicture}[remember picture,overlay]\coordinate [below=12cm] (midpoint) at (current page.north);\node at (current page.north west){\begin{tikzpicture}[remember picture,overlay]\node[anchor=north west,inner sep=0pt] at (0,0) {\includegraphics[width=\paperwidth]{background}}; % Background image\draw[anchor=north] (midpoint) node [fill=ocre!30!white,fill opacity=0.6,text opacity=1,inner sep=1cm]{\Huge\centering\bfseries\sffamily\parbox[c][][t]{\paperwidth}{\centering The Search for a Title\\[15pt] % Book title{\Large A Profound Subtitle}\\[20pt] % Subtitle{\huge Dr. John Smith}}}; % Author name\end{tikzpicture}};\end{tikzpicture}\vfill\endgroup

For comparison:

Pdflatex
pdflatex.png (76.16 KiB) Viewed 1054 times

Xelatex
xetex.png (72.88 KiB) Viewed 1054 times

Tags:

Johannes_B
Site Moderator
Posts: 3450
Joined: Thu Nov 01, 2012 4:08 pm
Without having tested anything: did you do multiple compile runs?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

kdelwat
Posts: 4
Joined: Wed Feb 15, 2017 1:21 am
Johannes_B wrote:Without having tested anything: did you do multiple compile runs?

Yes, I have tried that already. Your post inspired me to do a bit more experimentation and I'm getting the following strange results:

1st run: pdflatex
2nd run: pdflatex
Result: correct alignment

1st run: xelatex
2nd run: xelatex
Result: incorrect alignment

1st run: pdflatex
2nd run: xelatex
Result: correct alignment

1st run: xelatex
2nd run: pdflatex
Result: title doesn't show at all

Vel
Site Moderator
Posts: 447
Joined: Fri Jun 29, 2012 1:20 am
Location: Sydney, Australia
Contact:
Just had a quick look at this and I can confirm this behavior. I've never actually tried compiling it with XeLaTeX but I can see how you'd need to if you want to use a custom font.

I'll fix up the template and release a new version once we figure out what's going on.
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com

kdelwat
Posts: 4
Joined: Wed Feb 15, 2017 1:21 am
Vel wrote:Just had a quick look at this and I can confirm this behavior. I've never actually tried compiling it with XeLaTeX but I can see how you'd need to if you want to use a custom font.

I'll fix up the template and release a new version once we figure out what's going on.

Thanks, that would be really helpful! I'm pretty much locked-in to Xetex for font and Unicode support so I don't have another option.

kdelwat
Posts: 4
Joined: Wed Feb 15, 2017 1:21 am
In case anyone stumbles across this page with the same problem, I managed to get it working!

The problem was the nested tikzpicture environments. Replacing those with a simpler solution did the trick. The new title page code is as follows:

\begingroup\thispagestyle{empty} \begin{tikzpicture}[remember picture,overlay] \node[inner sep=0pt] (background) at (current page.center) {\includegraphics[width=\paperwidth]{background}}; \draw (current page.center) node [fill=ocre!30!white,fill opacity=0.6,text opacity=1,inner sep=1cm]{\Huge\centering\bfseries\sffamily\parbox[c][][t]{\paperwidth}{\centering The Search for a Title\\[15pt] % Book title{\Large A Profound Subtitle}\\[20pt] % Subtitle{\huge Dr. John Smith}}}; % Author name \end{tikzpicture}\vfill\endgroup

Vel
Site Moderator
Posts: 447
Joined: Fri Jun 29, 2012 1:20 am
Location: Sydney, Australia
Contact:
Awesome, thanks for finding the solution! I'll implement it and push a new version of the template soon.
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com

Vel
Site Moderator
Posts: 447
Joined: Fri Jun 29, 2012 1:20 am
Location: Sydney, Australia
Contact:
The template has been updated to include this change, v2.2.
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com