Fonts & Character SetsHow to change chapter title format

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Diogo Remoaldo
Posts: 26
Joined: Mon Apr 06, 2015 8:24 pm

How to change chapter title format

Post by Diogo Remoaldo »

Hi I would like to make the chapters appear as the image in the appendix (Capítulo 1 - Introdução).

Thanks in advance for your time.

My code is as follows:

Code: Select all

Code, edit and compile here:
\documentclass[a4paper,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{float}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage{url}
\usepackage[all]{hypcap}
\usepackage{caption}
\usepackage[paper=a4paper,top=3.5cm,bottom=2cm,right=1.5cm,left=3.0cm,twoside ,bindingoffset=1cm,marginparwidth=0in,marginparsep=0in]{geometry}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{indentfirst}
\usepackage[export]{adjustbox}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{enumitem}
\usepackage[titletoc]{appendix}
\usepackage{titlesec}
\usepackage{multirow}
\captionsetup[table]{position=above}
\usepackage{siunitx}
%\usepackage[stretch=10,shrink=10]{microtype}
\newcolumntype{C}{>{\centering\arraybackslash}m}
\sisetup{per-mode=symbol}
\usepackage{hhline}
\captionsetup[table]{position=above}
\setcounter{secnumdepth}{4}
\DeclareSIUnit{\year}{ano}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{1.5ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\usepackage{eurosym}
\usepackage{makeidx}
\usepackage{subcaption}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Attachments
mycode.png
mycode.png (4.63 KiB) Viewed 42431 times
Introdução.png
Introdução.png (9.06 KiB) Viewed 42569 times
Last edited by Johannes_B on Mon Aug 01, 2016 11:50 am, edited 2 times 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.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to change chapter title format

Post by Johannes_B »

Since you have again not provided a minimal working example but rather a clutter of code, i will not present you with the ready made solution.
Just one hint: You are already changing the appearance of chapter headings in your code. So, you should be able to figure out how to change it to your needs.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

How to change chapter title format

Post by Stefan Kottwitz »

Hi Diogo,

you have this line for configuring the chapter heading:

Code: Select all

\titleformat{\chapter}[display]
{\normalfont\chapfnt\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\chapfnt}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Just change it. For example, remove the [display] option, similar to the following section line. The titlesec manual shows how to customize it.

Stefan
LaTeX.org admin
Diogo Remoaldo
Posts: 26
Joined: Mon Apr 06, 2015 8:24 pm

How to change chapter title format

Post by Diogo Remoaldo »

Hi,

I ended up doing it. Johannes I came from vacations today and could only reply now, I don't know what I did wrong, I sent you my full code plus images, it still has almost no text because I am first setting the layout and than I will start writting. What else do you want me to send the next time?

Hope I haven't offended you, but I think you were a bit unfair.

Now I have another problem. I corrected my problema doing the following

Code: Select all

Code, edit and compile here:
\titleformat{\chapter}
{\normalfont\chapfnt\bfseries}{\chaptertitlename\ \thechapter-}{0em}{\chapfnt}
\titlespacing*{\chapter}{0pt}{0pt}{*2}
\titleformat{\section}
{\normalfont\secfnt\bfseries}{\thesection-}{0em}{}
\titleformat{\subsection}
{\normalfont\ssecfnt\bfseries}{\thesubsection-}{0em}{}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
But the - doesn't appear in the índex, I would like to Capítulo - 1 appear as follows in the índex. How can I work it around?
Post Reply