LaTeX forum ⇒ Page LayoutIBM Technical Handbook - Chapter in black box

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
darkcruix
Posts: 2
Joined: Sat Aug 22, 2020 5:25 pm

IBM Technical Handbook - Chapter in black box

Postby darkcruix » Sat Aug 22, 2020 5:30 pm

I am trying to mimic the IBM manuals with a black box and white text towards the outside of a page to have a visual marker when looking from the side of the page.
Example here e.g. on page 20 http://www.minuszerodegrees.net/manuals/IBM_5150_Technical_Reference_6322507_APR84.pdf

I could create the box and that simulates it, but not as part of a chapter marker on each page:
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{article}
  2. \usepackage[explicit]{titlesec}
  3. \usepackage{xcolor}
  4. \usepackage{lipsum}
  5. \usepackage{array}
  6. \usepackage{makecell}
  7. \usepackage{graphicx}
  8. \usepackage{titlesec}
  9. \newdimen\parboxheight
  10. \makeatletter
  11. \newcommand*{\org@iiiparbox}{}
  12. \let\org@iiiparbox\@iiiparbox
  13. \renewcommand*{\@iiiparbox}[2]{%
  14. \ifx\relax#2%
  15. \setlength{\parboxheight}{0pt}%
  16. \else
  17. \setlength{\parboxheight}{#2}%
  18. \fi
  19. \org@iiiparbox{#1}{#2}%
  20. }
  21. \makeatother
  22. \setlength{\fboxsep}{-\fboxrule}
  23. \titleformat{\section}[display]
  24. {\normalfont\normalsize\bfseries}{}{0pt}{\colorbox{black}{\fbox{\parbox[][3.7cm][c]{1cm}{\centering\rotatebox{90}{\textcolor{white}{\thesection\quad#1}}}}}}
  25. \titleformat{name=\section,numberless}
  26. {\normalfont\normalsize\bfseries}{}{0em}{\colorbox{black}{\parbox{1cm}{\textcolor{white}{#1}}}}
  27.  
  28. \begin{document}
  29. \setlength{\fboxsep}{-\fboxrule}
  30. \section{Hardware}
  31. \lipsum[4]
  32. \section{Another Test Section}
  33. \lipsum[4]
  34. \section{Another Test Section with a long title spanning more than one line}
  35. \lipsum[4]
  36. \section*{An Unnumbered Test Section}
  37. \lipsum[4]
  38.  
  39. \end{document}
Last edited by cgnieder on Sun Aug 23, 2020 8:09 pm, edited 1 time in total.
Reason: Changed inline markup to block

darkcruix
Posts: 2
Joined: Sat Aug 22, 2020 5:25 pm

Postby darkcruix » Mon Aug 24, 2020 9:11 pm

To better describe it: I would like to have the Header (which should be exactly like the black box in the picture below with the Section name in it) displayed on every page within the section range:

Screen Shot 2020-08-24 at 21.07.24.png
Screen Shot 2020-08-24 at 21.07.24.png (258.68 KiB) Viewed 283 times


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 3 guests