I am preparing a LaTeX beamer presentation for students. I am looking for a simple way to create two versions of my presentation.
One version for the Students, which just contains the text of the tasks they get for homework and an other one for me which also contains the solution.
So I have created a macro that is intended to check if the file name contains "student". If it does, the macro outputs nothing, and if it does not, the argument is passed:
\newcommand{\hausaufgabenLoesung}[1]{%
\IfSubStringInString{student}{\jobname}{}{#1}%
}
But this does not work as intended.
No matter how I name the file, the conditional always goes to the false-expression.
I think the \jobname
macro returns something which can not be processed by \IfSubStringInString
but I have no other idea how I could approach this.
If I replace the \jobname
macro in the conditional with a fixed string, it works as intended but this would render it fairly useless.
I used \jobname
to avoid including the currfile-package, but with the currfile-macros I get the same behaviour. I am using texlive 2014 pdflatex on Linux and Windows.
Anyone here got a hint for that?
Here is a minimal complete example:
\documentclass[ngerman]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{ifthen}
\usepackage{substr}
\newcommand{\hausaufgabenLoesung}[1]{%
\IfSubStringInString{student}{\jobname}{}{#1}%
}
\begin{document}
\begin{frame}{Title}{Subtitle}
\begin{itemize}
\item \jobname
\item Visible in both files
\hausaufgabenLoesung{\item Solution not in the student file}
\end{itemize}
\end{frame}
\end{document}
`
to mark your inline code. – mvkorpel Aug 21 '14 at 12:26\IfSubStr
fromxstring
package. And you mean\usepackage[ngerman]{babel}
, not vice versa ;-) – user31729 Aug 21 '14 at 12:32\newcommand{\hausaufgabenLoesung}[1]{\IfSubStr{\jobname}{student}{}{#1}}
– Andi Aug 21 '14 at 12:37