Skip to content

Instantly share code, notes, and snippets.

@larsvilhuber
Created December 15, 2017 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsvilhuber/bfdd92dd4ed1147056955d7f3f2c7239 to your computer and use it in GitHub Desktop.
Save larsvilhuber/bfdd92dd4ed1147056955d7f3f2c7239 to your computer and use it in GitHub Desktop.
Use of toggle in latex
\usepackage{etoolbox}
\newtoggle{final}
\newtoggle{blind}
%\togglefalse{final}
\toggletrue{final}
%\toggletrue{blind}
\togglefalse{blind}
% define a mc=margincomment command
\iftoggle{final}{
\newcommand{\mc}[2]{#1} % make margincomments go away
\newcommand{\tc}[2]{#1} % make text comments go away
}%else
{
\newcommand{\mc}[2]{% 1 referenced text 2 initials 3 comment
\textcolor{blue}{#1}
\marginpar{\scriptsize\textbf\raggedright\textcolor{red}{#2}}}
\newcommand{\tc}[2]{\textcolor{blue}{#1}[\textcolor{red}{#2}]}
}
\begin{document}
\iftoggle{blind}{}{Much of the work developing this paper occurred while Mark Kutzbach was an employee of the U.S. Census Bureau.}}\\
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment