Re: Frage zu Befehls-Scope und Datei-Inkludierung

Marei Peischl <[email protected]>
Newsgroups gmane.comp.tex.german
Message-ID <[email protected]>
Moin Nils,

Hooks sind deine Freunde ;-)

\AddToHook{include/before}{\begingroup}
\AddToHook{include/after}{\endgroup}

siehe auch

texdoc ltfilehook-doc (oder online 
https://texdoc.org/serve/ltfilehook-doc/0)

Liebe Grüße

Marei

On 2/19/24 22:57, Nils Pickert wrote:
> Hallo liebe TeXies,
>
> ich stehe gerade mal wieder auf dem Schlauch, wie man etwas eleganter 
> lösen kann...
>
> Ursprüngliches Problem: ein Dokument mit mehreren Includes, die 
> Includes können andere Autoren haben als die Hauptdatei und ich möchte 
> diese Autoren dann in der Kopf/Fußzeile anzeigen.
>
> Das folgende Minimalbeispiel macht, was es soll, allerdings braucht es 
> noch die geschweiften Klammern um die "include" Befehle, damit das mit 
> den Befehls-Scopes hinhaut... Kann man irgendwie automatisch sagen, 
> dass ein input einen eigenen Scope haben soll oder macht das mehr 
> kaputt als das es hilft? Bzw. allgemein: wie geht das schöner?
>
> ---- Haupt-Datei main.tex ----
>
> \documentclass[twoside]{scrartcl}
> \usepackage{scrlayer-scrpage}
> \usepackage{titling}
> \title{A test}
> \author{The Main Author}
> \date{}
> \newcommand{\myauthor}{\theauthor}
> \newcommand{\myhead}{\chead{\myauthor}}
>
> \begin{document}
> \maketitle
> {\include{include1.tex}}
> {\include{include2.tex}}
> \end{document}
>
> ---- ENDE main.tex ----
>
> --- include1.tex ----
>
> \renewcommand{\myauthor}{Another Author}
> \myhead
> Text 1
> \cleardoublepage
>
> ---- ENDE include1.tex ---
>
> ---- include2.tex ----
>
> \myhead
> Text 2
> \cleardoublepage
>
> ----- ENDE include2.tex ----
>
>
> Viele Grüße
>
> Nils
>
>

-- 
FAQ: http://texfragen.de/
Durchsuchbares Archiv: https://www.listserv.dfn.de/sympa/arc/tex-d-l 
Unsubscribe/Verwaltung: https://www.listserv.dfn.de/sympa/info/tex-d-l
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.