Skip to content

Instantly share code, notes, and snippets.

@martinarroyo
Created June 1, 2015 22:10
Show Gist options
  • Save martinarroyo/b9e0a963ad27169a6eee to your computer and use it in GitHub Desktop.
Save martinarroyo/b9e0a963ad27169a6eee to your computer and use it in GitHub Desktop.
A LaTeX macro that sets a Wikipedia-stylized "Citation Needed" template and outputs the counter of references with a surprise. Use with write18 enabled! and the Figures directory in \graphicspath{}!
\newcounter{undefinedreferences}
\setcounter{undefinedreferences}{0}
\newcommand{\citationneeded}[1][None]{\stepcounter{undefinedreferences}\textsuperscript{\color{blue} [Citation needed: #1]}}
\newcommand{\checkreferences}{
\ifnum\value{undefinedreferences} > 0
\begin{center}
\immediate\write18{wget -O Figures/protester.png -nc http://imgs.xkcd.com/comics/wikipedian_protester.png}
\includegraphics[width=\textwidth]{protester.png}
\end{center}
\else
No undefined references. Good!
\fi
}
@ashwinvis
Copy link

Minimalistically (without the images and the counter):

% Wikipedia-style "citation needed" macro
\newcommand{\citationneeded}[1][]{\textsuperscript{\color{blue} [citation needed: #1]}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment