composição do código-fonte (Funnelweb), 2ª tentativa

composição do código-fonte (Funnelweb), 2ª tentativa

Segunda versão depergunta sobre Funnelweb e códigos ASCII engraçados.

ADICIONADO: aqui está minha entrada (arquivo Funnelweb).

@p typesetter = tex
\documentclass{article}
\begin{document}
@$@<Example@>==@{ABC@^D(025)@}
@O@<ex.txt@>==@{@-
@<Example@>
@}
\end{document}

E aqui está o exemplo completo e mínimo do Latex gerado automaticamente.

\tolerance=10000
\parindent=0pt
\def\fwparskipon{\parskip=\medskipamount}
\def\fwparskipoff{\parskip=0pt}
\fwparskipon
\raggedbottom
\font\fwfontnote=cmr7
\font\fwfontnorm=cmr10
\font\fwfontnorma=cmr10 scaled \magstep1
\font\fwfontnormb=cmr10 scaled \magstep2
\font\fwfontbold=cmbx10
\font\fwfontbolda=cmbx10 scaled \magstep1
\font\fwfontboldb=cmbx10 scaled \magstep2
\font\fwfontboldc=cmbx10 scaled \magstep3
\font\fwfontboldd=cmbx10 scaled \magstep4
\def\fwbeginmacro{\fwparskipoff\bigskip}
\def\fwendmacro{\fwparskipon\par}
\def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$}
\def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$}
\def\fwzero#1{{\bf Z}}
\def\fwmany#1{{\bf M}}
\def\fwlib#1{{\bf L}}
\def\fwequals{ $\equiv$}
\def\fwplusequals{ $+\equiv$}
\def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt}
\def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt}
\def\fwoquote{`}
\def\fwcquote{'}
\def\fwoparen{$($}
\def\fwcomma{$,$}
\def\fwcparen{$)$}
\def\fwparam#1{$\diamond #1$}
\def\fwparams#1{$(\diamond #1)$}
\def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip}
\def\fwnote#1{{\fwfontnote #1}\par}
\def\fwisafile#1{\fwnote{#1}}
\def\fwusedin#1{\fwnote{#1}}
\def\fwseealso#1{\fwnote{#1}}
\def\fwendmacronotes{\endgroup}
{\catcode`\`=\active \gdef`{\relax\lq}}
{\obeyspaces\global\let =\ }
\def\fwbtx[{%
\begingroup%
\def\par{\leavevmode\endgraf}%
\catcode`\`=\active%
\obeylines%
\def\do##1{\catcode`##1=12 }\dospecials%
\obeyspaces
\parskip=0pt%
\tt%
\fwverbatimgobble}
\def\fwverbatimgobble#1]fwetx={#1\endgroup}
\def\fwrule{\medskip\hrule\medskip}
\def\fwqh{\hskip1.5em\relax}
\def\fwbeforesec{\penalty-200\bigskip\medskip\par}
\def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule}
\def\fwtoca#1#2{\leftline{{\bf #1 #2}}}
\def\fwtocb#1#2{\leftline{\fwqh #1 #2}}
\def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}}
\def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}}
\def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}}
\def\fwtocfinish#1{\fwrule}
\def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip}
\def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip}
\def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip}
\def\fwlibd#1#2{\fwbeforesec{\bf          #1 #2}\penalty200}
\def\fwlibe#1#2{\fwbeforesec{\bf          #1 #2}}
\def\fwseca#1#2{\fwliba{#1}{#2}}
\def\fwsecb#1#2{\fwlibb{#1}{#2}}
\def\fwsecc#1#2{\fwlibc{#1}{#2}}
\def\fwsecd#1#2{\fwlibd{#1}{#2}}
\def\fwsece#1#2{\fwlibe{#1}{#2}}
\def\fwlit#1{{\tt #1}}
\def\fwemp#1{{\it #1}}
\def\fwnewpage{\vfill\eject}
\def\fwvskip#1{\null\vskip #1mm}
\def\fwfontnormal#1{{\fwfontnorm {#1}}}
\def\fwfonttitle#1{{\fwfontboldd {#1}}}
\def\fwfontsmalltitle#1{{\fwfontboldb {#1}}}
\def\fwleftline#1{\leftline{#1}}
\def\fwcenterline#1{\centerline{#1}}
\def\fwrightline#1{\rightline{#1}}
\def\p#1{{\tt #1}}  % P for Program text.
\def\flagpage#1#2{
   \null
   \vfill
   \centerline{\fwfontboldd #1}
   \vskip 1cm
   \centerline{\fwfontboldd #2}
   \vfill
   \null
   \vfill
}
\documentclass{article}
\begin{document}
\fwbeginmacro
\fwmacroname{Example}{1}\fwequals \fwodef \fwbtx[ABC]fwetx=%
\fwcdef 
\fwbeginmacronotes
\fwusedin{This macro is invoked in definition 2.}
\fwendmacronotes
\fwendmacro
\fwbeginmacro
\fwfilename{ex.txt}{2}\fwequals \fwodef \fwmacroname{Example}{1}\fwbtx[
]fwetx=%
\fwcdef 
\fwbeginmacronotes
\fwisafile{This macro is attached to an output file.}
\fwendmacronotes
\fwendmacro
\end{document}
\bye

E aqui está o erro

! Text line contains an invalid character.
l.97 ...Example}{1}\fwequals \fwodef \fwbtx[ABC^^Y
                                                  ]fwetx=%

Idealmente, eu gostaria de substituir apenas uma definição de macro e não adicionar nada novo.

Responder1

O site remove os caracteres de controle, mas adicionei um entre colchetes em um texto e adicionei duas linhas na parte superior para que ele seja impresso com segurança. MudarCONTROL-Ypara o que você quiser

Sei que é um código gerado, mas é horrível, o gerador de tex realmente deveria ser atualizado :-)

insira a descrição da imagem aqui

\catcode25=13 \def^^Y{CONTROL-Y}
\tolerance=10000
\parindent=0pt
\def\fwparskipon{\parskip=\medskipamount}
\def\fwparskipoff{\parskip=0pt}
\fwparskipon
\raggedbottom
\font\fwfontnote=cmr7
\font\fwfontnorm=cmr10
\font\fwfontnorma=cmr10 scaled \magstep1
\font\fwfontnormb=cmr10 scaled \magstep2
\font\fwfontbold=cmbx10
\font\fwfontbolda=cmbx10 scaled \magstep1
\font\fwfontboldb=cmbx10 scaled \magstep2
\font\fwfontboldc=cmbx10 scaled \magstep3
\font\fwfontboldd=cmbx10 scaled \magstep4
\def\fwbeginmacro{\fwparskipoff\bigskip}
\def\fwendmacro{\fwparskipon\par}
\def\fwmacroname#1#2{{\sl #1\/}$\lbrack$#2$\rbrack$}
\def\fwfilename#1#2{{\bf #1}$\lbrack$#2$\rbrack$}
\def\fwzero#1{{\bf Z}}
\def\fwmany#1{{\bf M}}
\def\fwlib#1{{\bf L}}
\def\fwequals{ $\equiv$}
\def\fwplusequals{ $+\equiv$}
\def\fwodef{\parindent=15pt\vskip0pt$\lbrace$\parindent=20pt}
\def\fwcdef{$\rbrace$\vskip0pt\parindent=0pt}
\def\fwoquote{`}
\def\fwcquote{'}
\def\fwoparen{$($}
\def\fwcomma{$,$}
\def\fwcparen{$)$}
\def\fwparam#1{$\diamond #1$}
\def\fwparams#1{$(\diamond #1)$}
\def\fwbeginmacronotes{\begingroup\baselineskip=9pt\smallskip}
\def\fwnote#1{{\fwfontnote #1}\par}
\def\fwisafile#1{\fwnote{#1}}
\def\fwusedin#1{\fwnote{#1}}
\def\fwseealso#1{\fwnote{#1}}
\def\fwendmacronotes{\endgroup}
{\catcode`\`=\active \gdef`{\relax\lq}}
{\obeyspaces\global\let =\ }
\def\fwbtx[{%
\begingroup%
\def\par{\leavevmode\endgraf}%
\catcode`\`=\active%
\obeylines%
\def\do##1{\catcode`##1=12 }\dospecials%
\obeyspaces
\parskip=0pt%
\tt%
\fwverbatimgobble}
\def\fwverbatimgobble#1]fwetx={#1\endgroup}
\def\fwrule{\medskip\hrule\medskip}
\def\fwqh{\hskip1.5em\relax}
\def\fwbeforesec{\penalty-200\bigskip\medskip\par}
\def\fwtocstart#1{\fwrule\leftline{\fwfontbolda Table of Contents}\fwrule}
\def\fwtoca#1#2{\leftline{{\bf #1 #2}}}
\def\fwtocb#1#2{\leftline{\fwqh #1 #2}}
\def\fwtocc#1#2{\leftline{\fwqh\fwqh #1 #2}}
\def\fwtocd#1#2{\leftline{\fwqh\fwqh\fwqh #1 #2}}
\def\fwtoce#1#2{\leftline{\fwqh\fwqh\fwqh\fwqh #1 #2}}
\def\fwtocfinish#1{\fwrule}
\def\fwliba#1#2{\vfill\eject{\fwfontboldc #1 #2}\penalty200\smallskip}
\def\fwlibb#1#2{\fwbeforesec{\fwfontboldb #1 #2}\penalty200\smallskip}
\def\fwlibc#1#2{\fwbeforesec{\fwfontnormb #1 #2}\penalty200\smallskip}
\def\fwlibd#1#2{\fwbeforesec{\bf          #1 #2}\penalty200}
\def\fwlibe#1#2{\fwbeforesec{\bf          #1 #2}}
\def\fwseca#1#2{\fwliba{#1}{#2}}
\def\fwsecb#1#2{\fwlibb{#1}{#2}}
\def\fwsecc#1#2{\fwlibc{#1}{#2}}
\def\fwsecd#1#2{\fwlibd{#1}{#2}}
\def\fwsece#1#2{\fwlibe{#1}{#2}}
\def\fwlit#1{{\tt #1}}
\def\fwemp#1{{\it #1}}
\def\fwnewpage{\vfill\eject}
\def\fwvskip#1{\null\vskip #1mm}
\def\fwfontnormal#1{{\fwfontnorm {#1}}}
\def\fwfonttitle#1{{\fwfontboldd {#1}}}
\def\fwfontsmalltitle#1{{\fwfontboldb {#1}}}
\def\fwleftline#1{\leftline{#1}}
\def\fwcenterline#1{\centerline{#1}}
\def\fwrightline#1{\rightline{#1}}
\def\p#1{{\tt #1}}  % P for Program text.
\def\flagpage#1#2{
   \null
   \vfill
   \centerline{\fwfontboldd #1}
   \vskip 1cm
   \centerline{\fwfontboldd #2}
   \vfill
   \null
   \vfill
}
\documentclass{article}
\begin{document}
\fwbeginmacro
\fwmacroname{Example}{1}\fwequals \fwodef \fwbtx[ABC]fwetx=%
\fwcdef 
\fwbeginmacronotes
\fwusedin{This macro is invoked in definition 2.}
\fwendmacronotes
\fwendmacro
\fwbeginmacro
\fwfilename{ex.txt}{2}\fwequals \fwodef \fwmacroname{Example}{1}\fwbtx[
]fwetx=%
\fwcdef 
\fwbeginmacronotes
\fwisafile{This macro is attached[] to an output file.}
\fwendmacronotes
\fwendmacro
\end{document}
\bye

informação relacionada