Path: ...!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!news.gegeweb.eu!gegeweb.org!.POSTED.arennes-654-1-273-187.w2-14.abo.wanadoo.fr!not-for-mail From: =?utf-8?Q?Vincent_Bela=C3=AFche?= Newsgroups: fr.comp.text.tex Subject: Re: Mais pourquoi le \fi reste =?utf-8?Q?l=C3=A0?= ! Date: Tue, 30 Nov 2021 12:10:25 +0100 Organization: Gegeweb News Server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: news.gegeweb.eu; posting-account="vbelaiche@orange.local"; posting-host="arennes-654-1-273-187.w2-14.abo.wanadoo.fr:2.14.63.187"; logging-data="51753"; mail-complaints-to="abuse@gegeweb.eu" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cancel-Lock: sha1:Yb4vVPaoc18aGdyX0AqA/RTgdLE= sha256:tdu98eploSaCz/TPrHPqS0u1buRjuKBO3XdhqDiknAI= Bytes: 2709 Lines: 57 Vincent Bela=C3=AFche writes: > Bonjour, > > Voici un ECM : > > ```LaTeX > > \documentclass{minimal} > \newcommand*\Toto[1]{Que le Grand #1 me croque !} > \begin{document} > \tracingmacros=3D1 > \expandafter\Toto\expandafter{\iftrue Cri\fi c} > \tracingmacros=3D0 > \end{document} > > ``` > > Dans le journal de transcription j'ai ceci : > > ``` > \Toto #1->Que le Grand #1 me croque ! > #1<-Cri\fi c > ``` > > L'argument pass=C3=A9 =C3=A0 \Toto est =C2=AB=C2=A0Cri\fi c=C2=A0=C2=BB e= t non =C2=AB=C2=A0Cric=C2=A0=C2=BB, et ceci > est probl=C3=A9matique, =C3=A0 moins que le but f=C3=BBt d'ins=C3=A9rer u= n \fi sans avoir =C3=A0 > =C3=A9quilibrer les \ifxxx et les \fi, ce qui n'est pas le cas. > > Dans cet exemple simplissime cela passerait inaper=C3=A7u, mais pas avec = du > code o=C3=B9 \Toto serait plus complexe. > > Bon, c'est contournable, mais j'aimerais comprendre o=C3=B9 j'ai faux, je > pensais que les conditions =C3=A9taient d=C3=A9veloppables. Juste pour dire qu'une solution c'est de faire comme =C3=A7a=C2=A0: ``` \documentclass{minimal} \newcommand*\Toto[1]{Que le Grand #1 me croque !} \begin{document} \makeatletter \tracingmacros=3D1 \expandafter\expandafter\expandafter\Toto \expandafter\expandafter\expandafter {\iftrue\expandafter\@firstofone\else\expandafter\@gobble\fi{Cri}c} \tracingmacros=3D0 \makeatother \end{document} ``` Dans ce cas l'argument pass=C3=A9 =C3=A0 \Toto devient =C2=AB=C2=A0\@firsto= fone{Cri}c=C2=A0=C2=BB et on n'est plus emb=C3=AAt=C3=A9 par le \fi qui reste. --=20