1

Thank you in advance and support that provides this website for the tex users. I am a new member of the tex society almost a year now and I can say that most of my answers related to my problems have been answered previously here. Your work is really impressing taken in consideration that people are sharing knowledge for free.

Recently I came across with a problem that I think it is a bug of the system. I was trying to create a beamer presentation and by using \usepackage{subcaption} and \begin{subfigure} environment. While I was trying to use the \label and \ref points to my subfigure(s) I noticed that only the first \label was operating correctly as 1a. Unfortunately the rest are coming up as ??. I assume this is because the \ref points are located before the \label, but in this case all of them should not be operating correctly all should fail.

I was not able to find an answer relative to my question no matter how much I searched for. Maybe it is a bug of the system. I was just hopping that you could provide more information and maybe a solution to overcome this problem.

More information and the testing code can be found here: Multiple \label commands before \ref.

\documentclass[xcolor=pdftex,dvipsnames,table]{beamer}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{caption}
\usepackage{subcaption}

\mode<presentation>
\setbeamertemplate{caption}[numbered]

\begin{document}
\begin{frame} 
\begin{columns}[t] 
\begin{column}[T]{5cm} 
\begin{itemize} 
\item<+-| alert@+> 1~\autoref{1} 
\item<+-| alert@+> 2~\autoref{2} etc 
\end{itemize} 
\end{column} 
\begin{column}[T]{5cm} 
\begin{figure} 
\only<1>{\begin{subfigure}[b]{1.0\linewidth} 
         \caption{sub caption 1} 
         \label{1} 
         \includegraphics[width=7.0cm,height=5cm]{fig 1} 
         \end{subfigure} } 
\only<2>{\begin{subfigure}[b]{1.0\linewidth} 
         \caption{sub caption 2} 
         \label{2} 
         \includegraphics[width=5.5cm,height=5cm]{fig 2} 
         \end{subfigure} }
\caption{main} 
\protect\label{3} 
\end{figure} 
\end{column} 
\end{columns} 
\end{frame}
\end{document}
Thanos
  • 1,133
  • 2
  • 10
  • 17
  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – jub0bs Oct 11 '13 at 09:00
  • 1
    As it stands, I don't see how this new question adds anything to the existing one: can you elaborate? – Joseph Wright Oct 11 '13 at 09:04
  • @Jubobs The testing code is on the hyperlink but off course I can re posted here. I just do not want to duplicate the code. – Thanos Oct 11 '13 at 09:06
  • On this site, we tend to prefer self-contained posts; it'd be great if you posted the code here rather than simply linking to it. – jub0bs Oct 11 '13 at 09:07
  • @Jubobs Perfect thank for providing advices, I have just added the code. Again thank you for your support. – Thanos Oct 11 '13 at 09:12
  • But... wait.... That's exactly the same code as in that question you link to. I agree with Joseph: how is your question any different from http://tex.stackexchange.com/questions/137149/multiple-label-commands-before-ref? – jub0bs Oct 11 '13 at 09:14
  • @Jubobs It is not a different question I thought that since there is not possible solution to my question on the previous post maybe this question should be reported as a bug. This is the reason that I reported here. Correct me if I am wrong. – Thanos Oct 11 '13 at 09:16
  • From the beamer manual: "If you find no answers there, or if you are sure you have found a bug in beamer, please report it via bitbucket.org/rivanvx/beamer/issues." Similarly other package manuals will usually tell where to report bugs on them. – Andrew Swann Oct 11 '13 at 10:54
  • @AndrewSwann Thank you for your advice. I was planning to report this as a bug but, before I do I was thinking about asking everyone here who know a lot about LaTeX. I suppose after a few days if there is no response I should report it. Thank you all for your time and effort assisting me in my problem. – Thanos Oct 11 '13 at 13:19

0 Answers0