Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

\newcommand{\secformat}[1]{\MakeLowercase{\so{#1}}}
% \so spaces out letters
\titleformat{\subsubsection}[block]
{\normalfont\scshape\filcenter}
{\thesubsubsection}
{1em}
{\secformat}
% La subsubseccion
\titleformat{\subsubsection}[leftmargin]
{\normalfont
\titlerule*[.6em]{\bfseries.}%
\vspace{6pt}%
\sffamily\bfseries\filleft}
{\thesubsubsection}{.5em}{}
\titlespacing{\subsubsection}
{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 :-?

share|improve this question
    
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? –  Herbert Feb 5 '11 at 20:54

1 Answer 1

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.

\documentclass[twocolumn]{memoir}
\usepackage{lipsum}
\settrimmedsize{11in}{210mm}{*}
\setlength{\trimtop}{0pt}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\settypeblocksize{7.75in}{33pc}{*}
\setulmargins{4cm}{*}{*}
\setlrmargins{1.25in}{*}{*}
\setmarginnotes{17pt}{51pt}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout

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

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.

Results:

Memoir marginpar example

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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