Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[twoside]{article}
- \usepackage{lipsum}
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \let\Sectionmark\sectionmark
- \def\sectionmark#1{\def\Sectionname{#1}\Sectionmark{#1}}
- \let\Subsectionmark\subsectionmark
- \def\subsectionmark#1{\def\Subsectionname{#1}\Subsectionmark{#1}}
- \fancyhf{}
- \fancyhead[CE]{\Sectionname}
- \fancyhead[CO]{\Subsectionname}
- \begin{document}
- \section{Section 1}
- \lipsum[1-2]
- \subsection{Subsection 1.1}
- \lipsum[1-18]
- \section{Section 2}
- \subsectionmark{}
- \lipsum[1-4]
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment