0

I provide the detail of tex document with codes that is:

\documentclass[10pt,a4paper]{book}
%\setlength{\columnseprule}{0.4pt}
\usepackage{amssymb,amsfonts}
%\usepackage{mathrsfs}
%\usepackage[centertags]{amsmath}
%\usepackage{biblatex}
\newtheorem{theorem}{Theorem}
\usepackage{epsfig}
\usepackage{graphicx}\graphicspath{{Graphics/}}
\usepackage{amsthm}
\usepackage{mathptmx}
\usepackage[square,sort&compress]{natbib}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usetikzlibrary{arrows}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{textcomp}
\usepackage{apacite}
\usepackage{fancyhdr}\pagestyle{fancy}
\usepackage{xcolor}
%\usepackage{setspace}
%\usepackage{booktabs}
%\usepackage{hyperref}
\usetikzlibrary{arrows.meta}
\renewcommand{\baselinestretch}{1.5}
\newcommand\aug{\fboxsep=-\fboxrule\!\!\!\fbox{\strut}\!\!\!}
\theoremstyle{definition}
\newtheorem{Thm}{Theorem}[section]
\newtheorem{lem}[Thm]{Lemma}
\newtheorem{pro}[Thm]{Proposition}
\newtheorem{de}[Thm]{Definition}
\newtheorem{re}[Thm]{Remark}
\newtheorem{ex}[Thm]{Example}
\newtheorem{cor}[Thm]{Corollary}
%\numberwithin{equation}{section}
%\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
\begin{document}
    \frontmatter
    %\include{frontmatter/colophon}
    %\include{fronmatter/frontpiece}
    %\include{frontmatter/dedication}
    %\include{frontmatter/preface}
    %\twocolumn
    \tableofcontents
    \mainmatter
    \include{mainmater/Chapter-1}
    \include{mainmatter/Chapter-2}
    \include{mainmatter/Chapter-3}                   
    \include{mainmatter/Chapter-4}
    %\include{mainmatter/Chapter-5}
    \backmatter
    \bibliographystyle{apacite}
    \bibliography{backmatter/MyReferences}
    \include{Graphics}
\end{document}

My bib file looks like:

@book{chandler2002basics,
  title={The basics},
  author={Chandler, Daniel},
  year={2002},
  publisher={Routledge London, UK}
}

@article{sebeok1960style, title={Style in language.}, author={Sebeok, Thomas A}, year={1960}, publisher={John Wiley} }

@book{brown1995elements, title={The elements of language curriculum: A systematic approach to program development.}, author={Brown, James Dean}, year={1995}, publisher={ERIC} }

But whenever I compile, I just get References title instead of reference below it which I have type in bib file. I do not know how to fix this problem. Also if their is any mistake in my tex document.

moewe
  • 175,683
  • Don't load natbib as \usepackage[square,sort&compress]{natbib} when you are using apacite. Remove the \usepackage[square,sort&compress]{natbib}. – moewe Dec 08 '21 at 16:28
  • To use natbib with apacite you need to load apacite with the [natbibapa] option (and don't load natbib separately, as @moewe says). – Alan Munn Dec 08 '21 at 16:29
  • @moewe Without \usepackage[square,sort&compress]{natbib} I get the same problem – Noor Aslam Dec 08 '21 at 16:35
  • There may be other issues with your code, but that is hard to tell without seeing a compilable example document that does not reference files we don't know (we don't know your \included files). As always you need to have \cited at least one of the entries in your .bib file and you need to make sure your .bib file has the correct name and is in the correct file location. Check the .log and .blg files for warnings or errors. – moewe Dec 08 '21 at 16:53
  • @moewe Sir kindly help me if possible I ma stuck here – Noor Aslam Dec 08 '21 at 16:56
  • Upload the .log and .blg files to a text-sharing website like https://pastebin.com/ or https://gist.github.com/. Try to run a simplified version of your document first like https://gist.github.com/moewew/df30e83f7e5bfc29f2fa24dad0b8068e – moewe Dec 08 '21 at 16:59
  • Are you actually running bibtex on the file? To get the references to appear you need to run pdflatex, bibtex, pdflatex, pdflatex. – Alan Munn Dec 08 '21 at 17:02
  • @moewe Mini version is also doing the same problem – Noor Aslam Dec 08 '21 at 17:40
  • 1
    @NoorAslam Can you get the sample document in the duplicate question to compile correctly? If not, then there is something else going wrong with what you're doing, but it's very hard to tell from the information you have given us so far. The question can be reopened if there is a different problem. – Alan Munn Dec 08 '21 at 19:44
  • Then show us the .log and .blg files. The mini version I posted should work when compiled with pdflatex apcex, bibtex apcex, pdflatex apcex, bibtex apcex. – moewe Dec 08 '21 at 19:51
  • @moewe In log I get the error Missing \begin{document}. @ – Noor Aslam Dec 09 '21 at 02:54
  • @moewe When I run bib.tex file to compile the reference I get these Process started: bibtex.exe "MyReferences.bib"

    This is BibTeX, Version 0.99d (MiKTeX 20.6.29) The top-level auxiliary file: MyReferences.bib.aux I found no \citation commands---while reading file MyReferences.bib.aux I found no \bibdata command---while reading file MyReferences.bib.aux I found no \bibstyle command---while reading file MyReferences.bib.aux (There were 3 error messages)

    – Noor Aslam Dec 09 '21 at 03:13
  • Do not run BibTeX on your .bib file. You should run both LaTeX and BibTeX on the base name (file name without extension) of your main .tex file. That's why I wrote pdflatex apcex and bibtex apcex for the file called apcex.tex in my link above. – moewe Dec 09 '21 at 05:37

0 Answers0