1

I'm tuning the code @CarLaTeX proposed in this topic to separate teacher version and student version.

The goal is when the boolean is true (student version), a blank line takes the place of the stuff. I'm sure it can be improved but it works for me.

Now, i'm convince that students need more space than what i can typeset (By example, demonstrations take often more place by hands than by computer) so i want to create an option for my command \ProfPart who is a number and will multiply the value of \the\heightOfProfBox consequently.

At the moment i can't simply by hands multiply the size in the \vspace so my hopes to make it an option seems like sweet dreams...

Someone could help me ?

Here is a MWE of what i have achieved untill now :

\documentclass[11pt,a4paper]{report}
\usepackage[latin1]{inputenc}

\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{mdframed}
\usepackage{etoolbox}

\newbool{studentversion}
\setbool{studentversion}{true}%true for students' version

\newlength{\heightOfProfBox}
\settoheight{\heightOfProfBox}{0pt}

\newcommand{\ProfPart}[1]%
{%
    \ifbool{studentversion}%
    {%%True (donc version pour étudiant)
        \settoheight{\heightOfProfBox}{%
            \parbox{\linewidth}{\begin{mdframed}
                    \textcolor{red}{#1}
        \end{mdframed}}}
        \vspace{\the\heightOfProfBox}%
    }%
    {%%False (donc version pour prof)
        \begin{mdframed}
            \textcolor{red}{#1}
        \end{mdframed}%
    }
}


\begin{document}
    \section{Section}
    \lipsum[1]
    \ProfPart{Stuff for teacher only. Access denied for students. Here are the answers to tests and exams.}
    \lipsum[2]
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.