34

What is the advantage of using minimal document class over article document class when creating a standalone graphic?


Bonus question:

Before I have time to make a test by myself, is there anybody here know whether minimal will compile faster than article?

Display Name
  • 46,933

3 Answers3

40
  • The minimal class has already empty page style, so no page number is printed. There's no page number needed for a standalone graphic.

  • minimal doesn't define macros. There's less than in article which could disturb.

However, usually I would use minimal just for testing or for showing a minimal working example. Though for just displaying a graphic it might be sufficient.

For creating graphics you might miss features which are provided by other base classes. Just some examples, important if you create graphics with text:

  • You cannot use common font size commands such as \small and \large, they are undefined. minimal uses a 10pt font.

  • Obsolete LaTeX 2.09 commands such as \bf and \it are still supported in article, but not in minimal.

Stefan Kottwitz
  • 231,401
  • 2
    I agree. Also I personally don't see minimal as a real class, e.g. because of the missing font size commands and missing length settings. A minimal example which uses the minimal class might show different results as a real class so it should be avoided. IMHO minimal is just a "hello world" class. – Martin Scharrer Jun 17 '11 at 11:11
  • 2
    @Martin: I disagree. When using tikZ or pstricks without having text, it really makes sense to use the minimal class instead of another one. –  Jun 17 '11 at 11:15
  • 3
    @Herbert: If you don't have any text, then maybe yes. I normally have some text in my diagram and then I often want to use different sizes. Is there a drawback of article in the no-text case? – Martin Scharrer Jun 17 '11 at 11:18
  • 1
    @Martin: I am talking about minimal examples and not regular diagrams. For minimal examples where users want to find a problem, it is easier to use the minimal class, because the filelist is then realy short. –  Jun 17 '11 at 12:24
  • 1
    I am not sure I would see the lack of high level font size commands as a big problem. In the setting discussed here, I'd like to have complete control over font sizes anyhow, so I'd just use the various font selection commands directly. – Harald Hanche-Olsen Jun 17 '11 at 12:26
  • 4
    @Harald: The absence of the high level font size commands is a big impact on user-friendliness. Of course if you know how to do it then you don't need them. I personally don't know much about the internal font commands, and I'm sure beginners would be totally lost here. I still fail to see the benefit of using minimal in a document with text. – Martin Scharrer Jun 17 '11 at 13:14
  • 3
    Another (in my opinion big) problem with minimal is that it doesn't assign values to \arraycolsep, \tabcolsep, \arrayrulewidth, \doublerulesep, \fboxsep, \fboxrule so standard environments such as tabular and array won't behave as expected in a class such as article (no separation between columns, no rules, for example). – Gonzalo Medina Jun 17 '11 at 14:18
  • 1
    @Martin: You wouldn't need anything other than \fontsize and \selectfont. \textbf and friends would still work. But I agree that it's hard to see a big benefit; all I'm saying is that the downside seems minimal (pun intended) to me. – Harald Hanche-Olsen Jun 17 '11 at 15:26
  • @Herbert, @Harald: Jake also does not recommend me to use minimal here http://tex.stackexchange.com/questions/4221/what-are-your-favorite-document-classes-and-what-do-you-use-them-for/6446#6446. – Display Name Jun 17 '11 at 18:38
  • 1
    @xport: for minimal examples it makes sense when you do not need all the other features of the the standard classes. –  Jun 17 '11 at 19:35
24

that is all, what minimal defines:

\renewcommand\normalsize{\fontsize{10pt}{12pt}\selectfont}   
\setlength{\textwidth}{6.5in}
\setlength{\textheight}{8in}
\pagenumbering{arabic}  % but no page numbers are printed because:
\pagestyle{empty}       % this is actually already in the kernel
6

Using minimal is simpler than using article for creating a graphics with a tight paper size.

\documentclass{minimal}%\documentclass{article}
%\pagestyle{empty}
%\headheight=0pt
%\headsep=0pt
\usepackage{pstricks}
\paperwidth=72.27pt
\paperheight=72.27pt
\topmargin=-72.27pt
\oddsidemargin=-72.27pt
\parindent=0sp
\special{papersize=\the\paperwidth,\the\paperheight}
\begin{document}
\begin{pspicture}(\paperwidth,\paperheight)
\psframe[linecolor=red](\paperwidth,\paperheight)
\end{pspicture}
\end{document}
Thorsten
  • 12,872
Display Name
  • 46,933