MartinScharrer / standalone

A LaTeX class and package is provided which allows LaTeX diagrams or other LaTeX code to be compiled standalone or as part of a main document. Special support for pictures with beamer overlays is also provided.
LaTeX Project Public License v1.3c
9 stars 2 forks source link

Confusion about draft mode when using `\includestandalone` #10

Open m-haug opened 8 months ago

m-haug commented 8 months ago

I have a basic standalone figure like this:

\documentclass[10pt, tikz]{standalone}

\begin{document}
  \begin{tikzpicture}
    \node[draw, rectangle] {Test};
  \end{tikzpicture}
\end{document}

When I include this into my main document using \includestandalone, I get differing results depending on whether draft mode is active or not:

No draft mode:

\documentclass[10pt, a4paper]{article}

\usepackage{standalone}
\usepackage{tikz}
\usepackage{ifdraft}

\begin{document}
    \ifdraft{DRAFT}{FINAL}

    \includestandalone{figure}
\end{document}

grafik

Draft mode:

\documentclass[10pt, a4paper, draft]{article}

\usepackage{standalone}
\usepackage{tikz}
\usepackage{ifdraft}

\begin{document}
    \ifdraft{DRAFT}{FINAL}

    \includestandalone{figure}
\end{document}

grafik

So far, this is expected behaviour. But if I deactivate draft mode by using draft = false, \includestandalone seems to think that draft mode is still in effect:

\documentclass[10pt, a4paper, draft = false]{article}

\usepackage{standalone}
\usepackage{tikz}
\usepackage{ifdraft}

\begin{document}
    \ifdraft{DRAFT}{FINAL}

    \includestandalone{figure}
\end{document}

grafik

Is this the expected behaviour? I would expect that setting draft = false is equivalent to not specifying draft at all. Alternatively, the standalone package could also provide draft and final package options to change the behaviour of \includestandalone independently of the class option.

MartinScharrer commented 8 months ago

Hi, traditionally the opposite of draft is final. A value like false or true are originally not used. standalone is implemented with this in mind, ignoring a value part if given.

However, I can change the implementation accordantly.