0

I am writing my thesis manuscript using the classicthesis package. I have four bibliography files (.bib files), one for each chapter, in a folder called "bibliographies." When I run the main file, it compiles correctly but the citations and bibliography do not appear and I do not get any error messages. So, I am not sure what the problem is. I get bold citation keys instead of in-text citations and no bibliography. I use PdfLaTeX + Bib(la)tex + PdfLaTeX (x2) + View Pdf for compilation using TexMaker.

I do not need separate bibliographies for each chapter but a single bibliography for the whole thesis.

I would be thankful to you for your assistance. Below is the information regarding the code.

I have the following code in the main file:

\addbibresource{bibliographies/chap1.bib}
\addbibresource{bibliographies/chap2.bib}
\addbibresource{bibliographies/chap3.bib}
\addbibresource{bibliographies/chap4.bib}
.
.
.
.
.
.
.
.
\cleardoublepage\include{FrontBackmatter/Bibliography}

and in the bibliography.tex, I have the following code:

\defbibheading{bibintoc}[\bibname]{%
  \phantomsection
  \manualmark
  \markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}%
  \addtocontents{toc}{\protect\vspace{\beforebibskip}}%
  \addcontentsline{toc}{chapter}{\tocEntry{#1}}%
  \chapter*{#1}%
}
\printbibliography[heading=bibintoc]

and in the classicthesis-config.tex, I have the following code:

\PassOptionsToPackage{
        natbib=true,
        style=authoryear-comp,
        dashed=false,
        hyperref=true,
        backend=biber,
        %bibencoding=ascii,
        maxbibnames=10,
        giveninits=true,
        uniquename=false,%init,
        maxcitenames=2,
        parentracker=true,
        url=true,
        doi=true,
        isbn=true,
        eprint=false,
        backref=true,
        sorting=nyt,
        sortcites=true,
    }   {biblatex}
    \usepackage{biblatex}
  \DeclareNameAlias{sortname}{family-given}
% report either doi (preffered) or url (if no doi)
\renewbibmacro*{doi+eprint+url}{% 
\iftoggle{bbx:url} 
{\iffieldundef{doi}{\usebibmacro{url+urldate}}{}} 
{}% 
\newunit\newblock 
\iftoggle{bbx:eprint} 
{\usebibmacro{eprint}} 
{}% 
\newunit\newblock 
\iftoggle{bbx:doi}
{\printfield{doi}}
{}}

% remove "in:" from articles. Thanks to Herbert. \renewbibmacro{in:}{% \ifentrytype{article}{}{% \printtext{\bibstring{in}\intitlepunct}}}

% omit "month" and "language" from Bibliography
\AtEveryBibitem{%
    \clearfield{month}{}%
    \clearlist{language}{}%
}

% omit from all types from Bibliography

% \AtEveryBibitem{\clearfield{doi}\clearfield{issn}\clearfield{isbn}} %\AtEveryCitekey{\clearfield{doi}\clearfield{issn}\clearfield{isbn}}

% omit from type "articles" from Bibliography
\AtEveryBibitem{\ifentrytype{article}{\clearfield{issn}\clearfield{isbn}}{}}

    % omit from type "articles" from Bibliography

% \AtEveryCitekey{\ifentrytype{article}{\clearfield{issn}}{}}

% some natbib backwards compatibility 
\let\citealp\cite
\let\cite\textcite

% increase vertical space between bibliography items.
\setlength\bibitemsep{0.5ex}
\setlength\bibnamesep{1.2ex}

% Comma before and after journal volume. Thanks to lockstep.
\renewbibmacro*{volume+number+eid}{%
    \setunit*{\addcomma\space}% NEW
    \printfield{volume}%
    \printfield{number}%
    \printfield{eid}}
\DeclareFieldFormat[article]{number}{(#1)}% number of a journal

% Citation Hyperlinks (not just years), thanks to Audrey.
\makeatletter
\renewbibmacro*{cite}{% Based on cite bib macro from authoryear-comp.cbx
    \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
        {\printtext[bibhyperref]{% Include labelname in hyperlink
                \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks
                \usebibmacro{cite:label}%
                \setunit{\addspace}%
                \usebibmacro{cite:labeldate+extradate}}%
            \usebibmacro{cite:reinit}}
        {\iffieldequals{namehash}{\cbx@lasthash}
            {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                    \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
                {\setunit{\addcomma}%
                    \usebibmacro{cite:extradate}}
                {\setunit{\compcitedelim}%
                    \usebibmacro{cite:labeldate+extradate}%
                    \savefield{labelyear}{\cbx@lastyear}}}
            {\printtext[bibhyperref]{% Include labelname in hyperlink
                    \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks
                    \printnames{labelname}%
                    \setunit{\nameyeardelim}%
                    \usebibmacro{cite:labeldate+extradate}}%
                \savefield{namehash}{\cbx@lasthash}%
                \savefield{labelyear}{\cbx@lastyear}}}}
    {\usebibmacro{cite:shorthand}%
        \usebibmacro{cite:reinit}}%
    \setunit{\multicitedelim}}

\renewbibmacro*{textcite}{% Based on textcite bib macro from authoryear-comp.cbx
    \iffieldequals{namehash}{\cbx@lasthash}
    {\iffieldundef{shorthand}
        {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
            {\setunit{\addcomma}%
                \usebibmacro{cite:extradate}}
            {\setunit{\compcitedelim}%
                \usebibmacro{cite:labeldate+extradate}%
                \savefield{labelyear}{\cbx@lastyear}}}
        {\setunit{\compcitedelim}%
            \usebibmacro{cite:shorthand}%
            \global\undef\cbx@lastyear}}
    {\ifnameundef{labelname}
        {\printtext[bibhyperref]{% Include labelname in hyperlink
                \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks
                \iffieldundef{shorthand}
                {\usebibmacro{cite:label}%
                    \setunit{%
                        \global\booltrue{cbx:parens}%
                        \addspace\bibopenparen}%
                    \ifnumequal{\value{citecount}}{1}
                    {\usebibmacro{prenote}}
                    {}%
                    \usebibmacro{cite:labeldate+extradate}}
                {\usebibmacro{cite:shorthand}}%
                \ifthenelse{\iffieldundef{postnote}\AND
                    \(\value{multicitetotal}=0\AND\value{citetotal}=1\)}
                {\bibcloseparen% Include closing parenthesis in hyperlink
                    \global\boolfalse{cbx:parens}}
                {}}}
        {\printtext[bibhyperref]{% Include labelname in hyperlink
                \DeclareFieldAlias{bibhyperref}{default}% Prevent nested hyperlinks
                \printnames{labelname}%
                \setunit{%
                    \global\booltrue{cbx:parens}%
                    \addspace\bibopenparen}%
                \ifnumequal{\value{citecount}}{1}
                {\usebibmacro{prenote}}
                {}%
                \iffieldundef{shorthand}
                {\iffieldundef{labelyear}
                    {\usebibmacro{cite:label}}
                    {\usebibmacro{cite:labeldate+extradate}}%
                    \savefield{labelyear}{\cbx@lastyear}}
                {\usebibmacro{cite:shorthand}%
                    \global\undef\cbx@lastyear}%
                \ifthenelse{\iffieldundef{postnote}\AND
                    \(\value{multicitetotal}=0\AND\value{citetotal}=1\)}
                {\bibcloseparen% Include closing parenthesis in hyperlink
                    \global\boolfalse{cbx:parens}}
                {}}%
            \savefield{namehash}{\cbx@lasthash}}}%
    \setunit{%
        \ifbool{cbx:parens}
        {\bibcloseparen\global\boolfalse{cbx:parens}}
        {}%
        \multicitedelim}}

\makeatother

% Backrefs "cited" instead of "cit"
\DefineBibliographyStrings{english}{%
    backrefpage={cited on p\adddot},
    backrefpages={cited on pp\adddot}
}

Zain
  • 43
  • 1
    Your document needs to be compiled with Biber and not with BibTeX. Make sure your editor is set up to run Biber for you. See https://tex.stackexchange.com/q/154751/35864. – moewe Jan 03 '24 at 06:46
  • 1
    We cannot compile the code shared in the question so far because it does not constitute a minimal working example (see https://tex.meta.stackexchange.com/q/228/35864), so I can't really comment on that, but you should definitely check the .log file and after you've made sure that Biber is run also the .blg file for warnings or errors. Even if the document appears to compile OK-ishly (without errors), there may be issues that your editor swept under the rug. – moewe Jan 03 '24 at 06:49
  • @moewe, Thank you for your comments. I combined all the references in one bibliography and then compiled it with Biber. It worked, but now the problem is that the bibliography at the end of the thesis is not numbered and arranged in alphabetical order. I want to have the citations in numbered style and the bibliography as a numbered list based on the appearance of citations. – Zain Jan 04 '24 at 05:33
  • 1
    Well, your classicthesis-config.tex code sets biblatex up for author-year citations and does a lot of other things that assume that an author-year style is loaded. If I were you, I'd probably get rid of all that code and just load biblatex with \usepackage[backend=biber, style=numeric, sorting=none]{biblatex}. – moewe Jan 04 '24 at 07:49

0 Answers0