2

I'm using multicol for a two-column layout so I can have column balancing/equalizing at the end of every chapter. I'm also using titlesec to format my chapter/section/subsection titles. I've been placing \begin{multicols}{2} after \chapter{} so I could have the chapter title centered above the two columns.

The problem I'm running in to now, is that there's some space between the top of the first section title, and the top margin of the first column. I want this title text to be flush with the top margin of the body of text on the page, but I don't want to lose the spacing I set for the section title. The section title doesn't have a rule or anything above it, so I want to give some space between the top of the section title and the bottom of the previous paragraph.

This is the code in question:

\documentclass[a4paper,12pt,twoside,openany]{book}
\usepackage{lipsum}
\usepackage[headsep=0px]{geometry}
%
% START multicol setup
\usepackage{multicol}
\setlength{\columnseprule}{0.5pt}
% END multicol setup
%

%
% START fancyhdr setup
\usepackage{fancyhdr}
\fancypagestyle{plain}{
\fancyhf{}
\fancyhead[C]{\bfseries{}Lorem Ipsum Tester}
\fancyhead[RO]{\bfseries\leftmark}
\fancyhead[LE]{\bfseries\leftmark}
\fancyfoot[RO]{\thepage}
\fancyfoot[LE]{\thepage}}

\pagestyle{plain}
\renewcommand{\chaptermark}{\markboth{\thechapter}}
\renewcommand{\sectionmark}{\markboth{\thesection}}
\renewcommand{\subsectionmark}{\markboth{\thesubsection}}
% END fancyhdr setup
%

%
% START titlesec setup
\usepackage{titlesec}
\titleformat{\chapter}[display]{\bfseries\filcenter\Huge}{\thechapter}{0px}{}
\titleformat{\section}[display]{\bfseries\filright}{}{0px}
    {\thesection\hfill}[\vspace{0px}\titlerule]
\titleformat{\subsection}[wrap]{\bfseries\filright}{\thesubsection\\}{0pt}{}
\titlespacing{\chapter}{0pc}{0pc}{0pc}
\titlespacing{\section}{0pc}{0pc}{4px}
\titlespacing{\subsection}{4pc}{1pc}{1pc}
% END titlesec setup
%

\begin{document}
%   \author{\bfseries Nickolas Peter}
%   \title{\bfseries Lorem Ipsum Tester}
%   \date{}
%   \maketitle
\newpage\null\thispagestyle{empty}
\tableofcontents
\newpage

\chapter{Lorem Chapter One}
\begin{multicols}{2}
\section{Ipsum One}
\lipsum[4]

\section{Ipsum Two}
\lipsum[6]
\end{multicols}
\newpage


\chapter{Lorem Chapter Two}
\begin{multicols}{2}
\section{Ipsum One}
\lipsum[3]

\subsection{}
\lipsum[2]

\subsection{}
\lipsum[2]

\subsection{}
\lipsum[2]

\section{Ipsum Two}
\lipsum[3]

\section{Ipsum Three}
\lipsum[3]
\end{multicols}
\newpage


\chapter{Lorem Chapter Three}
\begin{multicols}{2}
\section{Ipsum One}
\lipsum[3]

\section{Ipsum Two}
\lipsum[3]

\subsection{}
\lipsum[1]

\subsection{}
\lipsum[1]

\section{Ipsum Three}
\lipsum[3]

\subsection{}
\lipsum[1]

\subsection{}
\lipsum[1]

\subsection{}
\lipsum[1]
\end{multicols}
\newpage


\chapter{Lorem Chapter Four}
\begin{multicols}{2}
\section{Ipsum One}
\lipsum[3]

\section{Ipsum Two}
\lipsum[3]

\subsection{}
\lipsum[1]

\subsection{}
\lipsum[1]
\end{multicols}
\newpage

\end{document}

This is a picture of what I'm talking about: enter image description here

  • Use block instead of display in \titleformat{\section}[display]{.... Is that what you want? – user11232 Oct 17 '14 at 9:54

Your Answer

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

Browse other questions tagged or ask your own question.