Text FormattingRemove Chapter Prefix

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
mauro269
Posts: 9
Joined: Sun Feb 24, 2013 8:55 pm

Remove Chapter Prefix

Post by mauro269 »

Hi guys,

I'm here again. As I said in the previous thread, I've completed my academic thesis and I'm formatting the text. I'm trying to format the "Conclusions" section but LaTeX gives out this form.
Chapter XXX
Conclusions
I would like to remove the "Chapter XXX" from the output without influencing the Index.
For a better comprehension of my problem, I'm doing a main file with \include{chapterY} functions.

Thanks for your help :)
Last edited by cgnieder on Wed Feb 27, 2013 10:18 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Remove Chapter Prefix

Post by cgnieder »

Would you please add a Infominimal working example (please follow the link if you're unsure what that is)? An answer may very well depend on the document class, customizations...

Regards
site moderator & package author
mauro269
Posts: 9
Joined: Sun Feb 24, 2013 8:55 pm

Remove Chapter Prefix

Post by mauro269 »

Ok, it's a little bit hard. Here there is my MAIN file:

Code: Select all

\documentclass[12pt, a4paper, oneside, titlepage, openright]{book}
\usepackage[applemac]{inputenc}
\usepackage[english,italian]{babel}
\usepackage{float}
\usepackage[onehalfspacing]{setspace}
\usepackage{sectsty}
\sectionfont{\large}
\usepackage[center]{caption}
\usepackage[nottoc]{tocbibind}
\usepackage{indentfirst}
\usepackage{amsmath,amsfonts,amssymb,amsthm,mathrsfs}
\usepackage{mathtools}
\usepackage{booktabs}
\usepackage{latexsym}

\usepackage{makeidx}
\makeindex

\begin{document}
\input{abstract}

\tableofcontents

\input{chapter1}
\input{chapter2}
\input{conclusions}

\end{document}
My conclusion instead is the code below:

Code: Select all

\chapter{Conclusions}

Body of the text
turok
Posts: 7
Joined: Wed Oct 17, 2012 2:26 pm

Remove Chapter Prefix

Post by turok »

I hope it would be useful:

Code: Select all

\chapter{AAA}

\chapter*{Conclusions}
\addtocounter{chapter}{1}
\addcontentsline{toc}{chapter}{\thechapter. Conclusions}

\chapter{ZZZ}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Remove Chapter Prefix

Post by localghost »

turok wrote:I hope it would be useful:

Code: Select all

\chapter{AAA}

\chapter*{Conclusions}
\addtocounter{chapter}{1}
\addcontentsline{toc}{chapter}{\thechapter. Conclusions}

\chapter{ZZZ}
Where is the sense in putting an unnumbered chapter with a numbered entry into the ToC?


Thorsten
mauro269
Posts: 9
Joined: Sun Feb 24, 2013 8:55 pm

Re: Remove Chapter Prefix

Post by mauro269 »

I've not understood...If it's ok (localghost seems disappointed), where I have to put that code? In my main file?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Remove Chapter Prefix

Post by localghost »

mauro269 wrote:[…] (localghost seems disappointed) […]
No trace of disappointment, just irritation about the effect of the proposed code. I just want to point some issues.
  • The proposed code as is generates an unnumbered chapter but adds this chapter numbered to the ToC. Furthermore it does this with inconsistent spacing. As a reader I would expect the chapter entry in the ToC to be unnumbered as well.
  • Another issue is that the proposed code increments the chapter counter. This results in an unnumbered chapter followed by a numbered chapter which has no continued numbering.
Since you are using the book class, a better method would be to use the commands \frontmatter, \mainmatter and \backmatter to divide your document into certain parts. The below code shows a short example.

Code: Select all

\documentclass[
  12pt,
  a4paper
  english,
  italian
]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{makeidx}
\usepackage[nottoc]{tocbibind}
\usepackage{blindtext}  % only for dummy text here

\makeindex

\begin{document}
  \frontmatter
  \tableofcontents

  \chapter{Introduction}

  \mainmatter
  \blinddocument

  \appendix
  \chapter{Tables}

  \backmatter
  \chapter{Conclusions}
  \chapter{Acknowledgments}

  \begin{thebibliography}{9}  % usually generated by BibTeX
    \item{be} Bibliography Entry
  \end{thebibliography}

  \printindex
\end{document}
You wouldn't need any modifications in your sub-files which contain the chapters.
mauro269
Posts: 9
Joined: Sun Feb 24, 2013 8:55 pm

Remove Chapter Prefix

Post by mauro269 »

Thanks localghost! :)
Post Reply