From 690fc603e30dce51fae3d86c8d46548e795981cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Louren=C3=A7o?= Date: Thu, 28 Mar 2024 13:53:50 +0000 Subject: [PATCH] Fixes #497. --- Chapters/appendix1.tex | 6 +++++ Chapters/appendix2.tex | 6 +++-- novathesis.cls | 50 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/Chapters/appendix1.tex b/Chapters/appendix1.tex index 337d7399..56e8aa26 100644 --- a/Chapters/appendix1.tex +++ b/Chapters/appendix1.tex @@ -48,3 +48,9 @@ \chapter{\emph{NOVAthesis} covers showcase} % cover-ips-ests-msc, % cover-other-mscgt-msc% % } + +\lipsum[1-20] + +\section{A section here} + +\lipsum[1-20] diff --git a/Chapters/appendix2.tex b/Chapters/appendix2.tex index 34926f27..78daf38d 100644 --- a/Chapters/appendix2.tex +++ b/Chapters/appendix2.tex @@ -8,13 +8,15 @@ \typeout{NT FILE appendix2.tex}% -\begin{newpdflayout}{297mm}{420mm} +\begin{newpdflayout}{210mm}{297mm}%{420mm} \chapter{Appendix 2 Lorem Ipsum} \label{app:lorem_ipsum2} This is a test with citing something~\cite{ecoop12-dias} in the appendix. -\lipsum[1-5] +\lipsum[1-10] \end{newpdflayout} + +\lipsum[1-10] diff --git a/novathesis.cls b/novathesis.cls index 50c3b764..13c44de7 100644 --- a/novathesis.cls +++ b/novathesis.cls @@ -1270,12 +1270,20 @@ % -------------------------------------------------------- % Customize the pagestyle +\newcommand{\rightorleftmark}{% + \setbox0=\hbox{\rightmark} + \ifdim\wd0>0.1pt\relax + \rightmark + \else + \leftmark + \fi +} \makepagestyle{novathesis@mainmatter} \makeoddfoot{novathesis@mainmatter}{}{\thepage}{} \makeevenfoot{novathesis@mainmatter}{}{\thepage}{} \makeheadrule{novathesis@mainmatter}{\textwidth}{\normalrulethickness} \makeevenhead{novathesis@mainmatter}{\small\textsc{\leftmark}}{}{} -\makeoddhead{novathesis@mainmatter}{}{}{\small\textsc{\rightmark}} +\makeoddhead{novathesis@mainmatter}{}{}{\small\rightorleftmark} \makepagestyle{novathesis@frontmatter} \makeoddfoot{novathesis@frontmatter}{}{\thepage}{} @@ -2236,6 +2244,11 @@ } \newenvironment{newpdflayout}[3][]{% + % \typeout{textheight=\the\textheight} + % \typeout{textwidth=\the\textwidth} + % \AAAA + \let\oldstockheight=\stockheight + \let\oldstockwidth=\stockwidth \clearforchapter \begingroup \setstocksize{#2}{#3} @@ -2254,6 +2267,38 @@ \checkandfixthelayout[fixed] \setpdftexpagesize % From geometry + % \typeout{textheight=\the\textheight} + % \typeout{textwidth=\the\textwidth} + % \BBBB + \setlength{\@colht}{\textheight} + \setlength{\@colroom}{\textheight}% + \setlength{\vsize}{\textheight} + \setlength{\columnwidth}{\textwidth}% + \if@twocolumn% + \advance\columnwidth-\columnsep + \divide\columnwidth\tw@% + \@firstcolumntrue% + \fi% + \setlength{\hsize}{\columnwidth}% + \setlength{\linewidth}{\hsize}% +}{% + \clearforchapter% + \endgroup% + \setstocksize{\oldstockheight}{\oldstockwidth} + \settrimmedsize{\oldstockheight}{\oldstockwidth}{*} + \paperwidth=\stockwidth + \paperheight=\stockheight + \setlrmarginsandblock% + {\themargin(\option{/novathesis/media},left)}% + {\themargin(\option{/novathesis/media},right)}% + {*}% + \setulmarginsandblock% + {\themargin(\option{/novathesis/media},top)}% + {\themargin(\option{/novathesis/media},bottom)}% + {*}% + \checkandfixthelayout[fixed] + \setpdftexpagesize + % From geometry \setlength{\@colht}{\textheight} \setlength{\@colroom}{\textheight}% \setlength{\vsize}{\textheight} @@ -2265,7 +2310,8 @@ \fi% \setlength{\hsize}{\columnwidth}% \setlength{\linewidth}{\hsize}% -}{\clearforchapter\endgroup} + \clearforchapter% +} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%