1

I am writing my dissertation and am following the format of this link: https://github.com/UA-ACM-Student-Chapter/uathesis. However, the author of this document has only one big reference added at the end of the dissertation. I am trying to create separate references at the end of each chapter, and I am following the technique described below:

My code in the main text:

\documentclass[dissertation]{uathesis}

%% Basic packages you'll probably want to use. \usepackage{graphicx} %% For using \includegraphics{}

\usepackage{color} %% For colors used in listings. \usepackage{listings} %% Code listings (for engineers) \usepackage{csquotes} \usepackage{notoccite} % with this command, you can add a kerning to all possible math quotations and of course change or delete them later, if you change the font or dislike your first chose. \usepackage{hyperref} \newcommand{\mathenquote}[1]{\enquote{$#1$\kern.3ex}} \usepackage{xfrac} \usepackage{comment} \usepackage{color,soul} \usepackage{float} \usepackage{booktabs} \usepackage{graphicx} \usepackage{array, multirow} \usepackage{setspace} \usepackage{adjustbox} \usepackage{tabularray} \usepackage{caption} \usepackage{subcaption} \usepackage[numbers,sort&compress]{natbib}
\usepackage[sectionbib]{chapterbib}
\usepackage[titletoc]{appendix}

%% Required parameters (these default to undefined) \author{Nisha} %% Your name! \adviser{Dr.} %% Your adviser/committee chair!

%% The people on your committee. %% Use \and to break them up between lines. \committee{ Dr. K \and Dr. M \and Dr. J \and Dr. D }

\title{Con}

\degree{Doctor of Philosophy} %% Change to suit your degree. \department{Elec Engineering} %% Change to suit your department.

%% These are body text paragraphs to be placed in the front matter. %\abstract{ %There is such a thing as \gls{tmi}. My brother once said that \gls{tmi} %is what drives the world, some times causing fits of \gls{lol}. If one %is to get in a especially deep fit of the \glspl{lol}, then one could %find oneself \gls{rotflol}.

%By the way, \gls{alpha} and \gls{beta} are Greek letters. %}

%\dedication{ %Type or input{} your dedication here. %}

%\acknowledgments{ %Type or input{} your acknowledgments here. %}

%% Optional parameters. The default usage is shown. \university{The University of Alabama} \school{Graduate School} \gradyear{\the\year} \place{Tuscaloosa, Alabama}

\begin{document}

%% Makes the title, abstract, dedication, table of contents, etc. %% Must be before \begin{body} \makefrontmatter

%% BODY PORTION %% The bulk of your thesis. %% Begin your \chapter's here.

\begin{body} %\mainmatter \include{chapter/chapter1}

\include{chapter/chapter2}

\include{chapter/chapter3}

\begin{appendices} \addtocontents{toc}{\setlength{\cftchapnumwidth}{1em}} \renewcommand{\appendixname}{APPENDIX} \addtocontents{toc}{\setcounter{tocdepth}{0}} \addtocontents{toc}{\protect\renewcommand{\protect\cftchappresnum}{}}

\chapter{A BIG APPENDIX}

\end{appendices}

\end{body} \end{document}

chapter1.tex:

\chapter
This chapter
\section
This section. \cite{walis08,thomas09}

\renewcommand{\bibsection}{\topskip=1in\chapter*{REFERENCES}\topskip=0in \addcontentsline{toc}{chapter}{REFERENCES}} \bibliographystyle{unsrtnat} \bibliography{literature}

chapter2.tex:

\chapter
This chapter
\section
This section. \cite{boyd08,pam09}

\renewcommand{\bibsection}{\topskip=1in\chapter*{REFERENCES}\topskip=0in \addcontentsline{toc}{chapter}{REFERENCES}} \bibliographystyle{unsrtnat} \bibliography{chap2}

This is my code. The first chapter should contain 80 citations, whereas the second chapter should have 40 citations. But each chapter has its own reference section, which contains all 120 citations. Is there any solution to it? Thanks.

nisha98
  • 11
  • 2
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – DG' Apr 23 '23 at 11:44
  • Your code doesn't clearly show how you are using chapterbib, the normal usage is through \include (which then requires running bibtex on each resulting aux file) rather than \input, or are you using \cbinput? – Dai Bowen Apr 23 '23 at 13:51
  • DG' thank you for the suggestion. I will update it. I am really new to the latex environment and am trying to learn it asap.

    Dai, can you explain how to run BibTeX in the aux file. I am not clear on that. I am using overleaf and I am not seeing any option to run the .aux file separately. However, I am posting an updated version of the question with code as suggested DG' to help everyone understand.

    Kind regards, Nisha

    – nisha98 Apr 24 '23 at 05:40
  • @nisha98 apparently this should happen automatically on Overleaf (https://www.overleaf.com/latex/examples/per-chapter-bibliographies-with-chapterbib/pqzjpxwyyjyd). After changing to \include try using "Recompile from scratch" to reset aux files. You could also try moving hyperref to be the last package loaded and making sure your bib and chapter.tex files are all in the top level directory within overleaf files. – Dai Bowen Apr 24 '23 at 14:05

0 Answers0