2

i have been reading how to change that space but I could not. Here is a MWE that reproduces what I have:

I am not sure if it is "Title & chapter", but I upload the image to show what I want to change.

\documentclass[12pt,twoside]{report}
\usepackage{titlesec}
\begin{document}
\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\LARGE}
\titlespacing*{\chapter}{0pt}{-50pt}{0pt}

\tableofcontents

\chapter{Introducción}

\chapter{Estado del arte}

\chapter{Teoría}

\end{document}

Here is exactly the space i want to reduce

Please help!!

  • 2
    \titleformat{\chapter}[display] {\normalfont\Huge\bfseries}{\chaptertitlename\ \thechapter}{0pt}{\LARGE} – Moriambar Jun 2 '17 at 17:54
  • Oh, i am ashamed. thank you, now I will try @Moriambar – santimirandarp Jun 2 '17 at 17:57
  • 2
    Let me know how it goes. Anyway the fifth parameter of the titleformat command is the space left between the chapter name and its title. And many many thanks for the MWE – Moriambar Jun 2 '17 at 17:59
  • @Moriambar just another doubt, how can i make numbered those chapters? i mean, change "introduccn" with "1.Introduccn". EDIT: mmh, maybe it is not necessary – santimirandarp Jun 2 '17 at 18:08
  • Now, don’t forget that you need \usepackage[T1]{fontenc} \usepacakge[utf8]{inputenc} to get the accented letters right… :-) – GuM Jun 2 '17 at 18:08
3

As I stated in the comments, your problem is in the second of last parameter to titleformat.

Your \titleformat{\chapter}[display] {\normalfont\Huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\LARGE} inserts 20 points of space between the word Chapter and the chapter name, as stated in the titlesec package documentation.

Just rewrite it as:

\titleformat{\chapter}[display]{\normalfont\Huge\bfseries}{\chaptertitlename\ \thechapter}{0pt}{\LARGE}

or tweak the spacing in order to achieve the asked results.

Furthermore I take on Gustavo's suggestion of inserting the fontenc and inputenc packages in order to accept accented characters, and use type-1 fonts.

Also you should use the babel package if you're not using English, with the proper option (I guessed spanish), to correctly parse the language and load the hyphenation codes.

Finally, to meet your requirement of having the number just before the text you should tweak the last parameter.

Here is my example; I think you could start from there

\documentclass[12pt,twoside]{report}
\usepackage{titlesec}
\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc}
\begin{document}
\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries}{\chaptertitlename}{0pt}{\LARGE\thechapter.\ }
\titlespacing*{\chapter}{0pt}{-50pt}{0pt}

\tableofcontents

\chapter{Introducción}

\chapter{Estado del arte}

\chapter{Teoría}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.