PierreSenellart / apxproof

LaTeX package for automatically putting proof environments in appendix
LaTeX Project Public License v1.3c
23 stars 8 forks source link

Reference only in the appendix #31

Closed fsikora closed 4 years ago

fsikora commented 5 years ago

Hello,

I use \newtheoremrep and, in the proof, there is a citation to something only appearing in this proof. With pdflatex/bibtex, it becomes a "?" and "Package natbib Warning: Citation DLS09journal on page 20 undefined", and there is no separate bibliography at the end. If I remove package natbib, I got "LaTeX Warning: Citation DLS09journal on page 20 undefined on input line 16. ) No file bu1.bbl."

Strangely enough, whit sharelatex, there is the new separate section, and the reference appears, but without any number (just []). (same log).

Do I miss something? Best

Edit: it works with LIPICS style (although the numbering of lemma isn't then, but it's another issue)

PierreSenellart commented 4 years ago

Can you provide a minima completel example that illustrates the issue? The bibliography option of the apxproof package controls whether a separate bibliography will be created, but what you describe should not happen.

fsikora commented 4 years ago

Sure !

\documentclass{article}

\usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}

\title{Minimal Example}

%article \author{Me}

%\usepackage{natbib} \usepackage{amsthm, amssymb} \usepackage{amsmath} \usepackage{hyperref}

\usepackage{apxproof}

\newtheorem{theorem}{Theorem} \newtheoremrep{theorem}{Theorem} %for apxproof package

\begin{document}

\maketitle

\begin{abstract} Bla \end{abstract}

\section{Introduction}

Bla. This ref \cite{CFK+15}

\begin{theoremrep} \label{thm} Thm \end{theoremrep}

\begin{proof}

It is shown in~\cite[Theorem 5.1]{DLS09journal} and \cite{DLS09journal} (see also Exercise 15.4.10 of~\cite{CFK+15}) \end{proof}

\begin{theorem} Thm2 \end{theorem}

End

\bibliographystyle{plainurl}
\bibliography{references}

\end{document}

\appendix

references.bib:

@book{CFK+15, author = {A1}, title = {T1}, publisher = {P1}, year = {2015}, }

@article{DLS09journal, author = {A2}, title = {T2}, journal = {J2}, volume = {}, number = {}, pages = {}, year = {}, }

PierreSenellart commented 4 years ago

This example works for me. I think I understand now the problem: apxproof uses bibunits to compile multiple bibliographies. This means that bibtex needs to be called twice (once for the main bibliography as usual, once for the appendix bibliography, use "bibtex bu1").

Some LaTeX compilation environments do this automatically: on your example, "latexmk -pdf" does the right thing, for instance.

PierreSenellart commented 4 years ago

This issue needs to be resolved with the precision that you need to call bibtex on several files. Please reopen the issue in case something remains unclear.