0

Minimum code where the pagesel command prevents refs and cites be updated. I would like to understand why

\documentclass{article}

\usepackage{graphicx} 

%% PDFTeX
% http://tex.stackexchange.com/a/218102/13173
\usepackage{mathtools, amssymb, amsbsy}
\usepackage{mathrsfs}

\usepackage{pgffor}            

\usepackage{subcaption}
\usepackage{pdfpages}

\usepackage[1-]{pagesel}

\begin{document}

Fig. \ref{figure:ba_sinus_female}, 

\begin{figure}
\foreach \ii in {2,...,2}{
\centering% not \center!
\begin{subfigure}{0.32\textwidth}
  \centering
  \includegraphics[scale=0.16, page=\ii]{{Rplots.bland}.pdf}
  \caption{\#\ii, ite. 1.}
\end{subfigure}
\begin{subfigure}{0.32\textwidth}
  \centering
  \includegraphics[scale=0.16, page=\ii]{{Rplots.bland}.pdf}
  \caption{\#\ii, ite. 2.}
\end{subfigure}
\begin{subfigure}{0.32\textwidth}
  \centering
  \includegraphics[scale=0.16, page=\ii]{{Rplots.bland}.pdf}
  \caption{\#\ii, ite. 3.}
\end{subfigure}
}
\caption{Bland.}
\label{figure:ba_sinus_female}
\end{figure}

\end{document}
  • 5
    If I add \ref{figure:cor_gender} I get 1 (after double run of LaTeX). – egreg Nov 16 '16 at 15:39
  • 2
    Sorry? Why should you use two underscores if the label has one? – egreg Nov 16 '16 at 16:00
  • 1
    Of course there's no difference so long as you use the same tokens in \ref as for \label. – egreg Nov 16 '16 at 16:03
  • @egreg I still cannot get any refs work in to such environments. Please, see the list of packages which I use. Can there by anything which may be the reason for the case? – Léo Léopold Hertz 준영 Nov 16 '16 at 20:49
  • 4
    Why don't you make a single self-contained example that presents the error? – egreg Nov 16 '16 at 21:04
  • @egreg Please, see the body. I think the problem becomes from the fact that I have very many for loops in my body about 7 with each 1-2 iterations. Decreasing the file size, the problem disappears if I run the pdflatex many times. However, including many such loops causes the failure. Can you confirm? - - Is there any workaround for the problem? - - To compile bib and refs separately from for-loops? – Léo Léopold Hertz 준영 Nov 16 '16 at 21:23
  • 1
    You have a complete minimal example, the start of an overly complicated example, and then a long non-complete example that you say exhibits the error. Which one causes the problem? Give us a single example that we can copy, paste, compile four times, and still see the error. – Teepeemm Nov 16 '16 at 21:29
  • 4
    @Masi: If you have a number of iterations all having the same \label, you'll have multiply-defined \labels. – Werner Nov 16 '16 at 21:40
  • See the body. I found the issue. Pagesel prevents updating those things. – Léo Léopold Hertz 준영 Nov 16 '16 at 22:18

1 Answers1

2

Section 1.2.1 in the manual for pagesel:

\usepackage[files,1-]{pagesel}

Without the files option, the .aux file is not written.

Alternatively, process the document with the call to pagesel commented out, then uncomment and reprocess.

egreg
  • 1,121,712