Skip to content

Commit c455bc1

Browse files
committed
spacing fixed for shorter problems, not-working headers fixed
1 parent a3aae12 commit c455bc1

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

byrnebook.cls

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
\pagestyle{fancy}
4040
\fancyhead[LE,RO]{\thepage}
41-
\fancyhead[CO,CE]{\rightmark}
41+
\fancyhead[CO,CE]{\bookString\ \thepart.~\rightmark}
4242
\fancyhead[LO,RE]{}
4343
\fancyfoot[LE,RO]{}
4444
\fancyfoot[CO,CE]{}
@@ -190,22 +190,26 @@
190190
%\hskip -\LettrineTotalWidth \hskip -\parindent \offset[y=\LettrineTotalHeightMinusLine,x=0pt]{\hbox{\putLettrine{#1}}}{\sc\hskip\LettrinePadding \ctxlua{formatting.dedent([==[#2]==])}\ \it #3} \vskip \baselineskip
191191
%}
192192

193-
\newdimen\vPos
194193
\newdimen\vThreshold
194+
\newdimen\ProblemHeight
195+
\newdimen\FirstLineHeight
196+
\newbox\FirstLineBox
195197
\newcommand{\problem}[4][4]{%
196198
\createNewHypothesisLabel%
197199
\pictureIndent=0cm%
198-
\vPos=\pagetotal%
199-
\vThreshold=5\baselineskip%
200-
\initialIndentation[#1]{7}%
201-
%\vbox{\hbox{\putLettrine{#2}}\vskip -\LettrineSize\vskip -0.5\baselineskip}%
202-
\noindent{\raisebox{0pt}[0pt][0pt]{\hskip-\LettrineSize\hskip-5pt\raisebox{0.5\baselineskip}{\raisebox{-\LettrineSize}{\putLettrine{#2}}}\hskip2pt}\textsc{\directlua{formatting.dedent([==[#3]==])}}}\textit{ #4}%
203-
\vskip \baselineskip%
204-
\advance\vPos by -\pagetotal%
205-
\vPos=-\vPos%
206-
\ifnum\vPos<\vThreshold%
207-
\vspace{-\vPos}%
208-
\vspace{4\baselineskip}%
200+
\vThreshold=4\baselineskip%
201+
\setbox0=\vbox{\initialIndentation[#1]{7}\noindent\vadjust{\break}{\raisebox{0pt}[0pt][0pt]{\hskip-\LettrineSize\hskip-5pt\raisebox{0.5\baselineskip}{\raisebox{-\LettrineSize}{\putLettrine{#2}}}\hskip2pt}\textsc{\directlua{formatting.dedent([==[#3]==])}}}\textit{ #4}%
202+
\vskip 0.5\baselineskip}%
203+
\ProblemHeight=\ht0%
204+
\setbox2=\copy0
205+
\setbox4=\vsplit2 to \maxdimen
206+
\setbox4=\vbox{\unvbox4 \global\setbox\FirstLineBox=\lastbox}%
207+
\FirstLineHeight=\ht\FirstLineBox%
208+
\advance\ProblemHeight by -\FirstLineHeight%
209+
\box0%
210+
\ifnum\ProblemHeight<\vThreshold%
211+
\vskip -\ProblemHeight%
212+
\vskip 4\baselineskip%
209213
\fi%
210214
\resetInitialIndentation%
211215
}
@@ -534,14 +538,14 @@
534538
\newcommand{\starttheoremAZ}[2][-1]{\prepropositionskip\startpropositionAZdiv[#1]{#2}}
535539

536540
\newcommand{\prepropositionskip}{%
541+
\def\tmpbeforeskip{\baselineskip}%
542+
\def\tmpafterskip{\baselineskip}%
537543
\ifnum\pagetotal>0%
538-
\def\tmpbeforeskip{\baselineskip}%
539-
\def\tmpafterskip{\baselineskip}%
540544
\def\tmpstyle{\large\centering}%
541545
\else%
542-
~\vskip -3\baselineskip~
546+
~\vspace{-3\baselineskip}~
543547
\def\tmpbeforeskip{0pt}%
544-
\def\tmpafterskip{0pt}%
548+
\def\tmpafterskip{0.01pt}% 0pt for some reason causes headers to break
545549
\def\tmpstyle{\phantom}%
546550
\fi%
547551
}

0 commit comments

Comments
 (0)