A bit of context to help understand what I want to do. I am working with a project that is using Gregorio to typeset chant. The output is not used in a PDF but rather converted to images to be used in other documents. So the idea is to have pages that fit exactly to the size necessary without any extra white space around it. I have been handed 1000+ files that have been collected from various sources to be used like this.

A template for the .tex file used to convert them would look something like this:

% !TEX program = LuaLaTeX+se
% !TEX encoding = UTF-8 Unicode



Problem is that I have to manually work out what height should be used for each file. I would rather it be able to workout the height automatically. There are other questions that are similar like this one XeLaTeX: how do I make paper to be exactly the size of the content? but I need to some how specify the width that I want, and \documentclass{standalone} does not seem to allow for that. Other options also seem to result the wrong output, with all the chant on a single line.

Is there any possible solution to what I want to do, or am I going to have to do this manually?


You can use e.g. standalone together with a minipage to force a specific width:




enter image description here

  • You might mention the preview option to allow linebreaks outside of boxes. – Skillmon May 29 '17 at 20:29
  • @Skillmon I don't see a reason to use preview here. – Ulrike Fischer May 29 '17 at 20:35
  • I added my comment just for the sake of completion, but you're right, here it is unnecessary. – Skillmon May 29 '17 at 20:50
  • Just needed to add \RequirePackage{luatex85} for LuaLaTex. Otherwise works perfectly and does just what I want. – Michael Buckley May 29 '17 at 21:07

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.