General ⇒ switching between different output versions of one document
-
- Posts: 9
- Joined: Mon Nov 09, 2009 6:14 pm
switching between different output versions of one document
Anyone got an idea how to keep different output versions within one document? To explain what I want to do: I have to design tests for math courses so that there are two sets A and B of students so that each B may sit next to an A and never a B, getting different forms corresponding to their very set and not having to use sight shields. And since the tests have to be similar I'd like to write both versions of each exercise underneath one another and at the end simply switch between the whole outputs by filling in an A or B at the top.
One easy way to do this would be to write ... say
% A or % B
before each exercise and then finally delete the % A's or the % B's via editor. But I'd like the document itself to perform this task, not me using an editor.
Any idea anyone?
Thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 9
- Joined: Mon Nov 09, 2009 6:14 pm
switching between different output versions of one document
Code: Select all
\documentclass[a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage{ifthen}
\newcounter{Strg1} %new Variable
\setcounter{Strg1}{1} %set it to 0 for noprint or 1 for print
\newcommand{\hide}[4]{%
\ifthenelse{#1 = #2}{#3}{#4}
}
\begin{document}
\verstecken{\value{Strg1}}
{1}
{Write here.}
{Or write here.}
\end{document}
-
- Posts: 9
- Joined: Mon Nov 09, 2009 6:14 pm
switching between different output versions of one document
Code: Select all
...
\usepackage{comment}
\begin{document}
\includecomment{versiona} \excludecomment{versionb}
% \includecomment{versionb} \excludecomment{versiona}
\begin{versiona}
$3x^2+12=-12x$\hfill \mbox{4 P.}\\[3mm]
\end{versiona}
\begin{versionb}
$5x^2+20=-20x$\hfill \mbox{4 P.}\\[3mm]
\end{versionb}
\end{document}