Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am making my resume using and for xelatex. Certain versions of my resume have my name and address, they others, those which are public do not. Is there an easy way to hide this information on the public versions. As of now I just run

xelatex file.tex

I really don't want to have to go in and edit the file every time. any ideas?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

You can create your document using a template like the following (call this file.tex):

\documentclass{article}
\newif\ifinclude
\ifdefined\public\else\includetrue\fi
\begin{document}
Here is some content that is always visible.

\ifinclude
Here is some content that depends on a condition.
\fi

Here is some content that is always visible.
\end{document}

This defines a conditional \ifinclude that can either be true (\includetrue) or false (\includefalse, default). This condition is switched on/off by virtue of whether a macro \public is defined or not (using the e-TeX primitive \ifdefined). Wrapping the non-public details within your document/resume around a primitive \ifinclude...\fi conditional, you can selectively include this content or not, based on the existence of \public, which you then define at the command line. For example,

xelatex \def\public{}\input{file.tex}

produces

enter image description here

while

xelatex file.tex

produces

enter image description here

since \public is undefined.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.