diff options
author | Karl Berry <karl@freefriends.org> | 2017-11-17 22:18:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-11-17 22:18:08 +0000 |
commit | 52f5a6fb83e0ac58c9bf3cd7c6faf21e26218463 (patch) | |
tree | 19042f8e64fa18aa478c2f5283b79c0e99e8e5ce /Master/texmf-dist/tex/lualatex/novel/novel.cls | |
parent | 391cfb2ba71abd1145f54ac3865e19aab5fe89d4 (diff) |
novel (17nov17)
git-svn-id: svn://tug.org/texlive/trunk@45839 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/novel/novel.cls')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/novel/novel.cls | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/lualatex/novel/novel.cls b/Master/texmf-dist/tex/lualatex/novel/novel.cls index 9e0e2d3f223..84ff490d429 100644 --- a/Master/texmf-dist/tex/lualatex/novel/novel.cls +++ b/Master/texmf-dist/tex/lualatex/novel/novel.cls @@ -17,9 +17,10 @@ %% \NeedsTeXFormat{LaTeX2e}[1995/12/01] % Actually needs LuaLaTeX, at least version 0.95 from TeXLive 2016. -\ProvidesClass{novel}[2017/11/12 v1.43.1 LaTeX document class] +\ProvidesClass{novel}[2017/11/17 v1.46 LaTeX document class] %% -%% Version 1.44: General cleanup of docs and code, for improved readbaility. +%% Version 1.46: Possibly final version. +%% Version 1.43: General cleanup of docs and code, for improved readbaility. %% Version 1.42: Greatly improved HTML documentation. %% Version 1.41: Improved HTML documentation. %% Versions 1.40.x: Incremental minor changes, leading to 1.42. @@ -239,6 +240,14 @@ \DeclareOption{polyoff}{ \@polyofftrue } +% New in version 1.46: test option, primarily for developer use. +% Throws error if Liberintus and Latin Modern Roman fonts are unavailable. +% Throws error is file novel-testimage.png is not in same folder. +% Lets \lettrine relax if `lettrine' package not loaded. +\newif \if@testsuite +\DeclareOption{test}{ + \@testsuitetrue +} %% Note that document size and normal font size are not class options. %% They are set by commands in the Preamble, and have default values. % @@ -347,6 +356,25 @@ \RequirePackage{novel-Footnotes} %% + +%% Special features of test suite. +%% ----------------------------------------------------------------------------- +\newcommand\testsuiteoops[1]{% + \ClassError{novel}{#1 missing}{Install the necessary file(s).}% +} +\if@testsuite + \IfFontExistsTF{libertinusserif-regular.otf}{}{\testsuiteoops{`libertinus' fonts}} + \IfFileExists{lmodern.sty}{}{\testsuiteoops{`lmodern' package}} + \IfFileExists{novel-testimage.png}{}{\testsuiteoops{`novel-testimage.png'}} + \NewFontFamily\mustbelibertinus{Libertinus Serif} + \NewFontFamily\mustbelmodern{Latin Modern Roman} +\fi +\AtBeginDocument{\@ifpackageloaded{lettrine}{}% + {\DeclareDocumentCommand\lettrine{ O{} m m }{#2#3}}% +} +%% end special features of test suite. + + %% \AtEndPreamble sets defaults and calculates layout %% ----------------------------------------------------------------------------- \AtEndPreamble{ @@ -368,14 +396,36 @@ %% \AtBeginDocument finishes the setup %% ----------------------------------------------------------------------------- +\newlength\normalparindent \AtBeginDocument{ % + \@ifpackageloaded{lettrine}{% + \LettrineOnGridtrue% + \setlength\DiscardVskip{10\nbs}% effectively infinite + \global\DiscardVskip=\DiscardVskip% + \setlength\DefaultFindent{0.25em}% about one space + \global\DefaultFindent=\DefaultFindent% + \setlength\DefaultNindent{0em}% uniform gap + \global\DefaultNindent=\DefaultNindent% + \setcounter{DefaultLines}{3}% more likely than 2. + }{}% % Find some useful measurements: + \setlength\normalparindent{\parindent} + \global\normalparindent=\parindent \gdef\@normalxheight{\heightof{x}} \setlength\normalxheight{\@normalxheight} \global\normalxheight=\normalxheight \gdef\@normalXheight{\heightof{X}} \setlength\normalXheight{\@normalXheight} \global\normalXheight=\normalXheight + \gdef\@normalscxheight{\heightof{\textsc{x}}} + \setlength\normalscxheight{\@normalscxheight} + \global\normalscxheight=\normalscxheight + \gdef\@normalAringheight{\heightof{Å}} + \setlength\normalAringheight{\@normalAringheight} + \global\normalAringheight=\normalAringheight + \gdef\@normaldescender{\depthof{gjpqy}} + \setlength\normaldescender{\@normaldescender} + \global\normaldescender=\normaldescender % Activate user choice of whether or not to indent after scenebreak commands: \if@indentAfterScenebreak\else \NoIndentAfterCmd{\scenebreak} |