summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-10-19 21:28:46 +0000
committerKarl Berry <karl@freefriends.org>2017-10-19 21:28:46 +0000
commit65c87b552bf411a1a352dd55485976609b28911c (patch)
tree2aaa281526ee99e4550198fa55deddb342fc161e /Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty
parentb88e60ca81fae4479f3368d4741b6d314417aee8 (diff)
novel (19oct17)
git-svn-id: svn://tug.org/texlive/trunk@45558 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty')
-rw-r--r--Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty104
1 files changed, 52 insertions, 52 deletions
diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty b/Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty
index debfd50c6db..929fd9718de 100644
--- a/Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty
+++ b/Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty
@@ -13,11 +13,11 @@
%%
%%
\ProvidesFile{novel-LayoutSettings.sty}%
-[2017/10/04 v1.42 LaTeX file (layout settings)]
+[2017/10/19 v1.43 LaTeX file (layout settings)]
%%
-%% Note that nearly all layout settings are preconfigured based on Trim Size.
+%% Note that nearly all layout settings are pre-configured based on Trim Size.
%% In general, these user commands may be used to over-ride the presets.
\newlength\Old@TrimWidth % finished width of printed book
@@ -65,8 +65,6 @@
% Note: This class does not ask you to set the width/height of the textblock.
% Instead, these values are automatically calculated from other dimensions.
%
-
-%
% \SetTrimSize{}{} width and height of printed book.
\newcommand\SetTrimSize[2]{%
\global\@TrimSizeSettrue
@@ -346,6 +344,22 @@
%%
+%% New in version 1.44: flexible images (without built-in resolution dpi)
+\gdef\@novimgres{300} % default (can only be set once)
+\gdef\@novereserror{%
+ \ClassError{novel}{\string\SetFlexResolution\space bad value}%
+ {Resolution must be integer from 200 to 9600. Default 300.}%
+}
+\newcommand\SetFlexResolution[1]{
+ \IfInteger{#1}{ %
+ \FPiflt{#1}{200}\@novereserror\else\fi %
+ \FPifgt{#1}{9600}\@novereserror\else\fi %
+ \gdef\@novimgres{#1} %
+ }{\@novreserror}
+}
+%
+
+
%% Markers (superscript, subscripts):
\newtoggle{@usesymbolmark} % true when footnote markers are symbolic
\newtoggle{@realmarker} % true when OT features sups, sinf, subs requested
@@ -495,57 +509,43 @@
%% --------------------------------------------------------------------------
%% Prior to v. 1.1, parentfont was known as masterfont. Backwards compatible.
%
-\providecommand\rmdefault{lmr} % should be lmr anyway, at this point.
-\LetLtxMacro\@noveloldrmdefault\rmdefault\relax % stored for later comparison.
+% These are the LaTeX defaults, which should already be built-in by now.
+% But just in case they are undefined, here they are set to LaTeX defaults:
+\providecommand\rmdefault{lmr}
+\providecommand\sfdefault{lmss}
+\providecommand\ttdefault{lmtt}
% The `no-math' option prevents fontspec from tracking certain font changes.
% This is probably necessary, since novel does some of its own font tracking:
\RequirePackage[no-math]{fontspec} % For LuaLaTeX. NOT package `fontenc'.
-% You shouldn't be doing math! You can use \setmathfont, if you wish.
-% If you must load a math font package, it should be done using
-% \RequirePackage before (yes, before) calling the document class.
-\RequirePackage{unicode-math}
-%
-% Math font no kern:
+\defaultfontfeatures{} % reset
\defaultfontfeatures{SmallCapsFeatures={Renderer=Basic},Ligatures=TeX,}
+% Main and sans fonts: kerning, ligatures, and OldStyle numbers if available:
+\defaultfontfeatures[\rmfamily,\sffamily]{Kerning=On,Numbers=OldStyle,Ligatures=Common}
+% Package `unicode-math' uses Latin Modern Math as default math font:
+\RequirePackage{unicode-math}
%
-\IfFontExistsTF{Libertinus Math}
-{\setmathfont{Libertinus Math}}
-{\IfFontExistsTF{Asana Math}
- {\setmathfont{Asana Math}}
- {\IfFontExistsTF{STIX Math}
- {\setmathfont{STIX Math}}
- {\setmathfont{Latin Modern Math}} % last choice
- }
-}% end \IfFontExistsTF nest.
-% For user-created font commands:
-\defaultfontfeatures{SmallCapsFeatures={Renderer=Basic},Kerning=On,Ligatures=TeX,}%
-%%
%% This could have been easier, but fontspec allows mandatory and optional
% arguments to appear in either order. We wish to store the fontnames
% and arguments, but need Expl syntax to tell which is which.
-\ExplSyntaxOn
%% Store settings for the parent font:
% \AtEndPreamble, the parent font becomes becomes
% the default ancestor of all novel-defined fonts, except the deco font.
\newif \if@parentfontset
-\gdef\@parentfontfeatures{}
-\gdef\@parentfontname{}
-\gdef\parentfontfeatures{} % for convenience
-\gdef\parentfontname{} % for convenience
+\gdef\parentfontfeatures{}
+\gdef\parentfontname{}
\DeclareDocumentCommand \SetParentFont { O{} m O{} } {% from version 1.1.
\novel@checkfeatures{#1,#3}
- \gdef\@parentfontfeatures{#1,#3}
- \gdef\@parentfontname{#2}
- \gdef\parentfontfeatures{#1,#3} % for convenience
- \gdef\parentfontname{#2} % for convenience
+ \gdef\parentfontfeatures{#1,#3}
+ \gdef\parentfontname{#2}
\global\@parentfontsettrue
}%
\DeclareDocumentCommand \SetMasterFont { O{} m O{} } {% DEPRECATED
\novel@checkfeatures{#1,#3}
- \gdef\@parentfontfeatures{#1,#3}
- \gdef\@parentfontname{#2}
+ \gdef\parentfontfeatures{#1,#3}
+ \gdef\parentfontname{#2}
\global\@parentfontsettrue
}%
+
%% Store settings for the chapterfont:
% The chapter font is used by the \ChapterTitle{} command.
\newif \if@chapterfontset
@@ -553,7 +553,7 @@
\gdef\@chapterfontname{}
\DeclareDocumentCommand \SetChapterFont { O{} m O{} } {%
\novel@checkfeatures{#1,#3}
- \gdef\@chapterfontfeatures{#1,#3}
+ \gdef\@chapterfontfeatures{Numbers=Lining,#1,#3}
\gdef\@chapterfontname{#2}
\global\@chapterfontsettrue
}%
@@ -564,7 +564,7 @@
\gdef\@subchfontname{}
\DeclareDocumentCommand \SetSubchFont { O{} m O{} } {%
\novel@checkfeatures{#1,#3}
- \gdef\@subchfontfeatures{#1,#3}
+ \gdef\@subchfontfeatures{Numbers=Lining,#1,#3}
\gdef\@subchfontname{#2}
\global\@subchfontsettrue
}%
@@ -573,9 +573,10 @@
\newif \if@headfontset
\gdef\@headfontfeatures{}
\gdef\@headfontname{}
-\DeclareDocumentCommand \SetHeadFont { O{} m O{} } {%
+\DeclareDocumentCommand \SetHeadFont { O{} m O{} } {% revised v 1.40.3
\novel@checkfeatures{#1,#3}
- \gdef\@headfontfeatures{WordSpace=\@looseheadword,LetterSpace=\@loosehead,#1,#3} % revised in v. 1.40.3.
+ \gdef\@headfontfeatures{Numbers=Lining,%
+ WordSpace=\@looseheadword,LetterSpace=\@loosehead,#1,#3}
\gdef\@headfontname{#2}
\global\@headfontsettrue
}%
@@ -588,29 +589,22 @@
\gdef\@decofontname{}
\DeclareDocumentCommand \SetDecoFont { O{} m O{} } {%
\novel@checkfeatures{#1,#3}
- \gdef\@decofontfeatures{#1,#3}
\gdef\@decofontname{#2}
\global\@decofontsettrue
\global\@gotdecotrue
\newfontface\decofont[#1,#3]{#2}
}%
-%
-\msg_set:nnnn {fontspec} {font-not-found} { % rewrites the standard message
- Font~ "#1"~ cannot~ be~ found.
- }{
- If~the~missing~font~is~Libertinus~or~Libertine~or~Biolinum~or~NovelDeco,\\
- see~the~`novel'~class~documents~for~help.\\
- If~the~missing~font~is~anything~else,~then~the~missing~font~is\\
- not~caused~by~`novel'~class.\\
-}%
%% For syntax consistency:
+\ExplSyntaxOn
\cs_new_eq:NN \NewFontFamily \newfontfamily
\cs_new_eq:NN \NewFontFace \newfontface
\cs_new_eq:NN \SetSansFont \setsansfont
\cs_new_eq:NN \SetMonoFont \setmonofont
+
\cs_new_eq:NN \SetMathFont \setmathfont
\cs_new_eq:NN \AddFontFeatures \addfontfeatures
\cs_new_eq:NN \AddFontFeature \addfontfeatures
+\ExplSyntaxOff
%%
%% \CreateFontFeature{substitutions}{feature code}
% Problem: Font has one or more alternate glyphs that you would like to use,
@@ -649,8 +643,6 @@
}
} %% end \CreateFontFeature. Above thanks to fontspec 2016.
%%
-\ExplSyntaxOff
-%%
%% end definition of parent and other fonts.
@@ -765,7 +757,15 @@
%% polyglossia
% Language-specific settings:
-\RequirePackage{polyglossia} % loading order changed in v. 1.40.3.
+\if@polyoff % polyoff is new in v 1.44.
+ \ClassWarning{novel}{^^JYou chose the `polyoff' class option.^^J%
+ So, the polyglossia package was not loaded. But like it or not,^^J%
+ the babel package was loaded, with generic hyphenation.^^J%
+ This behavior, or choice of language, cannot be changed.^^J%
+ If you want a specific language, you will have to use polyglossia.^^J}%
+\else
+ \RequirePackage{polyglossia} % loading order changed in v. 1.40.3.
+\fi
%% end polyglossia