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.

If I have a new list environment like so:

\newenvironment{textblockX}
{ 
    \begin{list}
    {Question}
    {}
}
{
    \end{list}
}

How would I refer to an item of the list within the environment? As an example, how could I modify the code above such that every entry is now bold, but the word question stays in normal text? Is this where the ##1 is used?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can't refer to an item in the environment definition because the \items are not part of that definition. They are only added inside the environment. You can use formatting macros like \bfseries which don't take arguments but are valid for the whole environment. Then to switch back to normal use \textnormal{...} or \normalfont. There is also \normalsize and \normalcolor if you require it.

The environment arguments like #1 standing for normal macro arguments direct after the \begin{<env>} and don't have anything to do with the \items.

\newenvironment{textblockX}
{% 
    \bfseries
    \begin{list}%
    {\textnormal{Question}}%
    {}%
}
{%
    \end{list}%
}
share|improve this answer
add comment

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.