summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-04-29 23:01:28 +0000
committerKarl Berry <karl@freefriends.org>2018-04-29 23:01:28 +0000
commit07e8af9baf7a1fb3ae90901b8fe31460a80cb2d2 (patch)
tree942288a55a6debbd3540eba18c0751a5508819e1 /Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty
parent962840188681e1d6f4aec0ebf07e05a70609325d (diff)
novel (26apr18)
git-svn-id: svn://tug.org/texlive/trunk@47492 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty')
-rw-r--r--Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty54
1 files changed, 48 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty b/Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty
index a1bc3e2ec26..e297eeacd34 100644
--- a/Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty
+++ b/Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty
@@ -13,7 +13,7 @@
%%
%%
\ProvidesFile{novel-ChapterScene.sty}%
-[2018/04/07 v1.50.4 LaTeX file (chapter and scene macros)]
+[2018/04/26 v1.52 LaTeX file (chapter and scene macros)]
%%
@@ -94,18 +94,60 @@
% Default behavior is \noindent for following paragraph.
% Use \SetScenebreakIndent{true or false} in Preamble to change globally.
% Either way, local behavior changed using \forceindent or \backindent.
-\newcommand\scenebreak{\null}
+% \newcommand\scenebreak{\null}
+%
+\newcommand\scenebreak{% revised in version 1.52.
+ \leavevmode\getBreakpos{scenebreak}~\par
+}
%
\newcommand\sceneline{%
- \noindent\hfil%
+ \noindent\getBreakpos{sceneline}\hfil%
\raisebox{0.2em}{\rule{0.35\textwidth}{.4pt}}\hfil\par%
}
%
\newcommand\scenestars{%
- \noindent\hfil%
+ \noindent\getBreakpos{scenestars}\hfil%
\raisebox{-.3em}{*\quad\quad*\quad\quad*}\hfil\par%
}
-%% end scene changes
+%
+\gdef\getBreakpos#1{%
+ \begingroup%
+ \savepos%
+ \protected@write\@auxout{}{%
+ \protect\@getBreakpos{\noexpand\number\lastypos}{\thepage}{#1}%
+ }%
+ \endgroup%
+}
+%
+\newlength\CurrentBreakpos
+\gdef\@getBreakpos#1#2#3{} % nothing, when reading aux at beginning
+\gdef\@RedefineBreakpos{ % called by `novel.cls' \AtBeginDocument
+ \gdef\@getBreakpos##1##2##3{% numerical position sp, page, break type
+ \gsetlength\CurrentBreakpos{##1sp}% measured up from very bottom of page.
+ \FPsub{\@BreakLines}{\strip@pt\TotalYpos}{\strip@pt\CurrentBreakpos}
+ \FPdiv{\@BreakLines}{\@BreakLines}{\strip@pt\nbs}%
+ \FPround{\@BreakLines}{\@BreakLines}{0}% integer lines from text top
+ \ifthenelse{\equal{##3}{scenebreak}}{%
+ \xdef\thisline{\@BreakLines}%
+ \ifnum\@BreakLines=1%
+ \ClassWarning{novel}{Replace \string\scenebreak\space at top of ^^J%
+ page ##2 with \string\sceneline\space or \string\scenestars.}%
+ \fi%
+ \ifnum\@BreakLines=\@LinesPerPage%
+ \ClassWarning{novel}{Replace \string\scenebreak\space at bottom of ^^J%
+ page ##2 with \string\sceneline\space or \string\scenestars.}%
+ \fi%
+ }{}%
+ \FPsub{\@nearthebottom}{\@LinesPerPage}{1}%
+ \ifnum\@BreakLines=2%
+ \ClassWarning{novel}{\string\ ##3 too close to top of page ##2.}%
+ \fi%
+ \ifnum\@BreakLines=\@nearthebottom%
+ \ClassWarning{novel}{\string\ ##3 too close to bottom of page ##2.}%
+ \fi%
+ }%
+} % end @RedefineBreakpos
+%%
%% Repair \FirstLine{} command from `magaz' package.
@@ -194,7 +236,7 @@
\vspace{\@fixlines\nbs}%
\if@DeleteCSline\else\null\fi% adjusts when dropfolioinside
\global\@WithinChapterStartfalse%
- \vspace{\@NovelCaulk}%
+ \vspace{0.1pt plus 0pt minus 0.2pt}% caulk
\gsetlength\parindent{\normalparindent}% restored
\nov@AfterGroup\NoIndentAfterThis% etextools and noindentafter
}