Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have use the \ref function to make an internal reference to another section with \label and \ref{} but my reference is invisible but click able.

Someone has the same problem?

EDIT BY LOCKSTEP: Strange indeed. Here's a MWE (and yes, there's a click able link):

\documentclass{moderncv}

\firstname{John}
\familyname{Doe}

\begin{document}

\maketitle

\section{Master thesis}\label{sec:th}
\cvline{title}{\emph{Title}}

\section{Experience}
\cventry{year--year}{Job title}{Employer}{City}{}{See section \ref{sec:th}}

\end{document}
share|improve this question
4  
Welcome to TeX.sx! Your question was migrated here from crypto.stackexchange.com. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. Also, please add a minimal working example (MWE) that illustrates your problem. –  N.N. Oct 21 '11 at 8:28
    
Actually, it was first posted on Stack Overflow, and wrongly migrated to Cryptography because of me flagging it wrong (mis-click). Sorry. –  Paŭlo Ebermann Oct 21 '11 at 13:40
2  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  Martin Scharrer Oct 21 '11 at 15:40
    
As per link formatting colors underlines in cv I can get the box to show up with hypersetup{pdfborder = 0 0 1} after \begin{document}, but this is not very useful to symbolize a link. –  Peter Grill Oct 21 '11 at 20:54
    
But, what should the now invisible link contain to make it visible? Sections in moderncv don't produce numbering, so there's no string to be picked up to generate a reference; they just contain \phantomsection to create an anchor. –  Gonzalo Medina Oct 21 '11 at 21:01
add comment

migrated from crypto.stackexchange.com Oct 21 '11 at 8:26

This question came from our site for software developers, mathematicians and others interested in cryptography.

1 Answer

The moderncv document class defines a section without a counter. Here's the \section command extracted from moderncv.cls:

% usage: \section{<title>}
\newcommand*{\section}[1]{%
  \vspace*{2.5ex}%
  \parbox[m]{\hintscolumnwidth}{\raggedleft\hintfont{\color{sectionrectanglecolor}\rule{\hintscolumnwidth}{1ex}}}%
  \phantomsection{}% reset the anchor for hyperrefs
  \addcontentsline{toc}{part}{#1}%
  \hspace{\separatorcolumnwidth}%
  \parbox[m]{\maincolumnwidth}{\sectionstyle{#1}}%
  \par\nobreak\vskip 1ex\@afterheading}% to avoid a pagebreak after the heading

Correct referencing is obtained via hyperref's \phantomsection. Hence, \ref returns nothing other than a correct internal hyperlink. This is also evident from the fact that the sections in moderncv is not typeset with a numbered counter.

As such, if you want to have a description associated with the link, you need to use \hyperref[<lab>]{<text>} where <lab> is your label, and <text> is what you want to be clickable. For example, using the posted MWE, you could use

\cventry{year--year}{Job title}{Employer}{City}{}{See section \hyperref[sec:th]{Master thesis}}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.