2

I want to get references at the end of each chapter. references are in bib files. Please help me. I also want to write the title of each chapter.

    \documentclass[twoside]{book}
\usepackage[paperwidth=7.25in, paperheight=9.5in,bindingoffset=.75in]{geometry}
\usepackage{fancyhdr,graphicx,lipsum,multibib}
\usepackage{natbib}
\usepackage{chapterbib}
\usepackage{abstract}
\renewenvironment{abstract}[1]
{\begin{quote}
\noindent \rule{\linewidth}{.5pt}\par{\bfseries Abstract.} #1}
{\medskip\noindent \rule{\linewidth}{.5pt}
\end{quote}
}
\pagestyle{fancy}
\fancyhead[LO]{\includegraphics[width=1.5cm,height=1.5cm,keepaspectratio]{example-image-a}}
\fancyhead[RE]{\includegraphics[width=1.5cm,height=1.5cm,keepaspectratio]{example-image-b}}
\setlength{\headheight}{47.0pt}
\begin{document}
\include{ch1}
\include{ch2}
\end{document}

Ch1 file

         \begin{abstract}
    Each chapter should be preceded   \cite{celik2009allee} ....
    \end{abstract}
      \bibliography{bibtex_1}
    \bibliographystyle{plain}

ch2 file

        \begin{abstract}
        Each chapter should be preceded  \cite{guin2014spatial} ....
        \end{abstract}
          \bibliography{bibtex_2}
        \bibliographystyle{plain}

bibtex_1

@article{celik2009allee,
  title={Allee effect in a discrete-time predator--prey system},
  author={Celik, Canan and Duman, Oktay},
  journal={Chaos, Solitons \& Fractals},
  volume={40},
  number={4},
  pages={1956--1962},
  year={2009},
  publisher={Elsevier}
}
@article{gao2013dynamics,
  title={DYNAMICS OF A RATIO-DEPENDENT PREDATOR-PREY SYSTEM WITH A STRONG ALLEE EFFECT.},
  author={Gao, Yujing and Li, Bingtuan},
  journal={Discrete \& Continuous Dynamical Systems-Series B},
  volume={18},
  number={9},
  year={2013}
}

bibtex_2 file

@article{guin2014spatial,
  title={Spatiotemporal dynamics of reaction--diffusion models of interacting populations},
  author={Guin, L N and Mandal, P K},
  journal={Applied Mathematical Modelling},
  year={http://dx.doi.org/10.1016/j.apm.2014.02.022},
  publisher={Elsevier}
}
@article{freedman1979stability,
  title={Stability analysis of a predator-prey system with mutual interference and density-dependent death rates},
  author={Freedman, HI},
  journal={Bulletin of Mathematical Biology},
  volume={41},
  number={1},
  pages={67--78},
  year={1979},
  publisher={Springer}
}
  • 1
    See ctan.org/topic/bibtex-multi. – cfr Dec 26 '14 at 20:47
  • cfr I tried, read chapterbib.pdf but failed to solve the issue. please guide me. – user1942348 Dec 26 '14 at 20:55
  • 1
    Did you run bibtex on each bibliography file produced during initial compilation? Unlike biblatex, bibtex won't handle this automatically. – cfr Dec 26 '14 at 20:58
  • cfr yes I have. – user1942348 Dec 26 '14 at 21:00
  • The problem is that the references are not coming in case of two or more bib files. I want to solve the issue. – user1942348 Dec 26 '14 at 21:03
2
  • I removed packages not relevant to the problem.
  • book does not have an abstract environment. In order to get the code to compile, I had to remove the use of the package abstract and substitute \renewcommand... for \newcommand....

Problems relevant to the question:

  • http://dx.doi.org/10.1016/j.apm.2014.02.022 is not a year and you cannot persuade bibtex to accept it as one. I made this a url field.
  • multibib appears to hang compilation, probably because it does not entirely agree with chapterbib though I did not investigate. Instead, I removed it.
  • plain is not compatible with author-year citations which causes natbib to complain. However, if you continue compilation, it is fine - it just uses numerical labels instead. You should consider using plainnat instead, which is natbib's and will still get you numerical citations, without complaints.

Then it works fine. At least, the use of rules is weird but that's an issue with your definition of abstract and not anything to do with bibliographies.

Code

\begin{filecontents}{ch1.tex}
  \begin{abstract}
    Each chapter should be preceded   \cite{celik2009allee} ....
  \end{abstract}
  \bibliography{bib1}
  \bibliographystyle{plain}
\end{filecontents}
\begin{filecontents}{ch2.tex}
  \begin{abstract}
    Each chapter should be preceded  \cite{guin2014spatial} ....
  \end{abstract}
  \bibliography{bib2}
  \bibliographystyle{plain}
\end{filecontents}
\begin{filecontents}{bib1.bib}
  @article{celik2009allee,
    title={Allee effect in a discrete-time predator--prey system},
    author={Celik, Canan and Duman, Oktay},
    journal={Chaos, Solitons \& Fractals},
    volume={40},
    number={4},
    pages={1956--1962},
    year={2009},
    publisher={Elsevier}
  }
  @article{gao2013dynamics,
    title={DYNAMICS OF A RATIO-DEPENDENT PREDATOR-PREY SYSTEM WITH A STRONG ALLEE EFFECT.},
    author={Gao, Yujing and Li, Bingtuan},
    journal={Discrete \& Continuous Dynamical Systems-Series B},
    volume={18},
    number={9},
    year={2013}
  }
\end{filecontents}
\begin{filecontents}{bib2.bib}
  @article{guin2014spatial,
    title={Spatiotemporal dynamics of reaction--diffusion models of interacting populations},
    author={Guin, L N and Mandal, P K},
    journal={Applied Mathematical Modelling},
    url={http://dx.doi.org/10.1016/j.apm.2014.02.022},
    publisher={Elsevier}
  }
  @article{freedman1979stability,
    title={Stability analysis of a predator-prey system with mutual interference and density-dependent death rates},
    author={Freedman, HI},
    journal={Bulletin of Mathematical Biology},
    volume={41},
    number={1},
    pages={67--78},
    year={1979},
    publisher={Springer}
  }
\end{filecontents}
\documentclass{book}
\usepackage{natbib}
\usepackage{chapterbib}
\newenvironment{abstract}[1]
{\begin{quote}
    \noindent \rule{\linewidth}{.5pt}\par{\bfseries Abstract.} #1}
  {\medskip\noindent \rule{\linewidth}{.5pt}
  \end{quote}
}
\begin{document}
  \include{ch1}
  \include{ch2}
\end{document}
  • Would you mean this \documentclass[twoside]{book} \usepackage[paperwidth=7.25in, paperheight=9.5in,bindingoffset=.75in]{geometry} \usepackage{fancyhdr,graphicx} \usepackage{natbib} \usepackage{chapterbib} \pagestyle{fancy} \fancyhead[LO]{\includegraphics[width=1.5cm,height=1.5cm,keepaspectratio]{example-image-a}} \fancyhead[RE]{\includegraphics[width=1.5cm,height=1.5cm,keepaspectratio]{example-image-b}} \setlength{\headheight}{47.0pt} \begin{document} \include{ch1} \include{ch2} \end{document} – user1942348 Dec 26 '14 at 21:41
  • 1
    @user1942348 I've posted the code which I used. Except you should use plainnat rather than plain. – cfr Dec 26 '14 at 22:00
  • @user1942348 When you run exactly the code I posted, what happens? Put the code in a new, blank document and run pdflatex -> pdflatex. Don't add or subtract anything. We need a sanity check and that means we want to know if the reference displays OK when you run exactly the same code I run. EDIT; also, work in an otherwise empty directory. (Empty folder if you are on Windows.) – cfr Dec 27 '14 at 23:02
  • @user1942348 Not the problem but you should adjust page dimensions manually if you're using geometry as it won't know about the changes. Pass headheight=47pt as another option to geometry instead. – cfr Dec 27 '14 at 23:04
  • I have followed the code and steps you have suggested. But the reference places are still coming as ?. – user1942348 Dec 28 '14 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.
https://tex.stackexchange.com/questions/219548/how-to-get-references-at-the-end-of-each-chapter
tex.stackexchange.com
crawl=CC-MAIN-2019-30
154582
application/http; msgtype=response
sha1:Q5HUPABXAEJVCFC77HWPZ35C7246ZXUY
<urn:uuid:90c43d16-7f25-4e76-9b56-5e7140849a29>
2019-07-22T14:46:56Z
151.101.1.69
text/html
sha1:S6K54HWOZ53CZESQCH3NH7CVPTHN44PY
<urn:uuid:38dcc702-866e-4a6d-ad18-1471126cbde6>
https://tex.stackexchange.com/questions/219548/how-to-get-references-at-the-end-of-each-chapter
response
<urn:uuid:d9b6afb1-2a27-495b-806d-16a37a00c7a8>
isPartOf: CC-MAIN-2019-30
publisher: Common Crawl
description: Wide crawl of the web for July 2019
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-166-45-251.ec2.internal
software: Apache Nutch 1.15 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/