dbitouze / yathesis

Classe de thèse LaTeX pour universités françaises
27 stars 3 forks source link

Wrong header with bibliography #65

Closed PierreMarchand20 closed 4 years ago

PierreMarchand20 commented 5 years ago

As mentionned here, the header in the bibliography references the previous chapter. Here's a MWE with biblatex:

\begin{filecontents*}{\jobname.bib}
@incollection{deitmar2005schemes,  
  title={Schemes over },  
  author={Deitmar, Anton},  
  booktitle={Number fields and function fields---two parallel worlds},  
  editor={Gerard van der Geer and Ben Moonen and Ren{\'e} Schoof},
  pages={87--100},  
  year={2005},  
  publisher={Birkh{\"a}user Boston}
}  
@article{kurokawa2005zeta,  
  title={Zeta functions over},  
  author={Kurokawa, Nobushige and others},  
  journal={Proceedings of the Japan Academy, Series A, Mathematical Sciences},  
  volume={81},  
  number={10},  
  pages={180--184},  
  year={2005},  
  publisher={The Japan Academy}  
}  
\end{filecontents*}

\documentclass{yathesis}
\usepackage{fontspec}
\usepackage{biblatex}

\addbibresource{\jobname.bib}

\begin{document}

\mainmatter
\chapter{test}

\nocite{*}
\printbibliography

\end{document}

and another MWE with bibtex:

\documentclass{yathesis}

\usepackage{fontspec}

\begin{document}

\mainmatter
\chapter{test}

\nocite{*}

\begin{thebibliography}{99}

\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\bibitem{example}
\end{thebibliography}

\end{document}
PierreMarchand20 commented 5 years ago

For information, the workaround proposed in the link I gave does not work when the version is set to submitted. I get the following error: image

PierreMarchand20 commented 5 years ago

For the record, the workaround was

\chapter*{\bibname}
\begingroup
\let\cleardoublepage\relax
\printbibliography[heading=none]
\endgroup

which does not work when the version is set to submitted. But

\chapter*{\bibname}
\let\cleardoublepage\relax
\printbibliography[heading=none]

seems to work for now.

samcarter commented 5 years ago

@PierreMarchand20 Where would I add submitted to reproduce the problem?

PierreMarchand20 commented 5 years ago

This is how I call yathesis \documentclass[mainlanguage=english,localtocs,output=screen,version=submitted,fncychap=Sonny,secnumdepth=subsubsection]{yathesis}

samcarter commented 5 years ago

@PierreMarchand20 You can trick the error message with

\chapter*{\bibname}
\begingroup
\let\cleardoublepage\relax
\printbibliography[heading=none]
\endgroup
\makeatletter
\booltrue{YAD@printbibliography@used}
\makeatother

or you could use

\chapter*{\bibname}
\let\cleardoublepageold\cleardoublepage
\let\cleardoublepage\relax
\printbibliography[heading=none]
\let\cleardoublepage\cleardoublepageold

(the risk with removing \begingroup....\endgroup is that it will then effect the whole remaining document until the end. If you have something else after the bibliography, check carefully if all page breaks are still there)

PierreMarchand20 commented 5 years ago

I did not see any issue with removing \begingroup....\endgroup, but your improved workaround works also.

dbitouze commented 4 years ago

Issue closed thanks to the @samcarter's workaround: thanks @samcarter! :smile: