4

I'm trying to create multiple pages with varying page heights using the standalone package. When I try to run my file (using XeLaTeX on a mac) the content gets shifted up and to the left so that it's no longer on the page. When I increase the margins I'm able to force a page size that will display the content but I end up with unnecessary white space at the bottom of the page (which defeats the purpose of using the standalone package).

Could my issue have anything to do with the large font size I'm using or the page width constraint? If so, is there any way to resolve these issue?

I'm rather new to using LaTeX so any help is greatly appreciated.

\documentclass[multi=minipage, border=0]{standalone}

\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{float}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{geometry}
\usepackage{anyfontsize}
\usepackage{t1enc}
\usepackage{fontspec}
\usepackage[none]{hyphenat}
\usepackage{standalone}

\pagestyle{empty}
\geometry{papersize={500bp}}
\begin{document}
\setmainfont{Georgia}
\raggedright
\fontsize{20}{24}
\selectfont
\begin{minipage}{1\linewidth}
This is some question text.
\end{minipage}
\end{document}
  • Do you need the geometry package? Why set the papersize then use standalone to create pages of varying heights? Taking this out seems to get better results. – Matthew Leingang Mar 18 '13 at 16:02
  • Also, what is \setfontsize supposed to do? It gives me an undefined control sequence error. – Matthew Leingang Mar 18 '13 at 16:06
  • I'm using the geometry package because I need the paper width to be a constant, I only want the page height to resize. I've edited the MWE to take out \setfontsize, that was something a command I'd created. – ekrah Mar 18 '13 at 16:07
  • For best results, please trim down your minimal working example (MWE) excluding unnecessary code, and soup up the example to include the effect you see. For instance, does this only happen in XeTeX with fontspec and the Georgia font? If not, cut it out and just leave the default. Your question is about mutiple pages but your example has only one page in it. – Matthew Leingang Mar 18 '13 at 16:18
5

it makes no sense to set the papersize, because standalonestrips all whitespace around the text anyway.

use the minipage width for setting the paper (text) width:

\documentclass[multi=minipage, border=0]{standalone}
\usepackage{fontspec}

\begin{document}
\setmainfont{Georgia}
\raggedright
\fontsize{20}{24}\selectfont
\begin{minipage}{350bp}
This is some question text.
\end{minipage}
\end{document}

enter image description here

1

Try this, does it make what you want?

\documentclass[multi=varwidth, border=0]{standalone}

\pagestyle{empty}
\begin{document}
\begin{varwidth}
This is a very huge text with lot of words\dots
\end{varwidth}
\begin{varwidth}
This is a small text
\end{varwidth}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.