Re: [RISOLTO] Extend Captions

#23732
Up
0
Down
::


Grazie moltissime, è veramente perfetto! Sì, userò \abcname nelle macro, ma almeno nelle definizioni nel preambolo me lo volevo risparmiare se possibile, eheh! Grazie!
Ora confronto permettimi un confronto…
Tua versione CORRETTA:
`\expandafter\let\expandafter\@tempA\csname captions#1\endcsname
\toks0=\expandafter\expandafter\expandafter{%
\expandafter\@tempA\expandafter\def\csname #2name\endcsname{#3}}
\expandafter\xdef\csname captions#1\endcsname{\the\toks0 }`
Versione mia errata:
`\expandafter\let\expandafter\@tempA\csname captions#1\endcsname
\expandafter\let\expandafter\@tempB\csname #2name\endcsname
\toks0=\expandafter{\@tempA\def\@tempB{#3}}
\expandafter\xdef\csname captions#1\endcsname{\the\toks0}`

Ammesso che conosco meno della metà dei comandi che ci sono… ma la differenza a occhio mi sembra solo di alcuni \expandafter in meno, o sbaglio?

Grazie ancora, buona serata!

Riepilogo la soluzione:
`\makeatletter
\newcommand*\ExtendCaptionsM[3]
{ { \@ifundefined{captions#1}
{ \PackageWarning{AggiungiCaption}%
{ Language option #1 not specified
\MessageBreak
Skipping any redefinition
\MessageBreak
}
}
{ \expandafter\let\expandafter\@tempA\csname captions#1\endcsname
\toks0=\expandafter\expandafter\expandafter
{ \expandafter\@tempA\expandafter\def\csname #2name\endcsname{#3}
}
\expandafter\xdef\csname captions#1\endcsname{\the\toks0}
}
}
}
\makeatother`
Da usare come:
`\ExtendCaptionsM{}{}{}`
Che aggiunge nelle infix string della la definizione `\name` che se inserita nel documento produce in output .

Go to top