0

I'm new on LaTeX, and I want to reduce the title spacing in the ToC, LoF, and LoT. They have that format because of the chapter style that I'm using but I want to reduce de spacing of those without modifying the chapter style. This is the code and these are the images I've got. And If you recommend, change the style of the thanks part.

\documentclass[a4paper,oneside,onecolumn,openany,12pt]{book}
\usepackage[spanish]{babel} 
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{microtype} 
\usepackage[garamond]{mathdesign}
\usepackage{garamondx}%%
\usepackage[x11names]{xcolor}
\usepackage{graphicx}
\usepackage{etoolbox}
\usepackage{environ} 
\usepackage{anysize}
\usepackage{geometry}
\usepackage{titlesec}%[newparttoc]
%\usepackage{tocloft}
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength\fboxrule{0.8pt}
\definecolor{titlecolour}{rgb}{0,0,0}
\newlength\labelframewd
\settowidth{\labelframewd}{~\footnotesize\textsc{capitulo}~}

\newsavebox\chapterlabelbox%

\newcommand\chapterlabel{%
\makebox[1pt]{\fcolorbox{titlecolour}{titlecolour}{%
\raisebox{14ex}[5pt]{\rlap{\hspace{-\fboxsep}\resizebox*{\dimexpr\labelframewd+2\fboxsep\relax}{!}{\color{titlecolour}\lsstyle\scshape\scriptsize{capitulo}}}}%
\usebox{\chapterlabelbox}}}
\hskip-\fboxsep\color{titlecolour}{\raisebox{-13ex}{\fbox{\phantom{\usebox{\chapterlabelbox}}}}}
}%

\titleformat{\chapter}[display]{}
{%
 \sbox{\chapterlabelbox}{\raisebox{0pt}[12ex][27ex]{\resizebox{\labelframewd}{!}{\hfill\color{white}{\arabic{chapter}}\hfill}}}
\smash{\chapterlabel}}%
{6ex}
{\thispagestyle{empty}{\color{titlecolour}\titlerule[\fboxrule]}\vskip3.0ex\hspace*{2.5\labelframewd}\fontsize{32}{30}\itshape}%

\titlespacing{\chapter}{1pt}{1.25\baselineskip}{9\baselineskip}
\renewcommand*\thechapter{\arabic{chapter}}
%\setlength\cftaftertoctitleskip{8pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\marginsize{4cm}{2cm}{3cm}{3cm}
\pagenumbering{arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document} 
\begin{titlepage}
\begin{center}
\begin{Huge}
\textsc{Un buen título es muy importante}
\end{Huge}
\end{center}
\end{titlepage}
\newpage
$\ $
\thispagestyle{empty} % para que no se numere esta pagina
\newpage
\chapter*{}
\setcounter{page}{5}
\begin{flushright}
\textit{Dedicado a mis padres y hermanos \\}
\end{flushright}
\chapter*{Agradecimientos}
jdlksajkdjalkjda
\tableofcontents % indice de contenidos
\listoffigures % indice de figuras
\listoftables % indice de tablas
\chapter{INTRODUCCIÓN}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\end{document}

img

  • Hello and Welcome to Tex.SX! what space do you mean? The spaces between the horizontal lines and the actual title (i.e. "introducción" and "Índice general")? – Wamseln Dec 15 '16 at 20:01
0

Since you use titlesec, make a separate formatting for numberless chapters:

\documentclass[a4paper,oneside,onecolumn,openany,12pt]{book}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{microtype}
\usepackage[garamond]{mathdesign}
\usepackage{garamondx}%%
\usepackage[x11names]{xcolor}
\usepackage{graphicx}
\usepackage{etoolbox}
\usepackage{environ}
\usepackage{anysize}
\usepackage{geometry}
\usepackage{titlesec}%[newparttoc]
%\usepackage{tocloft}
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength\fboxrule{0.8pt}
\definecolor{titlecolour}{rgb}{0,0,0}
\newlength\labelframewd
\settowidth{\labelframewd}{~\footnotesize\textsc{capitulo}~}

\newsavebox\chapterlabelbox%

\newcommand\chapterlabel{%
\makebox[1pt]{\fcolorbox{titlecolour}{titlecolour}{%
\raisebox{14ex}[5pt]{\rlap{\hspace{-\fboxsep}\resizebox*{\dimexpr\labelframewd+2\fboxsep\relax}{!}{\color{titlecolour}\lsstyle\scshape\scriptsize{capitulo}}}}%
\usebox{\chapterlabelbox}}}
\hskip-\fboxsep\color{titlecolour}{\raisebox{-13ex}{\fbox{\phantom{\usebox{\chapterlabelbox}}}}}
}%

\titleformat{\chapter}[display]{}
{%
 \sbox{\chapterlabelbox}{\raisebox{0pt}[12ex][27ex]{\resizebox{\labelframewd}{!}{\hfill\color{white}{\arabic{chapter}}\hfill}}}
\smash{\chapterlabel}}%
{6ex}
{\thispagestyle{empty}{\color{titlecolour}\titlerule[\fboxrule]}\vskip3.0ex\hspace*{2.5\labelframewd}\fontsize{32}{30}\itshape}%
\titlespacing{\chapter}{1pt}{1.25\baselineskip}{9\baselineskip}
\renewcommand*\thechapter{\arabic{chapter}}

%%%% Numberless chapters%
\titleformat{name=\chapter, numberless}[block]{\filcenter}{}{0pt}
{\thispagestyle{empty}\fontsize{32}{30}\itshape}%
\titlespacing{name=\chapter, numberless}{1pt}{0\baselineskip}{5\baselineskip}
%\setlength\cftaftertoctitleskip{8pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\marginsize{4cm}{2cm}{3cm}{3cm}
\pagenumbering{arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{titlepage}
\begin{center}
\begin{Huge}
\textsc{Un buen título es muy importante}
\end{Huge}
\end{center}
\end{titlepage}
\newpage
$\ $
\thispagestyle{empty} % para que no se numere esta pagina
\newpage
\chapter*{}
\setcounter{page}{5}
\begin{flushright}
\textit{Dedicado a mis padres y hermanos \\}
\end{flushright}
\chapter*{Agradecimientos}
jdlksajkdjalkjda
\tableofcontents % indice de contenidos
\listoffigures % indice de figuras
\listoftables % indice de tablas
\chapter{INTRODUCCIÓN}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
\section{Primera sección}

\end{document} 

enter image description here

0

You can use tocloft package and set the length of \cftbeforetoctitleskip (and equivalents for LoF and LoT). In order the final document to look similar as your original one, you also have to tweak the ToC's name with \renewcommand{\contentsname}{new ToC name}.

For setting the spacing in the Thanks section I suggest using \vspace{} command.

Here is the MWE based on your code:

\documentclass[a4paper,oneside,onecolumn,openany,12pt]{book}
\usepackage[spanish]{babel} 
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{microtype} 
\usepackage[garamond]{mathdesign}
\usepackage{garamondx}%%
\usepackage[x11names]{xcolor}
\usepackage{graphicx}
\usepackage{etoolbox}
\usepackage{environ} 
\usepackage{anysize}
\usepackage{geometry}
\usepackage{titlesec}%[newparttoc]
\usepackage{tocloft}
\usepackage[colorlinks=true,linkcolor=blue]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength{\cftbeforetoctitleskip}{-12em}
\setlength{\cftbeforeloftitleskip}{-12em}
\setlength{\cftbeforelottitleskip}{-12em}

\setlength\fboxrule{0.8pt}
\definecolor{titlecolour}{rgb}{0,0,0}
\newlength\labelframewd
\settowidth{\labelframewd}{~\footnotesize\textsc{capitulo}~}

\newsavebox\chapterlabelbox%

\newcommand\chapterlabel{%
\makebox[1pt]{\fcolorbox{titlecolour}{titlecolour}{%
\raisebox{14ex}[5pt]{\rlap{\hspace{-\fboxsep}\resizebox*{\dimexpr\labelframewd+2\fboxsep\relax}{!}{\color{titlecolour}\lsstyle\scshape\scriptsize{capitulo}}}}%
\usebox{\chapterlabelbox}}}
\hskip-\fboxsep\color{titlecolour}{\raisebox{-13ex}{\fbox{\phantom{\usebox{\chapterlabelbox}}}}}
}%

\titleformat{\chapter}[display]{}
{%
 \sbox{\chapterlabelbox}{\raisebox{0pt}[12ex][27ex]{\resizebox{\labelframewd}{!}{\hfill\color{white}{\arabic{chapter}}\hfill}}}
\smash{\chapterlabel}}%
{6ex}
{\thispagestyle{empty}{\color{titlecolour}\titlerule[\fboxrule]}\vskip3.0ex\hspace*{2.5\labelframewd}\fontsize{32}{30}\itshape}%

\titlespacing{\chapter}{1pt}{1.25\baselineskip}{9\baselineskip}
\renewcommand*\thechapter{\arabic{chapter}}
%\setlength\cftaftertoctitleskip{8pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\marginsize{4cm}{2cm}{3cm}{3cm}
\pagenumbering{arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document} 
\begin{titlepage}
\begin{center}
\begin{Huge}
\textsc{Un buen título es muy importante}
\end{Huge}
\end{center}
\end{titlepage}
\newpage
$\ $
\thispagestyle{empty} % para que no se numere esta pagina
\newpage
\chapter*{}
\setcounter{page}{5}
\begin{flushright}
\textit{Dedicado a mis padres y hermanos \\}
\end{flushright}
\chapter*{Agradecimientos}
\vspace{-8em}
jdlksajkdjalkjda

\chapter*{\contentsname}
\renewcommand{\contentsname}{}
\tableofcontents % indice de contenidos

\chapter*{\listfigurename}
\renewcommand{\listfigurename}{}
\listoffigures % indice de figuras

\chapter*{\listtablename}
\renewcommand{\listtablename}{}
\listoftables % indice de tablas

\chapter{INTRODUCCIÓN}
Text text text text text.

\end{document}

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.