I would like to write a book document with two columns and subsubsection titles as margin notes at both sides of the page (in the side which corresponds to the column).

In order to specify the subsubsection titles I have used a simple variation of titlesec example code:

% \so spaces out letters
% La subsubseccion
{4pc}{1.5ex plus .1ex minus .2ex}{1pc}

As you can see following image, margin titles are located in the left side as it's set as a fixed parameter in the code, so titles are over the text in the right column.

two-column example

I would like to know how I can check dynamically if the title corresponds to the right or the left column and to put it in the real margin: I suppose it could be done by setting the parameter [leftmargin] or [rightmargin] but I'm not sure :-?

  • To determine whether you are in the left or right column, you can use \if@firstcolumn Left column \else Right column \fi (at least with some classes). But I couldn't force titlesec to give different styles on the same page. – Bruno Le Floch Jan 26 '11 at 14:03
  • which documentclass you are using? – user2478 Feb 5 '11 at 20:54

I'm not sure how much flexibility you have in changing base document classes, but the memoir class includes features similar to titlesec, and doesn't exhibit this problem by default.


\chapter{Chapter Title}
\section{Section Title}
\marginpar{\subsection{Subsection Title 1}}{\lipsum[1-3]}
\marginpar{\subsection{Subsection Title 2}}{\lipsum[4]}

Here, I'm using the page layout used in the memoir manual (section 2.9.1). You'd need to read through their page layout documentation and adjust for your needs.


Memoir marginpar example

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.