Redefining commands in a new environment

后端 未结 2 610
深忆病人
深忆病人 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:46

    Sure; it's hard to know what went wrong without seeing your code. As an answer to your two questions, see if this helps:

    \documentclass{article}
    \begin{document}
    \newenvironment{myitemize}{%
      \begin{list}{}{}% whatever you want the list to be
      \let\olditem\item
      \renewcommand\item{\olditem ITEM: }
    }{%
      \end{list}
    }  
    \begin{myitemize}
    \item one \item two
    \end{myitemize}
    \end{document}
    

提交回复
热议问题