# How can I do optional pdf generation?

I am experimenting with dynamic citations.

I want four options:

1. default no dynamics;
2. a click on citation goes to bibliography;
3. a click on the external citation goes to the internet;
4. both 2 and 3.

Something like: if this, do something, else do another thing.

Edit I only want a method to include/exclude portions of the LaTeX. I already have a handle on the dynamics.

-
2-4 seem like they would be taken care of by a bibliography such as biblatex with hyperref loaded. Assuming you mean bibliography citations. Or do you mean textual quotes (full passages ?). And what do you mean with include/exclude portions of the LaTeX ? – ach May 27 '13 at 7:48

If I understand your question correctly, you want to enable/disable parts of your code programmatically. If so, you may want to create two toggles, each associated to one type of link. Here is a skeletal solution:

\documentclass{article}

\usepackage{etoolbox}

\toggletrue{citationlinks}  % <--- comment that in or out
\toggletrue{internetlinks}  % <--- comment that in or out

% if true, do this
}{%
% if false, do that
}