3

I vant to make the section design like shown on the picture below. So far i have managed to get the section numbering in the margin, but I have no idea how to make the box (or change the fonts in sections, chapters and subtitles, but that is not the main thing im asking for now, but if you by any chance know yeah, id love to know :D ).

enter image description here

Im making the document with document class "scrreprt", and the code i used for getting the section numbering in the margin was:

\documentclass[11pt, twoside=semi, titlepage]{scrreprt}    

\usepackage[top=2.5cm, bottom=2.5cm, left=6cm, right=2cm, heightrounded, marginparwidth=3.5cm, 
marginparsep=0.5cm]{geometry}


\renewcommand*{\othersectionlevelsformat}[1]{%
\makebox[0pt][r]{%
\csname the#1\endcsname\enskip}%
}

\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}

Do anyone know if this is possible, and how to do it? :)

  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Sverre Oct 27 '14 at 21:13
  • sorry, im kinda new to this, didn't think about it, addet it now! (Y) – landigio Oct 27 '14 at 21:20
  • 1
    #denfølelsen når læreboka bruker \raggedright... – Holene Oct 27 '14 at 21:24
7

This is the basics, adjust to suit.

\documentclass[11pt, twoside=semi, titlepage]{scrreprt}

\usepackage[top=2.5cm, bottom=2.5cm, left=6cm, right=2cm, heightrounded, marginparwidth=3.5cm,
marginparsep=0.5cm]{geometry}

\usepackage{xcolor}

\renewcommand*{\othersectionlevelsformat}[1]{%
  \makebox[0pt][r]{%
    \fcolorbox{blue}{blue}{\color{white}\csname the#1\endcsname}%
    \enskip
  }
}


\begin{document}

\setcounter{chapter}{1} % just to emulate a chapter has started

\section{VEKTORER I ROMMET}

\end{document}

enter image description here

| improve this answer | |

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.