# How to create a operation manual like format with sidebars

I wonder if there is an easy way to achieve formatting like this document.

Some notable features of such a format

• There is a left sidebar to allow users to take notes
• The sidebar contains section headings that can be aligned with a specific line of text
• headings and figures can span both the main text and the sidebar
• You can use a longtable. It would be a ghetto rig, but workable. – ajeh Sep 19 '14 at 19:10
• yes that seems to be a rather daunting task to use longtable for a complex document... I wonder how people format these documents after all, using MS Word? – Leo Sep 19 '14 at 19:44
• Do they create them in MS Word? I actually find that format visually rather confusing. Maybe it is discipline-centric. (I find it confusing because it is not obvious which thing comes after which other thing. The lines in the sidebar are inconsistent and distracting.) The left sidebar can be created just using a large marginpar length, I think. – cfr Sep 19 '14 at 22:27
• thank you all for the wonderful answers below. I will try them out. – Leo Sep 21 '14 at 6:34
• @cfr I asked this on Quora also. It looks like it's pretty easy to create such a format in InDesign – Leo Sep 21 '14 at 6:35

With titlesec and geometry:

\documentclass{article}
\usepackage{titlesec,xcolor}
\usepackage[margin=1in,left=3in]{geometry}

\titleformat{\section}[block]
{\Large
\titleline*[l]{\color{blue}\titlerule[2pt]}%
\normalfont\bfseries}
{\thesection\hspace{-0.5em}}{2in}{}

\titleformat{name=\subsection, numberless}[block]
{\large
\titleline*[l]{\color{blue}\titlerule[2pt]}%
\hrule depth 0pt width \linewidth height 0.5pt%
\normalfont\bfseries}
{}{2in}{}

\titlespacing*{\section} {-2in}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\titlespacing*{\subsection} {-2in}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\begin{document}
\section{Some section}
\noindent Some text here.
\subsection*{Some sub section}
\noindent Some text here.
\end{document}


This is not intended as a solution as such. It is more intended to give you some ideas of ways in which you might develop the format you'd like to construct. It demonstrates the following:

• use of geometry to set up the wide left margin etc.
• use of fancyhdr to set up head and foot lines extending the entire width of the page
• use of titlesec to put section titles in the margin and rules in the text
• use of enumitem to set up a customised enumeration environment which labels each item 'Step X' and puts the labels in the margin.

The code:

\documentclass[a4paper]{article}
\usepackage{geometry}
\geometry{landscape, hscale=.6, vscale=.8, hmarginratio=5:1, vmarginratio=1:1, marginparwidth=.375\paperwidth, ignoremp}
\usepackage[T1]{fontenc}
\usepackage[explicit]{titlesec}
\titlespacing*{\section}{\dimexpr -\marginparsep-\marginparwidth}{*4}{*1}
\titleformat{\section}[runin]{\large\bfseries\titlerule[.5pt]\filright}{\makebox[1em][c]{\thesection}}{1em}{\parbox[t]{\dimexpr\marginparwidth-2em}{#1}\hskip\marginparsep\mbox{}}[\newline]
\usepackage{enumitem}
\newlist{steps}{enumerate}{1}
\setlist[steps]{label=Step \arabic*, font=\bfseries, leftmargin=-\marginparsep, itemindent=\marginparsep, align=right}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhfoffset[lh,lf]{\dimexpr\marginparwidth+\marginparsep}
\fancyhf[lf]{left foot}
\fancyhf[cf]{centre foot}
\fancyhf[rf]{right foot}
\renewcommand{\footrulewidth}{.4pt}
\usepackage{kantlipsum}
\begin{document}

\section{How To Do Things With Text}
\kant[1]
\section{How To Do More Things With Text}
\kant[2]
\begin{steps}
\item First
\item Second
\item Third
\end{steps}

\end{document}


The result:

All, what you need to do is

• to set adequate amount of the left margin
• to use \llap in order to typeset something in the margin.

A simple example which uses plain TeX and OPmac follows:

\input opmac

\margins/1 a4 (5,2,2,2)cm

\def\printsec#1{\par \norempenalty-200 \medskip
\llap{\localcolor\Blue \vrule height1mm width3cm\kern2mm}\nobreak
{\secfont \noindent \llap{\hbox to3.2cm{\dotocnum{\thetocnum}\hfil}}#1\nbpar}%
\nobreak \remskip\medskipamount \firstnoindent
}
\def\printsecc#1{\par \norempenalty-200 \medskip
\llap{\localcolor\Blue \vrule height1mm width3cm\kern2mm}\nobreak
\hrule\nobreak\medskip
{\seccfont \noindent #1\nbpar}%
\nobreak \remskip\medskipamount \firstnoindent
}

\sec Title of section

text of section

\sec Title of second section

text of section

\secc Some subsection

text of subsection

\bye


Note, that the bodies of the macros \printsec and \printsecc were copied from opmac.tex and slightly modified to solve your task.