# Conditionally print VC macros

How might I go about conditionally printing a macro? I know this exists for graphics (\includegraphics) and there's ifdraft for the rest. For example, using fancyhdr I have the following (simplified) document:

preamble.sty

\usepackage{fancyhdr}
\fancyhf{}
\ifdraft {\cfoot{\textit{\VCDateISO - \GITAbrHash}}} {}


test.tex

\documentclass[letterpaper,12pt]{article}
\usepackage{preamble}
\immediate\write18{./vc}
\input{vc}
\begin{document}
FOO BAR BAZ
...
...
\ifdraft %{VC Macros}{}
\end{document}


Does this make sense if I want to only print the VC stats when in draft mode?

• @Werner ctan.org/pkg/ifdraft?lang=en – Chris Jan 15 at 18:14
• I would probably use it in the following way: \cfoot{\ifdraft{\textit{\VCDateISO - \GITAbrHash}}{}}. Note that you still need to set \pagestyle{fancy} in order to see a change in the headers/footers. – Werner Jan 15 at 18:16