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 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.

share|improve this question
    
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

1 Answer 1

up vote 3 down vote accepted

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}
\newtoggle{citationlinks}   % false by default
\newtoggle{internetlinks}   % false by default

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

\iftoggle{citationlinks}{%
    % if true, do this
}{%
    % if false, do that
}

\iftoggle{internetlinks}{%
    % if true, do this
}{%
    % if false, do that
}

\begin{document}
%...
\end{document}
share|improve this answer
    
+1 This is exactly what I was looking for. –  Fred Kline May 27 '13 at 10:09

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.