Advertisement
Guest User

D.C.s heading fix for N.L. with two additions by N.L.

a guest
Feb 28th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.64 KB | None | 0 0
  1. \documentclass[paper=a5,pagesize]{scrartcl}
  2. \usepackage{blindtext,xcolor,tikz,eso-pic,titlesec}
  3.  
  4. \setkomafont{section}{\normalsize}
  5. %-------------------------------------- new
  6. \setkomafont{subsection}{\normalsize}
  7. %-------------------------------------------
  8.  
  9. % baseline grid
  10. \AddToShipoutPicture{%
  11. \AtTextLowerLeft{
  12.    \begin{tikzpicture}[overlay,remember picture]%
  13.         \draw[red!10!white,thin]%
  14.              (current page.south west) grid[step=\baselineskip]%
  15.              (current page.north east);%
  16.     \end{tikzpicture}%
  17.     }%
  18. }
  19.  
  20. % spacing for headings
  21. \titlespacing*{\section}{0em}{2\baselineskip}{\baselineskip}
  22. \titlespacing*{\subsection}{0em}{.5\baselineskip}{0.5\baselineskip}
  23. \titlespacing*{\subsubsection}{0em}{\baselineskip}{0em}
  24.  
  25.  
  26.  
  27. %% workaround
  28. %\titlespacing*{\subsection}{0em}{1\baselineskip}{0.5\baselineskip}
  29. %\titleformat{\subsection}{\sectfont{\color{white}\titlerule[0.6\baselineskip]}}{\thesubsection}{1ex}{}
  30.  
  31. \makeatletter
  32. \def\xsubsection{subsection}
  33. \let\oldttl@straight@ii\ttl@straight@ii
  34. \def\ttl@straight@ii #1#2#3#4#5#6#7{%
  35. \def\tmp{#6}%
  36. \ifx\tmp\xsubsection
  37. \null\nobreak
  38. \fi
  39. \oldttl@straight@ii{#1}{#2}{#3}{#4}{#5}{#6}{#7}}
  40.  
  41. \begin{document}
  42. \section{Lorem Ipsum}
  43. \Blindtext
  44. \subsection{Lorem Ipsum}
  45. \Blindtext\newpage
  46. {\tracingall
  47. \subsection{Lorem Ipsum}}
  48. \Blindtext
  49. \subsubsection{Lorem Ipsum}
  50. \Blindtext
  51. %-------------------------------------- new
  52. \subsection{Lorem Ipsum}
  53. \Blindtext\Blindtext
  54. \subsection{Lorem Ipsum}
  55. \Blindtext\Blindtext\Blindtext
  56. \subsection{Lorem Ipsum}
  57. \Blindtext\Blindtext\Blindtext\Blindtext
  58. %------------------------------------------
  59. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement