4

Since the enumiten Package (and therefore leftmargin=*) doesnt work in custom environments, I was trying to trick a bit, doing the items in a table like this (don't ask..) :

  \documentclass[fleqn,10pt,twocolumn]{article} % Document font size and equations 
  \usepackage{tabularx}
  \renewcommand\tabularxcolumn[1]{m{#1}}
  \newcommand{\localtextbulletone}{{\raisebox{.45ex}{\rule{.6ex}{.6ex}}}}

  \newenvironment{parameters}
      {Parameters:\\
       \tabularx{\linewidth}{>{\raggedright\arraybackslash}p{0.3cm}X@{}}    }
      {\endtabularx}

      \newcommand{\parameter}[2] %Name, Description
  {\localtextbulletone & #1: #2\\}

  \begin{document}
  \begin{parameters}
  \parameter{Test}{This is a long text to illustrate the alignment of the item... 
  blablabla long text long text long text long text long text long text long text long 
  text long text long text}
  \end{parameters}

\end{document}

I needed to set the tabularxcolumn to 'm' instead of 'p' for other tables in my document. In this case I would like to set it back to p, but only in this particular environment so the bullets are top aligned and not centered.

If I try to just do the analoge \renewcommand\tabularxcolumn[1]{p{#1}}inside the environment, latex is not happy. How can I reset the tabularxcolumn just for this environment?

Many Thanks in advance

5

Just put the \renewcommand line immediately before the \tabularx it will be scoped by the surrounding parameters element.

 \newenvironment{parameters}
      {Parameters:\\
       \renewcommand\tabularxcolumn[1]{m{##1}}%
       \tabularx{\linewidth}{>{\raggedright\arraybackslash}p{0.3cm}X@{}}    }
      {\endtabularx}

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.