[latexrefman-discuss] \newenvironment (non starred) vs \newenvironment* (starred)

Vincent Belaïche vincent.belaiche at domain.hid
Fri Nov 6 16:38:57 CET 2015


Hello,

Trying to update the translation of node \newenvironment &
\renewenvironment, I noted a discrepancy:

English version:

   Unlike @code{\newcommand} and @code{\renewcommand}, the
   @code{*}-forms @code{\newenvironment*} and @code{\renewcommand*} have
   the same effect as the forms with no @code{*}.


French version:

   La forme étoilée de ces commandes exige que les arguments (à ne pas
   confondre avec le contenu de l'environnement) ne contiennent pas de
   paragraphes de texte.


Well, the difference comes from rev 346 by Jim:

http://svn.gna.org/viewcvs/latexrefman/trunk/latex2e.texi?r1=345&r2=346

ie the French version is the translation of the pre-rev 346 text:

   The @code{*}-form of these commands requires that the arguments (not
   the contents of the environment) not contain multiple paragraphs of
   text.

Now, I must say that a small experiment quickly shows that the original
text was indeed correct:


   \documentclass{article}
   \usepackage{lipsum}
   \newenvironment{toto}[1]{\begin{itemize}\item #1}{\end{itemize}}
   \newenvironment*{tata}[1]{\begin{itemize}\item #1}{\end{itemize}}
   
   \begin{document}
   
   \begin{toto}{\lipsum[1-2]}
     \item \lipsum[3-4]
   \end{toto}
   
   \begin{tata}{\lipsum[1-2]}
     \item \lipsum[3-4]
   \end{tata}
   
   \begin{toto}{\lipsum[1]\par\lipsum[2]}
     \item \lipsum[3-4]
   \end{toto}
   
   %\begin{tata}{\lipsum[1]\par\lipsum[2]}
   %  \item \lipsum[3-4]
   %\end{tata}
   
   \end{document}

If you uncomment the second \begin{tata}...\end{tata}, the the exemple
does not compile (FYI toto and tata are the French cousins of foo and
bar).

I would also suggest that we encourage the use of starred version when
possible, see What Manuel Pégourié-Gonnard wrote on this LaTeX tips
page:


https://elzevir.fr/imj/latex/tips.html#stared

VBR,
	Vincent

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus





More information about the latexrefman mailing list