Discussion:
unexpected result using minimal and standalone classes
(too old to reply)
corporal
2014-08-14 01:14:52 UTC
Permalink
recently I provided an answer to a question on tex stackexchange:

http://tex.stackexchange.com/questions/195836/how-to-introduce-a-dynamic-counter-for-enumerate-environment/195944#195944
(maybe a broken link, I'm not using an optimal interface)

My answer was

\documentclass{article}
\newcommand\finalitem{\item[(\theenumi+1.)]}
\begin{document}
\begin{enumerate}
\item
\item
\finalitem
\end{enumerate}
\end{document}

This produces the expected output:

1.
2.
(2+1.)


replacing "article" by either "minimal" or "standalone" produces odd results.

Using "minimal" only (2+1.) appears in the pdf or dvi.

Using "standalone" produces no output, but an error message.
! LaTeX Error: Something's wrong--perhaps a missing \item.

As far as I know my TeX distribution is up to date; the first line in the log file is:
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit) (preloaded format=latex 2014.4.17) 14 AUG 2014 11:05

What is going wrong? Should I put in a bug report?

regards from corporal
jon
2014-08-14 04:17:37 UTC
Permalink
Post by corporal
\documentclass{article}
\newcommand\finalitem{\item[(\theenumi+1.)]}
\begin{document}
\begin{enumerate}
\item
\item
\finalitem
\end{enumerate}
\end{document}
[...]
Post by corporal
replacing "article" by either "minimal" or "standalone" produces odd results.
Using "minimal" only (2+1.) appears in the pdf or dvi.
the general advice is (i think): don't use the minimal document class.

the name is something of a misnomer; it was used in early latex days
by developers to test the package loading mechanisms and so on. it is
not meant for constructing "minimal" documents in the normal sense of
the word (use the article documentclass for this).

if you compare minimal.cls and article.cls, you'll see how minimal it is!

for the standalone class, use:

\documentclass[varwidth]{standalone}

cheers,
jon.
corporal
2014-08-14 06:06:14 UTC
Permalink
Post by jon
the general advice is (i think): don't use the minimal document class.
the name is something of a misnomer; it was used in early latex days
by developers to test the package loading mechanisms and so on. it is
not meant for constructing "minimal" documents in the normal sense of
the word (use the article documentclass for this).
if you compare minimal.cls and article.cls, you'll see how minimal it is!
\documentclass[varwidth]{standalone}
cheers,
jon.
thanks, jon. I was mystified. I looked at the minimal.cls file and saw it had very little content. I didn't know about the [varwidth] option for standalone. I sometimes use standalone to make cropped graphics using tikz.

regards from corporal

Loading...