Redefining commands in a new environment

后端 未结 2 607
深忆病人
深忆病人 2021-02-19 11:03

Two questions:

  1. Does LaTeX allow one to (re)define commands within a \\newenvironment? I\'ve tried using \\renewcommand, \\newcom

2条回答
  •  执笔经年
    2021-02-19 11:26

    Too late perhaps, but it may be useful for someone else

    \newenvironment{coolitemize}{%
    \let\olditem\item% 
    \renewcommand\item[2][]{\olditem \textbf{##1}\\[0.3\baselineskip]##2}%
    \begin{itemize}}{\end{itemize}%
    }
    

    and use it

    \begin{coolitemize}
    \item[Title of my first item] Text of my 1st item.
    \item[Second one] And some text here.
    \end{coolitemize}
    

提交回复
热议问题