
Me enfrento a un problema en el que necesito etiquetas "reconectables".
Estoy trabajando en un mecanismo para ejecutar una parte del archivo tex dos veces con dos parámetros diferentes, para escribir diferentes partes del texto. Usando \input con una variable establecida antes. En el PDF final ambos arreglos deben imprimirse uno detrás del otro.
El mecanismo funciona así:
...
\DefCurrentLanguage{DE}
\input{content.tex}
\DefCurrentLanguage{EN}
\input{content.tex}
...
Esto me crea algunos problemas cuando uso etiquetas. Vea aquí una versión simplificada (sin \input, pero con texto claro)
\documentclass{scrbook}
\usepackage{etoc}
\usepackage{hyperref}
\counterwithout{section}{chapter}
\begin{document}
% Usually this is input my \input{myfile.txt} with the first option
\chapter{GERMAN}
\etocsettocstyle{\section*{Inhalt}}{}
\etocsettocdepth.toc{subsection}
\localtableofcontents
\setcounter{section}{0}
\section{Eins}
Referenz auf zwei: \ref{mylabel}
\subsection{Ein.Eins}
\section{Zwei}\label{mylabel}
% Usually this is input my \input{myfile.txt} with the second option
\chapter{ENGLISH}
\etocsettocstyle{\section*{Content}}{}
\etocsettocdepth.toc{subsection}
\localtableofcontents
\setcounter{section}{0}
\section{One}
Refenence to two: \ref{mylabel}
\subsection{One.One}
\section{Two}\label{mylabel}
\end{document}
Necesito algo para cambiar el nombre de la etiqueta mylabel a DE.mylabel en el primer caso y EN.mylabel en el segundo caso.
Supongo que de alguna manera necesito crear un comando \label y \ref individual. ¿Alguna pista? Usar esto tal como está conduce, por supuesto, a múltiples etiquetas definidas.
Jorge
Respuesta1
Gracias a @Teepeemm:
\documentclass{scrbook}
\usepackage{etoc}
\usepackage{hyperref}
\counterwithout{section}{chapter}
\begin{document}
% Usually this is input my \input{myfile.txt} with the first option
\def\lang {DE}
\chapter{GERMAN}
\etocsettocstyle{\section*{Inhalt}}{}
\etocsettocdepth.toc{subsection}
\localtableofcontents
\setcounter{section}{0}
\section{Eins}
Referenz auf zwei: \ref{\lang mylabel}
\subsection{Ein.Eins}
\section{Zwei}\label{\lang mylabel}
% Usually this is input my \input{myfile.txt} with the second option
\def\lang {EN}
\chapter{ENGLISH}
\etocsettocstyle{\section*{Content}}{}
\etocsettocdepth.toc{subsection}
\localtableofcontents
\setcounter{section}{0}
\section{One}
Refenence to two: \ref{\lang mylabel}
\subsection{One.One}
\section{Two}\label{\lang mylabel}
\end{document}