Fonts & Character SetsAbbreviation chapter messes with chapter configuaration of next chapter

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
jantzla
Posts: 3
Joined: Wed Oct 12, 2022 12:28 pm

Abbreviation chapter messes with chapter configuaration of next chapter

Post by jantzla »

Hi,

I'm trying to implement a chapter of used abbreviations in my document (class report). This is working fine so far, but the following chapters are affected by this new chapter and the style of front page of a new chapter is not displayed as it is supposed to (see chapter Introduction vs References). This happens no matter where I put the abbreviation chapter.

Here is the code I've been using:

Code: Select all

%----- Packages and Formatting %------

\documentclass [a4paper, 12pt, twoside]{report}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage[left=30mm,right=25mm,top=35mm,bottom=30mm]{geometry}
\usepackage{nomencl}
\makenomenclature
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage[round]{natbib}
\usepackage{bigstrut}
\hypersetup{
	colorlinks,
	citecolor=black,
	filecolor=black,
	linkcolor=black,
	urlcolor=black
}
\usepackage{titlesec}
\usepackage{glossaries}
\makeglossaries
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{color}
\usepackage{acro}


% Declare abbreviations %
\DeclareAcronym{HCC}{
	short=HCC,
	long=Hepatocellular Carcinoma,
}


% Defining folder of images
\graphicspath{{./img}}

\newcounter{savepage}

% Defining section style numbers:
\def\thesection{\arabic{chapter}}

% Add New Command for Header Footer Settings Title Page

\usepackage{xpatch}
\xapptocmd{\titlepage}{\thispagestyle{firstpage}}{}{}

% rest of the headers
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\fancyhf{}
\fancyhead[R]{%
	% The chapter number only if it's greater than 0
	\ifnum\value{chapter}>0 \chaptername\ \thechapter. \fi
	% The chapter title
	\leftmark}
\fancyfoot[C]{\thepage}

\fancypagestyle{plain}{
	\renewcommand{\headrulewidth}{0pt}
	\fancyhf{}
	\fancyfoot[C]{\thepage}
}

\setlength{\headheight}{14.5pt}

% Set chapter settings
\titleformat{\chapter}
{\normalfont\huge\bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{8.5ex plus 1ex minus .2ex}{5.3ex plus .2ex}


%------------------- Start document --------------%

\begin{document}

% Introduction %

\chapter*{Introduction}
\chaptermark{INTRODUCTION}

\Blindtext 
Regrading primary liver cancers, hepatocellular carcinoma \acs{HCC} accounts for 80-90\% of all cases.

% Abbreviation page %

\chapter*{Abbreviations}
\renewcommand{\chapter}[2]{}
\chaptermark{Abbreviations}
\printacronyms

% References %

\chapter*{References}
\renewcommand{\chapter}[2]{}
\chaptermark{REFERENCES}
\bibliographystyle{abbrvnat}
\bibliography{library}

\end{document}
Thankful for any ideas that could to solve this :-)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Abbreviation chapter messes with chapter configuaration of next chapter

Post by Stefan Kottwitz »

Hi jantzla,

welcome to the forum!

Remove \renewcommand{\chapter}[2]{} because this redefines/removes the \chapter command.

Stefan
LaTeX.org admin
jantzla
Posts: 3
Joined: Wed Oct 12, 2022 12:28 pm

Abbreviation chapter messes with chapter configuaration of next chapter

Post by jantzla »

Hi Stefan,
Thanks for the hint! But when I do that the title of the chapter changes from "Abbreviations" to "Acronyms" and I would prefer to keep the former. Any suggestions on how to achieve that?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Abbreviation chapter messes with chapter configuaration of next chapter

Post by Stefan Kottwitz »

Instead of \printacronyms you could use:

Code: Select all

\printglossary[type=\acronymtype,title={Abbreviations}]
Or after loading babel, in the preamble:

Code: Select all

\addto\captionsenglish{\renewcommand*{\acronymname}{Abbreviations}}
Stefan
LaTeX.org admin
jantzla
Posts: 3
Joined: Wed Oct 12, 2022 12:28 pm

Abbreviation chapter messes with chapter configuaration of next chapter

Post by jantzla »

Hi Stefan,

thanks so much for your input. However, I've successfully generated the right title but now I have no output of acronyms/abbreviations...
Do you have a solution? :D

Laura
Post Reply