Pregunta

Dos preguntas:

  1. ¿LaTeX permite (re)definir comandos dentro de un \newenvironment?He intentado usar \renewcommand, \newcommand y \def en el antes declaración pero fue en vano.

  2. ¿Cómo se redefiniría \item al crear un nuevo entorno de lista?

He creado un nuevo tipo de entorno de lista desde cero usando \newenvironment mientras usa otro token en lugar de \item para cada uno, pero realmente me gustaría mantener las cosas consistentes usando \list y redefiniendo \item.

¿Fue útil?

Solución

Claro; Es difícil saber qué salió mal sin ver su código. Como respuesta a sus dos preguntas, vea si esto ayuda:

\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}

Otros consejos

Demasiado tarde tal vez, pero puede ser útil para otra persona

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

y úsalo

\begin{coolitemize}
\item[Title of my first item] Text of my 1st item.
\item[Second one] And some text here.
\end{coolitemize}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top