[OS X TeX] hyperref external label

Nestor Aguilera aguilera at santafe-conicet.gov.ar
Wed Jan 4 10:37:53 EST 2012


On 4 Jan 2012, at 09:50, Themis Matsoukas wrote:

> 
> On Jan 4, 2012, at 3:49 AM, David Arnold wrote:
> 
>> Hi,
>> 
>> I have two files, file1.tex and file2.tex.
>> 
>> In file2.tex I have:
>> 
>> \section{Introducing Fractions}\label{sec:introducingfractions}
>> 
>> In file1.tex and want to reference this label in file2.tex. I am using the hyperref package.
>> 
>> I need a \nameref and a \pageref to sec:introducingfractions.
>> 
>> Can someone help me with this?
>> 
> 
> Is this what you are looking for? It works with either \include or \input.
> 
> %root file
> \documentclass[11pt]{article}
> \usepackage[colorlinks=true,linkcolor=blue,plainpages=false]{hyperref}
> \begin{document}
> \include{file1}
> \include{file2}
> \end{document}
> 
> %file1.tex-----
> \section{Introducing Fractions}\label{sec:introducingfractions}
> See also section  \ref{sec:discussion}, \nameref{sec:discussion}, on page \pageref{sec:discussion}. 
> [...]
> 
> 
> %file2.tex----
> \section{Discussion}
> Read first section \ref{sec:introducingfractions}, \nameref{sec:introducingfractions},  on page \pageref{sec:introducingfractions}
> 
> I hope this helps.
> 
> Themis

Otherwise, if you want to get separate output (say pdf) files, you may use

   \usepackage{xr-hyper}%
   \usepackage[...]{hyperref}

Hope it helps.

Nestor




More information about the MacOSX-TeX mailing list