code_junkie

How can one keep a section{} from being at the end of a page in LaTeX

Nov 14th, 2011
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. section{Heading}
  2.  
  3. Here is some text after the heading.
  4.  
  5. usepackage{titlesec}
  6. titleformat{chapter}[display]
  7. {normalfonthugebfseries}{chaptertitlename thechapter}{20pt}{Huge}
  8. titleformat{section}
  9. {normalfontLargebfseries}{thesection}{1em}{}
  10. titleformat{subsection}
  11. {normalfontlargebfseries}{thesubsection}{1em}{}
  12. titleformat{subsubsection}
  13. {normalfontnormalsizebfseries}{thesubsubsection}{1em}{}
  14. titleformat{paragraph}[runin]
  15. {normalfontnormalsizebfseries}{theparagraph}{1em}{}
  16. titleformat{subparagraph}[runin]
  17. {normalfontnormalsizebfseries}{thesubparagraph}{1em}{}
  18. titlespacing*{chapter} {0pt}{50pt}{40pt}
  19. titlespacing*{section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
  20. titlespacing*{subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
  21. titlespacing*{subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
  22. titlespacing*{paragraph} {0pt}{3.25ex plus 1ex minus .2ex}{1em}
  23. titlespacing*{subparagraph} {parindent}{3.25ex plus 1ex minus .2ex}{1em}
  24.  
  25. widowpenalty=1000
  26. clubpenalty=1000
  27.  
  28. documentclass[oneside,12pt]{article}
  29. defoneline{%
  30. text text text text abc def ghi text
  31. text text text text abc def ghi text
  32. text
  33. }
  34. deffiveline{onelineonelineonelineonelineonelinepar}
  35. deftwentyfiveline{fivelinefivelinefivelinefivelinefiveline}
  36. begin{document}
  37. section{one}
  38. twentyfiveline
  39. %oneline
  40. section{two}
  41. twentyfiveline
  42. end{document}
Add Comment
Please, Sign In to add comment