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.
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 😕
Best Answer
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.
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: