# Using \ref in moderncv class

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}

-

## migrated from crypto.stackexchange.comOct 21 '11 at 8:26

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

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
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

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

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}}