Re: xr-hyper: reference zu Datei name

Uwe Brauer <[email protected]>
Newsgroups gmane.comp.tex.german
Message-ID <[email protected]>
>>> "HS" == Hendrik Seliger <(via tex-d-l Mailing List) <[email protected]>> writes:

> Schöne Sonntag!
> Ich benutze dafür das Paket „currfile“, dann bekomme ich z. B. mit
> „\currfilebase“ den Namen (ohne Endung) der aktuell eingelesenen
> Datei. Nutze ich, um mit Python Übungsaufgaben aus einer Sammlung (für
> xsim) auszuwählen und dann den Dateinamen daneben zu setzen, damit ich
> hinterher noch weiß, wo das Ding herkam. Aber das Paket bietet noch
> mehr, Extension, Ordner etc.

Guten Morgen

Danke, aber ich will nicht den Namen des aktuellen Files, den ich gerade
bearbeite sondern den Namen des externen Files, also in docA, sollte

The main result can be found in \nameref{B-sec:main-result}

So was geben wie 

The main result can be found in docB {Main result}

Ich habe «Main result»  in Klammern gesetzt um anzuzeigen, daß es ein
externer link ist. 

Vielleicht sogar 

  {docB Main result}

Gruß


Uwe Brauer 


>  Beste Grüße
> Hendrik Seliger

> On 26.11.23 08:03, Uwe Brauer (via tex-d-l Mailing List) wrote:
>> Nov 26, 2023 07:59
>> 
>> Hallo
>> 
>> Mit xr-hyper, kann ich zum Beispiel auf Gleichungen, Abschnitte, und
>> auch Seiten von anderen Dateien verweisen, hier ist ein MWE
>> 
>> Gibt es eine Möglichkeit auch den Datei Namen anzugeben.
>> Also \fileref{B-} oder so etwas?
>> 
>> Gruß
>> 
>> Uwe Brauer
>> 
>> --8<---------------cut here---------------start------------->8---
>> \documentclass{article}
>> \usepackage{xr-hyper}
>> \usepackage[colorlinks]{hyperref}
>> \externaldocument[B-]{docB}% <- full or relative path
>> \externaldocument[C-]{./external/docC}% <- full or relative path
>> \begin{document}
>> \section{Introduction}
>> \label{sec:introduction}
>> This is a test for math.
>> \begin{equation}
>> E=mc^2 \label{eq:1}
>> \end{equation}
>> This is a second test for math.
>> \begin{equation}
>> r = \sqrt{x^2 + y^2} \label{eq:2}
>> \end{equation}
>> In document B Eq.~~(\ref{B-eq:x})
>> 
>> Now test  (\autoref{C-eq:docC:1})
>> 
>> The main result can be found in \nameref{B-sec:main-result}
>> \end{document}
>> --8<---------------cut here---------------end--------------->8---
>> 
>> Und
>> 
>> --8<---------------cut here---------------start------------->8---
>> \documentclass{article}
>> \usepackage{xr-hyper}
>> \usepackage[colorlinks]{hyperref}
>> \externaldocument[A-]{docA}
>> \begin{document}
>> \setcounter{equation}{5}
>> \section{Main result}
>> \label{sec:main-result}
>> As was shown in Eq.~(\ref{A-eq:1}) is it
>> ... or in Eq.~(\ref{A-eq:2}) is ...
>> \begin{equation}
>> \mathrm{e}^{i\pi}-1=0 \label{eq:x}
>> \end{equation}
>> \end{document}
>> --8<---------------cut here---------------end--------------->8---

-- 
I strongly condemn Hamas heinous atrocities on Israel, especially the despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine.
smime.p7s (application/pkcs7-signature, 5.5 KB) - not displayed
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.