LaTeX forum ⇒ Theses, Books, Title pagesLegrand Orange Book: title page out of alignment with XeTeX

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

Postby kdelwat » Wed Feb 15, 2017 1:32 am

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:

  1. \begingroup
  2. \thispagestyle{empty}
  3. \begin{tikzpicture}[remember picture,overlay]
  4. \coordinate [below=12cm] (midpoint) at (current page.north);
  5. \node at (current page.north west)
  6. {\begin{tikzpicture}[remember picture,overlay]
  7. \node[anchor=north west,inner sep=0pt] at (0,0) {\includegraphics[width=\paperwidth]{background}}; % Background image
  8. \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
  9. {\Large A Profound Subtitle}\\[20pt] % Subtitle
  10. {\huge Dr. John Smith}}}; % Author name
  11. \end{tikzpicture}};
  12. \end{tikzpicture}
  13. \vfill
  14. \endgroup


For comparison:

Pdflatex
pdflatex.png
pdflatex.png (76.16 KiB) Viewed 572 times


Xelatex
xetex.png
xetex.png (72.88 KiB) Viewed 572 times

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3348
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Feb 15, 2017 5:32 am

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

Postby kdelwat » Wed Feb 15, 2017 6:57 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

User avatar
Vel
Site Moderator
Posts: 444
Joined: Fri Jun 29, 2012 1:20 am
Location: Sydney, Australia
Contact:

Postby Vel » Wed Feb 15, 2017 2:41 pm

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

Postby kdelwat » Wed Feb 15, 2017 10:55 pm

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

Postby kdelwat » Sat Mar 18, 2017 10:23 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:

  1. \begingroup
  2. \thispagestyle{empty}
  3.  
  4. \begin{tikzpicture}[remember picture,overlay]
  5.  
  6. \node[inner sep=0pt] (background) at (current page.center) {\includegraphics[width=\paperwidth]{background}};
  7.  
  8. \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
  9. {\Large A Profound Subtitle}\\[20pt] % Subtitle
  10. {\huge Dr. John Smith}}}; % Author name
  11.  
  12. \end{tikzpicture}
  13. \vfill
  14. \endgroup

User avatar
Vel
Site Moderator
Posts: 444
Joined: Fri Jun 29, 2012 1:20 am
Location: Sydney, Australia
Contact:

Postby Vel » Mon Mar 20, 2017 3:03 pm

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

User avatar
Vel
Site Moderator
Posts: 444
Joined: Fri Jun 29, 2012 1:20 am
Location: Sydney, Australia
Contact:

Postby Vel » Wed Mar 29, 2017 3:15 pm

The template has been updated to include this change, v2.2.
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 2 guests