2

When converting tex code to png images for tools that support TeX (like Anki), some recipes on the net recommend to use the standalone class because of its trimming capabilities. Using just standalone instead of article, as usually proposed, quickly shows discrepancies, e.g. when using lists.

But can we expect that a one-page-article usually will work when using its contents with

\documentclass[varwidth]{standalone}

or, after wrapping it in a box or minipage, with just \documentclass{standalone}? Which LaTeX constructs will not work?

gernot
  • 49,614
  • Although I think that this is an interesting question, as it stands now, it's quite broad. Perhaps you could show an example of something that doesn't work, and ask why, with the more general question as an addition. – Alan Munn Oct 09 '16 at 19:05
  • @AlanMunn Well, the cases that didn't work before, they work since discovering the varwidth option (or the varwidth environment). However, in my answer for "Convert LaTeX (Tikz) Anki Note to .png Error" I try to describe robust methods for using Anki with pdflatex, and I'd like to mention the known limits of the standalone approach. – gernot Oct 09 '16 at 19:23
  • Then perhaps I've misunderstood the question. From what I understand, anything with a \par (or equivalent) will not work without the varwidth option. I thought you were asking about cases that won't work with despite the varwidth option (which I have encountered). – Alan Munn Oct 09 '16 at 19:28

1 Answers1

3

The question resolves basically down to the question of what works in a varwidth environment from the package of that name. Fortunately the package documents some major such classes of tex construct.

% This version works fine, but there are still many questions about
% how it would work best.  Should there be a version that avoids the
% usual minipage formatting style?
%
% Numbered equations are not handled well, especially with leqno.
% AMSmath environments have not been tried, and undoubtedly fail.
%
% To do:  Extend v-list wrappers to handle all e-TeX primitives.
%         (pdfTeX too?)
%         Capture marks and floats, propagating them out of the box
%         Support numbered equations, including ams math.
% 

in addition to the things listed in the above documentation, the package's support for whatsits such as \special and \pdfliteral hasn't been updated for the new luatex 0.95/1.0 constructs such as \pdfextension literal

David Carlisle
  • 757,742