Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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