|
38 | 38 |
|
39 | 39 | \pagestyle{fancy} |
40 | 40 | \fancyhead[LE,RO]{\thepage} |
41 | | -\fancyhead[CO,CE]{\rightmark} |
| 41 | +\fancyhead[CO,CE]{\bookString\ \thepart.~\rightmark} |
42 | 42 | \fancyhead[LO,RE]{} |
43 | 43 | \fancyfoot[LE,RO]{} |
44 | 44 | \fancyfoot[CO,CE]{} |
|
190 | 190 | %\hskip -\LettrineTotalWidth \hskip -\parindent \offset[y=\LettrineTotalHeightMinusLine,x=0pt]{\hbox{\putLettrine{#1}}}{\sc\hskip\LettrinePadding \ctxlua{formatting.dedent([==[#2]==])}\ \it #3} \vskip \baselineskip |
191 | 191 | %} |
192 | 192 |
|
193 | | -\newdimen\vPos |
194 | 193 | \newdimen\vThreshold |
| 194 | +\newdimen\ProblemHeight |
| 195 | +\newdimen\FirstLineHeight |
| 196 | +\newbox\FirstLineBox |
195 | 197 | \newcommand{\problem}[4][4]{% |
196 | 198 | \createNewHypothesisLabel% |
197 | 199 | \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% |
209 | 213 | \fi% |
210 | 214 | \resetInitialIndentation% |
211 | 215 | } |
|
534 | 538 | \newcommand{\starttheoremAZ}[2][-1]{\prepropositionskip\startpropositionAZdiv[#1]{#2}} |
535 | 539 |
|
536 | 540 | \newcommand{\prepropositionskip}{% |
| 541 | + \def\tmpbeforeskip{\baselineskip}% |
| 542 | + \def\tmpafterskip{\baselineskip}% |
537 | 543 | \ifnum\pagetotal>0% |
538 | | - \def\tmpbeforeskip{\baselineskip}% |
539 | | - \def\tmpafterskip{\baselineskip}% |
540 | 544 | \def\tmpstyle{\large\centering}% |
541 | 545 | \else% |
542 | | - ~\vskip -3\baselineskip~ |
| 546 | + ~\vspace{-3\baselineskip}~ |
543 | 547 | \def\tmpbeforeskip{0pt}% |
544 | | - \def\tmpafterskip{0pt}% |
| 548 | + \def\tmpafterskip{0.01pt}% 0pt for some reason causes headers to break |
545 | 549 | \def\tmpstyle{\phantom}% |
546 | 550 | \fi% |
547 | 551 | } |
|
0 commit comments