4

I have defined a command

\newcommand{\CV}[1]{\parbox[c]{0.2\textwidth}{\begin{flushleft}#1\end{flushleft}}}

which I obviously have to call like

\CV{My text}

However I rather would like to use two separate commands without parameters (my reason is in endnote [*]), so that the call sequence looks like:

\beginCV My text \endCV

How can I define these commands, so that the \parbox gets appropriately "opened" and "closed".


[*] I use pandoc to convert markdown documents to LaTeX or HTML, and I tweak the LaTeX output a bit with some helper commands. This does not affect the HTML output, as long as no text is a parameter to a LaTeX command.

6

The environment form of \parbox is minipage:

\newenvironment{CV}
 {\begin{minipage}{0.2\textwidth}\raggedright}
 {\end{minipage}}

Note that you don't want a flushleft environment inside the minipage, because it adds vertical space fore and aft; with \raggedright this doesn't happen.

Now you can call

\begin{CV}
Text
\end{CV}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.