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.

In this topic list the cases in text, I got a way to list cases by using

\begin{enumerate}
    [label=\textbf{Case~\arabic*.},    
     labelwidth=\dimexpr-\mylen-\labelsep\relax,leftmargin=0pt,align=right]

here label=\textbf{Case~\arabic*.} makes the label of the cases being of bold font. But later, I would like to cross-reference to the cases, but with a normal font (not bold). Is there an easy way to assign the font and font size when using \ref? By "easy way", I mean : not using \renewcommand or more complicated ways. Of course, if there is no easy way, any method is appreciated.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

If you look at the documentation for the enumitem package you can find on p. 3 the ref key, which allows you to set the references separately from the labels. So in your example, if you want the reference to just be normal text, you could use:

\documentclass{article}
\usepackage{enumitem}
\newlength{\mylen}
\begin{document}
\begin{enumerate}
    [label=\textbf{Case~\arabic*.}, ref={Case~\arabic*},   
     labelwidth=\dimexpr-\mylen-\labelsep\relax,leftmargin=0pt,align=right]
\item Foo \label{1}
\item Bar \label{2}
\end{enumerate}
These are references: \ref{1} and \ref{2}
\end{document}

output of code

Note that I made your code into a minimal working example. In future, it would be helpful for you to put similar kinds of examples in the question.

share|improve this answer
    
Thank you. But still one question. Because I will reference to these cases in many different places, "during a proof case by case" or "reference these cases in a text line". In the first, I would like to use bold font and in the second I would like to use a normal font. Do you have ideas to do this? –  user565739 Dec 24 '11 at 23:53
    
Keep the specification as I gave, and just use \textbf{\ref{...}} for the ones you want to be bold. –  Alan Munn Dec 24 '11 at 23:57
    
Thank you very much!! –  user565739 Dec 25 '11 at 0:00

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.