I use moderncv for my CV and changed the header for the classic and the casual style (but not the other three styles), following the advice from this post:
Moderncv adding date of birth to personal information
That worked as a charm regarding the layout. I put each changed \makecvhead{}
macro in a separate file, put them in the main LaTeX-document with \input
and if I want the classic or the casual style, I have to remove the comment accordingly:
%\input{dateofbirth_for_casual}
\input{dateofbirth_for_classic}
To learn something new, and for the sake of simplicity, now I want to just change the style in \moderncvstyle{}
and the rest should be taken care of automatically, i.e. the appropriate header should be used as necessary.
It boils down to the question:
How can I extract which style is defined by the user (aka myself) programmatically and use it in if-statements?
Something like this:
\ifthenelse{\equal{\@moderncvstyle}{classic}}{
%do something because it's classic
}{}
\ifthenelse{\equal{\@moderncvstyle}{casual}}{
%do something because it's casual
}{}
From scanning the code of "moderncv.cls" and the other files in the package, I have no clue where the value of \moderncvstyle{}
is stored, and I do not know if my test is okay or maybe I have to put the testing condition in quotation marks or anything..?
\ifthenelse{\equal{**WHAT IS THE STYLE?**}{"casual"}}{
%do something because it's casual
}{}
At the end I only want to have one file as \input
I use everytime and don't want to care anymore which changed header is used:
\input{dateofbirth_for_classic_or_casual}
Thanks!
Not working ME with pseudo code:
\documentclass[12pt]{moderncv}
\moderncvstyle{casual}
% Pseudo-Code starts here:
% If style = casual
% do this
% if style = classic
% do that
% if style = banking or fancy or oldstyle
% do nothing
\name{John}{Doe}
\address{111 Mimimi}{Here}{Somewhere}
\phone[mobile] {+01~(0)123 456789}
\email{John.Doe@mail.com}
\begin{document}
\makecvtitle
\end{document}