0

image of 1st chapterFollowing is main.tex of MWE

 \documentclass{report}
 \usepackage{xcolor}
\definecolor{blue}{RGB}{243,102,25}
\usepackage[english]{babel}
\usepackage{enumitem}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{pdflscape}
\usepackage{csquotes}
\input{structure}

\begin{document} \tableofcontents \chapter{Chapter1} \input{ch1} \chapter*{Bibliography} \addcontentsline{toc}{chapter}{\textcolor{blue}{Bibliography}} \printbibliography[heading=none] \end{document}

Following is structure.tex of MWE:

\usepackage[

backend=biber, style=numeric, sorting=nyt, sortcites=true, autopunct=true, autolang=hyphen, abbreviate=false, backref=true, ]{biblatex} \defbibheading{bibempty}{} \addbibresource{Reference.bib}

Following is Reference.bib for MWE:

@book{1.1, title={Securing critical information infrastructure: Global perspectives and practices}, author={Sharma, Munish}, year={2017}, publisher={Institute for Defence Studies and Analyses} } 

Following is Ch1.tex of MWE:

The reference used here is \cite{1.1}

This works well and gives output pdf file.

SDe
  • 1
  • 3
  • 1
    Please make a full but minimal example others can copy and test as is. See https://tex.meta.stackexchange.com/q/228, we cannot test your code here as there is no document class (which might contain stuf that are important) – daleif Mar 13 '24 at 10:38
  • Normally \chapter*{Bibliography} \addcontentsline{toc}{chapter}{\textcolor{blue}{Bibliography}} are bit needed. And where does \chapterimage come from? – daleif Mar 13 '24 at 10:39
  • @daleif there is an image file to be placed at the top of the first page of each chapter. So, \chapterimage is used. – SDe Mar 13 '24 at 11:10
  • None of the code you provided defines \chapterimage and thus your code cannot be test by us. So how exactly are we suppose to help you? – daleif Mar 13 '24 at 11:24
  • A simple question: Did you remember to run biber on your project and then compiling twice? Depending on your editor this does not happen automatically. – daleif Mar 13 '24 at 11:26
  • The only class in my latex dist that provides \chapterimage is litesolution.cls – daleif Mar 13 '24 at 11:26
  • 1
    There's no way to know if this is the problem without an MWE, but you seem to call \addbibresource twice with the same argument. One of those uses appears to be in the body, where \addbibresource cannot be used. – vjeffcott Mar 13 '24 at 12:17
  • As ValerieJeffcott says: \addbibresource{References.bib} is definitely wrong in the document body (and \printbibliography can only sensibly used in the document body), so it appears that the first code snippet should lose the \addbibresource{References.bib}. The LaTeX run on your document should finish without errors. You should then run Biber (see https://tex.stackexchange.com/q/63852/35864 and https://tex.stackexchange.com/q/154751/35864) and then LaTeX twice more. – moewe Mar 13 '24 at 20:29
  • @ValerieJeffcott MWE main.tex: \documentclass{report} \usepackage{xcolor} \definecolor{blue}{RGB}{243,102,25} \usepackage[english]{babel} \usepackage{enumitem} \usepackage{caption} \usepackage{subcaption} \usepackage{booktabs} \usepackage{pdflscape} \input{structure} \begin{document} \chapter{Chapter1} \input{ch1} \chapter*{Bibliography} \addcontentsline{toc}{chapter}{\textcolor{blue}{Bibliography}} \printbibliography \end{document} – SDe Mar 14 '24 at 08:17
  • @ValerieJeffcott ch1.tex MWE The reference used here is \cite{1.1}. and for the MWE reference.bib is @book{1.1, title={Securing critical information infrastructure: Global perspectives and practices}, author={Sharma, Munish}, year={2017}, publisher={Institute for Defence Studies and Analyses} } The document appears in Overleaf, BUT Chapter1 is written as heading twice in the same page and Bibliography heading appears in an empty page and in the next page with the bib entry – SDe Mar 14 '24 at 08:19
  • @ValerieJeffcott structure.tex for MWE: \usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,autolang=hyphen,hyperref=true,abbreviate=false,backref=true,,backend=biber]{biblatex} \defbibheading{bibempty}{} \addbibresource{Reference.bib} – SDe Mar 14 '24 at 08:20
  • @daleif I have commented out \chapterimage. If I wanted to use \chapterimage how should I define it and where? The cls file used in overleaf for Legrand orangebook is ltxmdf.cls. Do i need to add another cls file? Or do i simply add the definition of \chapterimage in structure file? – SDe Mar 14 '24 at 08:27
  • @ValerieJeffcott in the legrand book which i am using there are errors with tikz, like \usetikzlibrary{arrows.meta,calc,positioning} gives Missing \begin{document}. \tikzset{block/.style={draw,thick,text width=2cm,minimum height=1cm,ali.... gives Undefined control sequence. I have included the tikz package but still this happens. – SDe Mar 14 '24 at 08:33
  • Please edit the code into your question: It's really hard to read in the comments. – moewe Mar 15 '24 at 07:04
  • @moewe code is edited. MWE gives pdf file where Chapter1 is written as heading twice in the same page and Bibliography heading appears in an empty page and in the next page with the bib entry. How can i fix the tikz error of the actual file that i am working on? – SDe Mar 16 '24 at 16:01
  • I've shown in my answer below how you can avoid the duplicate heading. The example does not reproduce a TikZ error. I suggest you ask a new question with suitable MWE about that. – moewe Mar 16 '24 at 22:47
  • @moewe Thank You. I made the change you suggested and the double bibliography headings are gone. However, double chapter heading still there. What to do? – SDe Mar 18 '24 at 06:32
  • This is just the chapter heading style: It shows "Chapter n ". If you want to change that, ask a new question. It has nothing to do with the bibliography. – moewe Mar 18 '24 at 07:00
  • @moewe Thank You. I just posted a tikz related MWE. I also need to thank
    Valerie Jeffcott and daleif . Thank You ... to all of you for helping me out with latex related errors
    – SDe Mar 18 '24 at 07:34

1 Answers1

2

In the example you get double the bibliography headings and empty pages, because the example explicitly produces a new "Bibliography" chapter with \chapter* and then \printbibliography does the same.

Ideally you would just let \printbibliography generate the heading. If you want the bibliography to appear in the table of contents, use the option heading=bibintoc. This will not, however, make the entry in the ToC blue. If you need that, it is probably easiest to manually take over printing the heading and tell biblatex not to print any heading with heading=none,.

\documentclass{report}
\usepackage{xcolor}
\definecolor{blue}{RGB}{243,102,25}
\usepackage[english]{babel}
\usepackage[
  backend=biber,
  style=numeric,
  sorting=nyt,
  sortcites=true,
  autopunct=true,
  autolang=hyphen,
  abbreviate=false,
  backref=true,
]{biblatex}
\addbibresource{biblatex-examples.bib}

\begin{document} \tableofcontents \chapter{Chapter1} The reference used here is \cite{sigfridsson} \chapter*{Bibliography} \addcontentsline{toc}{chapter}{\textcolor{blue}{Bibliography}} \printbibliography[heading=none] \end{document}

ToC

moewe
  • 175,683