0

Here is a MWE:

\documentclass{minimal}
\usepackage{xltxtra}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Adobe Garamond Pro}
\makeatletter
\g@addto@macro\normalsize{
  \setlength{\intextsep}{0.8cm}
  \setlength\abovedisplayskip{5pt}
  \setlength\belowdisplayskip{5pt}
  \setlength\abovedisplayshortskip{5pt}
  \setlength\belowdisplayshortskip{5pt}
}
\makeatother
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor\footnote{This is a footnote.} incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}

When I comment \setmainfont[Ligatures=TeX]{Adobe Garamond Pro} (ideally required since it's the font that I want) I get this output:

enter image description here

When I comment the \makeatletter \makeatother block (ideally required because that's the spacing that I want for equations in the rest of the document), I get this output:

enter image description here

When I comment nothing, I get this output with the extra blank space:

enter image description here

Does someone know what is wrong here and how I can overcome this issue? Many thanks,

G Viaud
  • 135
  • 1
  • 6
  • 2
    you have redefined \normalsize to add six spaces every time it is used. add % to the end of each line in the definition. – David Carlisle Nov 10 '17 at 14:22
  • 1
    note you should not use \usepackage{xltxtra} (just load fontspec) and beware using \documentclass{minimal} in test files as it is very minimal and has strange artefacts from things (like default fonts) not being set up, it is better to test with artticle – David Carlisle Nov 10 '17 at 14:26
  • @David Carlisle: art tickle? ;o) – Bernard Nov 10 '17 at 14:48
  • Thank you very much David, this worked perfectly. This is actually quite strange to me the way the LaTeX parser works... – G Viaud Nov 10 '17 at 14:57
  • @GViaud why strange? if you are writing text in a paragraph you expect a newline to act like a space and you expect a b c to produce a b c not abc, so newlines produce spaces. – David Carlisle Nov 10 '17 at 15:13

0 Answers0