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.

How can I get references to subcaption numbers when using memoir? In this example:

\documentclass{memoir}

\newsubfloat{figure}
\begin{document}

\chapter{Lorem}
\section{ipsum}

\begin{figure}[b]
\begin{minipage}{0.49\textwidth}
    \centering
    \Large \textbf{Lorem}
    \subcaption{Lorem}
    \label{lorem}
\end{minipage}
\begin{minipage}{0.49\textwidth}
    \centering
    \Large \textbf{ipsum}
    \subcaption{Ipsum}
    \label{ipsum}
\end{minipage}
\caption{Lorem Ipsum}
\end{figure}

Lorem (figure:~\ref{lorem}) ipsum (figure:~\ref{ipsum}) dolor sit amet, consectetur adipiscing elit. Nullam ut nunc lacus, ac vestibulum orci. Nullam viverra dictum dolor, in molestie neque ullamcorper sed. Nullam felis velit, vestibulum ut convallis quis, luctus sit amet est. Etiam vel viverra magna. Phasellus euismod venenatis augue, quis rutrum sem pulvinar at. Donec pellentesque enim vitae ante tristique lacinia. Nulla auctor fermentum lorem, ut scelerisque nunc vehicula id. Phasellus sed facilisis erat. Nulla porttitor, metus eu bibendum molestie, elit dui lacinia dolor, nec iaculis sem tortor sit amet tortor. Vivamus a euismod arcu.

\end{document}

I would like to get references like "Lorem (figure: 1.1a) ipsum (figure: 1.1b)" instead it looks like this:

enter image description here

With the subcaption package which was used before I switched to memoir it seems this worked out of the box. How can I get this behavior with memoir?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Put the label within the subcaption command, as mentioned in §10.9 of the memoir manual. This will print parenthesis around the subreference, e.g. 1.1(a), but those cannot, at the moment, be removed (see comment by daleif).

\documentclass{memoir}
\newsubfloat{figure}
\begin{document}

\chapter{Lorem}
\section{ipsum}

\begin{figure}[h]
\begin{minipage}{0.49\textwidth}
    \centering
    \Large \textbf{Lorem}
    \subcaption{Lorem\label{lorem}}
\end{minipage}
\begin{minipage}{0.49\textwidth}
    \centering
    \Large \textbf{ipsum}
    \subcaption{Ipsum\label{ipsum}}
\end{minipage}
\caption{Lorem Ipsum}
\end{figure}

Lorem (figure:~\ref{lorem}) ipsum (figure:~\ref{ipsum}) dolor sit amet[...]
\end{document}

enter image description here

share|improve this answer
    
Actually, that works for me. Thanks! But now that you mention it I am very curious whether those parantheses can be removed... :) –  jonalv Oct 5 '11 at 19:49
3  
The ()'s are hardwired into the macro/label and currently cannot be removed. –  daleif Oct 10 '11 at 8:37
    
@daleif Thanks, good to know. –  Torbjørn T. Oct 11 '11 at 11:50

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.