0

I have chapter's heading customized, so I want to reduce the spacing of bibliography title without affecting chapter's style. Thank you a lot. This is the 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{ragged2e}
    \usepackage[colorlinks=true,linkcolor=blue,urlcolor=red,
            citecolor=magenta]{hyperref}
    \usepackage[square,numbers]{natbib}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \setlength{\cftbeforetoctitleskip}{-12em}
    \setlength{\cftbeforeloftitleskip}{-12em}
    \setlength{\cftbeforelottitleskip}{-12em}
    \renewcommand\cftsecafterpnum{\vskip 8pt}
    \renewcommand\cftchapafterpnum{\vskip 8pt}
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \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{13.5ex}[6pt]{\rlap{\hspace{-\fboxsep}\resizebox*     {\dimexpr\labelframewd+2\fboxsep\relax}{!}{\color{titlecolour}\lsstyle\scshape\scriptsize{capitulo}}}}%
    \usebox{\chapterlabelbox}}}
    \hskip-\fboxsep\color{titlecolour}{\raisebox{-15ex}{\fbox{\phantom{\usebox{\chapterlabelbox}}}}}
    }%

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

    \titlespacing{\chapter}{1pt}{1.25\baselineskip}{10\baselineskip}
    \renewcommand*\thechapter{\arabic{chapter}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \marginsize{4cm}{2cm}{3cm}{3cm}
\pagenumbering{arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document} 
...
\addcontentsline{toc}{chapter}{Bibliografía}
\bibliographystyle{plainnat}
 \bibliography{tesis1}
\end{document}

enter image description here

0

Change the value of the last argument in \titlespacing and code in \titleformat for numberless chapters. Also when you want to set a colour to some know colour like black, it's not particularly useful to set its rgb values. It's much simpler to use the \colorletcommand from xcolor. I took the liberty to remove the horizontal rule above the chapter title for the bibliography:

\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{ragged2e}
    \usepackage[colorlinks=true,linkcolor=blue,urlcolor=red,
            citecolor=magenta]{hyperref}
    \usepackage[square,numbers]{natbib}
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \setlength{\cftbeforetoctitleskip}{-12em}
    \setlength{\cftbeforeloftitleskip}{-12em}
    \setlength{\cftbeforelottitleskip}{-12em}
    \renewcommand\cftsecafterpnum{\vskip 8pt}
    \renewcommand\cftchapafterpnum{\vskip 8pt}
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \setlength\fboxrule{0.8pt}%
    \colorlet{titlecolour}{black}
    \newlength\labelframewd
    \settowidth{\labelframewd}{~\footnotesize\textsc{capitulo}~}

    \newsavebox\chapterlabelbox%

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

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

    \titlespacing{\chapter}{1pt}{1.25\baselineskip}{10\baselineskip}
    \renewcommand*\thechapter{\arabic{chapter}}

     \titleformat{name=\chapter, numberless}[block]{}
    {}%
    {0ex}
    {\thispagestyle{empty}\vskip3.0ex\hspace*{3\labelframewd}\fontsize{32}{32}\itshape}%
    \titlespacing{name=\chapter, numberless}{1pt}{1.25\baselineskip}{4\baselineskip}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \marginsize{4cm}{2cm}{3cm}{3cm}
\pagenumbering{arabic}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\chapter{A first chapter}
...
\nocite{*}
\addcontentsline{toc}{chapter}{Bibliografía}
\bibliographystyle{plainnat}
 \bibliography{tesis1}
\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.