Generalswitching between different output versions of one document

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
littlemathteacher
Posts: 9
Joined: Mon Nov 09, 2009 6:14 pm

switching between different output versions of one document

Post by littlemathteacher »

Hi.

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
Last edited by littlemathteacher on Sun Jan 15, 2012 9:15 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

littlemathteacher
Posts: 9
Joined: Mon Nov 09, 2009 6:14 pm

switching between different output versions of one document

Post by littlemathteacher »

found something myself:

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} 
littlemathteacher
Posts: 9
Joined: Mon Nov 09, 2009 6:14 pm

switching between different output versions of one document

Post by littlemathteacher »

And yet another thing, in which I don't like that, compared to the editor method, the corresponding lines are not directly underneath:

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}
Post Reply