Closed beausoleilmo closed 10 months ago
That is not a hyperref/backref issue. bibunits reads in the aux-file with the wrong catcode setting. Try
\makeatletter
\def\@startbibunit{%
\global\let\@startbibunitorrelax\relax
\global\let\@finishbibunit\@finishstartedbibunit
\global\advance\@bibunitauxcnt 1
\if@filesw
{\endlinechar-1
\makeatletter %new
\@input{\@bibunitname.aux}}%
\immediate\openout\@bibunitaux\@bibunitname.aux
\immediate\write\@bibunitaux{\string\bibstyle{\@localbibstyle}}%
\fi
}
\makeatletter
Thanks for the fast reply! This indeed solved the first part of the problem! However, I'm still struggling to get the
\chapter*{\normalfont\huge\bfseries Bibliography} % Add title to bibliography
\addcontentsline{toc}{chapter}{Bibliography} % Add to toc
\renewcommand{\bibsection}{}
part of the script to work. Basically, if you 'uncomment' the \chapter*
and \renewcommand
, you'll probably get the error
Chapter 1.
(./bu1.aux)
No file bu1.bbl.
[1{/usr/local/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
[2] (./bu1.aux
./bu1.aux:7: You can't use `\spacefactor' in vertical mode.
\@->\spacefactor
\@m {}
l.7 \@
writefile{brf}{\backcite{goossens93}{{1}{1.1}{section.1.1}}}
? ./bu1.aux:7: Missing $ inserted.
<inserted text>
$
l.7 \@
writefile{brf}{\backcite{goossens93}{{1}{1.1}{section.1.1}}}
?
What is causing this and how to resolve it?
This here is not a bibunits
support site but the hyperref issue tracker. And the problem is the same: the aux is read in another place with the wrong catcode.
I wanted to use the backref option in hyperref package. But when using it, I noticed weird behaviours. First, when I add a reference in the document, it is seen in the document but a
writefilebrfwritefilebrfwritefilebrfwritefilebrfwritefilebrf
preceding it:This is when I
Pdflatex
+BibTex
+Pdflatex
+Pdflatex
I'm not sure what is causing the problem so I'm pasting a simple example, but with all packages.
Second, if I uncomment the
I get this error:
I use TeX, Version 3.141592653 (TeX Live 2023) (macOS)
This is a reproducible example