diff options
author | Karl Berry <karl@freefriends.org> | 2017-03-02 22:04:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-03-02 22:04:43 +0000 |
commit | ed9d19652f40ee17941ba6832f511e3726a87747 (patch) | |
tree | 1363a8c132b7883bb1b8e0f87cb9ba89751d7bfc /Master/texmf-dist/tex | |
parent | e4e5bf0f152ea04be229a2747f8b3c2edc4407e7 (diff) |
novel (2mar17)
git-svn-id: svn://tug.org/texlive/trunk@43384 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
17 files changed, 5140 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-CGATSTR001.clo b/Master/texmf-dist/tex/lualatex/novel/novel-CGATSTR001.clo new file mode 100644 index 00000000000..ba1653ff03f --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-CGATSTR001.clo @@ -0,0 +1,15 @@ +% Typically used in the USA. Novel file version 1.0.6 + +% The values of the arguments are public industry standards. + +% Remember: TeX special characters must be backslashed here. +% You may see % or # or _ in the data or file names. +% Be sure that they are written as \% \# \_ or there will be trouble. + +% This identifier has spaces, even though file name has no spaces. +\gdef\@OIidentifier{CGATS TR 001} % also called "reference name" +\gdef\@OIcondition{SWOP (Publication) printing in USA (Printing process definition: ANSI CGATS.6).} +\gdef\@OIinfo{U.S. Web Coated (SWOP) v2} +\gdef\@OIregistry{http://www.color.org} +\gdef\@OIprofile{USWebCoatedSWOP.icc} + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-CalculateLayout.sty b/Master/texmf-dist/tex/lualatex/novel/novel-CalculateLayout.sty new file mode 100644 index 00000000000..92d38d8bf68 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-CalculateLayout.sty @@ -0,0 +1,679 @@ +%% +%% This is file `novel-CalculateLayout.sty', a custom file. +%% Copyright 2017 Robert Allgeyer. +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-CalculateLayout.sty}% +[2017/03/01 v1.0.6 LaTeX file (layout calculations)] +%% + + +%% +%% This file is loaded \AtEndPreamble, which precedes \AtBeginDocument. +%% + +\newlength\normalFontSize % becomes 1em in normal text, after \AtBeginDocument +\newlength\normalBaselineSkip % also abbreviated as \nbs + + +%% SET DEFAULT SIZES, AND INITIAL CORRECTIONS +%% ----------------------------------------------------------------------------- +%% +% Default Trim Size, if user does not set it. This is a popular size for +% US softcover fiction, and is close to a popular British size. +\if@TrimSizeSet\else + \SetTrimSize{5.5in}{8.5in} % width, height + \if@MediaSizeSet\else + \SetMediaSize{5.5in}{8.5in} + \fi +\fi +% Default margins are based on Trim Height, if user does not set margins. +% Works for standard w/h aspect ratios, but not for exotically narrow. +\if@MarginsSet\else + \ifthenelse{\dimtest{\Old@TrimHeight}{<}{8.99in}}{ % small sizes: + \global\setlength\Old@TopMargin{0.5in} + \global\setlength\Old@OutsideMargin{0.5in} + \global\setlength\Old@BottomMargin{0.5in} + \global\setlength\Old@InsideMargin{0.75in} + \global\setlength\New@TopMargin{0.5in} + \global\setlength\New@OutsideMargin{0.5in} + \global\setlength\New@BottomMargin{0.5in} + \global\setlength\New@InsideMargin{0.75in} + }{ % medium sizes: + \ifthenelse{\dimtest{\Old@TrimHeight}{<}{9.99in}}{ + \global\setlength\Old@TopMargin{0.75in} + \global\setlength\Old@OutsideMargin{0.75in} + \global\setlength\Old@BottomMargin{0.75in} + \global\setlength\Old@InsideMargin{1in} + \global\setlength\New@TopMargin{0.75in} + \global\setlength\New@OutsideMargin{0.75in} + \global\setlength\New@BottomMargin{0.75in} + \global\setlength\New@InsideMargin{1in} + }{ % large sizes: + \global\setlength\Old@TopMargin{1in} + \global\setlength\Old@OutsideMargin{1in} + \global\setlength\Old@BottomMargin{1in} + \global\setlength\Old@InsideMargin{1.25in} + \global\setlength\New@TopMargin{1in} + \global\setlength\New@OutsideMargin{1in} + \global\setlength\New@BottomMargin{1in} + \global\setlength\New@InsideMargin{1.25in} + } % end internal dimtest + } % end dimtest for margins. +\fi % end default margins +% +% Choose default font size based on Trim Width, unless font size set by user: +\if@FontSizeSet\else + \ifthenelse{\dimtest{\Old@TrimWidth}{<}{5.49in}}{ + \global\setlength\Old@FontSize{11pt} % smaller books + }{ + \ifthenelse{\dimtest{\Old@TrimWidth}{<}{6.24in}}{ + \global\setlength\Old@FontSize{11.4pt} % medium books + }{ + \global\setlength\Old@FontSize{12pt} % larger books + } % end internal dimtest + } % end dimtest for font size. +\fi +% +% Default lines/page based on Trim Height, font size, unless LPP set by user: +\if@LinesPerPageSet\else + \def\@tempOFSnum{\strip@pt\Old@FontSize} + \FPmul{\@tempOBSnum}{\@tempOFSnum}{1.3} % for a nice, uncramped baselineskip + \def\@tempTH{\strip@pt\Old@TrimHeight} + \def\@tempTM{\strip@pt\Old@TopMargin} + \FPsub{\@tempLH}{\@tempTH}{\@tempTM} + \FPsub{\@tempLH}{\@tempLH}{\@tempTM} % \@tempLH is available live height + \FPdiv{\@tempLPP}{\@tempLH}{\@tempOBSnum} + \FPsub{\@tempLPP}{\@tempLPP}{1.5} % allows for default header + \FPround{\@tempLPP}{\@tempLPP}{0} % integer + \FPclip{\@tempLPP}{\@tempLPP} % remove excess trailing 0. + \gdef\my@LinesPerPage{\@tempLPP} +\fi +% +% Correct bottom margin for descenders, assumed to be 0.3em: +\addtolength\Old@BottomMargin{0.3\Old@FontSize} +\addtolength\New@BottomMargin{0.3\Old@FontSize} +% Warn if user requests unrealistic HeadJump or FootJump: +\FPiflt{\@headjump}{1} + \ClassWarning{novel}{^^JYou requested \string\HeadJump<1. Unless you have^^J% + a very good reason for that, you had better increase it to at least 1.^^J}% +\else\fi +% +\FPiflt{\@footjump}{1} + \ClassWarning{novel}{^^JYou requested \string\FootJump<1. Unless you have^^J% + a very good reason for that, you had better increase it to at least 1.^^J}% +\else\fi +% +%% end set default sizes and initial corrections + + + +%% OLD, NEW, CURRENT, LIVE, TEXT MACRO DEFINITIONS +%% ----------------------------------------------------------------------------- +%% +% The `novel' class has a \Rework feature. This allows the user to compile +% a document using "old" settings" then re-compile using some "new" settings, +% without changing the paragraph structure or pagination. Not for everyone! +% The rework is done all at once, without requiring an additional pass. +% Here, the old and new values are compared, and the effect predicted. +% The reworked document has will have font size and baselineskip changed +% to meet the new size requirements. +% +% "Old" values come from preset values, depending on class Trim Size option. +% Or, the presets may be over-ridden using \Set---- commands. +% "New" values are initialized to "Old" or \Set---- as above. +% Then, they can be over-ridden using \Rework---- commands. +% "Current" values are the latest and greatest, as calculations progress. +% They are initialized to "Old" values." +% Widths and Heights are lengths, stored by \setlength. +% Expression ending in "Num" are pure numbers, suitable for FP calculations. +% "Live" refers to the area available to text (including header/footer). +% +% Find the Old and New Live Width and Height, and initialize +% Text Width and Height to Old Live. Initialize Font Size. +\newlength\Old@LiveWidth + \setlength\Old@LiveWidth{\Old@TrimWidth} + \addtolength\Old@LiveWidth{-\Old@OutsideMargin} + \addtolength\Old@LiveWidth{-\Old@InsideMargin} + \def\Old@LiveWidthNum{\strip@pt\Old@LiveWidth} +\newlength\Old@LiveHeight + \setlength\Old@LiveHeight{\Old@TrimHeight} + \addtolength\Old@LiveHeight{-\Old@TopMargin} + \addtolength\Old@LiveHeight{-\Old@BottomMargin} +\newlength\Current@FontSize + \setlength\Current@FontSize{\Old@FontSize} + \def\Current@FontSizeNum{\strip@pt\Current@FontSize} + \def\Old@FontSizeNum{\strip@pt\Old@FontSize} + \addtolength\Old@LiveHeight{-\Current@FontSizeNum pt} + \def\Old@LiveHeightNum{\strip@pt\Old@LiveHeight} +\newlength\Current@TextWidth + \setlength\Current@TextWidth{\Old@LiveWidth} + \def\Current@TextWidthNum{\strip@pt\Current@TextWidth} +\newlength\Current@TextHeight + \setlength\Current@TextHeight{\Old@LiveHeight} + \def\Current@TextHeightNum{\strip@pt\Current@TextHeight} +\newlength\New@LiveWidth + \setlength\New@LiveWidth{\New@TrimWidth} + \addtolength\New@LiveWidth{-\New@OutsideMargin} + \addtolength\New@LiveWidth{-\New@InsideMargin} + \def\New@LiveWidthNum{\strip@pt\New@LiveWidth} +\newlength\New@LiveHeight + \setlength\New@LiveHeight{\New@TrimHeight} + \addtolength\New@LiveHeight{-\New@TopMargin} + \addtolength\New@LiveHeight{-\New@BottomMargin} + \def\New@LiveHeightNum{\strip@pt\New@LiveHeight} +% +%% End old, new... macro definitions. + + + +%% PRELIMINARY CALCULATION OF BASELINESKIP +%% ----------------------------------------------------------------------------- +%% +% Get values of \@gotHeader and \@gotFooter booleans: +\@reserveHFspace % defined in `novel-LayoutSettings.sty'. +% Adjusted LinesPerPage will include header, footer, and added separations: +\let\adj@LinesPerPage\my@LinesPerPage % Start with the textblock lines. +% The footskip is always "there" even if no content. Remove it: +\FPsub{\adj@LinesPerPage}{\adj@LinesPerPage}{1} +% +\if@gotHeader % allow for header jump + \FPadd{\adj@LinesPerPage}{\adj@LinesPerPage}{\@headjump} +\fi +% +\if@gotFooter % allow for footer jump + \FPadd{\adj@LinesPerPage}{\adj@LinesPerPage}{\@footjump} +\fi +% +% Baseline Skip is Live Height divided by adjusted number of lines. +% Thus initially, Text (with header/footer) occupies full Live Height. +\newlength\Current@BaselineSkip +\FPdiv{\Current@BaselineSkipNum}{\Old@LiveHeightNum}{\adj@LinesPerPage} +% Check to see if Baseline Skip is insufficient: +\FPdiv{\@ratioBStoFS}{\Current@BaselineSkipNum}{\Current@FontSizeNum} +\FPiflt{\@ratioBStoFS}{1.2}% + \ClassError{novel}{Too many lines per page^^J}% + {You requested too many lines per page, for the page dimensions and^^J% + font size. Maybe few lines, or smaller font size, or eliminate^^J% + header or footer? Or a bigger Trim Size?^^J}% +\else % OK, so set CurrentBaselineSkip: + \setlength\Current@BaselineSkip{\Current@BaselineSkipNum pt} +\fi +\newlength\Old@BaselineSkip + \setlength\Old@BaselineSkip{\Current@BaselineSkipNum pt} +\gdef\Old@BaselineSkipNum{\strip@pt\Old@BaselineSkip} +% +%% End preliminary calculation of baselineskip. + + + +%% FIT CurrentTextWidth TO NewLiveWidth +%% ----------------------------------------------------------------------------- +%% +\FPdiv{\my@TextRescaleNum}{\New@LiveWidthNum}{\Current@TextWidthNum} +\FPmul{\Current@FontSizeNum}{\Current@FontSizeNum}{\my@TextRescaleNum} +\setlength\Current@FontSize{\Current@FontSizeNum pt} +\FPmul{\Current@TextWidthNum}{\Current@TextWidthNum}{\my@TextRescaleNum} +\setlength\Current@TextWidth{\Current@TextWidthNum pt} +% +%% end fit CurrentTextWidth to NewLiveWidth + + + +%% ADJUST CurrentBaselineSkip TO FIT NewLiveHeight +%% ----------------------------------------------------------------------------- +%% +% Test if New Text Height fits within New Live Height: +\FPifgt{\Current@TextHeightNum}{\New@LiveHeightNum} % does not fit, so fix it + \FPdiv{\my@NBSrescaleNum}{\New@LiveHeightNum}{\Current@TextHeightNum} + \FPmul{\Current@BaselineSkipNum}{\Current@BaselineSkipNum}{\my@NBSrescaleNum} + \setlength\Current@BaselineSkip{\Current@BaselineSkipNum pt} + \FPmul{\Current@TextHeightNum}{\Current@BaselineSkipNum}{\adj@LinesPerPage} +\fi +% Check if the revised skip is too small: +\FPdiv{\@ratioBLtoFS}{\Current@BaselineSkipNum}{\Current@FontSizeNum} +\FPiflt{\@ratioBLtoFS}{1.2} % Too small. Re-tweak font, text width, skip. + \FPdiv{\@rescaleFontSize}{\@ratioBLtoFS}{1.2} + \FPmul{\Current@FontSizeNum}{\Current@FontSizeNum}{\@rescaleFontSize} + \setlength\Current@FontSize{\Current@FontSizeNum pt} + \FPmul{\Current@TextWidthNum}{\Current@TextWidthNum}{\@rescaleFontSize} + \setlength\Current@TextWidth{\Current@TextWidthNum pt} + \FPdiv{\Current@BaselineSkipNum}{\New@LiveHeightNum}{\adj@LinesPerPage} + \setlength\Current@BaselineSkip{\Current@BaselineSkipNum pt} + \FPmul{\Current@TextHeightNum}{\Current@BaselineSkipNum}{\adj@LinesPerPage} +\fi +% +% Note that if the revised skip is larger than desired, it is easy to change. +% Simply increase the top/bottom margin, which does not affect line breaks. +% +%% end adjust CurrentBaselineSkip to fit NewLiveHeight. + + + +%% DISTRIBUTE SIDE EXCESS +%% ----------------------------------------------------------------------------- +%% The prior calculation may have shrunk CurrentTextWidth below NewLiveWidth. +\newlength\fix@SideMargin + \setlength\fix@SideMargin{\New@LiveWidth} + \addtolength\fix@SideMargin{-\Current@TextWidth} +\addtolength\New@OutsideMargin{0.5\fix@SideMargin} +\addtolength\New@InsideMargin{0.5\fix@SideMargin} +% +%% end distribute side excess. + + + +%% SET TEXTWIDTH, FONT SIZE, BASELINESKIP +%% ----------------------------------------------------------------------------- +% +\setlength\textwidth{\Current@TextWidthNum pt} +% +\setlength\normalFontSize{\Current@FontSizeNum pt} +\setlength\normalBaselineSkip{\Current@BaselineSkipNum pt} + +\@setfontsize\normalsize\normalFontSize{\normalBaselineSkip}% + + +\normalsize % Defined in `novel.cls'. Uses numbers, not lengths. +% +\newlength\nfs % abbreviation for normal fontsize +\setlength\nfs{\normalFontSize} +\gdef\nfsnum{\strip@pt\nfs} +\newlength\nbs % abbreviation for normal baselineskip +\setlength\nbs{\normalBaselineSkip} +\gdef\nbsnum{\strip@pt\nbs} % just the numerical part +% +% This document class limits range of normal point size: +\FPiflt{\Current@FontSizeNum}{8}% + \ClassError{novel}{Normal fontsize must be at least 8pt^^J}% + {In the class options, you chose a font size that is too small.^^J% + It must be at least 8pt.^^J}% +\fi +% +\FPifgt{\Current@FontSizeNum}{18.1}% + \ClassError{novel}{Normal fontsize cannot exceed 18bp^^J}% + {In the class options, you chose a font size that is too large.^^J% + It cannot exceed 18bp.^^J}% +\fi +% Alert when lines closer than generally-accepted usage: +\FPmul{\@minBaselineSkipNum}{\Current@FontSizeNum}{1.24} +\FPiflt{\Current@BaselineSkipNum}{\@minBaselineSkipNum} + \typeout{^^JClass `novel' Alert: Line spacing is allowable, but close.^^J% + Consider fewer lines per page, or eliminate header or footer.^^J}% +\fi +% Alert when lines are farther than generally-accepted usage: +\FPmul{\@bigBS}{\Current@FontSizeNum}{1.41} +\FPifgt{\Current@BaselineSkipNum}{\@bigBS} + \typeout{^^JClass `novel' Alert: Line spacing is allowable, but wide.^^J% + Consider more lines per page, or add header or footer.^^J}% +\fi +% +\FPdiv{\Ratio@BaselineSkip}{\Current@BaselineSkipNum}{\Old@BaselineSkipNum} +\FPround{\Ratio@BaselineSkip}{\Ratio@BaselineSkip}{3} +\FPclip{\Ratio@BaselineSkip}{\Ratio@BaselineSkip} +% +\FPdiv{\Ratio@EM}{\Current@FontSizeNum}{\Old@FontSizeNum} +\FPround{\Ratio@EM}{\Ratio@EM}{3} +\FPclip{\Ratio@EM}{\Ratio@EM} +% Alert if images scaled by \Rework: +\ifthenelse{\equal{\Ratio@EM}{1} \AND \equal{\Ratio@BaselineSkip}{1}}{}{% + \typeout{^^JClass `novel' Alert: Due to \string\Rework\space there may be^^J% + places where an image no longer fits properly with surrounding text.^^J% + Try scaling such images in an external graphics editor. They cannot be^^J% + automatically scaled within the document. See `novel' docs, Page 9.^^J% + Suggested scale for inline images: \Ratio@EM ^^J% + Suggested scale for block images: \Ratio@BaselineSkip ^^J% + Maybe also change gaps for imageAtLeft and imageAtRight, trial-and-error.^^J}% +} +% +\setlength\parindent{1.5em} +% +%% Values to be used by footnotes: +\FPdiv{\my@FontScale}{\Current@FontSizeNum}{12} +% Substitute for \footnotesize, but only works for actual footnotes, +% about 10pt with similarly reduced skip: +\FPmul{\@myfootnotesizenum}{\my@FontScale}{10} +\FPround{\@myfootnotesizenum}{\@myfootnotesizenum}{2} +\FPmul{\@myfootnoteskipnum}{\my@FontScale}{\Current@BaselineSkipNum} +\FPmul{\@myfootnoteskipnum}{\@myfootnoteskipnum}{0.84} +\FPround{\@myfootnoteskipnum}{\@myfootnoteskipnum}{2} +% +%% end set textwidth, font size, baselineskip + + + + + +%% BEGIN LAYOUT CALCULATIONS +%% ----------------------------------------------------------------------------- +% +\if@gotHeader + \setlength\headheight{\nbs} + \FPsub{\@headsepmul}{\@headjump}{1} + \FPmul{\@headsep}{\@headsepmul}{\Current@BaselineSkipNum} + \setlength\headsep{\@headsep pt} +\else + \setlength\headheight{0pt} + \setlength\headsep{0pt} +\fi +% +% Prior to this, the following were set by user or calculated: +% \textwidth \headsep \headheight +% +\setlength\paperwidth{\New@MediaWidth} % MediaWidth +\setlength\paperheight{\New@MediaHeight} % MediaHeight + + +%% The `closecrop' class option calculates layout, then removes most of the +%% margins. Draft mode only. Purpose is to create a file with just enough white +%% space around the text to be readable on a handheld device. Not an E-book! +%% Additional closecrop code is located farther down this page. +\if@closecrop + \setlength\paperwidth{\textwidth+0.2in} +\fi +%% + + +% +% Standard TeX \hoffset and \voffset is not relative to the MediaBox, but is +% relative to 1in from the top left corner of the MediaBox. Ouch. +% I thought about making the 1in go away, by re-setting \hoffset and \voffset +% to -1in each. Then other calculations would make more sense. +% In the end, I decided against that, since other packages expect the usual. +\setlength\hoffset{0pt} % relative to 1in built-in offset at left side +\setlength\voffset{0pt} % relative to 1in built-in offset at top +% +% \textheight is peculiar. Unless it is exact to 1/65536 TeX pt, which is +% the smallest resolution, the log file will babbled about Underfull vbox +% (badness 10000) for every page. I believe this is a bug in Tex. It's not +% all that bad, folks. On the other hand, if \textheight is even a fraction +% smaller than its theoretical value, there will be one less line of text. +% Even the geometry package can miss, due to rounding error somewhere. +% After some investigation, I determined that the following works. Basically, +% \textheight must be the normal baselineskip multiplied by the number of lines +% per page, minus 1 for the (invisible) footskip, with \normalFontSize added. +% To straddle the fence between Underfull vbox complaints, and missing a line, +% I added a very tiny fudge amount, which is less that 1/65536pt. +\FPsub{\less@LinesPerPage}{\my@LinesPerPage}{1} +\setlength\textheight{\normalFontSize+\less@LinesPerPage\nbs+0.000001pt} +% +% \oddsidemargin is at the left (inside, spine edge) of recto pages. +% Measured 1in (72.27pt) inside the MediaBox, to the textblock. May be negative. +% When the TrimBox equals the MediaBox, or is centered within it, +% the value is \New@InsideMargin+0.5\New@MediaWidth-0.5\New@TrimWidth-72.27pt +\if@offcenterTrim + \setlength\oddsidemargin{\New@InsideMargin-72.27pt} +\else + \setlength\oddsidemargin{% + \New@InsideMargin+0.5\New@MediaWidth-0.5\New@TrimWidth-72.27pt} +\fi + +%% +\if@closecrop + \setlength\oddsidemargin{-0.9in} +\fi +%% + +% +% \evensidemargin is at the left (outside edge) of verso pages. +% Calculation as above, but using \New@OutsideMargin +\if@offcenterTrim + \setlength\evensidemargin{\New@OutsideMargin-72.27pt} +\else + \setlength\evensidemargin{% + \New@OutsideMargin+0.5\New@MediaWidth-0.5\New@TrimWidth-72.27pt} +\fi + +%% +\if@closecrop + \setlength\evensidemargin{-0.9in} +\fi +%% + + + +% +% \topmargin is measured from 1in below the top of the MediaBox, to the top of +% whatever comes first (header or textblock). May be negative. +% When the TrimBox equals the MediaBox, or is centered within it, +% the value is \New@TopMargin+0.5\New@MediaHeight-0.5\New@TrimHeight-72.27pt +\if@offcenterTrim + \setlength\topmargin{\New@TopMargin-72.27pt} +\else + \setlength\topmargin{% + \New@TopMargin+0.5\New@MediaHeight-0.5\New@TrimHeight-72.27pt} +\fi +% + +%% +\if@closecrop + \if@gotHeader + \setlength\topmargin{-1in} + \else + \setlength\topmargin{-0.9in} + \fi +\fi +%% + + + +% Vertical position of the textblock is measured to the "top" of the first line +% of text. But that could be an X height, or an accented character height, +% an ascender, or something else, depending on the line's content. +% Setting \topskip=\normalFontSize places the "top" at 1em above the baseline, +% which provides a fixed clearance regardless of accented characters +% (unless stacked high). Note that when \charscale is used to make a special +% line start, it doesn't affect the height, since it is "smashed." +\setlength\topskip{\normalFontSize} +% +% In `novel' class, footers are done in an unusal manner. The position of +% the footer baseline is fixed, regardless of the desired jump between text +% and footer. Then, the content (if any) of the footer is relatively positioned +% using \smash and \raisebox. +\setlength\footskip{\nbs} +% + + +%% +\if@closecrop + \if@gotFooter + \if@gotHeader + \setlength\paperheight{% + \textheight+\headsep+\headheight+\@footjump\nbs+1pt} + \else + \setlength\paperheight{% + \textheight+\headsep+\headheight+\@footjump\nbs+\nfs} + \fi + \else + \setlength\paperheight{\textheight+\headsep+\headheight+0.1in} + \fi +\fi +%% + + + +%% End layout calculations. + + + + +% When Media Size exceeds Trim Size, this sets the position: +\newlength\temp@PaperWidth +\newlength\temp@PaperHeight +\newlength\temp@Hoffset +\newlength\temp@Voffset +% +\if@offcenterTrim + \setlength\temp@PaperWidth{\New@TrimWidth} + \setlength\temp@PaperHeight{\New@TrimHeight} + \setlength\temp@Hoffset{0pt} + \setlength\temp@Voffset{0pt} +\else + \setlength\temp@PaperWidth{\New@MediaWidth} + \setlength\temp@PaperHeight{\New@MediaHeight} + \setlength\temp@Hoffset{\temp@PaperWidth} + \addtolength\temp@Hoffset{-\New@TrimWidth} + \setlength\temp@Hoffset{0.5\temp@Hoffset} + \setlength\temp@Voffset{\temp@PaperHeight} + \addtolength\temp@Voffset{-\New@TrimHeight} + \setlength\temp@Voffset{0.5\temp@Voffset} +\fi +% End when Media Size exceeds Trim Size. + + + +% When Media Size = Trim Size, cropmarks are disabled. +% Too late for \@cropviewfalse; OK since CropBox already calculated properly. +\ifthenelse{% + \dimtest{\New@TrimWidth}{=}{\New@MediaWidth} % + \AND \dimtest{\New@TrimHeight}{=}{\New@MediaHeight}% +}{\global\@cropmarksfalse}{} +% end disabling `cropmarks' option. + +% Left, Right, Top, Bottom, x and y +\newlength\Trim@Lx +\newlength\Trim@Rx +\newlength\Trim@Ty +\newlength\Trim@By +\newlength\Live@Lx +\newlength\Live@By +\newlength\adj@NewLiveHeight +\setlength\adj@NewLiveHeight{\New@LiveHeight+0.3\normalFontSize} +% +\gdef\@getPageXY{ + \check@IsVerso % defined in novel-HeadFootStyles.sty + \if@isVerso + \setlength\Trim@Lx{\evensidemargin-\New@OutsideMargin+72.27pt} + \setlength\Trim@Rx{\Trim@Lx+\New@TrimWidth} + \setlength\Live@Lx{\evensidemargin+72.27pt} + \else + \setlength\Trim@Lx{\oddsidemargin-\New@InsideMargin+72.27pt} + \setlength\Trim@Rx{\Trim@Lx+\New@TrimWidth} + \setlength\Live@Lx{\oddsidemargin+72.27pt} + \fi + \if@offcenterTrim + \setlength\Trim@By{\New@MediaHeight-\New@TrimHeight} + \setlength\Trim@Ty{\New@MediaHeight} + \else + \setlength\Trim@By{0.5\New@MediaHeight-0.5\New@TrimHeight} + \setlength\Trim@Ty{0.5\New@MediaHeight+0.5\New@TrimHeight} + \fi + \setlength\Live@By{\Trim@By+\New@BottomMargin-0.3\normalFontSize} +} +% + + + +%% With class option `shademargins' (only effective in draft mode): +% Based on code by Ulrike Fischer at tex.stackexchange.com, CC-by-sa-3.0: +% The 0.903215 is a value that the user would not be likely to choose. +% The re-defined color command makes an exception for that value. +\definecolor[named]{hingledingle}{gray}{1} % fake white, when white disallowed +% +\if@shademargins + \pagecolor{hingledingle}% + \if@offcenterTrim% + \AddToShipoutPictureBG{\@getPageXY% + \AtPageLowerLeft{\color[gray]{0.903215}% + \hspace{\Trim@Lx}\rule[\Trim@By]{\New@TrimWidth}{\New@TrimHeight}}% + }% + % + \AddToShipoutPictureBG{\@getPageXY% + \AtPageLowerLeft{\color{hingledingle}% + \hspace{\Live@Lx}\rule[\Live@By]{\New@LiveWidth}{\adj@NewLiveHeight}}% + }% + \else% trim is centered + \AddToShipoutPictureBG{\@getPageXY% + \AtPageLowerLeft{\color[gray]{0.903215}% + \hspace{\Trim@Lx}\rule[\Trim@By]{\New@TrimWidth}{\New@TrimHeight}}% + }% + % + \AddToShipoutPictureBG{\@getPageXY% + \AtPageLowerLeft{\color{hingledingle}% + \hspace{\Live@Lx}\rule[\Live@By]{\New@LiveWidth}{\adj@NewLiveHeight}}% + }% + \fi% +\fi % end \if@shademargins +% + +% Labels each page with DRAFT at upper left, if in draft mode: +\if@useDraftMode + \AddToShipoutPictureBG{\@getPageXY% + \AtPageUpperLeft{\raisebox{-\nbs}{\textbf{~DRAFT}}} + }% +\fi +% + + +% Cropmarks (trim marks, really) are not important in this document class. +% That's because the targeted printing services generally do not want them. +% But a minimal capability was easy to add. The far end of each mark is +% half an inch from the trim area. The close end is separated by a gap >= 0pt. +% So the length of the marks is generally less than half an inch. +% If trim is at the edge of the media box, instead of centered, +% then only one pair of marks will be written. +% The marks are turned on using `cropmarks' class option. The gap is set +% in Preamble using \SetCropmarkGap{length}. +\if@cropmarks + \if@offcenterTrim + \check@IsVerso + \if@isVerso + % H bottom left: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx-0.5in}\rule[\Trim@By-0.5pt]{0.5in-\@mygap}{0.5pt}}} + % V bottom left: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx-0.5pt}\rule[\Trim@By-0.5in]{0.5pt}{0.5in-\@mygap}}} + \else + % H bottom right: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Rx+\@mygap}\rule[\Trim@By-0.5pt]{0.5in-\@mygap}{0.5pt}}} + % V bottom right: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\Trim@Rx}\rule[\Trim@By-0.5in]{0.5pt}{0.5in-\@mygap}}} + \fi + \else + % H top left: + \AddToShipoutPictureBG{\@getPageXY% + \AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx-0.5in}\rule[\Trim@Ty]{0.5in-\@mygap}{0.5pt}}} + % H bottom left: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx-0.5in}\rule[\Trim@By-0.5pt]{0.5in-\@mygap}{0.5pt}}} + % H top right: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Rx+\@mygap}\rule[\Trim@Ty]{0.5in-\@mygap}{0.5pt}}} + % H bottom right: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Rx+\@mygap}\rule[\Trim@By-0.5pt]{0.5in-\@mygap}{0.5pt}}} + % V top left: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx-0.5pt}\rule[\Trim@Ty+\@mygap]{0.5pt}{0.5in-\@mygap}}} + % V bottom left: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx-0.5pt}\rule[\Trim@By-0.5in]{0.5pt}{0.5in-\@mygap}}} + % V top right: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\Trim@Rx}\rule[\Trim@Ty+\@mygap]{0.5pt}{0.5in-\@mygap}}} + % V bottom right: + \AddToShipoutPictureBG{\@getPageXY\AtPageLowerLeft{% + \hspace{\Trim@Rx}\rule[\Trim@By-0.5in]{0.5pt}{0.5in-\@mygap}}} + \fi +\fi +% +%% end cropmarks + + + +%% +%% End of file `novel-CalculateLayout.sty'. + + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty b/Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty new file mode 100644 index 00000000000..7fdf5adb33c --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-ChapterScene.sty @@ -0,0 +1,319 @@ +%% +%% This is file `novel-ChapterScene.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-ChapterScene.sty}% +[2017/03/01 v1.0.6 LaTeX file (chapter and scene macros)] +%% + + +% Class `novel' does not use \maketitle. +\gdef\maketitle{% + \ClassError{novel}{\string\maketitle does not exist in this class}% + {Sorry, but there is no \string\maketitle command in `novel' class.^^J% + You must make your own title pages!^^J}% +} +% + + +%% SCENE CHANGES +%% ----------------------------------------------------------------------------- +%% \scenebreak \sceneline \scenestars +% Use anywhere in document body. +% These commands skip a line. +% \scenebreak leaves the gap empty. +% \sceneline centers a line, about 1/3 textwidth. +% \scenestars centers three widely-spaced asterisks. +% Default behavior is \noindent for following paragraph. +% Use \IndentAfterScenebreak in preamble to change this globally. +% Either way, the local behavior can be changed using \indent or \noindent. +% Note: The indent behavior is activated AtBeginDocument. +\newif\if@indentAfterScenebreak \@indentAfterScenebreakfalse +\newcommand\IndentAfterScenebreak{\@indentAfterScenebreaktrue} +% +\newcommand\scenebreak{\null} +% +\newcommand\sceneline{% + \noindent\hfil% + \raisebox{0.2em}{\rule{0.35\textwidth}{.4pt}}\hfil\par% +} +% +\newcommand\scenestars{% + \noindent\hfil% + \raisebox{-.3em}{*\quad\quad*\quad\quad*}\hfil\par% +} +%% end scene changes + + +%% Repair \FirstLine{} command from `magaz' package. +% Problem: Conflict with \noindent\nov@AfterGroup as used in ChapterDisplay. +% The \noindent is carried past \FirstLine to the following paragraph. +% Solution: After FirstLine completes, back up one line vertically, then insert +% and empty line to restore grid and absorb the noindent. +% Starred version uses the original \FirstLine definition, just in case +% the following paragraph has some exotic feature. +% Thanks to user `egreg' at tex.stackexchange.com for debug assistance. +\let\oldFirstLine\FirstLine +\def\FirstLine{\@ifstar\FirstLineFoo\@FirstLineFoo} % improved +\def\FirstLineFoo#1{\oldFirstLine{#1}} % starred restores original def. +\def\@FirstLineFoo#1{% + \oldFirstLine{#1}\par\vspace{-\nbs}\strut\par% +} +%% + + + +%% ChapterDisplay environment. +% The most useful way to start a new chapter. Occupies a fixed amount of +% vertical space. Also self-adjust when used with dropfolio. Automatically +% calls \thispagestyle if set for all chapter displays. +\newif \if@addCTline \@addCTlinetrue +\newcounter{@linequarter} +\newif \if@csalignok \@csalignokfalse +% +% The argument is the number of normal baselineskips high: +\newenvironment{ChapterDisplay}[1][10] +{% + \FPsub{\@fixlines}{#1}{3}% + \FPsub{\@fixlines}{\@fixlines}{0.001}% fudge to avoid rounding problems + \if@thispagestyleset\else\thispagestyle{\@setchapterdisplay}\fi% + \null% + \ResetFootnoteSymbol% resets symbolic markers, but not numeric markers + \if@addCTline\null\else\fi% used with dropfolio + \setcounter{@linequarter}{0}% + \begin{textblock*}{\textwidth}[0,0](0pt,0pt)% +}{% + \ifthenelse{% + \equal{\value{@linequarter}}{1} \OR \equal{\value{@linequarter}}{5}% + \OR \equal{\value{@linequarter}}{9} \OR \equal{\value{@linequarter}}{13}% + }{\vspace{0.75\nbs}}{}% + \ifthenelse{% + \equal{\value{@linequarter}}{2} \OR \equal{\value{@linequarter}}{6}% + \OR \equal{\value{@linequarter}}{10} \OR \equal{\value{@linequarter}}{14}% + }{\vspace{0.5\nbs}}{}% + \ifthenelse{% + \equal{\value{@linequarter}}{3} \OR \equal{\value{@linequarter}}{7}% + \OR \equal{\value{@linequarter}}{11} \OR \equal{\value{@linequarter}}{15}% + }{\vspace{0.25\nbs}}{}% + \end{textblock*}% + \vspace{\@fixlines\nbs}% + \nov@AfterGroup\NoIndentAfterThis% etextools and noindentafter +} +%% + + +% +\newcommand\ChapterTitle[2][c]{% optional alignment l, c, r + \vspace{0.5\nbs}\addtocounter{@linequarter}{2} + \@csalignokfalse% + \ifthenelse{\equal{#1}{l}}{\let\@csalign\relax\@csalignoktrue}{} + \ifthenelse{\equal{#1}{c}}{\let\@csalign\centering\relax\@csalignoktrue}{} + \ifthenelse{\equal{#1}{r}}{\let\@csalign\hfill\relax\@csalignoktrue}{} + \if@csalignok\else% + \ClassError{novel}{Chapter Title, Deco, Subtitle align must be l, c, or r}% + {On page \thepage you wrote a Chapter command with alignment^^J% + other than the allowed l, c, or r.}% + \fi% + {\@csalign\stake\smash{{\chapterfont #2}}\par}% +} +% +\newcommand\ChapterSubtitle[2][c]{% optional alignment l, c, r + \vspace{0.25\nbs}\addtocounter{@linequarter}{1} + \@csalignokfalse% + \ifthenelse{\equal{#1}{l}}{\let\@csalign\relax\@csalignoktrue}{} + \ifthenelse{\equal{#1}{c}}{\let\@csalign\centering\relax\@csalignoktrue}{} + \ifthenelse{\equal{#1}{r}}{\let\@csalign\hfill\relax\@csalignoktrue}{} + \if@csalignok\else% + \ClassError{novel}{Chapter Title, Deco, Subtitle align must be l, c, or r}% + {On page \thepage you wrote a Chapter command with alignment^^J% + other than the allowed l, c, or r.}% + \fi% + {\@csalign{\stake\smash{\subchfont #2}}\par}% +} +% In ChapterDeco, a trick is used. Instead of two optional arguments, and +% instead of using expl3 syntax to create different argument delimiters, +% the arguments for alignment and scale are passed as a single option. +% This works because one is a letter, and the other is a number. +% So it is easy to separte them by parsing. +\newcommand\ChapterDeco[2][c1]{% optional alignment and scale, either order + \StrDel{#1}{ }[\temp@cds]% may use space separator + \StrDel{\temp@cds}{,}[\temp@cd]% may use comma separator + \IfSubStr{#1}{l}{% + \let\@csalign\relax\@csalignoktrue% + \StrDel{\temp@cd}{l}[\temp@cd]% + }{}% + \IfSubStr{#1}{c}{% + \let\@csalign\centering\relax\@csalignoktrue% + \StrDel{\temp@cd}{c}[\temp@cd]% + }{}% + \IfSubStr{#1}{r}{% + \let\@csalign\hfill\relax\@csalignoktrue% + \StrDel{\temp@cd}{r}[\temp@cd]% + }{}% + \if@csalignok\else% + \let\@csalign\centering\relax\@csalignoktrue% + \fi% + \IfEndWith{\temp@cd}{.}{\StrSubstitute{\temp@cd}{.}{.0}[\temp@cd]}{}% + \IfBeginWith{\temp@cd}{.}{\StrSubstitute{\temp@cd}{.}{1.}[\temp@cd]}{}% + \IfDecimal{\temp@cd}{\def\@thisScale{\temp@cd}}{\def\@thisScale{1}}% + {\@csalign\charscale[\@thisScale,0pt,0.2\nbs]{#2}\par}% +} +% +%% + + +%% \Epigraph[align,scale,width]{text} +%% Not to be confused with lowercase \epigraph from package of same name. +%% +% \Epigraph takes one optional argument, which will be parsed for +% comma-separated values. You may use one, two, or all three values. +% First value is l, c, or r. Position of Epigraph in the textblock. Default c. +% If l or c, the text within the Epigraph is either left-aligned or justified, +% depending on whether the third value is given. Note that value c does not +% center each line of the Epigraph; if that is what you want, then simply +% use the centering command. If first value is r, text is right-aligned. +% Second value, if given, changes the text size and internal baseline skip. +% Thus, the text will go off-grid, but that's OK for the purpose. +% The second value is a number, being scale relative to normal font size. +% Default is 1. A good value for chapter displays might be around 0.92, +% equivalent to about 1pt smaller text size (and skip) than normal. +% A front page, near the book title, might use a value greater than 1. +% If no third value is given, the macro uses the tabular environment to set +% ragged text at its natural width. Good for verse in particular. +% If a third value is given, it must be a number that does not exceed 1. +% This is the portion of textwidth that will be used. Within the Epigraph, +% text will be justified to the specified width. So, for example, using 0.5 +% creates a justified Epigraph as half the textwidth. Its position will be +% determined by the first value, l, c, or r. +% The mandatory text argument is the Epigraph, as well as its attribution. +% More than one paragraph is permitted. +% Use ordinary \\ and \par for breaks. You will need to use either \par +% or \\\par before the attribution. Use \hfill to shift the attribution to +% the right edge of the Epigraph. +% The text may be styled with the usual simple commands such as \emph{}. +% There is no provision for a horizontal line. +% If used on a stand-alone page, or in the ChapterDisplay environment, +% then the vertical extent of the Epigraph does not much matter. +% If mingled with main text (not recommended) you may have to correct +% the line grid using some amount of \vspace{}. That's your problem. +% +\newcommand\Epigraph[2][c]{% note capital E + \StrDel{#1}{ }[\@onens] + \StrCut{\@onens}{,}{\@onealigna}{\@onemore} + \StrCut{\@onemore}{,}{\@onefsa}{\@onewsa} + \ifthenelse{\equal{\@onealigna}{c}\OR\equal{\@onealigna}{}}{\def\@onealign{c}}{\def\@onealign{\@onealigna}} + \ifthenelse{\equal{\@onealign}{c}\OR\equal{\@onealign}{l}\OR\equal{\@onealign}{r}}{}{% + \ClassError{novel}{Wrong syntax in \string\epigraph\space on page \string\thepage}% + {Optional argument of \string\epigraph\space must begin with l, c, or r.}% + } + \IfEndWith{\@onefsa}{.}{\StrGobbleRight{\@onefsa}{1}[\@onefsb]}{\def\@onefsb{\@onefsa}} + \IfEndWith{\@onewsa}{.}{\StrGobbleRight{\@onewsa}{1}[\@onewsb]}{\def\@onewsb{\@onewsa}} + \ifthenelse{\equal{\@onefsb}{}}{\def\@onefs{1}}{\def\@onefs{\@onefsb}} + \IfDecimal{\@onefs}{}{% + \ClassError{novel}{Wrong syntax in \string\epigraph\space on page \string\thepage}% + {Optional argument of \string\epigraph\space cannot be parsed for number(s).}% + } + \ifthenelse{\equal{\@onewsb}{}}{\def\@onews{-1}}{\def\@onews{\@onewsb}} + \IfDecimal{\@onews}{}{% + \ClassError{novel}{Wrong syntax in \string\epigraph\space on page \string\thepage}% + {Optional argument of \string\epigraph\space cannot be parsed for number(s).}% + } + % + \ifthenelse{\equal{\@onews}{-1}}{% ragged text, no particular width + \begin{parascale}[\@onefs] + \ifthenelse{\equal{\@onealign}{c}}{\begin{center}\begin{tabular}{l}}{}% + \ifthenelse{\equal{\@onealign}{l}}{\begin{tabular}{l}}{}% + \ifthenelse{\equal{\@onealign}{r}}{\hfill\begin{tabular}{r}}{}% + \ifvmode\else\unskip\fi#2\par + \ifthenelse{\equal{\@onealign}{r}}{\end{tabular}}{}% + \ifthenelse{\equal{\@onealign}{l}}{\end{tabular}}{}% + \ifthenelse{\equal{\@onealign}{c}}{\end{tabular}\end{center}}{}% + \end{parascale}\par + }{% justified text at specified width fraction + % + \newlength\@thistw + \setlength\@thistw{\@onews\textwidth} + \newlength\@exctw + \setlength\@exctw{\textwidth} + \addtolength\@exctw{-\@thistw} + % + \ifthenelse{\equal{\@onealign}{l}}{% + \begin{adjustwidth}{0pt}{\@exctw} + \setlength\parindent{0pt} + \ifvmode\else\unskip\fi#2\par + \end{adjustwidth}\par + }{} + % + \ifthenelse{\equal{\@onealign}{r}}{% + \begin{adjustwidth}{\@exctw}{0pt} + \setlength\parindent{0pt} + \ifvmode\else\unskip\fi#2\par + \end{adjustwidth}\par + }{} + % + \ifthenelse{\equal{\@onealign}{c}}{% + \begin{adjustwidth}{0.5\@exctw}{0.5\@exctw} + \setlength\parindent{0pt} + \ifvmode\else\unskip\fi#2\par + \end{adjustwidth}\par + }{} + % + }% end ifthenelse + % +} % end \Epigraph +%% +\providecommand\epigraph{% to avoid confusion with epigraph package + \ClassError{novel}{No command \string\epigraph. Try \string\Epigraph}% + {The `novel' built-in \string\Epigraph\space command uses capital E.}% +} +%% + + +%% \QuickChapter[line style]{text} intended for a story consisting of numerous +% short chapters without page breaks. Two blank lines are inserted. In the gap +% is the text, using subchfont. Optional line follows using \bigemdash style. +% If option is empty, no line. If a length, then the line is that length. +% If option * then the line fills to end of text line. +\newlength\@tempscfx% +\newcommand\QuickChapter[2][]{% + \null% + \def\@qctweak{0.3} % raise above grid, em of subchfont + \noindent{\subchfont\charscale[1,0pt,\@qctweak em]{#2}% + \setlength\@tempscfx{\heightof{x}}% + \global\@tempscfx=\@tempscfx% + }% end subchfont + \def\@tempscfxnum{\strip@pt\@tempscfx}% + \def\nxhnum{\strip@pt\normalxheight}% + \FPdiv{\@qclineth}{\@tempscfxnum}{\nxhnum}% scale of subchfont + \FPmul{\@howthick}{\@qclineth}{0.049}% typical emdash thickness, em. + \FPadd{\@howraise}{\@qctweak}{0.23}% typical emdash height em raised. + \FPmul{\@howraise}{\@howraise}{\@qclineth}% + \def\@tempscfxnum{\strip@pt\@tempscfx}% + \ifthenelse{\equal{#1}{} \OR \equal{#1}{ }}{}{% no line, else: + \ifthenelse{\equal{#1}{*}}{% line fills: + ~\leaders\hbox{\smash{\rule[\@howraise em]{1pt}{\@howthick em}}}\hfill\stake\par% + }{% else line at specific length: + ~\makebox[#1][l]{\leaders\hbox{\smash{\rule[\@howraise em]{1pt}{\@howthick em}}}\hfill}% + }% + }% + \NoIndentAfterThis% +} % end \QuickChapter +%% + + + + +% +%% End of file `novel-ChapterScene.sty'. + + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-FOGRA39.clo b/Master/texmf-dist/tex/lualatex/novel/novel-FOGRA39.clo new file mode 100644 index 00000000000..64536e5345d --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-FOGRA39.clo @@ -0,0 +1,14 @@ +% Typically used in Europe. Novel file version 1.0.6 + +% The values of the arguments are public industry standards. + +% Remember: TeX special characters must be backslashed here. +% You may see % or # or _ in the data or file names. +% Be sure that they are written as \% \# \_ or there will be trouble. + +\gdef\@OIidentifier{FOGRA39} % also called "reference name" +\gdef\@OIcondition{Offset commercial and specialty printing according to ISO 12647-2:2004 / Amd 1, paper type 1 or 2 (gloss or matte coated offset, 115 g/m2), screen frequency 60/cm.} +\gdef\@OIinfo{Coated FOGRA39 (ISO 12647-2:2004)} +\gdef\@OIregistry{http://www.color.org} +\gdef\@OIprofile{CoatedFOGRA39.icc} + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-FileData.sty b/Master/texmf-dist/tex/lualatex/novel/novel-FileData.sty new file mode 100644 index 00000000000..86df6b85e6f --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-FileData.sty @@ -0,0 +1,176 @@ +%% +%% This is file `novel-FileData.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-FileData.sty}% +[2017/03/01 v1.0.6 LaTeX file (File Data settings)] +%% + + +%% FILE DATA (see class documentation for technical meaning of this term). +%% ----------------------------------------------------------------------------- +%% +% \title{} or \SetTitle{} +% Must be used immediately after \documentclass[options]{novel}. +% Copied to metadata at end of preamble, unless not set or over-ridden. +% May be over-ridden in metadata using \metatitle{}. +% May be re-set in body, but not in metadata. +% Provides \thetitle anywhere. +% If not set, PDF cannot conform to PDF/X. +\gdef\SetTitle#1{\gdef\@title{#1}} % for stylistic consistency +\gdef\title#1{\gdef\@title{#1}} +\gdef\thetitle{\@title} +\gdef\theTitle{\@title} +\title{} +% +% \author{} or \SetAuthor{} +% Copied to metadata at end of preamble, unless not set or over-ridden. +% May be over-ridden in metadata using \metaauthor{}. +% May be re-set in body, but not in metadata. +% Provides \theauthor anywhere. +\gdef\SetAuthor#1{\gdef\@author{#1}} % for stylistic consistency +\gdef\author#1{\gdef\@author{#1}} +\gdef\theauthor{\@author} +\gdef\theAuthor{\@author} +\author{} +% +% \subtitle{} or \SetSubtitle{} (if any) +% Not copied to metadata by itself, as there is no such metadata entry. +% May appear in metadata along with title, using \metatitle{}. See below. +% May be re-set in body. +% Provides \thesubtitle anywhere. +\gdef\SetSubtitle#1{\gdef\@subtitle{#1}} % for stylistic consistency +\gdef\subtitle#1{\gdef\@subtitle{#1}} +\gdef\thesubtitle{\@subtitle} +\gdef\theSubtitle{\@subtitle} +\subtitle{} +% +% \SetApplication{} (rarely used) +% Also known as CreatorTool. +% Name of the software that created the source document. +% Changing this does not change the software, it just changes the name. +% Normally leave as default, but can change if urgent. +\gdef\SetApplication#1{\gdef\@novelApplication{#1}} +\SetApplication{LaTeX with novel and microtype} % default +% +% \SetProducer{} (rarely used) +% Name of the software that compiles to source to make PDF. +% Changing this does not change the software, it just changes the name. +% Normally leave as default, but can change if urgent. +\gdef\SetProducer#1{\gdef\@novelProducer{#1}} +\SetProducer{LuaTeX with novel-pdfx and hyperref} % default +% +% Although some other data fields could have been added, +% they do not pertain to fiction, especially if your book is print-on-demand. +% No need to set copyright in metadata, since your book is only for use by +% the print service, and is not being distributed as a PDF e-book. +% Your copyright notice is on the printed page, where it should be. +% Particularly note that your print service is NOT the publisher: YOU are! +% +%% End file data. + + +%% SET PDF/X ARGUMENTS +%% ----------------------------------------------------------------------------- +%% Arguments: [embed-icc or no-embed]{compliance standard}{output intent} +%% Default option is no-embed. +%% When this command is not used, it is equivalent to compliance `off'. +% +\newif \if@chosenComplianceOK +\newif \if@chosenEmbedOK +\newif \if@gotConformance +\newif \if@noembedicc \@noembedicctrue +\newif \ifpdfx@isOFF \pdfx@isOFFtrue +% These will get meaningful info when an output intent file is loaded: +\gdef\@OIidentifier{} +\gdef\@OIcondition{} +\gdef\@OIinfo{} +\gdef\@OIregistry{} +\gdef\@OIprofile{} +% +%% +\gdef\SetPDFX{\@ifstar\@setpdfxst\@setpdfxns} +\newcommand\@setpdfxst[2][CGATSTR001]{ + \global\@noembediccfalse + \@setpdfx{#1}{#2} +} +\newcommand\@setpdfxns[2][CGATSTR001]{ + \global\@noembedicctrue + \@setpdfx{#1}{#2} +} +% +\newcommand\@setpdfx[2]{ + \ifthenelse{\equal{#2}{off}}{ + \global\pdfx@isOFFtrue + \@chosenComplianceOKtrue + }{} + \ifthenelse{\equal{#2}{X-1a:2001}}{ + \pdfx@isOFFfalse + \@chosenComplianceOKtrue + \gdef\@PDFversion{PDF/X-1} + \gdef\@PDFXversion{PDF/X-1a:2001} + \gdef\@PDFXconformance{PDF/X-1a:2001} + \global\@gotConformancetrue + \global\pdfminorversion=3 + }{} + \ifthenelse{\equal{#2}{X-1a:2003}}{ + \pdfx@isOFFfalse + \@chosenComplianceOKtrue + \gdef\@PDFversion{PDF/X-1} + \gdef\@PDFXversion{PDF/X-1a:2003} + \gdef\@PDFXconformance{PDF/X-1a:2003} + \global\@gotConformancetrue + \global\pdfminorversion=3 + }{} + \ifthenelse{\equal{#2}{X-3:2002}}{ + \pdfx@isOFFfalse + \@chosenComplianceOKtrue + \gdef\@PDFversion{PDF/X-3} + \gdef\@PDFXversion{PDF/X-3:2002} + \global\pdfminorversion=3 + }{} + \ifthenelse{\equal{#2}{X-3:2003}}{ + \pdfx@isOFFfalse + \@chosenComplianceOKtrue + \gdef\@PDFversion{PDF/X-3} + \gdef\@PDFXversion{PDF/X-3:2003} + \global\pdfminorversion=4 + }{} + \if@chosenComplianceOK\else + \ClassError{novel}{Bad compliance argument for \string\SetPDFX}% + {Choose: off, X-1a:2001, X-1a:2003, X-3:2002, X-3:2003.^^J}% + \fi + % + \ifpdfx@isOFF\else % Output Intent ignored if compliance is `off'. + % Grab the file that defines the output intent information: + \makeatletter % Apparently needed when non-*.sty is input within a command! + \IfFileExists{novel-#1.clo}{\input{novel-#1.clo}}{ + \ClassError{novel}{Bad Output Intent argument for \string\SetPDFX}% + {Use filename (without~extension) of a file with *.clo~extension. ^^J% + Filename must begin with novel- ^^J% + The file must be where TeX can find it. Or use standard code: ^^J% + CGATSTR001, FOGRA39, JC200103.}% + } + \makeatother % back to usual + \fi +} % end \@setpdfx +% + +%% + + + +%% +%% End of file `novel-FileData.sty'. + + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty b/Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty new file mode 100644 index 00000000000..72426d40435 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-FontDefaults.sty @@ -0,0 +1,261 @@ +%% +%% This is file `novel-FontDefaults.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-FontDefaults.sty}% +[2017/03/01 v1.0.6 LaTeX file (default fonts)] +%% + + +%% +%% This file is loaded \AtEndPreamble. +%% +%% Most TeX installations will use Latin Modern or Computer Modern +%% as default fonts. These are unsuitable for commercial fiction. +%% But `novel' class uses Libertinus as defaults. +%% Change them using \SetMasterFont and other fontspec commands, in Preamble. +% Libertinus Serif has Regular, Italic, Bold, Bold Italic. +% Here, Semibold over-rides Bold. +% +%% Now to activate the font definitions: +% +\defaultfontfeatures{} % reset +% +% The mono font: +\defaultfontfeatures[\ttfamily]{% mono font has no kerning or common ligatures + SmallCapsFeatures={Renderer=Basic},Ligatures=TeX,% +}% +\ifthenelse{\equal{\ttdefault}{lmtt} \OR \equal{\ttdefault}{cmtt}}{ % over-ride: + \IfFontExistsTF{Libertinus Mono}{ + \setmonofont[% + ItalicFont={},% Doesn't have these. + BoldFont={},% + BoldItalicFont={},% + ]{Libertinus Mono} + }{ + \IfFontExistsTF{Linux Libertine Mono O}{ + \setmonofont{Linux Libertine Mono O} + }{ + \setmonofont{Latin Modern Mono}% Eeek! Only because you have it! + } + } +}{} % User \setmonofont, so leave alone. +% +%% +\defaultfontfeatures{} % reset +% Main and sans fonts use kerning, ligatures, and OldStyle numbers if available: +\defaultfontfeatures[\rmfamily,\sffamily]{% + SmallCapsFeatures={Renderer=Basic},Kerning=On,Numbers=OldStyle,% + Ligatures=Common,Ligatures=TeX,% +}% +% The sans font: +\ifthenelse{\equal{\sfdefault}{lmss} \OR \equal{\sfdefault}{cmss}}{ % over-ride: + \IfFontExistsTF{Libertinus Sans}{ + \setsansfont{Libertinus Sans} + }{ + \IfFontExistsTF{Linux Biolinum O}{ + \setsansfont{Linux Biolinum O} + }{ + \setsansfont{Latin Modern Sans}% Eeek! Only because you have it! + } + } +}{} % User \setsansfont, so leave alone. +%% +% At this point, if \rmdefault is something other than lmr or cmr, it probably +% means that the user issued \setmainfont. But that's ineffective in this +% class, because it will be over-written. Use \SetMasterFont instead: +\ifthenelse{\equal{\rmdefault}{lmr} \OR \equal{\rmdefault}{cmr}}{}{% + \ClassWarning{novel}{^^JDid you use \string\setmainfont\space in Preamble?^^J% + The \string\setmainfont\space command is ineffective in `novel' class.^^J% + Use \string\SetMasterFont\space instead. This Warning may be spurious if^^J% + you have an unusual configuration for your TeX installation.^^J}% +}% +% The masterfont: +\if@masterfontset\else + \IfFontExistsTF{Libertinus Serif}{ + \SetMasterFont[% + BoldFont=libertinusserif-semibold.otf,% + BoldItalicFont=libertinusserif-semibolditalic.otf,% + ]{Libertinus Serif} + }{ + \IfFontExistsTF{Linux Libertine O}{ + \SetMasterFont[% + BoldFont=LinLibertine_RZ.otf,% + BoldItalicFont=LinLibertine_RZI.otf,% + ]{Linux Libertine O} + }{ + \SetMasterFont[% + SmallCapsFont={Latin Modern Roman Caps}% + ]{Latin Modern Roman}% Eeek! Only because you have it! + \let\scshape\oldscshape % or small caps won't work + \let\smcp\oldscshape % ditto + } + } +\fi +% Now we are ready to set the main font: +\setmainfont[\@masterfontfeatures]{\@masterfontname} +% +%% +\defaultfontfeatures{} % reset +% The novel-specific display fonts use these defaults: +\defaultfontfeatures{% + SmallCapsFeatures={Renderer=Basic},Kerning=On,% + Ligatures=TeX,Ligatures=CommonOff,Numbers=Lining,% +}% +% The novel-specific fonts: +\if@chapterfontset\else + \SetChapterFont[\@masterfontfeatures,Scale=1.6]{\@masterfontname} +\fi +\newfontfamily\chapterfont[\@chapterfontfeatures]{\@chapterfontname} +% +\if@subchfontset\else + \SetSubchFont[\@masterfontfeatures,Scale=1.2]{\@masterfontname} +\fi +\newfontfamily\subchfont[\@subchfontfeatures]{\@subchfontname} +% +\newif \if@headfontdefault +\if@headfontset\else + \SetHeadFont[\@masterfontfeatures,Scale=0.92]{\@masterfontname} + \global\@headfontdefaulttrue +\fi +\newfontfamily\headfont[\@headfontfeatures]{\@headfontname} +%% +\defaultfontfeatures{} % reset +\defaultfontfeatures{% for decofont + SmallCapsFeatures={Renderer=Basic},Kerning=On,Ligatures=TeX,% +}% +%% The decofont must be NovelDeco.otf or a user modification of that font: +\if@decofontset\else + \IfFontExistsTF{NovelDeco.otf}{ + \SetDecoFont{NovelDeco} + }{} +\fi +%% +\gdef\acronym#1{#1}% Re-defined below, if decofont available. +%% +%% Now to get the decofont activated: +% Decorative glyphs, only in this font. Should not be re-set by user: +\gdef\decoglyph#1{~} % If NovelDeco not found, non-breaking space in main text. +% +\if@gotdeco % NovelDeco or a user-defined alternative was found: + \newfontface\@decoglyph[% + \@decofontfeatures,% + ]{\@decofontname} + \newfontface\@decoglypha[% + \@decofontfeatures,RawFeature=+ss01,% + ]{\@decofontname} + \newfontface\@decoglyphb[% + \@decofontfeatures,RawFeature=+ss02,% + ]{\@decofontname} + \newfontface\@decoglyphc[% + \@decofontfeatures,RawFeature=+ss03,% + ]{\@decofontname} + % + \gdef\decoglyph#1{% Be sure to use % without preceding space: + \IfBeginWith{#1}{s}{% numeral superscript + \StrBehind{#1}{s}[\@tempdecoglyph]{\@decoglyph{#1}}% + }{}% + \IfBeginWith{#1}{r}{% regular weight symbol + \StrBehind{#1}{r}[\@tempdecoglyph]{\@decoglyph\symbol{\@tempdecoglyph}}% + }{}% + \IfBeginWith{#1}{l}{% light weight symbol + \StrBehind{#1}{l}[\@tempdecoglyph]{\@decoglypha\symbol{\@tempdecoglyph}}% + }{}% + \IfBeginWith{#1}{e}{% extra light weight symbol + \StrBehind{#1}{e}[\@tempdecoglyph]{\@decoglyphb\symbol{\@tempdecoglyph}}% + }{}% + \IfBeginWith{#1}{t}{% thin weight symbol + \StrBehind{#1}{t}[\@tempdecoglyph]{\@decoglyphc\symbol{\@tempdecoglyph}}% + }{}% + }% end gdef decoglyph + % + % The trouble with acronyms is that they look too big in regular capitals, + % and too small in small caps. Command \acronym{} tries to provide an + % intermediate size. The letters were drawn from Linux Libertine, scaled, + % weights adjusted, the placed in NovelDeco.otf. + \gdef\acronym#1{{\decofont{#1}}} + % +\fi% end \if@gotdeco +% +%% +% Any other fonts will use these defaults: +\defaultfontfeatures{} % reset +% The novel-specific display fonts use these defaults: +\defaultfontfeatures{% + SmallCapsFeatures={Renderer=Basic},% + Ligatures=TeX,% +}% +% +%% + + +% Get rid of previously-defined fake polyglossia commands, +% but you can still use \setkeys from that package: +\let\SetMainLanguage\relax +\let\SetDefaultLanguage\relax +\let\SetOtherLanguage\relax +\let\SetOtherLanguages\relax +\let\setmainlanguage\relax +\let\setdefaultlanguage\relax +\let\setotherlanguage\relax +\let\setotherlanguages\relax +% Now that the basic fonts are defined, we can load these packages: +\RequirePackage{polyglossia} % Instead of babel. +% +\ifthenelse{\equal{\@setmainlang}{}}{ + \setmainlanguage{english} +}{ + \ifthenelse{\equal{\@setmainlangopt}{}}{ + \setmainlanguage{\@setmainlang} + }{ + \setmainlanguage[\@setmainlangopt]{\@setmainlang} + } +} +\ifthenelse{\equal{\@setotherlang}{}}{}{ + \ifthenelse{\equal{\@setotherlangopt}{}}{ + \setotherlanguage{\@setotherlang} + }{ + \setotherlanguage[\@setotherlangopt]{\@setotherlang} + } +} +\ifthenelse{\equal{\@setotherlangs}{}}{}{ + \ifthenelse{\equal{\@setotherlangsopt}{}}{ + \setotherlanguages{\@setotherlangs} + }{ + \setotherlanguages[\@setotherlangsopt]{\@setotherlangs} + } +} +%% This provides default microtype settings, allows the user to over-ride, and +% hopefully prevents the user from choosing inappropriate settings: +\let\microtypesetup\relax % fake command no longer needed +\if@setmicrotype % user wrote \microtypesetup{} in Preamble + \IfSubStr{\@mymicrotypesetup}{config}{% user specified own config file + \gdef\@mymicrotypeset{\@mymicrotypesetup} + }{ % default to novel's config file + \gdef\@mymicrotypeset{% + config=novel-microtype,\@mymicrotypesetup} + } +\else % user did not write \microtypesetup{} in Preamble + \gdef\@mymicrotypeset{% + config=novel-microtype,stretch=20,shrink=20} +\fi +\RequirePackage[\@mymicrotypeset,final,tracking]{microtype} +% +%% + + + +% +%% End of file `novel-FontDefaults.sty' + + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-Footnotes.sty b/Master/texmf-dist/tex/lualatex/novel/novel-Footnotes.sty new file mode 100644 index 00000000000..4cdec984649 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-Footnotes.sty @@ -0,0 +1,268 @@ +%% +%% This is file `novel-Footnotes.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-Footnotes.sty}% +[2017/03/01 v1.0.6 LaTeX file (commands for footnotes and endnotes)] +%% + + +%% FOOTNOTES +%% ----------------------------------------------------------------------------- +% In `novel' class, you may place footnotes at the botom of the textblock. +% The markers may be symbolic (default begins with asterisk), or +% set so that the asterisk is not used, or the markers may be numbers, +% If symbolic, they will be automatically reset by ChapterDisplay. +% You can manually reset them at any time. +% You can also make a non-marked footnote, which does not increment the count. + + + +%% footnotesize is calculated by layout, based on normal font size and skip. +%% It is used only for actual footnotes! + +% +\newcounter{@fnsymbolcount} % counter, footenote symbolic markers + \setcounter{@fnsymbolcount}{1} +\newcounter{@fnnumbercount} % counter, footnote numerical markers + \setcounter{@fnnumbercount}{1} +\newcounter{@rnnumbercount} % counter, endnote markers (always numerical) + \setcounter{@rnnumbercount}{1} +\newcounter{@maxfnsymbol} % max footnote symbol count before recycle +% +\gdef\ResetFootnote{% symbols or numbers + \setcounter{@fnsymbolcount}{1}% + \setcounter{@fnnumbercount}{1}% +} +\gdef\ResetFootnoteSymbol{\setcounter{@fnsymbolcount}{1}} % only symbols +\gdef\Resetendnote{\setcounter{@rnnumbercount}{1}} +% +\newtoggle{@usenomark} % when true: no mark, no increment count +\newtoggle{@placedfootnotenumber} % true if any numerical footnote placed +% +\let\my@oldfootnote\footnote\relax % copies the original definition +\let\footnote\relax % so it can be re-defined, below +% +\gdef\@fourem{% length of rule separating footnotes from main text + \vspace{-\nbs} + \noindent\strut\smash{\rule[-2pt]{0.33\textwidth}{0.05\normalFontSize}} +} +\let\footnoterule\@fourem +% + + +% \@makefnmark applies to the footnote marker in the flow of main text: +\gdef\@makefnmark{\iftoggle{@usenomark}{}{\@getfnmark}} +% +\long\gdef\@makefntext#1{% the actual footnote, at bottom of textblock + \iftoggle{@usenomark}% + {\forceindent#1}% + {\forceindent\@getbotfnmark\,#1}% +} % end \@makefntext +% Now re-define \footnote: +\newcommand\footnote[2][]{% + \ifthenelse{\equal{#1}{0}}{% + \global\toggletrue{@usenomark}% + }{% + \global\togglefalse{@usenomark}% + }% + \gdef\footnoterule{\@fourem}% + \begingroup% + \def\footnotesize{% Not gdef. Only here in footnote. Calculated during layout. + \@setfontsize\footnotesize{\@myfootnotesizenum pt}{\@myfootnoteskipnum pt}% + }% + \unskip\my@oldfootnote{#2}% + \endgroup% +} % end \footnote +% +% \@rollfnsymbol prevents running out of symbolic markers: +\gdef\@rollfnsymbol{% + \stepcounter{@fnsymbolcount}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{\value{@maxfnsymbol}}}{% + \setcounter{@fnsymbolcount}{1}% + }{}% +} % end \@rollfnsymbol +% +% \@getfnmark places a footnote marker in the running text. +% The marker depends upon whether it should be a number or a symbol. +% If the latter, then it depends on whether the symbols include asterisks. +% And, it depends upon the current count for that type of marker. +\gdef\@getfnmark{% + \iftoggle{@usesymbolmark}% + {% + \global\togglefalse{@placedfootnotenumber}% + \ifthenelse{\equal{\@myfnsymbols}{*}}{% + \ifthenelse{\equal{\value{@fnsymbolcount}}{1}}{\charscale[1,0pt,-\@twast]{*}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{2}}{\charscale[0.8,0pt,-\@twdag]{†}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{3}}{\charscale[0.8,0pt,-\@twdbldag]{‡}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{4}}{\charscale[0.8,0pt,-\@twsect]{§}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{5}}{\charscale[1,0pt,-\@twast]{**}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{6}}{\charscale[0.8,0pt,-\@twdag]{††}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{7}}{\charscale[0.8,0pt,-\@twdbldag]{‡‡}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{8}}{\charscale[0.8,0pt,-\@twsect]{§§}}{}% + }{}% + \ifthenelse{\equal{\@myfnsymbols}{†}}{% + \ifthenelse{\equal{\value{@fnsymbolcount}}{1}}{\charscale[0.8,0pt,-\@twdag]{†}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{2}}{\charscale[0.8,0pt,-\@twdbldag]{‡}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{3}}{\charscale[0.8,0pt,-\@twsect]{§}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{4}}{\charscale[0.8,0pt,-\@twdag]{††}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{5}}{\charscale[0.8,0pt,-\@twdbldag]{‡‡}}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{6}}{\charscale[0.8,0pt,-\@twsect]{§§}}{}% + }{}% + }{% + \global\toggletrue{@placedfootnotenumber}% + \sups{\arabic{@fnnumbercount}}% + }% +} % end \@getfnmark +% +% \@getbotfnmark places the marker in front of the actual footnote, +% towards the bottom of the textblock. It duplicates the marker used in +% running text, but is not elevated. Then, it increments the relevant count. +% Note that (unlike some other TeX document classes) this marker is at +% the indent, so that the footnote text is farther inward than the indent. +% This is the preferred style. +\gdef\@getbotfnmark{% + \iftoggle{@usesymbolmark}% + {% + \ifthenelse{\equal{\@myfnsymbols}{*}}{% + \ifthenelse{\equal{\value{@fnsymbolcount}}{1}}{*}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{2}}{†}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{3}}{‡}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{4}}{§}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{5}}{**}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{6}}{††}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{7}}{‡‡}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{8}}{§§}{}% + }{}% + \ifthenelse{\equal{\@myfnsymbols}{†}}{% + \ifthenelse{\equal{\value{@fnsymbolcount}}{1}}{†}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{2}}{‡}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{3}}{§}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{4}}{††}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{5}}{‡‡}{}% + \ifthenelse{\equal{\value{@fnsymbolcount}}{6}}{§§}{}% + }{}% + \@rollfnsymbol% + }{% + \textrm{\arabic{@fnnumbercount}.}% + \stepcounter{@fnnumbercount}% + }% +} %end \@getbotfnmark +% +%% end footnotes + + +%% ENDNOTES +%% ----------------------------------------------------------------------------- +% \endnote only places a marker. It does not store a note for later use. +% The \memo{} command is helpful, to make a non-printing note to yourself. +% Whenever \endnote is used, the marker number and page is added to a list, +% and the list is typed into the log file after the document ends. That way, +% you can hunt down where the endnotes markers were placed. +\newtoggle{@gotendnotes} % true when \endnote used +% +\long\gdef\@endnotelist{} +\newcounter{@endnotecount} +% +\DeclareDocumentCommand \endnote { } +{% +\global\toggletrue{@gotendnotes}% +\stepcounter{@endnotecount}\sups{\arabic{@endnotecount}}% +\long\edef\@endnotelist{\@endnotelist\space (\arabic{@endnotecount},p.\thepage)}% +} +%% +% \endnotetext{ID}{text} where ID is (usually) the endnote number. +% If ID is other than space or tilde, it prints at left margin, followed by +% period. Then the entire text is block-indented. Only one paragraph allowed. +% If ID is space or empty, then the entire text is block-indented. This is +% the method for continuing a prior endnote to a new paragraph. The text +% may begin with \forceindent, according to your needs. +\DeclareDocumentCommand \endnotetext { m +m }% xparse allows \end... commands! +{ + \ifthenelse{\equal{#1}{\space}\OR\equal{#1}{}}% + {\noindent\hangindent=\parindent\flexbox{\space}#2\par}% + {\noindent\hangindent=\parindent\flexbox{#1.}#2\par}% +} +%% end endnotes + + + +%% ATBEGINDOCUMENT +%% ----------------------------------------------------------------------------- +%% +\AtBeginDocument{ + \gdef\SetFootnoteMarker#1{% + \typeout{^^JClass `novel' Alert: % + \string\SetFootnoteMarker\space ineffective after Preamble.^^J}% + } + % Must wait for \nbs to be calculated: + \setlength\footnotesep{0.8\nbs} + % Must wait for main font and its size to be active: + \newlength\@hoaring + \setlength\@hoaring{\heightof{Å}} + \global\@hoaring=\@hoaring + \newlength\@twast % tweaks asterisk + \setlength\@twast{\heightof{*}} + \addtolength\@twast{-\@hoaring} + \global\@twast=\@twast + \newlength\@twdag % tweaks dagger + \setlength\@twdag{\heightof{†}} + \addtolength\@twdag{-0.2\@twdag} + \addtolength\@twdag{-\@hoaring} + \global\@twdag=\@twdag + \newlength\@twdbldag % tweaks double dagger + \setlength\@twdbldag{\heightof{‡}} + \addtolength\@twdbldag{-0.2\@twdbldag} + \addtolength\@twdbldag{-\@hoaring} + \global\@twdbldag=\@twdbldag + \newlength\@twsect % tweaks section mark + \setlength\@twsect{\heightof{§}} + \addtolength\@twsect{-0.2\@twsect} + \addtolength\@twsect{-\@hoaring} + \global\@twsect=\@twsect + \newlength\@tweight % tweaks 8, reliably the tallest digit + \setlength\@tweight{\heightof{8}}% + \addtolength\@tweight{-0.2\@tweight}% + \addtolength\@tweight{-\@hoaring}% + \global\@tweight=\@tweight% + % Must wait to see how \SetFootnoteMarker was used: + \ifthenelse{\equal{\@myfnsymbols}{*}}{\setcounter{@maxfnsymbol}{8}}{} + \ifthenelse{\equal{\@myfnsymbols}{†}}{\setcounter{@maxfnsymbol}{6}}{} + % +} % end \AtBeginDocument +%% + + +%% ATENDDOCUMENT +%% ----------------------------------------------------------------------------- +%% Write a list of endnote (number,page) into log file, +% and Big Bad Warning if numerical footnotes and endnotes both used: +\AtEndDocument{% + \iftoggle{@gotendnotes}% + {\typeout{^^J^^JClass `novel' Alert: You placed endnotes (number,page):^^J% + \@endnotelist% + ^^J^^J}% + }{} + % + \iftoggle{@placedfootnotenumber}% + {\iftoggle{@gotendnotes}% + {\typeout{^^JClass `novel' BIG BAD WARNING:^^J% + Numbered footnotes and endnotes! Better use symbolic footnotes!^^J^^J}% + }{}% + }{}% +}% end \AtEndDocument +%% + + +%% end of file `novel-Footnotes.sty' + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-HeadFootStyles.sty b/Master/texmf-dist/tex/lualatex/novel/novel-HeadFootStyles.sty new file mode 100644 index 00000000000..8717ac15fa2 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-HeadFootStyles.sty @@ -0,0 +1,364 @@ +%% +%% This is file `novel-HeadFootStyles.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-HeadFootStyles.sty}% +[2017/03/01 v1.0.6 LaTeX file (header and footer styles)] +%% + + +%% File `novel-LayoutSettings.sty' reserved space for header/footer, +%% but did not place anything there. In this file, `fancyhdr' syntax +%% defines the standard styles. These styles are not activated until +%% \AtEndPreamble, and only if the user did not already define the styles +%% in the Preamble. + + +% @isVerso true = even page, false = odd page. Only accurate during shipout. +% Not to be used in commands that are inserted in main text! +\newif \if@isVerso \@isVersofalse +\def\check@IsVerso{% + \def\my@PageNum{\arabic{page}}% + \FPdiv{\my@HalfPageNum}{\my@PageNum}{2}% + \FPifint{\my@HalfPageNum}% + \global\@isVersotrue% + \else% + \global\@isVersofalse% + \fi% +} +% +\newtoggle{@inheadfoot} % true in header or footer +%% + + +%% INITIALIZE FANCYHDR +%% ----------------------------------------------------------------------------- +%% Before now now, space was reserved for header/footer. +% Start by loading package `fancyhdr' and blanking everything: +\RequirePackage{fancyhdr} + \renewcommand\headrulewidth{0pt} + \renewcommand\footrulewidth{0pt} + \fancyhead[LO,RE,LE,RO,CE,CO]{} + \fancyfoot[LO,RE,LE,RO,CE,CO]{} +% \textls looseness factor (microtype) 0=tight, 50=default +\gdef\SetLooseHead#1{ + \gdef\@loosehead{#1} + \FPmin{\@looseheadnum}{\@loosehead}{50} % Don't want numbers too loose. +} +\SetLooseHead{50} + +% Create flags to know if \fancyhead and \fancyfoot have been defined by user, +% somewhere in the Preamble. If not, then pre-defined styles based on trimsize +% will be applied \AtEndPreamble. +\LetLtxMacro{\@tempFancyhead}{\fancyhead} % from package `letltxmacro' +\renewcommand\fancyhead[2][]{% + \@styledHeadertrue% + \@tempFancyhead[#1]{\toggletrue{@inheadfoot}{\normalsize#2}}% +} +% +\LetLtxMacro{\@tempFancyfoot}{\fancyfoot} +\renewcommand\fancyfoot[2][]{% + \@styledFootertrue% + \FPsub{\@footraise}{\@footjump}{1}% + \FPmul{\@footraise}{-\@footraise}{\Current@BaselineSkipNum}% + \@tempFancyfoot[#1]{% + \toggletrue{@inheadfoot}% + \stake\smash{\raisebox{\@footraise pt}{{\normalsize#2}}}% + }% +} +% +\LetLtxMacro{\@myTempTPS}{\thispagestyle} +% Re-define \thispagestyle based on layout. When style requests only the page +% number, decide what to do based on this command and whether footer is used: +\newif \if@thispagestyleset \@thispagestylesetfalse +\AtBeginShipout{\global\@thispagestylesetfalse} +% +\gdef\thispagestyle#1{% + \global\@thispagestylesettrue% + \gdef\@pagestyleOK{false}% + \ifthenelse{\equal{#1}{fancy}}{% + \gdef\@pagestyleOK{true}% + \@myTempTPS{fancy}% + }{}% + \ifthenelse{\equal{#1}{empty}}{% + \gdef\@pagestyleOK{true}% + \@myTempTPS{empty}% + }{}% + \ifthenelse{\equal{#1}{plain}\OR\equal{#1}{fancyplain}\OR\equal{#1}{footer}}{% + \gdef\@pagestyleOK{true}% + \if@gotFooter \@myTempTPS{fancyplain}% + \else \@myTempTPS{empty}% + \fi% + }{}% + \ifthenelse{\equal{#1}{forcenumber}}{% + \gdef\@pagestyleOK{true}% + \if@gotFooter \@myTempTPS{fancyplain}% + \else \@myTempTPS{fancynumber}% + \fi% + }{}% + % + \ifthenelse{\equal{#1}{dropfolioinside}% after \clearpage + \OR \equal{#1}{dropfolio} \OR \equal{#1}{dropfoliolater}}{% compatibility + \gdef\@pagestyleOK{true}% + \if@gotFooter% + \@myTempTPS{fancyplain}% + \else% + \global\@addCTlinefalse% + \@myTempTPS{empty}% + \@dropfolioinside + \fi% + }{}% + % With `dropfoliobeneath` only a footer is used, if present. If no footer, + % then the styled page number is centered at one baselineskip beneath the + % ordinary bottom of the textblock. Thus, the number intrudes into the + % bottom margin. This is OK if the bottom margin is wider than minimum. + % Whether the margin is wide enough, is for the user to determine, because + % the document class does not know the printer's limitations. + \ifthenelse{\equal{#1}{dropfoliobeneath}}{% after \clearpage + \gdef\@pagestyleOK{true}% + \if@gotFooter% + \@myTempTPS{fancyplain}% + \else% + \@myTempTPS{empty}% + \@dropfoliobeneath + \fi% + }{}% + %% + \ifthenelse{\equal{\@pagestyleOK}{true}}{}{% + \ClassWarning{novel}{^^JPage \pagenumberstyle\space has % + \string\thispagestyle{}^^J% + but its argument is not defined. Default substituted. Better fix that.^^J}% + }% +} +% +%% End initialize fancyhdr. + + + +%% ACTIVATE HEADER/FOOTER STYLES AT BEGIN DOCUMENT +%% ----------------------------------------------------------------------------- +% +\gdef\@activateHeadFootStyles{ % called \AtBeginDocument by novel.cls + % Pre-configured header/footer styles, unless user over-rode them: + % \versoheadtext is initialized to \theauthor + % \rectoheadtext is initialized to \thetitle + \@ifundefined{versoheadtext}{ + \NewVersoHeadText{\smcp{\StrSubstitute{\theauthor}{\space}{~}}} + }{} + \@ifundefined{rectoheadtext}{ + \NewRectoHeadText{\smcp{\StrSubstitute{\thetitle}{\space}{~}}} + }{} + % + % ---------------------------------------------------------------------------- + % IF YOU ARE WRITING YOUR OWN HEADER/FOOTER STYLE: + % Look here for the pre-defined styles, for use as models. + % Note that if you write \fancyhead or \fancyfoot in the Preamble, + % that sets the \@styledHeader flag, so these codes do not over-ride yours. + \ifthenelse{\equal{\my@HeadFootStyle}{1}}{ % default + \if@styledHeader\else + \fancyhead[LE]{\makebox[2.5em][l]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}\my@VersoEmblem% + } + \fancyhead[RO]{\my@RectoEmblem\makebox[2.5em][r]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}% + } + \fancyhead[CE]{{\headfont\textls[\@loosehead]{\versoheadtext}}} + \fancyhead[CO]{{\headfont\textls[\@loosehead]{\rectoheadtext}}} + \fi + }{} + % + \ifthenelse{\equal{\my@HeadFootStyle}{2}}{ + \if@styledFooter\else + \fancyfoot[LE]{\makebox[2.5em][l]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}\my@VersoEmblem% + } + \fancyfoot[RO]{\my@RectoEmblem\makebox[2.5em][r]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}% + } + \fi + }{} + % + \ifthenelse{\equal{\my@HeadFootStyle}{3}}{ + \if@styledFooter\else + \fancyfoot[CO,CE]{{% + \headfont\textls[\@looseheadnum]{\pagenumberstyle}}% + } + \fi + }{} + % + \ifthenelse{\equal{\my@HeadFootStyle}{4}}{ + \if@styledHeader\else + \fancyhead[LE]{\makebox[2.5em][l]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}% + \my@VersoEmblem\hspace{1em}% + {\headfont\textls[\@loosehead]{\versoheadtext}}% + } + \fancyhead[RO]{{\headfont\textls[\@loosehead]{\rectoheadtext}}% + \hspace{1em}\my@RectoEmblem\makebox[2.5em][r]{{% + \headfont\textls[\@looseheadnum]{\pagenumberstyle}}}% + } + \fi + }{} + % + \ifthenelse{\equal{\my@HeadFootStyle}{5}}{ + \if@styledHeader\else + \fancyhead[CE]{{\headfont\textls[\@loosehead]{\versoheadtext}}} + \fancyhead[CO]{{\headfont\textls[\@loosehead]{\rectoheadtext}}} + \fi + \if@styledFooter\else + \fancyfoot[CO,CE]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}% + } + \fi + }{} + % + \ifthenelse{\equal{\my@HeadFootStyle}{6}}{ + \if@styledHeader\else + \fancyhead[LE]{\makebox[2.5em][l]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}\my@VersoEmblem% + } + \fancyhead[RO]{\my@RectoEmblem\makebox[2.5em][r]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}% + } + \fancyhead[RE]{{\headfont\textls[\@loosehead]{\versoheadtext}}} + \fancyhead[LO]{{\headfont\textls[\@loosehead]{\rectoheadtext}}} + \fi + }{} + % + % END PRE-DEFINED STYLES. + % ---------------------------------------------------------------------------- + % + % Substitute for \thispagestyle{plain} + \fancypagestyle{fancyplain}{ % if has footer + \renewcommand\headrulewidth{0pt} + \renewcommand\footrulewidth{0pt} + \fancyhead[LO,RE,LE,RO,CE,CO]{} + \fancyfoot[LO,RE,LE,RO,CE,CO]{} + \fancyfoot[CO,CE]{{\headfont\textls[\@looseheadnum]{\pagenumberstyle}}} + } + % Not a user command, use plain or fancyplain: + \fancypagestyle{fancynumber}{ % if has header but not footer + \renewcommand\headrulewidth{0pt} + \renewcommand\footrulewidth{0pt} + \fancyhead[LO,RE,LE,RO,CE,CO]{} + \fancyhead[LE]{\makebox[2.5em][l]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}\my@VersoEmblem% + } + \fancyhead[RO]{\my@RectoEmblem\makebox[2.5em][r]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}% + } + \fancyfoot[LO,RE,LE,RO,CE,CO]{} + } + % Now put `fancyhdr' to work: + \pagestyle{fancy} % default unless over-ridden by \thispagestyle{} + % +} % end \@activateHeadFootStyles +% +%% end initialize fancyhdr + + + +%% DROPFOLIO +%% ----------------------------------------------------------------------------- +\newlength\temp@pgnumwidth +\newlength\temp@pgnumraise +% +% \@dropfolioinside reduces the textblock height by one lineskip. At the bottom, +% where the last line would have been, the styled page number is centered. +\newcommand\@dropfolioinside{% + \thispagestyle{empty}% + \enlargethispage{-\nbs} + \setlength\temp@pgnumwidth{% + \widthof{{\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}}% + \if@offcenterTrim% + \setlength\temp@pgnumraise{% + \New@BottomMargin+\New@MediaHeight-\New@TrimHeight}% + \else% + \setlength\temp@pgnumraise{% + \New@BottomMargin+0.5\New@MediaHeight-0.5\New@TrimHeight}% + \fi% + \check@IsVerso% + \if@isVerso% + \AddToShipoutPicture*{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx+\New@OutsideMargin+0.5\textwidth-0.5\temp@pgnumwidth}\raisebox{% + \temp@pgnumraise}{{\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}}}% + \else% + \AddToShipoutPicture*{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx+\New@InsideMargin-0.5\temp@pgnumwidth}% + \charscale[1,0.5\textwidth,\temp@pgnumraise]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}}}% + \fi% +} % end \@dropfolioinside +% +\let\dropfolionow\relax % compatibility with earlier version. +% +% \@dropfoliobeneath does not change the textblock height. The styled page +% number is centered where an extra line would be, within the bottom margin. +\newcommand\@dropfoliobeneath{% + \thispagestyle{empty}% + \setlength\temp@pgnumwidth{% + \widthof{{\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}}% + \if@offcenterTrim% + \setlength\temp@pgnumraise{% + \New@BottomMargin-\nbs+\New@MediaHeight-\New@TrimHeight}% + \else% + \setlength\temp@pgnumraise{% + \New@BottomMargin-\nbs+0.5\New@MediaHeight-0.5\New@TrimHeight}% + \fi% + \check@IsVerso% + \if@isVerso% + \AddToShipoutPicture*{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx+\New@OutsideMargin-0.5\temp@pgnumwidth}\raisebox{% + \temp@pgnumraise}{{\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}}}% + \else% + \AddToShipoutPicture*{\@getPageXY\AtPageLowerLeft{% + \hspace{\dimexpr\Trim@Lx+\New@InsideMargin-0.5\temp@pgnumwidth}% + \charscale[1,0.5\textwidth,\temp@pgnumraise]{% + {\headfont\textls[\@looseheadnum]{\pagenumberstyle}}}}}% + \fi% +} % end \@dropfoliobeneath +%% +% +% Content of header text (if present) can be changed at any time within +% the body, using the following commands. If not used, then +% Verso is initialized to \theauthor and Recto is initialized to \thetitle +% AtBeginDocument, with adjustments to interword spacing. +% If you wish, you may write the commands with empty arguments, in which case +% the header still appears with page number (if present), but no text. +% +\newlength\@mykem +% +\gdef\NewVersoHeadText#1{ + \FPdiv{\@myk}{\@loosehead}{500} + \setlength\@mykem{\@myk em} + \gdef\versoheadtext{\gdef~{\kern\@mykem\space}#1\gdef~{\nobreakspace {}}} +} +\let\SetVersoHeadText\NewVersoHeadText\relax % for convenience +\let\RenewVersoHeadText\NewVersoHeadText\relax % for convenience +% +\gdef\NewRectoHeadText#1{ + \FPdiv{\@myk}{\@loosehead}{500} + \setlength\@mykem{\@myk em} + \gdef\rectoheadtext{\gdef~{\kern\@mykem\space}#1\gdef~{\nobreakspace {}}} +} +\let\SetRectoHeadText\NewRectoHeadText\relax % for convenience +\let\RenewRectoHeadText\NewRectoHeadText\relax % for convenience +% +%% end dropfolio. + + + +% +%% End of file `novel-HeadFootStyles.sty' + + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-Images.sty b/Master/texmf-dist/tex/lualatex/novel/novel-Images.sty new file mode 100644 index 00000000000..9a823653d37 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-Images.sty @@ -0,0 +1,268 @@ +%% +%% This is file `novel-Images.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-Images.sty}% +[2017/03/01 v1.0.6 LaTeX file (image placement)] +%% + + +%% +%% Be sure to read the separate documentation about how to prepare images. +%% In general: (1) png or jpg only. (2) Flattened, no transparency. +%% (3) 300dpi (grayscale) or 600dpi (black/white) are industry norms. +%% (4) Image file must contain its resolution. (5) Exact size, without scaling. +%% (6) No private metadata. (7) Be sure grayscale is 1-channel, not rgb gray. +%% + + + +% \InlineImage[hoffset,voffset]{imagefile.png or jpg} and starred version. +% +% Use hoffset to displace the image horizontally. Positive is to the right. +% Use voffset to displace the image vertically. Positive is upward. +% Can use hoffset by itself, then voffset defaults to 0pt. +% +% The TOP of the image is placed at the baseline of text (unless offset). +% To place image so that its BOTTOM (rather than top) is at the text baseline, +% use voffset b. Can also use b+2em or b-3.4pt etc. without spaces. +% To place image so that its top is as text X height, voffset \heightof{X}. +% +% You can combine lengths, such as: +% voffset 0.2em+\heightof{X} or b-\heightof{Aring}+0.5em +% However, do not begin the string with + or - followed directly by \heightof. +% +% Unstarred command: Image occupies its natural width, so that following text +% (if on same line) is after the image. +% Starred command: Image occupies zero width, so that following text (if on +% the same line) overlays the image. +% In all cases, the image occupies zero height, so that following text lines +% will overlay the image, unless you insert some \null lines. +% In some case, having following text overlay the image is desirable. But talk +% with your print service about that. Not all like it. +% If the image rises above its line of text, it may overlay text on the +% preceding line, which obscures that text. Don't do it. +% +% Clever use of hoffset, with narrowed textblock, can place text beside image. +% +% \imagewidth and \imageheight may be used for offsets, or for any other +% purpose once the image is placed. These lengths retain their values +% until a subsequent image is placed, not including anything in header/footer. +% +\def\Aring{Å} % has typical maximum accented character height in Latin-1. +% +\newlength\imagewidth +\newlength\imageheight +\newlength\imagehoffset +\newlength\imagevoffset +\newlength\@imagewidth +\newlength\@imageheight +\newlength\@imagehoffset +\newlength\@imagevoffset +\gdef\imagestarred{false} +\gdef\imagefilename{unknown} +% Neutralize \includegraphics, so it is no longer a user command: +\let\@includegraphics\includegraphics\relax +\let\includegraphics\relax +\newcommand\includegraphics[2][]{ + \ClassError{novel}{Cannot use \string\includegraphics\space on page \thepage} + {The `novel' class has its own commands for placing images. See docs.^^J% + You cannot use the \string\includegraphics\space command.}% +} +% +% \InlineImage can be used in body, header, footer. +% However, macros such as \imagefilename, \imagewidth, etc. +% are only set or re-set when the image in in the body. +% That prevents an intervening header/footer image from over-writing +% values set by the most recent body image. +% The unstarred command occupies the width of the image. +% The starred command occupies zero width. +% +\ExplSyntaxOn +\DeclareDocumentCommand \InlineImage { s O{0pt} m }{% + \newif\if@imgExtOK% + \IfEndWith{#3}{png}{\@imgExtOKtrue}{}% + \IfEndWith{#3}{PNG}{\@imgExtOKtrue}{}% + \IfEndWith{#3}{jpg}{\@imgExtOKtrue}{}% + \IfEndWith{#3}{JPG}{\@imgExtOKtrue}{}% + \IfEndWith{#3}{jpeg}{\@imgExtOKtrue}{}% + \IfEndWith{#3}{JPEG}{\@imgExtOKtrue}{}% + \if@imgExtOK\else% + \ClassError{novel}{^^JImage~`#3'~format~not~allowed}% + {^^JImage~`#3'~has~file~type~not~allowed~in~`novel'~class.^^J% + Must~have~file~extension~png,~jpg,~jpeg~(or~capitalized).^^J% + Others~such~as~pdf~bmp,~tiff,~eps,~pdf,~svg~are~not~allowed.^^J}% + \fi% + \StrDel{#2}{\space}[\@myila]% + \StrCut{\@myila}{,}{\@myilxa}{\@myilya}% + \ifthenelse{\equal{\@myilxa}{} \OR \equal{\@myilxa}{0}}{% + \def\@myilx{0pt}}{\def\@myilx{\@myilxa}% + }% + \ifthenelse{\equal{\@myilya}{} \OR \equal{\@myilya}{0}}{% + \def\@myily{0pt}}{\def\@myily{\@myilya}% + }% + \iftoggle{@inheadfoot}{}{\gdef\imagefilename{#3}}% for possible later use + \gdef\my@graphic{\@includegraphics[draft=false]{#3}}% + \setlength\@imagewidth{\widthof{\my@graphic}}% + \global\@imagewidth=\@imagewidth% + \iftoggle{@inheadfoot}{}{\setlength\imagewidth{\@imagewidth}}% + \setlength\@imageheight{\heightof{\my@graphic}}% + \global\@imageheight=\@imageheight% + \iftoggle{@inheadfoot}{}{% + \setlength\imageheight{\@imageheight}% + \global\imageheight=\imageheight% + \typeout{^^JClass~`novel'~Info:~An~image~was~placed~on~page~\thepage.^^J% + Review~layout~to~ensure~that~it~does~not~overflow~into~margins.^^J}% + }% + \gdef\@imageheightnum{\strip@pt\@imageheight}% + \FPdiv{\@imagelines}{\@imageheightnum}{\nbsnum}% + \FPadd{\@imagelines}{\@imagelines}{0.5}% round up to integer, not down + \FPround{\@imagelines}{\@imagelines}{0}% + \FPclip{\@imagelines}{\@imagelines}% + \iftoggle{@inheadfoot}{}{\gdef\imagelineskip{\@imagelines}}% + % + \setlength\@imagehoffset{\@myilx}% + \IfBeginWith{\@myily}{b}{% + \StrDel[1]{\@myily}{b}[\temp@adjVoffseta]% + \ifthenelse{\equal{\temp@adjVoffseta}{} \OR \equal{\temp@adjVoffseta}{0}}{% + \def\temp@adjVoffset{0pt}}{\def\temp@adjVoffset{\temp@adjVoffseta}% + }% + \setlength\@imagevoffset{\temp@adjVoffset}% + }{% + \setlength\@imagevoffset{-\@imageheight}% + \addtolength\@imagevoffset{\@myily}% + }% + % + \IfBooleanTF{#1}% + % starred: + {% + \iftoggle{@inheadfoot}{}{\gdef\imagestarred{true}}% + \makebox[0pt][l]{% + \hspace{\@imagehoffset}% + \stake\smash{\raisebox{\@imagevoffset}{\my@graphic}}% + }% + }% + % unstarred: + {% + \iftoggle{@inheadfoot}{}{\gdef\imagestarred{false}}% + \hspace{\@imagehoffset}% + \stake\smash{\raisebox{\@imagevoffset}{\my@graphic}}% + }% end IfBooleanTF{#1} + \iftoggle{@inheadfoot}{}{\setlength\imagehoffset{\@imagehoffset}}% + \iftoggle{@inheadfoot}{}{\setlength\imagevoffset{\@imagevoffset}}% +} % end DeclareDocumentCommand \InlineImage +\ExplSyntaxOff +% +%% + + + +%% \BlockImage[alignment]{image}[text] +% Alignment may have up to 3 comma-separated values. Default is [c] +% First alignment: l, c, r (left, center, right). +% Second alignment: x-offset of image (not text). Default 0pt. May use 0. +% Third alignment: y-offset of image (not text). Default 0pt. May use 0. +% Offsets are positive right and up. +% The optional text, if used, must have its opening bracket immediately +% follow the image closing brace, without intervening space. +% Text may have line break or more than one paragraph, and may be styled. +% But any font family change must go outside this command, not within the text. +% The text will begin in the same block of vertical space as the image. +% If image is centered, the text will automatically be centered, so that +% it necessarily overlies the image. +% \forceindent or \backindent may be needed. Text may have several paragraphs. +% Subsequent text (after all that) will clear the image bottom, and also +% be at the baseline grid. Beware of using this command near bottom of page. +\ExplSyntaxOn +\DeclareDocumentCommand \BlockImage { O{c} m +O{} }{ + % Allows empty or blank to be used, and still provide default values: + \ifthenelse{\equal{#1}{}\OR\equal{#1}{\space}}{% + \def\@myargs{c}}{\def\@myargs{#1}% + } + \StrDel{\@myargs}{\space}[\@myargsns] % needs {\space} not { } + \StrCut{\@myargsns}{,}{\@myalign}{\@mycoord} + \StrCut{\@mycoord}{,}{\@myxt}{\@myyt} + \ifthenelse{\equal{\@myxt}{}\OR\equal{\@myxt}{0}}{% + \def\@myx{0pt}}{\def\@myx{\@myxt}% + } + \ifthenelse{\equal{\@myyt}{}\OR\equal{\@myyt}{0}}{% + \def\@myy{0pt}}{\def\@myy{\@myyt}% + } + \newdimen\@sbsheight + \ifthenelse{\equal{\@myalign}{c}\OR\equal{\@myalign}{}}{% + {\centering\InlineImage*[{\@myx-0.5\imagewidth},{\@myy}]{#2}\par} + \vspace{-\nbs} + {\centering #3\par} + \setbox0=\vbox{{\centering #3\par}} + }{} + \ifthenelse{\equal{\@myalign}{r}}{% + \noindent\InlineImage*[{\textwidth-\imagewidth+\@myx},{\@myy}]{#2}\par% + \vspace{-\nbs} + \begin{adjustwidth}{0pt}{\imagewidth+\parindent}% + #3\par% + \end{adjustwidth}% + \setbox0=\vbox{% + \begin{adjustwidth}{0pt}{\imagewidth+\parindent}% + #3\par% + \end{adjustwidth}% + }% + }{} + \ifthenelse{\equal{\@myalign}{l}}{% + \noindent\InlineImage*[{\@myx},{\@myy}]{#2}\par% + \vspace{-\nbs} + \begin{adjustwidth}{\imagewidth+\parindent}{0pt}% + #3\par% + \end{adjustwidth}% + \setbox0=\vbox{% + \begin{adjustwidth}{\imagewidth+\parindent}{0pt}% + #3\par% + \end{adjustwidth}% + }% + }{} + % portion here, inspired by post from user Killian Foth, + % at stackoverflow.com, license CC-by-sa-3.0. + \@sbsheight=\ht0 \advance\@sbsheight by \dp0 + \def\@sbsheightnum{\strip@pt\@sbsheight} + \FPdiv{\@roughlines}{\@sbsheightnum}{\nbsnum} + \FPadd{\@roughlines}{\@roughlines}{0.5} % round up, not down + \FPround{\@roughlines}{\@roughlines}{0} + \FPclip{\@roughlines}{\@roughlines} + \FPadd{\@adjimagelines}{\imagelineskip}{1} % \imagelineskip from \InlineImage* + \FPsub{\@skipme}{\@adjimagelines}{\@roughlines} + \FPmax{\@skipme}{\@skipme}{0} + \vspace{\@skipme\nbs} +} +\ExplSyntaxOff +%% + + + + +% Returns 1 for monochrome, 8 for grayscale (or rgb). EXPERIMENTAL. +% Not documented. Not used as part of any other commands. +\gdef\imagecolordepth{% + \ifthenelse{\equal{\imagefilename}{unknown}}{unknown}{% + \directlua{% + img1=img.scan{filename="\imagefilename"}% + tex.print(tostring(img1.colordepth))% + }% + }% +} +% + + + +%% +%% End of file `novel-Images.sty'. + + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-JC200103.clo b/Master/texmf-dist/tex/lualatex/novel/novel-JC200103.clo new file mode 100644 index 00000000000..5fb491ab202 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-JC200103.clo @@ -0,0 +1,14 @@ +% Typically used in Japan. Novel file version 1.0.6 + +% The values of the arguments are public industry standards. + +% Remember: TeX special characters must be backslashed here. +% You may see % or # or _ in the data or file names. +% Be sure that they are written as \% \# \_ or there will be trouble. + +\gdef\@OIidentifier{JC200103} % also called "reference name" +\gdef\@OIcondition{Japan Color 2001 Coated: Printing process definition: ISO 12647-2:2004, sheet-fed offset printing, positive plates, paper type 3 (coated, 105 gsm), screen frequency 69/cm.} +\gdef\@OIinfo{Japan Color 2001 Coated} +\gdef\@OIregistry{http://www.color.org} +\gdef\@OIprofile{JapanColor2001Coated.icc} + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty b/Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty new file mode 100644 index 00000000000..1de97130d1d --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-LayoutSettings.sty @@ -0,0 +1,805 @@ +%% +%% This is file `novel-LayoutSettings.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-LayoutSettings.sty}% +[2017/03/01 v1.0.6 LaTeX file (layout settings)] +%% + + +%% 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 +\newlength\Old@TrimHeight % finished height of printed book +\newlength\New@TrimWidth % Initialized to \Old@TrimWidth. +\newlength\New@TrimHeight % Initialized to \Old@TrimHeight. +\newlength\Old@TopMargin +\newlength\Old@OutsideMargin +\newlength\Old@BottomMargin +\newlength\Old@InsideMargin +\newlength\New@TopMargin +\newlength\New@OutsideMargin +\newlength\New@BottomMargin +\newlength\New@InsideMargin +\newlength\Old@MediaWidth % Defaults to trim width, but can be set larger. +\newlength\Old@MediaHeight % Defaults to trim height, but can be set larger. +\newlength\New@MediaWidth % Initialized to \Old@MediaWidth. +\newlength\New@MediaHeight % Initialized to \Old@MediaHeight. +\newlength\Old@FontSize +% +\gdef\my@HeadFootStyle{1} % default: header but not footer +\gdef\my@VersoEmblem{} % no default emblem +\gdef\my@RectoEmblem{} % no default emblem +\gdef\novel@checkfeatures#1{} % re-defined below +% +\newif \if@TrimSizeSet +\newif \if@MarginsSet +\newif \if@MediaSizeSet +\newif \if@LinesPerPageSet +\newif \if@FontSizeSet +\newif \if@ReworkTrimSet +\newif \if@ReworkMarginsSet +% +\newlength\normalxheight +\newlength\normalXheight +%% + + +%% SIZE-RELATED COMMANDS AVAILABLE IN PREAMBLE. +%% ----------------------------------------------------------------------------- +%% Use if necessary for customization. +%% If you like a class option that pre-sets these values, +%% then you do not have to use any of these commands. +% +% Note: This class does not ask you to set the width or 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 + \ifthenelse{\dimtest{#1}{<}{2.99in}}{ + \ClassError{novel}{Unacceptably small Trim Width}% + {Trim Width must be at least 3in.}% + }{} + \ifthenelse{\dimtest{#2}{<}{2.99in}}{ + \ClassError{novel}{Unacceptably small Trim Height}% + {Trim Height must be at least 3in.}% + }{} + \if@ReworkTrimSet + \ClassError{novel}{^^JCannot set Trim after reworking Trim or Margins}% + {\string\SetTrimSize\space cannot follow \string\ReworkTrimSize.}% + \fi + \if@ReworkMarginsSet + \ClassError{novel}{^^JCannot set Trim after reworking Trim or Margins}% + {\string\SetTrimSize\space cannot follow \string\ReworkTrimSize^^J% + and cannot follow \string\ReworkMargins.}% + \fi + \setlength\Old@TrimWidth{#1}% + \setlength\Old@TrimHeight{#2}% + \setlength\New@TrimWidth{#1}% + \setlength\New@TrimHeight{#2}% + \if@MediaSizeSet\else + \setlength\Old@MediaWidth{#1}% + \setlength\Old@MediaHeight{#2}% + \setlength\New@MediaWidth{#1}% + \setlength\New@MediaHeight{#2}% + \fi +} +% +% Retroactively change Trim Size after layout. See documentation: +\newcommand\ReworkTrimSize[2]{% + \global\@ReworkTrimSettrue + \setlength\New@TrimWidth{#1}% + \setlength\New@TrimHeight{#2}% + \setlength\New@MediaWidth{#1}% + \setlength\New@MediaHeight{#2}% + \typeout{^^J Class `novel' Info: % + Used \string\ReworkTrimSize{}{} command.^^J% + Carefully review your PDF to ensure that line breaks, paragraphs,^^J% + and page breaks are where you expect them to be.^^J}% +} +% Margins at top and bottom are relative to: +% top of header, or top of textblock if no header; +% bottom of footer, or bottom of textblock if no footer. +% Inside margin generally greater than outside, due to gutter. +% Standard margins command ("TOBI, or not TOBI, that is the question."): +\newcommand\SetMargins[4]{ % top, outside, bottom, inside + \global\@MarginsSettrue + \if@ReworkMarginsSet + \ClassError{novel}{^^JCannot set Margins after reworking them}% + {\string\SetMargins\space cannot follow \string\ReworkMargins.}% + \fi + \setlength\Old@TopMargin{#1} + \setlength\New@TopMargin{#1} + \setlength\Old@OutsideMargin{#2} + \setlength\New@OutsideMargin{#2} + \setlength\Old@BottomMargin{#3} + \setlength\New@BottomMargin{#3} + \setlength\Old@InsideMargin{#4} + \setlength\New@InsideMargin{#4} +} +% Retroactively change margins after layout. See documentation: +\newcommand\ReworkMargins[4]{ + \global\@ReworkMarginsSettrue + \setlength\New@TopMargin{#1} + \setlength\New@OutsideMargin{#2} + \setlength\New@BottomMargin{#3} + \setlength\New@InsideMargin{#4} + \typeout{^^J Class novel Info: % + Used \string\ReworkMargins{}{} command.^^J% + Carefully review your PDF to ensure that line breaks, paragraphs,^^J% + and page breaks are where you expect them to be.^^J}% +} +% \SetMediaSize[]{}{} such as {8.5in}{11in}. +% This command is only used when the Trim Size must be placed in a larger +% Media Size. Otherwise, Media Size is automatically set to Trim Size. +% This command cannot be used until after Trim Size is set, either by +% class option or by \SetTrimSize{}{}. +% Trim will be horizontally and vertically centered in media. +% No `rework' is needed for Media Size, because interior layout is relative +% to Trim Size, not Media Size. +% +\newif \if@offcenterTrim \@offcenterTrimfalse +\newcommand\SetMediaSize[3][center]{ % [alignment] width, height + \ifthenelse{\equal{#1}{center} \OR \equal{#1}{edge}}{ + \global\@MediaSizeSettrue + \setlength\Old@MediaWidth{#2} + \setlength\New@MediaWidth{#2} + \setlength\Old@MediaHeight{#3} + \setlength\New@MediaHeight{#3} + }{ + \ClassError{novel}{Bad optional argument for \string\SetMediaSize}% + {\string\SetMediaSize\space optional argument must be `center' or `edge'.}% + } + \ifthenelse{\equal{#1}{edge}}{\@offcenterTrimtrue}{} +} +% \SetLinesPerPage{} may be limited due to fontsize and Trim Size constraints. +% There is no `rework' command, because as long as the number of lines fit, +% the line spacing will be automatically changed to fit a reworked size. +% The only possible problem is if lines were originally so tight that +% a reworked size cannot fit. In that case, the user's best plan is to remove +% header or footer (if possible), or reduce vertical margins (if possible). +\newcommand\SetLinesPerPage[1]{ + \global\@LinesPerPageSettrue + \FPiflt{#1}{1}% + \ClassError{novel}{\string\SetLinesPerPage\ must be at least 1}% + {You requested less than one line per page. Naughty!^^J}% + \else\fi % + \FPround{\temp@IntegerLines}{#1}{0} + \def\my@LinesPerPage{\temp@IntegerLines} +} +% \SetFontSize{} may be in any units, even decimals: 12.2pt, 11.5bp, etc. +% When packages load, the font size is temporarily set to 11pt at 15pt skip, +% so that moldy-oldie packages don't get confused about metrics. +% Then the size is changed to its actual value based on this command, or on +% the defaults for Trim Size, or on the effects of \Rework. +\newcommand\SetFontSize[1]{ + \global\@FontSizeSettrue + \global\setlength\Old@FontSize{#1} +} +% +%% End size-related commands available in Preamble. + + + +%% RESERVE SPACE FOR HEADER/FOOTER, AND SET DEFAULT CHAPTER DISPLAY PAGE +%% ----------------------------------------------------------------------------- +%% At this point, `novel' needs to know whether or not header/footer used, +%% so that space can be reserved at top/bottom. Actual styling comes later. +% +% If the user wishes to tweak layout, these Preamble commands store info, +% that will be used in novel-CalculateLayout.sty. +% The jumps are scale factors, which increase or decrease headsep and footskip +% relative to normal baselineskip. Do not use \setlength\headsep or +% \setlength\footskip directly, because direct settings will lead to +% improper calculations. +% These "jumps" are measured baseline-to-baseline. So, \SetHeadJump{1} means +% that the baseline of the header is 1 baselineskip above the baseline of +% the first line of textblock. In other words, on-grid. Value 2 would be +% equivalent to double-spaced vertically. A value of 1.5 is default, based +% on observations of actual novels. +% If \SetHeadJump is less than 1, then a warning appears in the log. +\gdef\SetHeadJump#1{\gdef\@headjump{#1}} +\SetHeadJump{1.5} % default +\gdef\SetFootJump#1{\gdef\@footjump{#1}} +\SetFootJump{1.5} % default +% See docs part 7 for available style choices: +\gdef\SetHeadFootStyle#1{\gdef\my@HeadFootStyle{#1}} +% See docs part 7 for what these emblems do, if used: +\newcommand\SetEmblems[2]{ % verso, recto + \gdef\my@VersoEmblem{{\headfont #1}} + \gdef\my@RectoEmblem{{\headfont #2}} +} +\let\SetEmblem\SetEmblems% for convenience +% If you want something fancier than \thepage: +\gdef\SetPageNumberStyle#1{\gdef\pagenumberstyle{#1}} +\AtBeginDocument{ + \ifcsname pagenumberstyle\endcsname\else + \SetPageNumberStyle{\thepage} + \fi +} +% +\newif \if@gotHeader \@gotHeaderfalse +\newif \if@gotFooter \@gotFooterfalse +\newif \if@styledHeader \@styledHeaderfalse +\newif \if@styledFooter \@styledFooterfalse +\newif \if@validHF \@validHFfalse +% +\gdef\@reserveHFspace{ % used for layout calculations + \ifthenelse{\equal{\my@HeadFootStyle}{0}}{ + \@gotHeaderfalse\@gotFooterfalse\@validHFtrue + }{} + \ifthenelse{\equal{\my@HeadFootStyle}{1}}{ % default + \@gotHeadertrue\@gotFooterfalse\@validHFtrue + }{} + \ifthenelse{\equal{\my@HeadFootStyle}{2}}{ + \@gotHeaderfalse\@gotFootertrue\@validHFtrue + }{} + \ifthenelse{\equal{\my@HeadFootStyle}{3}}{ + \@gotHeaderfalse\@gotFootertrue\@validHFtrue + }{} + \ifthenelse{\equal{\my@HeadFootStyle}{4}}{ + \@gotHeadertrue\@gotFooterfalse\@validHFtrue + }{} + \ifthenelse{\equal{\my@HeadFootStyle}{5}}{ + \@gotHeadertrue\@gotFootertrue\@validHFtrue + }{} + \ifthenelse{\equal{\my@HeadFootStyle}{6}}{ + \@gotHeadertrue\@gotFootertrue\@validHFtrue + }{} + % Ensure that user choice was on the allowed list: + \if@validHF\else + \ClassError{novel}{Invalid choice for \string\SetHeadFootStyle}% + {\string\SetHeadFootStyle\space needs choice of 0,1,2,3,4,5,6,^^J% + even if you wish to customize using fancyhdr syntax.^^J}% + \fi +} % end \@reserveHFspace +% Each new chapter generally has its own header/footer style. This allows a +% default setting when chapters begin with ChapterDisplay environment: +\gdef\SetChapterDisplay#1{\gdef\@setchapterdisplay{#1}} +\SetChapterDisplay{footer} % default +\AtBeginDocument{% check if user wrote good command or not + \def\@setchapterdisplayOK{false}% + \ifthenelse{\equal{\@setchapterdisplay}{empty}}{% + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplay}{plain}}{% + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplay}{footer}}{% + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplay}{fancyplain}}{% + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplay}{fancy}}{% + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplay}{forcenumber}}{% + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplay}{dropfolio}}{% no footnote there + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplay}{dropfoliolater}}{% has footnote(s) there + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplay}{foliobeneath}}{% + \def\@setchapterdisplayOK{true}% + }{}% + \ifthenelse{\equal{\@setchapterdisplayOK}{true}}{}{% + \ClassError{novel}{\string\SetChapterDisplay\space bad argument}% + {\string\SetChapterDisplay\space only allows certain choices.^^J}% + }% +} +% +%% End reserve space for header/footer and set default ChapterDisplay + + +%% +\newtoggle{@usesymbolmark} % true when footnote markers are symbolic +\newtoggle{@realmarker} % true when OT features sups, sinf, subs requested +% +% \SetMarkers does two things. +% Option real: OT features sups, sinf, subs requested. Fake if not available. +% Option fake: Always fake OT features sups, sinf, subs. +% Mandatory: asterisk, dagger, number. Pertains to footnote markers only. +% No matter real or fake, the asterisk symbol is always real, and the +% dagger, dbldagger, and section (when used as footnote markers) +% are always partially faked. +\newcommand\SetMarkerStyle[2][real]{ + \def\@goodfnm{no} + \ifthenelse{\equal{#2}{asterisk}}{% + \def\@goodfnm{yes}\global\toggletrue{@usesymbolmark}\gdef\@myfnsymbols{*}}{} + \ifthenelse{\equal{#2}{dagger}}{% + \def\@goodfnm{yes}\global\toggletrue{@usesymbolmark}\gdef\@myfnsymbols{†}}{} + \ifthenelse{\equal{#2}{number}}{% + \def\@goodfnm{yes}\global\togglefalse{@usesymbolmark}}{} + \def\@goodfnk{no} + \ifthenelse{\equal{#1}{real}\OR\equal{#1}{}}{% + \def\@goodfnk{yes}\global\toggletrue{@realmarker}}{} + \ifthenelse{\equal{#1}{fake}}{% + \def\@goodfnk{yes}\global\togglefalse{@realmarker}}{} + \ifthenelse{\equal{\@goodfnm}{no}\OR\equal{\@goodfnk}{no}}{% + \ClassError{novel}{Bad choice for \string\SetMarkers}% + {Optional: real, fake. Required: asterisk, dagger, number.}% + }{} +} +% +\SetMarkerStyle[real]{asterisk} % default +%% + + +%% Sets the gap between cropmarks and trim area: +\newlength\@mygap +\def\SetCropmarkGap#1{ + \ifthenelse{\lengthtest{#1 < 0pt}}{ + \setlength\@mygap{0pt} + }{ + \setlength\@mygap{#1} + } +} +\SetCropmarkGap{0.125in} % default +%% + + +%% Fake \microtypesetup until package is loaded later: +\newif \if@setmicrotype +\gdef\microtypesetup#1{ + \gdef\@mymicrotypesetup{#1} % used in novel-FontDefaults.sty + \global\@setmicrotypetrue +} +%% + + + + +%% MISCELLANOUS SETTINGS. Mostly remove "glue". Best to leave as-is. +%% ----------------------------------------------------------------------------- +%% +% +\@twocolumnfalse +\@twosidetrue +\@mparswitchtrue +% +\abovedisplayskip \z@ +\abovedisplayshortskip \z@ +\belowdisplayshortskip \z@ +\belowdisplayskip \abovedisplayskip +\global\@topnum \z@ +% +\setlength\smallskipamount{0pt} +\setlength\medskipamount{0pt} +\setlength\bigskipamount{0pt} +\setlength\topsep{0pt} +\setlength\partopsep{0pt} +\setlength\parsep{0pt} +\setlength\marginparwidth{0pt} +\setlength\marginparsep{0pt} +\setlength\marginparpush{0pt} +\setlength\textfloatsep{0pt} +\setlength\dbltextfloatsep{0pt} +% +\setlength\lineskip{0pt} +\setlength\normallineskip{0pt} +\renewcommand\baselinestretch{1} % multiplier +\setlength\parskip{0pt} +\@lowpenalty 51 +\@medpenalty 151 +\@highpenalty 301 +% +\setcounter{topnumber}{2} +\renewcommand\topfraction{.7} +\setcounter{bottomnumber}{1} +\renewcommand\bottomfraction{.3} +\setcounter{totalnumber}{3} +\renewcommand\textfraction{.2} +\renewcommand\floatpagefraction{.5} +\setcounter{dbltopnumber}{2} +\renewcommand\dbltopfraction{.7} +\renewcommand\dblfloatpagefraction{.5} +% +\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\normalfont\rmfamily} +\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\normalfont\sffamily} +\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\normalfont\ttfamily} +\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\normalfont\bfseries} +\DeclareOldFontCommand{\it}{\normalfont\itshape}{\normalfont\itshape} +\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\normalfont\slshape} +\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\normalfont\scshape} +% +\setlength\columnsep{12pt} % usually not needed, picked something at random +\setlength\columnseprule{0pt} +\pagestyle{empty} % will be over-ridden by fancyhead in separate file +\pagenumbering{arabic} % may be over-ridden in document +\flushbottom % may be over-ridden in document, but not advised +% +%% End miscellaneous settings. + + +% The following might become unnecessary if fontspec adds the capability +% to disable keys. For now: Color and Opacity cannot be used as font features, +% for a black/white printed book. Alas, fontspec over-rules xcolor. +% So, this code over-rules fontspec: +\gdef\novel@checkfeatures#1{% + \def\@featuresareok{yes} + \IfSubStr{#1}{Color}{\def\@featuresareok{no}}{}% + \IfSubStr{#1}{Colour}{\def\@featuresareok{no}}{}% + \IfSubStr{#1}{color}{\def\@featuresareok{no}}{}% + \IfSubStr{#1}{colour}{\def\@featuresareok{no}}{}% + \IfSubStr{#1}{Opacity}{\def\@featuresareok{no}}{}% + \IfSubStr{#1}{opacity}{\def\@featuresareok{no}}{}% + \ifthenelse{\equal{\@featuresareok}{yes}}{}{% + \ClassError{novel}{Color and Opacity forbidden as font features}% + {You defined a font, or added a font feature, with Color or Opacity.^^J% + That is disallowed in `novel' class.}% + } +} +%% + + + +%% DEFINITION OF MASTER AND OTHER FONTS +%% ----------------------------------------------------------------------------- +%% +% 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'. +\defaultfontfeatures{} % reset +% User-created fonts (not standard, not novel-specific defaults: +\defaultfontfeatures{% + SmallCapsFeatures={Renderer=Basic},Kerning=On,% + Ligatures=TeX,% +}% +% Latin Modern Math (Open Type) fonts will be selected by default, for math. +% 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} +%% +%% 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 master font: +% The master font will become the main font AtEndPreamble. It will also become +% the default ancestor of all novel-defined fonts, except the deco font. +\newif \if@masterfontset +\gdef\@masterfontfeatures{} +\gdef\@masterfontname{} +\DeclareDocumentCommand \SetMasterFont { O{} m O{} } {% + \novel@checkfeatures{#1,#3} + \gdef\@masterfontfeatures{#1,#3} + \gdef\@masterfontname{#2} + \global\@masterfontsettrue +}% +%% Store settings for the chapterfont: +% The chapter font is used by the \ChapterTitle{} command. +\newif \if@chapterfontset +\gdef\@chapterfontfeatures{} +\gdef\@chapterfontname{} +\DeclareDocumentCommand \SetChapterFont { O{} m O{} } {% + \novel@checkfeatures{#1,#3} + \gdef\@chapterfontfeatures{#1,#3} + \gdef\@chapterfontname{#2} + \global\@chapterfontsettrue +}% +%% Store settings for the subchfont: +% The subch font is used by the \ChapterSubtitle{} command. +\newif \if@subchfontset +\gdef\@subchfontfeatures{} +\gdef\@subchfontname{} +\DeclareDocumentCommand \SetSubchFont { O{} m O{} } {% + \novel@checkfeatures{#1,#3} + \gdef\@subchfontfeatures{#1,#3} + \gdef\@subchfontname{#2} + \global\@subchfontsettrue +}% +%% Store settings for the headfont: +% The headfont is used in headers and footers. +\newif \if@headfontset +\gdef\@headfontfeatures{} +\gdef\@headfontname{} +\DeclareDocumentCommand \SetHeadFont { O{} m O{} } {% + \novel@checkfeatures{#1,#3} + \gdef\@headfontfeatures{#1,#3} + \gdef\@headfontname{#2} + \global\@headfontsettrue +}% +%% Store settings for the deco font: +% The deco font is used for decorations and acronyms. +% It must be NovelDeco.otf or a font based on NovelDeco.otf. No other! +\newif \if@decofontset +\newif \if@gotdeco +\gdef\@decofontfeatures{} +\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: +\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 +%% +%% \CreateFontFeature{substitutions}{feature code} +% Problem: The font has one or more alternate glyphs that you would like to use, +% but they are not listed in a feature set for the font. +% Solution: Create your own feature set, with \CreateFontFeature. The created +% feature may then be used like a real feature, in any font definition. +% The substitutions are a comma-separated list, char=char.alt and so forth. +% For example, the following substitutions are syntactically OK: +% emdash=emdah.alt, one=one.rev, ntilde=ntilde.03 +% If a substitution is not available in a particular font, it is ignored. +% You have to look at the font in a font editor, to know what is available. +% It is possible to make silly substitutions, such as a=b, five=three without +% throwing an error, unless your code causes a cycle. +% The most useful application of this command is to reach alternate emdash, +% and alternate oldstyle one. Not every font has these. +% The feature code is a 4-character pseudo- Open Type code, otherwise unused. +% For example, the feature code might be myfs (my fake substitution) +% but it cannot be a pre-defined code such as lnum or smcp. It may be +% a style set such as ss03 if you are sure that the font in question +% do not already have ss03 (but this is taking a chance). +% Once defined, you may use it like this (for example): +% \SetMasterFont[RawFeature=+myfs]{fontname} +% \NewFontFamily\myfake[RawFeature=+myfs]{fontname} +% In the document body: {\addfontfeature{myfs} text} +\DeclareDocumentCommand \CreateFontFeature { m m } {% + \IfEndWith{#1}{,}{\StrGobbleRight{#1}{1}[\@fakezero]}{\def\@fakezero{#1}} + \def\@fakeone{["\@fakezero"} + \StrSubstitute{\@fakeone}{=}{"]="}[\@fakeone] + \StrSubstitute{\@fakeone}{,}{",\space["}[\@fakeone] + \directlua{ + fonts.handlers.otf.addfeature { + name = "#2", + type = "substitution", + data = {\@fakeone}, + } + } +} %% end \CreateFontFeature. Above thanks to fontspec 2016. +%% +\ExplSyntaxOff +%% +%% end definition of master and other fonts. + + + +%% FAKE POLYGLOSSIA COMMANDS +%% ----------------------------------------------------------------------------- +% The polyglossia package is not loaded until \AfterEndPreamble. +% So, its commands are not directly available in the Preamble. +% These fake commands store the data. Later, the commands will be relaxed, +% then the real polyglossia commands can work, and the data will be passed +% to the real commands at that time. +% Default main language will be set to english by novel-FontDefaults.sty. +\newcommand\SetMainLanguage[2][]{ + \gdef\@setmainlangopt{#1} + \gdef\@setmainlang{#2} +} +\let\setmainlanguage\SetMainLanguage\relax +\newcommand\SetDefaultLanguage[2][]{ + \gdef\@setmainlangopt{#1} + \gdef\@setmainlang{#2} +} +\let\setdefaultlanguage\SetDefaultLanguage\relax +\SetMainLanguage[]{} % if not user-specified, defaults to english +\newcommand\SetOtherLanguage[2][]{ + \gdef\@setotherlangopt{#1} + \gdef\@setotherlang{#2} +} +\let\setotherlanguage\SetOtherLanguage\relax +\SetOtherLanguage[]{} % default empty +\newcommand\SetOtherLanguages[2][]{ + \gdef\@setotherlangsopt{#1} + \gdef\@setotherlangs{#2} +} +\let\setotherlanguages\SetOtherLanguages\relax +\SetOtherLanguages[]{} % default empty +% +%% end fake polyglossia commands. + + + +%% FRONTMATTER, MAINMATTER, BACKMATTER +%% ----------------------------------------------------------------------------- +% +\newif \ifWithinFrontmatter \WithinFrontmatterfalse +\newif \ifWithinMainmatter \WithinMainmatterfalse +\newif \ifWithinBackmatter \WithinBackmatterfalse +\newcounter{frontmatterpages} +\newcounter{runningpages} +\AtBeginShipout{\stepcounter{runningpages}} +% +\def\frontmatter{ % starts page count and frontmatter count at 1. + \ifWithinFrontmatter + \ClassError{novel}{\string\frontmatter\ used more than once}% + {You issued \string\frontmatter\ more than once.^^J}% + \fi + \ifWithinMainmatter + \ClassError{novel}{\string\frontmatter\ cannot follow \mainmatter}% + {In order: \string\frontmatter\ \string\mainmatter\ \string\backmatter^^J% + but you do not need all of them.^^J}% + \fi + \ifWithinBackmatter + \ClassError{novel}{\string\frontmatter\ cannot follow \backmatter}% + {In order: \string\frontmatter\ \string\mainmatter\ \string\backmatter^^J% + but you do not need all of them.^^J}% + \fi + \WithinFrontmattertrue\WithinMainmatterfalse\WithinBackmatterfalse + \pagenumbering{roman} + \setcounter{page}{1} + \setcounter{frontmatterpages}{1} +} +% +\def\mainmatter{ % restarts page to 1, arabic numbers; freeze frontpagecount + \ifWithinMainmatter + \ClassError{novel}{\string\mainmatter\ used more than once}% + {You issued \string\mainmatter\ more than once.}% + \fi + \ifWithinBackmatter + \ClassError{novel}{\string\mainmatter\ cannot follow \backmatter}% + {In order: \string\frontmatter\ \string\mainmatter\ \string\backmatter^^J% + but you do not need all of them.^^J}% + \fi + \WithinFrontmatterfalse\WithinMainmattertrue\WithinBackmatterfalse + \setcounter{frontmatterpages}{\value{page}} + \addtocounter{frontmatterpages}{-1} + \pagenumbering{arabic} + \setcounter{page}{1} +} +% +\def\backmatter{\@ifstar\@backmatterst\@backmatterns} +% +\def\@backmatterst{ % continues frontmatter count with lowercase roman numerals + \ifWithinBackmatter + \ClassError{novel}{\string\backmatter\space used more than once}% + {You issued \string\backmatter\space more than once.^^J}% + \fi + % If you really must go directly from front to back without main, + % simply issue \mainmatter\backmatter together. Not advised. + \ifWithinFrontmatter + \ClassError{novel}{Missing \string\mainmatter}% + {You went directly from \string\frontmatter\space to \string\backmatter^^J% + Must have \string\mainmatter\space in between.^^J}% + \fi + \WithinFrontmatterfalse\WithinMainmatterfalse\WithinBackmattertrue + \addtocounter{frontmatterpages}{1} + \pagenumbering{roman} + \setcounter{page}{\value{frontmatterpages}} +} +% +\def\@backmatterns{ % continues mainmatter arabic numerals + \ifWithinBackmatter + \ClassError{novel}{\string\backmatter\space used more than once}% + {You issued \string\backmatter\space more than once.^^J}% + \fi + % If you really must go directly from front to back without main, + % simply issue \mainmatter\backmatter together. Not advised. + \ifWithinFrontmatter + \ClassError{novel}{Missing \string\mainmatter}% + {You went directly from \string\frontmatter\space to \string\backmatter^^J% + Must have \string\mainmatter\space in between.^^J}% + \fi + \WithinFrontmatterfalse\WithinMainmatterfalse\WithinBackmattertrue +} +% +\def\Backmatter{\@ifstar\@Backmatterst\@Backmatterns} +% +\def\@Backmatterst{ % continues frontmatter count with uppercase Roman numerals + \ifWithinBackmatter + \ClassError{novel}{\string\backmatter\space used more than once}% + {You issued \string\backmatter\space more than once.^^J}% + \fi + % If you really must go directly from front to back without main, + % simply issue \mainmatter\backmatter together. Not advised. + \ifWithinFrontmatter + \ClassError{novel}{Missing \string\mainmatter}% + {You went directly from \string\frontmatter\space to \string\backmatter^^J% + Must have \string\mainmatter\space in between.^^J}% + \fi + \WithinFrontmatterfalse\WithinMainmatterfalse\WithinBackmattertrue + \addtocounter{frontmatterpages}{1} + \pagenumbering{Roman} + \setcounter{page}{\value{frontmatterpages}} +} +% +\def\@Backmatterns{ % restarts page count with uppercase Roman numerals + \ifWithinBackmatter + \ClassError{novel}{\string\backmatter\ used more than once}% + {You issued \string\backmatter\ more than once.^^J}% + \fi + % If you really must go directly from front to back without main, + % simply issue \mainmatter\backmatter together. Not advised. + \ifWithinFrontmatter + \ClassError{novel}{Missing \string\mainmatter}% + {You went directly from \string\frontmatter\space to \string\backmatter^^J% + Must have \string\mainmatter\space in between.^^J}% + \fi + \WithinFrontmatterfalse\WithinMainmatterfalse\WithinBackmattertrue + \pagenumbering{Roman} + \setcounter{page}{1} +} +% +%% end frontmatter, mainmatter, backmatter. + + + +%% DISABLE OR NEUTRALIZE SOME STANDARD LATEX COMMANDS +%% ----------------------------------------------------------------------------- +% The `novel' class disallows these commands, or neutralizes them by simply +% repeating their arguments. In some cases, they request functionality that is +% not implemented in `novel'. In other cases, the functionality is part of core, +% but would interfere with the `novel' emphasis on constant line skip. +% You may re-define the commands using your own code in Preamble (discouraged). +% +\gdef\null{\hbox{\strut}} % May be important! +% +% Standard LaTeX font sizes are ineffective: +\let\small\relax +\let\footnotesize\relax +\let\scriptsize\relax +\let\tiny\relax +% +\let\large\relax +\let\Large\relax +\let\LARGE\relax +\let\huge\relax +\let\Huge\relax +\let\HUGE\relax +% All these do is echo the argument, if any: +\long\gdef\part#1{#1} +\long\gdef\chapter#1{#1} +\long\gdef\section#1{#1} +\long\gdef\subsection#1{#1} +\long\gdef\subsubsection#1{#1} +\long\gdef\paragraph#1{#1} +\long\gdef\subparagraph#1{#1} +% In some situations, the use will be interrupted: +\gdef\@nodocommand#1{ + \ClassError{novel}{No command `\string\#1' in this class}% + {The `\string\#1' command is not implemented in `novel' class.^^J}% +} +% Here is the interruption list: +\long\gdef\maketitle\@nodocommand{maketitle} +\long\gdef\makeindex\@nodocommand{makeindex} +\long\gdef\tableofcontents\@nodocommand{tableofcontents} +\long\gdef\listoftables\@nodocommand{listoftables} +\long\gdef\listoffigures\@nodocommand{listoffigures} +% +%% end disable or neutralize. + + + +%% +%% End of file `novel-LayoutSettings.sty'. + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-TextMacros.sty b/Master/texmf-dist/tex/lualatex/novel/novel-TextMacros.sty new file mode 100644 index 00000000000..613202fe5c4 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-TextMacros.sty @@ -0,0 +1,529 @@ +%% +%% This is file `novel-TextMacros.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-TextMacros.sty}% +[2017/03/01 v1.0.6 LaTeX file (text macros usable within document body)] +%% + + +%% This file contains commands that are usable within the document body, +%% for styling and otherwise manipulating text. +%% These are not commands used in Preamble for setup, although a few of them +%% can be used in Preamble for setup, then again in body for change. + + + +%% The following commands were defined in other files of `novel' class: +%% ----------------------------------------------------------------------------- +% \thetitle or \theTitle returns string set by \title{} or \SetTitle{} -- See novel-LayoutSettings.sty. +% \theauthor or \theAuthor returns string set by \author or \SetAuthor{} -- See novel-LayoutSettings.sty. +% \normalFontSize length of main font setting. May be tweaked during rework. -- See novel-CalculateLayout.sty. +% \normalBaselineSkip and \nbs (calculated) length of main baselineskip. -- See novel-CalculateLayout.sty. +% \thesubtitle or \theSubtitle returns string set by \subtitle{} or \SetSubtitle{} -- See novel-LayoutSettings.sty. +% \InlineImage, \BlockImage, \ClearImage -- See novel-Images.sty. +% \scenebreak, \sceneline, \scenestars -- See novel-ChapterScene.sty. +% ChapterDisplay, \ChapterTitle{}, \ChapterSubtitle{}, \ChapterDeco{}, \ChapterText -- See novel-ChapterScene.sty. +% \DecoChapterTitle{}{}, \SideDecoChapterTitle{}, ModernChapterTitle[]{}{} -- See novel-ChapterScene.sty. +% {\chapterfont text} and other pre-defined font selection commands -- See novel-LayoutSettings.sty. +% \decoglyph{} and \acronym{} -- See novel-FontDefaults.sty. +% \frontmatter, \mainmatter, \backmatter and variations -- See novel-LayoutSettings.sty. +% \footnote[]{}, \endnote, \endnotetext[]{} -- See novel-Footnotes.sty. +% \thispagestyle{choice} and \dropfolio -- See novel-HeadFootStyles.sty. +% \NewVersoHeadText{}, \NewRectoHeadText{} Also \Set and \Renew forms. -- See novel-HeadFootStyles.sty. +% \CreateFeature{substitutions}{feature code} fakes an Open Type feature -- See novel-LayoutSettings.sty. +% \Epigraph[align,scale,width]{text} creates an Epigraph -- See novel-ChapterScene.sty. + + + +%% The following commands are defined on this page: +%% ----------------------------------------------------------------------------- +% \memo{text} is a memo to yourself. Does not print, is not saved. +% \forceindent and \backindent when \indent and \noindent fail. +% \smcp{text} or \textsc{text} for lowercase to small caps. +% \allsmcp{text} puts both caps and lowercase into small caps. +% \charscale[scale,x,y]{text} for brief change of text size/position. No line wrap. +% parascale environment for long change in text size. Will go off-grid. +% toc environment for table of contents. +% \tocitem[]{}{} and \tocitem*[]{}{} for one-line entries in toc. +% legalese environment uses ragged right, disables hyphenation, and reduces microtype tweaks. +% poem environment uses ragged right, disables hyphenation, parindent zero, and optional increased right margin. +% \showlength[round]{length}{units} returns the length, re-calculated in units, rounded. +% \supersub{raise}{scale}{text} alternative to superscript and subscript commands. +% \sups{text}, \subs{text}, and \sinf{text} other alternatives to super/subscripts. +% \bigemdash[raise,thickness] provides a raised rule of flexible length, a "big em dash." +% \stake inserts zero-width rule, 1pt thick, as placeholder. +% \color and \textcolor (from package xcolor) have been modified to ensure black, or grayscale when permitted. +% \squeeze{} and \crush{} for emergency text adjustment. + + +%% The following useful commands are from core code, or other pre-loaded packages. +%% ----------------------------------------------------------------------------- +%% They are listed here as a reminder of their existence. Not a complete list. +%% A description is only provided here, when it is brief and simple. +% +% {\centering text\par} centers text. Needs the \par to finish. May also use internal \\ or \par. Avoid center environment. +% \makebox[length][alignment]{text} +% \hspace{length} +% \vspace{length} Caution: may disrupt text line grid! +% \kern +% \hfill and \dotfill +% \vfill (use only with discretion) +% \linebreak (use only with discretion) +% \null inserts an empty line. See also the scene break commands. +% \clearpage begins a new page. Two consecutive \clearpage does not make 2 pages (use \null if blank page desired). +% \strut is useful for occupying the full line height. +% \smash{text} allows its included text to overlay other content. Sometimes useful when text is too tall to fit the line grid. +% \textwidth (length) is the width of the textblock. +% adjustwidth environment (package: changepage) for block indents, etc. +% \FirstLine{} (package: magaz) may be useful for first line of new chapter. Patched by me. +% \textsuperscript{} and \textsubscript{} are re-defined. + + + +%% The following commands are available, but STRONGLY DISCOURAGED. +%% ----------------------------------------------------------------------------- +%% Beware: Their usage is likely to disturb the line grid. +%% That is less of an issue on pages where the line grid does not matter. +% +% Environments: center, minipage, sloppypar +% \parbox +% \framebox or \fbox +% \raisebox BUT can be used inside \smash or \charscale. +% \linespread +% Anything involving math mode. Note that $ is a normal text character. + + +%% The following commands are BANNED. +%% ----------------------------------------------------------------------------- +% The `novel' class disallows these commands, or neutralizes them by simply +% repeating their arguments. In some cases, they request functionality that is +% not implemented in `novel'. In other cases, the functionality is part of core, +% but would interfere with the `novel' emphasis on constant line skip. +% You may re-define the commands using your own code in Preamble (discouraged). +% +%% Standard LaTeX font sizes are ineffective. Use novel's own methods. +% If you write one of these size commands, it will silently be ignored: +% \small, \footnotesize, \scriptsize, \tiny, +% \large, \Large, \LARGE, \huge, \Huge, \HUGE. +% +%% Internal subdivisions are ineffective. +% The command will merely echo its argument, without any functionality: +% \part{}, \chapter{}, \section{}, \subsection{}, \subsubsection{}, \paragraph{}, \subparagraph{} +% +%% Certain commands will generate an error, so that you know they cannot be used: +% \maketitle, \makeindex, \tableofcontents, \listoftables, \listoffigures +% +%% You cannot use \includepdf (package: pdfpages). +% +%% You cannot use \includegraphics. Instead use novel's own image commands. +% +%% Commands normally provided in other classes, pertaining to floats, figures, and tables, +%% are not defined in `novel' class. If you attempt to use them, an error will result. + + + +%% AND NOW TO THE GOOD STUFF +%% ----------------------------------------------------------------------------- +% +%% \memo{} does not print or save its argument. +% Useful when you wish to put a note to yourself in the *.tex document. +% Not the same as % comment, because anything after the braces will print. +\long\gdef\memo#1{} +% +\gdef\stake{\rule{0pt}{1pt}} % placeholder +% +% \forceindent and \backindent perform or remove indent, using \hspace{}. +% Rationale: Sometimes \indent and \noindent are neutralized by another command. +\newlength\forceparlength % holds default value, even when \parindent changed +\AtBeginDocument{ + \setlength\forceparlength{\parindent} + \global\forceparlength=\forceparlength + \gdef\forceindent{\ifvmode\else\unskip\fi\stake\hspace{\forceparlength}} + \gdef\backindent{\ifvmode\else\unskip\fi\hspace{-\forceparlength}} +} +%% +% \smcp{} and \textsc{} small caps (Open Type) and \allsmcp{}: +% +\ExplSyntaxOn +% +\DeclareDocumentCommand \smcp { +m } + {% + {\AddFontFeature{Letters=SmallCaps}#1}% + } +% +\DeclareDocumentCommand \allsmcp { +m } + {% + \fontspec_if_feature:nTF {c2sc}{% + {\AddFontFeatures{Letters=UppercaseSmallCaps, Letters=SmallCaps}#1}% + }{% + {\AddFontFeature{Letters=SmallCaps}\MakeLowercase{#1}}% + }% + } +% +\ExplSyntaxOff +% +\let\textsc\smcp\relax % unified +\let\oldscshape\scshape\relax % in case needed later +\let\scshape\smcp\relax % unified +% +\providecommand\FirstLineFont{\smcp} % package `magaz' +\renewcommand\FirstLineFont{\smcp} +%% + +%% The `novel' class normally allows only black text on white paper. +%% In draft mode, option `shademargins` provides light gray margins, +%% but still black text on white paper. +%% However, with option `graytext' (in any mode) then grayscale text +%% is allowed. Images are always allowed grayscale. +%% Just in case `xcolor' re-defines its internals, to prevent code bomb: +\ProvideDocumentCommand\@declaredcolor { m } {} +\ProvideDocumentCommand\@undeclaredcolor { o m } {} +%% +\if@graytext % and the usual colors, including black and white. + \definecolor[named]{gray1}{gray}{0.15} % ten percent gray, etc. + \definecolor[named]{gray2}{gray}{0.25} + \definecolor[named]{gray3}{gray}{0.33} + \definecolor[named]{gray4}{gray}{0.4} + \definecolor[named]{gray5}{gray}{0.5} + \definecolor[named]{gray6}{gray}{0.6} + \definecolor[named]{gray7}{gray}{0.68} + \definecolor[named]{gray8}{gray}{0.75} + \definecolor[named]{gray9}{gray}{0.87} +\else + \let\my@color\color\relax + \let\color\relax + \DeclareDocumentCommand \color { o m } + {% + \ifthenelse{\equal{#1}{gray} \AND \equal{#2}{0.903215}}{\@undeclaredcolor[gray]{0.903215}}{}% shademargins + \ifthenelse{\equal{#2}{hingledingle}}{\@declaredcolor{white}}{}% hingledingle is internal alias for white + } +\fi +%% + + +% This code is slightly modified from package `etextools' by Florent Chervet. +% Its license: "This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 of this +% license or (at your option) any later version." +% My rationale for not simply loading the package: Other parts of the package +% generate warning messages, but the warnings do not apply. Also, I might +% wish to hack the code at some point. +\newcount\nov@ettl@fter +\newrobustcmd\nov@AfterGroup{% + \@ifstar{\nov@ettl@AfterGroup\@firstofone}{\nov@ettl@AfterGroup\unexpanded}% +} +\newrobustcmd\nov@ettl@AfterGroup[2]{% + \csxdef{nov@ettl@fterGroup\number\numexpr\the\nov@ettl@fter+1}% + {\global\csundef{nov@ettl@fterGroup\number\numexpr\the\nov@ettl@fter+1}#1{#2}}% + \global\advance\nov@ettl@fter\@ne% + \expandafter\aftergroup\csname nov@ettl@fterGroup\the\nov@ettl@fter\endcsname% +} +% End code from `etextools`. + + + + + +%% \flexbox based on code by Werner at tex.stackexchange.com, CC-by-sa-3.0: +% Optional first argument is minimum width of box. +% Second argument is contents of box. +% Box width will be the greater of #1 or the width of #2. +\newlength\@mylen +\newcommand{\flexbox}[2][\parindent]{% + \settowidth{\@mylen}{#2}% + \ifdim\@mylen < #1% + \makebox[#1][l]{#2}% + \else% + #2% + \fi% +} +%% \bigemdash inspired by code by RTBarnard at stackoverflow.com, CC-by-sa-3.0: +% Allows a rule of variable length to fill available space at its right. +% There must be a "right-hand limit" imposed by something, such as by enclosing +% the rule in a \makebox of known width, or by an immediate \par. +% Without this limit, rule will be missing (zero width) or excessively long, +% or an error will result (referring to \leaders). +% Takes a single optional argument: Comma-separated raise, line thickness. +% If no argument or empty, defaults to [1,1]. +% Without comma, argument defaults to [argument,1]. +% First number: Scales the raise up or down. 1 = raise of emdash in typical fonts. +% Second number: Scales the line thickness. 1 = thickness of emdash in typical fonts. +% NOTE: Built-in TeX PDF viewer might show the line at slightly incorrect +% width and height. Best seen in a "real" PDF viewer. +\DeclareDocumentCommand \bigemdash { O{1,1} } + {% + \ifthenelse{\equal{#1}{}\OR\equal{#1}{\space}}{\def\@myargsi{1,1}}{\def\@myargsi{#1}}% + \StrDel{\@myargsi}{\space}[\@myargs]% + \StrCut{\@myargs}{,}{\@myraisei}{\@mythicki}% + \ifthenelse{\equal{\@myraisei}{}\OR\equal{\@myraisei}{\space}}{\def\@myraise{1}}{\def\@myraise{\@myraisei}}% + \ifthenelse{\equal{\@mythicki}{}\OR\equal{\@mythicki}{\space}}{\def\@mythick{1}}{\def\@mythick{\@mythicki}}% + \FPmul{\@myraise}{\@myraise}{0.56}% ex, typical font emdash raise + \FPmul{\@mythick}{\@mythick}{0.049}% em, typical font emdash thickness + {\leaders\hbox{\rule[\@myraise ex]{1pt}{\@mythick em}}\hfill\stake}% + } +%% + + +%% +% \charscale[scale,x,y]{text} and starred version +% This is an "in-line" means of adjusting font size +% and position, without changing the baselineskip. +% If the optional argument is unused or empty, then the text is not scaled +% or moved, but equivalent to \stake\smash{text}. +% Up to 3 arguments may be used in the single optional argument. +% They are separated by commas. Spaces ignored. +% First argument is scale. Number>=0.5. Default 1. Relative to what the size +% would otherwise be. May multiply with an already-scaled font. +% Second and third arguments are x-offset and y-offset, respectively. +% Offsets are lengths, best measured in em or \nfs for x, +% and em or \nfs or \nbs for y. Default 0pt. Can abbreviate as 0. +% Posiive offsets are x right, y up. +% Text is "smashed" and may go anywhere, even overlying other text or image. +% The unstarred command occupies width equal to the scaled text, +% thus leaving a "hole" where the text would have been. +% The starred command occupies zero width, thus no hole. Consecutive starred +% commands, without intervening space, displace from same origin. +% The text must be on a single line, without break or wrap. +% Do not use \\ or \par inside \charscale, but you sometimes need \par after it. +% If the text is in a font other than usual, place the font command +% outside \charscale, not inside. +\ExplSyntaxOn +\DeclareDocumentCommand \charscale { s O{1} m } + { + % Allows empty or blank to be used, and still provide default values: + \ifthenelse{\equal{#2}{}\OR\equal{#2}{\space}}{\def\@myargs{1}}{\def\@myargs{#2}} + \StrDel{\@myargs}{\space}[\@myargsns] % needs {\space} not { } + \StrCut{\@myargsns}{,}{\@myscalet}{\@mycoord} + \ifthenelse{\equal{\@myscalet}{}}{\def\@myscale{1}}{\def\@myscale{\@myscalet}} + \FPmax{\@myscale}{\@myscale}{0.5}% not permitted below this scale + \StrCut{\@mycoord}{,}{\@myxt}{\@myyt} + \ifthenelse{\equal{\@myxt}{}\OR\equal{\@myxt}{0}}{\def\@myx{0pt}}{\def\@myx{\@myxt}} + \ifthenelse{\equal{\@myyt}{}\OR\equal{\@myyt}{0}}{\def\@myy{0pt}}{\def\@myy{\@myyt}} + \IfBooleanTF{#1} + {% starred + \ifvmode\else\unskip\fi% + \stake\makebox[0pt][l]{\smash{\hspace{\@myx}\raisebox{\@myy}{\scalebox{\@myscale}{#3}}}}% + }{% unstarred + \stake\makebox[0pt][l]{\smash{\hspace{\@myx}\raisebox{\@myy}{\scalebox{\@myscale}{#3}}}}% + \smash{\phantom{\scalebox{\@myscale}{#3}}}% + } + } +\ExplSyntaxOff +%% + + + + +%% +% If you really must change the font size and baselineskip on a paragraph basis, +% then use an environment. For example, the text on your Copyright page might +% be smaller (and less baselineskip) than normal. +% The following environment takes an optional argument, which is the scale +% of font size and baselineskip, relative to normal. Note that both size +% and skip are scaled together. The default is 1, meaning no change. +% To get the rough equivalent of traditional \footnotesize, use 0.83 scale. +% Example: +% \begin{parascale}[0.83] +% This text is like old footnotesize. It can go on for many lines.\par +% Be sure to end with the paragraph ending.\par +% You may need to manipulate whether anything indents.\par +% \end{parascale} +% Normally you should NOT use this environment within the main text, +% as it will upset the baselineskip there. If you have to do that for +% a special effect, then use \vspace{} before and after the environment, +% so that the following normalsize text is re-aligned. You'll have to +% do the calculations yourself. +\newenvironment{parascale}[1][1] +{\begingroup% +\FPmax{\my@tempDetailsNum}{#1}{0.5}% must be at least half normal. +\FPmul{\my@tempDetailsFontNum}{\my@tempDetailsNum}{\Current@FontSizeNum}% +\FPround{\my@tempDetailsFontNum}{\my@tempDetailsFontNum}{2}% +\FPmul{\my@tempDetailsSkipNum}{\my@tempDetailsNum}{\Current@BaselineSkipNum}% +\FPround{\my@tempDetailsSkipNum}{\my@tempDetailsSkipNum}{2}% +\fontsize{\my@tempDetailsFontNum pt}{\my@tempDetailsSkipNum pt}\selectfont}% +{\endgroup} +% +%% +% Environment toc (alternative table of contents): +% optional argument: additional vspace after each \tocitem entry. +% required: LR margin increase, to narrow the table (0pt = full textwidth). +\newlength\@tocnumwid +\newlength\@tocskip +\newenvironment{toc}[2][0]% +{% + \begin{adjustwidth}{#2}{#2}\begingroup% + \setlength\parindent{0pt}% + \setlength\@tocnumwid{\widthof{00.~}}% + \global\@tocnumwid=\@tocnumwid% + \setlength\@tocskip{#1\nbs}% + \global\@tocskip=\@tocskip% +}{% + \endgroup\end{adjustwidth}\par% +}% +%% \tocitem[number]{description}{page} provides a one-line table entry in toc. +% optional number might be chapter number. Can use ~ to offset. +% unstarred: distance between description and page is not decorated. +% starred (better): distance between description and page has dotted line. +\newcommand\tocitem{\@ifstar\@tocitemst\@tocitemns} +\newcommand\@tocitemst[3][]{% + \ifthenelse{\equal{#1}{}}{}{% + \ifthenelse{\equal{#1}{~}}{% + \makebox[\@tocnumwid][l]{~}% + }{% + \makebox[\@tocnumwid][l]{#1.}% + }% + }% + #2\,% + \dotfill% + \,#3\par\vspace{\@tocskip}% +}% +% +\newcommand\@tocitemns[3][]{% + \ifthenelse{\equal{#1}{}}{}{% + \ifthenelse{\equal{#1}{~}}{% + \makebox[\@tocnumwid][l]{~}% + }{% + \makebox[\@tocnumwid][l]{#1.}% + }% + }% + #2% + \hfill% + #3\par\vspace{\@tocskip}% +}% +%% end toc and \tocitem. +%% +%% legalese environment. Certain info, such as Copyright page, customarily is +% neither justified nor hyphenated. Can be used wherever desired, of course. +\newenvironment{legalese} +{\raggedright\hyphenpenalty=10000\exhyphenpenalty=10000} +{} +%% poem environment. Optional argument is left margin. +\newenvironment{poem}[1][0pt] +{\begin{adjustwidth}{#1}{0pt}% +\raggedright\hyphenpenalty=10000\exhyphenpenalty=10000} +{\end{adjustwidth}\par} +%% +\gdef\hangleft#1{% places content to left of usual position. + \newlength\@temphangl% + \setlength\@temphangl{\widthof{#1}}% + \stake\hspace{-\@temphangl}#1% +} +%% +% \showlength[decimal places]{length}{units} +% Returns the length as a string with the units, but does not change the length. +% length is any existing length +% units may be pt, bp, mm, cm, in +% decimal places for rounding (0=integer, 1=one decimal point, etc.) +% Example: \showlength[3]{17bp}{in} returns 0.236in +\newlength{\temp@showlength} +\newcommand\showlength[3][]{% + \setlength\temp@showlength{#2}% + \def\temp@lengthnum{\strip@pt\temp@showlength}% + \ifthenelse{\equal{#3}{bp}}{% + \FPmul{\temp@lengthnum}{\temp@lengthnum}{0.99626401}% + }{}% + \ifthenelse{\equal{#3}{mm}}{% + \FPmul{\temp@lengthnum}{\temp@lengthnum}{0.351459804}% + }{}% + \ifthenelse{\equal{#3}{cm}}{% + \FPmul{\temp@lengthnum}{\temp@lengthnum}{0.0351459804}% + }{}% + \ifthenelse{\equal{#3}{in}}{% + \FPmul{\temp@lengthnum}{\temp@lengthnum}{0.013837}% + }{}% + \ifthenelse{\equal{#1}{}}{}{\FPround{\temp@lengthnum}{\temp@lengthnum}{#1}}% + \temp@lengthnum#3% +} +%% end \showlength + + +%% \squeeze{} and \crush{} slightly shrink the horizonal dimension of the +% enclosed text. May span paragraphs. Emergency only! No compounding. +\long\gdef\squeeze#1{{\AddFontFeature{FakeStretch=0.99}#1}} +\long\gdef\crush#1{{\AddFontFeature{FakeStretch=0.98}#1}} +%% + + +%% \lnum for lining numbers. +\gdef\lnum#1{{\AddFontFeature{Numbers=Lining}#1}} +%% + + +%% superscripts and subscripts +\let\subs\relax +\let\sups\relax +\let\textsuperscript\relax +\let\textsubscript\relax +\newlength\@hoAhl % Measures the height of these characters in the current font. +% Perhaps superscripts and subscripts (scientific) are in the font, or not. +% Problem: The best fonts have these characters at size/weight designed +% to mingle with normal size. But many fonts merely scaled characters, +% which will be too light at the small size. +% The unstarred version of these commands use the Open Type features when +% they are present, then faking (auto scale/raise) if features not present. +% The starred version just fakes, without regard for features. +% + +% Note that the effect of these commands continues, not just one-shot: +\gdef\realmarker{\toggletrue{@realmarker}} % anywhere in text +\gdef\fakemarker{\togglefalse{@realmarker}} % anywhere in text +%% +\ExplSyntaxOn +% +\DeclareDocumentCommand \sups { m } + {% + \iftoggle{@realmarker}{% + \fontspec_if_feature:nTF {sups}{% + \ifvmode\else\unskip\fi{\AddFontFeature{VerticalPosition=Superior}\smash{#1}}% + }{% + \setlength\@hoAhl{\heightof{Ahl}}% + \ifvmode\else\unskip\fi\charscale[0.7,0pt,0.5\@hoAhl]{#1}% + }% + }{% + \setlength\@hoAhl{\heightof{Ahl}}% + \ifvmode\else\unskip\fi{\basefont\AddFontFeature{Numbers=Lining}\charscale[0.7,0pt,0.5\@hoAhl]{#1}}% + }% + }% end \sups +% +\DeclareDocumentCommand \subs { m } + {% + \iftoggle{@realmarker}{% + \fontspec_if_feature:nTF {sinf}{% + \ifvmode\else\unskip\fi{\AddFontFeature{VerticalPosition=ScientificInferior}\smash{#1}}% + }{% + \fontspec_if_feature:nTF {subs}{% + \ifvmode\else\unskip\fi{\AddFontFeature{VerticalPosition=Inferior}\smash{#1}}% + }{% + \setlength\@hoAhl{\heightof{Ahl}}% + \ifvmode\else\unskip\fi\charscale[0.7,0pt,-0.2\@hoAhl]{#1}% + }% + }% + }{% + \setlength\@hoAhl{\heightof{Ahl}}% + \ifvmode\else\unskip\fi{\basefont\AddFontFeature{Numbers=Lining}\charscale[0.7,0pt,-0.2\@hoAhl]{#1}}% + }% + }% end \subs +% +\ExplSyntaxOff +%% +\let\textsuperscipt\sups\relax +\let\textsubscript\subs\relax +%% + + + +%% +%% End of file `novel-TextMacros.sty'. + + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-glyphtounicode.tex b/Master/texmf-dist/tex/lualatex/novel/novel-glyphtounicode.tex new file mode 100644 index 00000000000..62a53374ba5 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-glyphtounicode.tex @@ -0,0 +1,88 @@ +%% +%% This is file `novel-glyphtounicode.tex', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% Additional glyph to unicode lookups, for Open Type ligatures. +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\ProvidesFile{novel-gyphtounicode.tex}% +[2017/03/01 v1.0.6 LaTeX file (additional glyph to unicode)] +%% + + +\begingroup +\catcode`\_=12 % so that underscore can be used in ligature names + + +\pdfglyphtounicode{f_f}{0066 0066} +\pdfglyphtounicode{f_i}{0066 0069} +\pdfglyphtounicode{f_l}{0066 006C} +\pdfglyphtounicode{f_f_i}{0066 0066 0069} +\pdfglyphtounicode{f_f_l}{0066 0066 006C} + +\pdfglyphtounicode{f_j}{0066 006A} +\pdfglyphtounicode{f_f_j}{0066 0066 006A} + +\pdfglyphtounicode{f_t}{0066 0074} +\pdfglyphtounicode{f_f_t}{0066 0066 0074} + +\pdfglyphtounicode{f_b}{0066 0062} +\pdfglyphtounicode{f_f_b}{0066 0066 0062} + +\pdfglyphtounicode{f_k}{0066 006B} +\pdfglyphtounicode{f_f_k}{0066 0066 006B} + +\pdfglyphtounicode{f_h}{0066 0068} +\pdfglyphtounicode{f_f_h}{0066 0066 0068} + +\pdfglyphtounicode{g_g}{0067 0067} + +\pdfglyphtounicode{s_s}{0073 0073} +\pdfglyphtounicode{s_t}{0073 0074} +\pdfglyphtounicode{t_t}{0074 0074} +\pdfglyphtounicode{c_t}{0063 0074} + +\pdfglyphtounicode{c_h}{0063 0068} +\pdfglyphtounicode{c_k}{0063 006B} +\pdfglyphtounicode{t_z}{0074 007A} + +\pdfglyphtounicode{Q_y}{0051 0079} +\pdfglyphtounicode{Q_u}{0051 0075} +\pdfglyphtounicode{Q_u_i}{0051 0075 0069} + +\pdfglyphtounicode{T_h}{0054 0068} +\pdfglyphtounicode{Tcaron_h}{0164 0068} +\pdfglyphtounicode{Tcommaaccent_h}{0162 0068} + +\pdfglyphtounicode{longs_longs}{017F 017F} +\pdfglyphtounicode{longs_h}{017F 0068} +\pdfglyphtounicode{longs_i}{017F 0069} +\pdfglyphtounicode{longs_longs_i}{017F 017F 0069} +\pdfglyphtounicode{longs_l}{017F 006C} +\pdfglyphtounicode{longs_t}{017F 0074} + +\pdfglyphtounicode{exclam_exclam}{0021 0021} +\pdfglyphtounicode{question_question}{003F 003F} +\pdfglyphtounicode{exclam_question}{0021 003F} +\pdfglyphtounicode{question_exclam}{003F 0021} + +\pdfglyphtounicode{uni3097}{3097} +\pdfglyphtounicode{uni3098}{3098} + + + + +\endgroup + + + +% End of file `novel-glyphtounicode.tex'. + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-microtype.cfg b/Master/texmf-dist/tex/lualatex/novel/novel-microtype.cfg new file mode 100644 index 00000000000..e00ec591fae --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-microtype.cfg @@ -0,0 +1,251 @@ +%% +%% This is file `novel-microtype.cfg', modified for `novel' document class. +%% +%% Original notice from `microtype.cfg' follows. +%% Same license for `novel-microtype.cfg'. +%% +%% ------------------------------------------------------------------------ +%% +%% This work may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License, either version 1.3c of this license or (at +%% your option) any later version. The latest version of this license is in: +%% http://www.latex-project.org/lppl.txt, and version 1.3c or later is part +%% of all distributions of LaTeX version 2005/12/01 or later. +%% +%% ------------------------------------------------------------------------ +%% +%% When modifying this file, also change the identification line below. +%% ------------------------------------------------------------------------ +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{novel-microtype.cfg} + [2017/03/01 v1.0.6 LaTeX file (microtype configuration file for novel class)] + +%%% ----------------------------------------------------------------------- +%%% FONT SETS + +\DeclareMicrotypeSet{all} + { } + +\DeclareMicrotypeSet{allmath} + { } + +\DeclareMicrotypeSet{alltext} + { } + +\DeclareMicrotypeSet{allmath-nott} + { family = {rm*,sf*} } + +\DeclareMicrotypeSet{alltext-nott} + { family = {rm*,sf*} } + +\DeclareMicrotypeSet{basicmath} + { family = {rm*,sf*}, series = {md*} } + +\DeclareMicrotypeSet{basictext} + { family = {rm*,sf*}, series = {md*}, } + +\DeclareMicrotypeSet{smallcaps} + { shape = {sc*,si,scit} } + +\DeclareMicrotypeSet{normalfont} + { font = */*/*/*/* } + +%%% ----------------------------------------------------------------------- +%%% DEFAULT SETS + +\DeclareMicrotypeSetDefault[protrusion]{alltext} +\DeclareMicrotypeSetDefault[expansion] {basictext} +\DeclareMicrotypeSetDefault[spacing] {basictext} +\DeclareMicrotypeSetDefault[kerning] {alltext} +\DeclareMicrotypeSetDefault[tracking] {smallcaps} + +%%% ----------------------------------------------------------------------- +%%% FONT VARIANTS AND ALIASES + +\DeclareMicrotypeVariants{x,j,w,a,d,0,1} + +\DeclareMicrotypeAlias{lmr} {Latin Modern Roman} +\DeclareMicrotypeAlias{lmm} {Latin Modern Math} + +%%% ----------------------------------------------------------------------- +%%% INTERACTION WITH THE `babel' PACKAGE + +\DeclareMicrotypeBabelHook + {english,UKenglish,british,USenglish,american} + {kerning=, spacing=nonfrench} + +\DeclareMicrotypeBabelHook + {french,francais,acadian,canadien} + {kerning=french, spacing=} + +\DeclareMicrotypeBabelHook + {turkish} + {kerning=turkish, spacing=} + +%%% ----------------------------------------------------------------------- +%%% CHARACTER INHERITANCE + +\DeclareCharacterInheritance + { encoding = * } + { A = {\`A,\'A,\^A,\~A,\"A,\r A,\k A,\u A}, + a = {\`a,\'a,\^a,\~a,\"a,\r a,\k a,\u a}, + C = {\'C,\c C,\v C}, + c = {\'c,\c c,\v c}, + D = {\v D,\DH}, + d = {\v d,\dj}, + E = {\`E,\'E,\^E,\"E,\k E,\v E}, + e = {\`e,\'e,\^e,\"e,\k e,\v e}, + G = {\u G}, + g = {\u g}, + I = {\`I,\'I,\^I,\"I,\.I}, + i = {\`i,\'i,\^i,\"i,\i}, + L = {\L,\'L,\v L}, + l = {\l,\'l,\v l}, + N = {\'N,\~N,\v N}, + n = {\'n,\~n,\v n}, + O = {\O,\`O,\'O,\^O,\~O,\"O,\H O}, + o = {\o,\`o,\'o,\^o,\~o,\"o,\H o}, + R = {\'R,\v R}, + r = {\'r,\v r}, + S = {\'S,\c S,\v S}, % \SS + s = {\'s,\c s,\v s}, + T = {\c T,\v T}, + t = {\c t,\v t}, + U = {\`U,\'U,\^U,\"U,\H U,\r U}, + u = {\`u,\'u,\^u,\"u,\H u,\r u}, + Y = {\'Y,\"Y}, + y = {\'y,\"y}, + Z = {\'Z,\.Z,\v Z}, + z = {\'z,\.z,\v z}, + } + +%%% ----------------------------------------------------------------------- +%%% TRACKING/LETTERSPACING + +\SetTracking + [ name = default, + no ligatures = {f, T} ] + { encoding = * } + { } + +%%% ----------------------------------------------------------------------- +%%% EXPANSION + +\SetExpansion + [ name = default ] + { encoding = * } + { + A = 500, a = 700, + \AE = 500, \ae = 700, + B = 700, b = 700, + C = 700, c = 700, + D = 500, d = 700, + E = 700, e = 700, + F = 700, + G = 500, g = 700, + H = 700, h = 700, + K = 700, k = 700, + M = 700, m = 700, + N = 700, n = 700, + O = 500, o = 700, + \OE = 500, \oe = 700, + P = 700, p = 700, + Q = 500, q = 700, + R = 700, + S = 700, s = 700, + U = 700, u = 700, + W = 700, w = 700, + Z = 700, z = 700, + 2 = 700, + 3 = 700, + 6 = 700, + 8 = 700, + 9 = 700, + } + + + +%%% ----------------------------------------------------------------------- +%%% PROTRUSION + +\SetProtrusion + [ name = default ] + { encoding = * } + { + A = {50,50}, + \AE = {50,50}, + F = { ,50}, + J = {50, }, + K = { ,50}, + L = { ,50}, + T = {50,50}, + V = {50,50}, + W = {50,50}, + X = {50,50}, + Y = {50,50}, + k = { ,50}, + r = { ,50}, + v = {50,50}, + w = {50,50}, + x = {50,50}, + y = { ,50}, + 1 = {50,50}, + 4 = {50,50}, + 7 = {50,50}, + . = { ,200}, + {,}= { ,200}, + : = { ,200}, + ; = { ,200}, + ! = { ,100}, + ? = { ,100}, + @ = {50,50}, + ~ = {200,200}, + \% = {50,50}, + * = {200,200}, + + = {200,200}, + ( = {100, }, + ) = { ,200}, + / = {100,200}, + - = {200,200}, + \textendash = {200,200}, \textemdash = {150,150}, + \textquoteleft = {200, }, \textquoteright = { ,200}, + \textquotedblleft = {200, }, \textquotedblright = { ,200}, + } + + +\SetProtrusion + [ name = it-default, ] + { encoding = * , + shape = {it,sl} } + { + . = { ,500}, + {,}= { ,500}, + : = { ,300}, + ; = { ,300}, + & = {50,50}, + \% = {100, }, + * = {200,200}, + + = {150,200}, + @ = {50,50}, + ~ = {150,150}, + ( = {200, }, + ) = { ,200}, + / = {100,200}, + - = {300,300}, + \textendash = {200,200}, \textemdash = {150,150}, + \textquoteleft = {400,200}, \textquoteright = {400,200}, + \textquotedblleft = {400,200}, \textquotedblright = {400,200}, + \textbackslash = {100,200}, + \quotesinglbase = {300,700}, \quotedblbase = {400,500}, + \guilsinglleft = {400,400}, \guilsinglright = {300,500}, + \guillemotleft = {300,300}, \guillemotright = {300,300}, + \textexclamdown = {100, }, \textquestiondown = {200, }, + \textbraceleft = {200,100}, \textbraceright = {200,200}, + } + + + +\endinput +%% +%% End of file `novel-microtype.cfg'. diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-pdfx.sty b/Master/texmf-dist/tex/lualatex/novel/novel-pdfx.sty new file mode 100644 index 00000000000..36f7bbb67ff --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-pdfx.sty @@ -0,0 +1,523 @@ +%% +%% This is file `novel-pdfx.sty', part of `novel' document class. +%% +%% Copyright (c) 2017, Robert Allgeyer. +%% +%% This file may be distributed and/or modified under the conditions +%% of the LaTeX Project Public License, either version 1.3c of this +%% license or (at your option) any later version. The latest version +%% of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% ----------------------------------------------------------------------------- +%% +%% File `novel-pdfx.sty' uses code, directly copied or modified, +%% from file `pdfx.sty', part of LaTeX package `pdfx': Copyright (c) 2015, +%% CV Radhakrishnan, Han The Thanh, Ross Moore, Peter Selinger. +%% Licensed LPPL 1.2+. +%% +%% ----------------------------------------------------------------------------- +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{novel-pdfx.sty} + [2017/03/01 v1.0.6 LaTeX file (PDF/X support for novel class)] +% This package supports, and is part of, class `novel'. +% No support for anything but LuaLaTeX. + + +%% +%% This file is loaded \AtEndPreamble. +%% + + +% +% Hyperref options for PDF/X with LuaTeX: +\def\pdfx@pdfX@opts@luatex{% + draft,pdftex,pdfpagemode=UseNone,bookmarks=false,hyperfootnotes=false,% + hyperindex=false,implicit=false,pdfversion=1.\the\pdfminorversion,% + pdfpagelabels=true,pageanchor=false,pdfstartview=} +% +\RequirePackage[\pdfx@pdfX@opts@luatex]{hyperref} +% +\hypersetup{pdfencoding=auto} +\expandafter\ifx\csname KV@Hyp@psdextra\endcsname\relax\else + \hypersetup{psdextra} +\fi +\Hy@bookmarksfalse +% +\newif \if@gottitle \@gottitlefalse % refers to PDF File Data +% Was \title{} called prior to this step? If so: +\ifthenelse{\equal{\@title}{} \OR \equal{\@title}{ }}{}{\@gottitletrue} +% +% Sanity check: If title is missing at this step, then compliance must be off: +\ifpdfx@isOFF\else + \if@gottitle\else + \ClassError{novel}{PDF/X requires \string\title\space first}% + {Unless \string\SetPDFX\space is off, must use \string\title\space ^^J% + before using \string\SetPDFX.^^J} + \fi +\fi +% +\if@gottitle\else + \ClassWarning{novel}{Your file has been compiled without standard^^J % + PDF internal metadata, such as the title. This is allowable, and in ^^J % + some cases desirable. But in most cases it is not what you intended. ^^J % + If you want title and other metadata to be in PDF internal metadata, ^^J % + then you must place them prior to the \string\SetPDFX.^^J} +\fi +% +\expandafter\ifx\csname pdfresetpageorigin\endcsname\relax\else + \pdfresetpageorigin=0 +\fi +\edef\pdfcreationdate{\pdfcreationdate}% +\let\pdfx@mdfivesum\pdf@mdfivesum +% + + + + +%% CALCULATE AND SPECIFY CROPBOX AND TRIMBOX +%% ----------------------------------------------------------------------------- +%% +% The MediaBox is automatically provided, so there is no need to write +% MediaBox in /pdfInfo (because it would be a duplicate). +% TrimBox is always necessary for PDF/X. +% Although CropBox is not necessary, it seems that it is often written +% by professional PDF software. For that reason, and for proper centering +% of TrimBox when MediaBox is larger, CropBox is created (= MediaBox). +% +\newcommand\my@MWnum{\strip@pt\New@MediaWidth} +\FPmul{\my@MWnum}{\my@MWnum}{0.99626401} +\FPround{\my@MWnum}{\my@MWnum}{3} +\FPclip{\my@MWnum}{\my@MWnum} +\newcommand\my@MHnum{\strip@pt\New@MediaHeight} +\FPmul{\my@MHnum}{\my@MHnum}{0.99626401} +\FPround{\my@MHnum}{\my@MHnum}{3} +\FPclip{\my@MHnum}{\my@MHnum} +\newcommand\my@TWnum{\strip@pt\New@TrimWidth} +\FPmul{\my@TWnum}{\my@TWnum}{0.99626401} +\FPround{\my@TWnum}{\my@TWnum}{3} +\newcommand\my@THnum{\strip@pt\New@TrimHeight} +\FPmul{\my@THnum}{\my@THnum}{0.99626401} +\FPround{\my@THnum}{\my@THnum}{3} +% +\FPsub{\my@TWorigin}{\my@MWnum}{\my@TWnum} +\FPmul{\my@TWorigin}{\my@TWorigin}{0.5} +\FPround{\my@TWorigin}{\my@TWorigin}{3} +\FPadd{\my@TWcorner}{\my@TWorigin}{\my@TWnum} +\FPround{\my@TWcorner}{\my@TWcorner}{3} +\FPsub{\my@THorigin}{\my@MHnum}{\my@THnum} +\FPmul{\my@THorigin}{\my@THorigin}{0.5} +\FPround{\my@THorigin}{\my@THorigin}{3} +\FPadd{\my@THcorner}{\my@THorigin}{\my@THnum} +\FPround{\my@THcorner}{\my@THcorner}{3} +% +\FPclip{\my@TWorigin}{\my@TWorigin} +\FPclip{\my@TWcorner}{\my@TWcorner} +\FPclip{\my@THorigin}{\my@THorigin} +\FPclip{\my@THcorner}{\my@THcorner} +% +\newcommand\novel@CropBox{% + \if@cropview% + /CropBox[\my@TWorigin\space\my@THorigin\space\my@TWcorner\space\my@THcorner]% + \else% + /CropBox[0\space0\space\my@MWnum\space\my@MHnum]% + \fi% +} +% +\newcommand\novel@TrimBox{% + /TrimBox[\my@TWorigin\space\my@THorigin\space\my@TWcorner\space\my@THcorner]% +} +% +\begingroup\edef\next{% +\endgroup\pdfpageattr{\novel@CropBox^^J\novel@TrimBox}}\next +% +%% End calculate and specify TrimBox. + + + +%% DISABLE HYPERLINKS AND BOOKMARKS +%% ----------------------------------------------------------------------------- +% +% Files for PDF/X cannot have hyperlinks. If your document has any, +% they will be functionally disabled. However, it is still necessary +% to ensure that you do not specify them in the wrong color space. +% Since `novel' class disallows any kind of color, `xcolor' is loaded with +% `monochrome' or `gray' option, prior to loading `hyperref'. +% +% Your text will be K black, rather than CMYK `rich black'. This is best. +% If you use a grayscale image anywhere, ask your print service whether it may +% be directly placed as grayscale (and they will convert to halftone) +% or whether you must convert it to halftone yourself, and place it that way. +% +% Note that LaTeX cannot detect any erroneous placement of a color image. +% +% The pagegrid package can only be used in draft mode, without PDF/X: +\gdef\@reallyOFF{off} +\@ifpackageloaded{pagegrid}{ + \if@useDraftMode\else + \ClassError{novel}{\string\pagegrid\space needs `draft' mode^^J}% + {\string\pagegrid\space may only be used with class option `draft'^^J}% + \fi + \ifpdfx@isOFF\else + \pdfx@isOFFtrue % cancels pdfx when using pagegrid (in draft mode) + \gdef\@reallyOFF{re-set to off by pagegrid package.} + \ClassWarning{novel}{You requested PDF/X compliance.^^J% + But you also used the \string\pagegrid\space package. Cannot have both.^^J% + So instead, your document was processed with \string\SetPDFX\space off.^^J% + Reason: The grid and text are in layers. No layers allowed.^^J}% + \fi +}{} + + + + +%% End disable hyperlinks and bookmarks. + + + +%% GENERAL PDF INTERNAL METADATA PREPARATION +%% ----------------------------------------------------------------------------- +% +% Create hashes that will be used for uuid data. Does not need to be fancy: +\edef\xmp@docid{\pdfx@mdfivesum{jobname.pdf}} +\edef\xmp@instid{\pdfx@mdfivesum{\pdfcreationdate}} +% +%% End general PDF in internal metadata preparation. + + + +%% PREPARATION OF XMP METADATA +%% ----------------------------------------------------------------------------- +%% Data prepared here, will later be inserted into the XMP packet template, +%% then the processed template will be incuded in the PDF. +%% XMP metadata is in utf-8 encoding. +% +% Make the XMP look pretty: +\def\pad@ii{\space\space} +\def\pad@iv{\pad@ii\pad@ii} +\def\pad@vi{\pad@iv\pad@ii} +\def\pad@viii{\pad@vi\pad@ii} +\def\pad@x{\pad@viii\pad@ii} +\def\pad@xii{\pad@x\pad@ii} +\def\pad@xiv{\pad@xii\pad@ii} +\def\pad@xvi{\pad@xiv\pad@ii} +\def\pad@xviii{\pad@xvi\pad@ii} +\def\pad@xx{\pad@xviii\pad@ii} +\def\pad@xxxii{\pad@xvi\pad@xvi} +\def\pad@lxiv{\pad@xxxii\pad@xxxii} +\def\pad@cxxviii{\pad@lxiv\pad@lxiv} +\def\pad@cclvi{\pad@cxxviii\pad@cxxviii} +\def\pad@dxii{\pad@cclvi\pad@cclvi} +% +% Frankly, I am not sure if all this rigamarole is necessary, but it works! +% Here, portions of XMP code are prepared. Later, they will be inserted +% into the XMP packet template. +\gdef\@titleString{ + \pad@vi<dc:title>^^J + \pad@viii<rdf:Alt>^^J + \pad@x<rdf:li xml:lang="x-default">\@title</rdf:li>^^J + \pad@viii</rdf:Alt>^^J + \pad@vi</dc:title>^^J +} +% +\ifthenelse{\equal{\@author}{}}{ + \gdef\@authorString{} +}{ + \gdef\@authorString{ + \pad@vi<dc:creator>^^J + \pad@viii<rdf:Bag>^^J + \pad@x<rdf:li>\@author</rdf:li>^^J + \pad@viii</rdf:Bag>^^J + \pad@vi</dc:creator>^^J + } +} +% +\def\@documentID{uuid:\xmp@docid} +\def\@instanceID{uuid:\xmp@instid} +% +\def\@pdfVersion{1.\the\pdfminorversion} +% +\ifpdfx@isOFF + \gdef\@verconfString{}% +\else + \gdef\@verconfString{ + \pad@vi<pdfx:GTS_PDFXVersion>\@PDFXversion</pdfx:GTS_PDFXVersion>^^J + \if@gotConformance + \pad@vi<pdfx:GTS_PDFXConformance>\@PDFXconformance</pdfx:GTS_PDFXConformance>^^J + \fi + } +\fi +% +\ifpdfx@isOFF + \gdef\@pdfidString{}% +\else + \gdef\@pdfidString{ + \pad@vi<pdfxid:GTS_PDFXVersion>\@PDFXversion</pdfxid:GTS_PDFXVersion>^^J + } +\fi +% +\ifthenelse{\equal{\@novelApplication}{} \OR \equal{\@novelApplication}{ }}{ + \gdef\@applicationString{}% +}{ + \gdef\@applicationString{\pad@vi<xmp:CreatorTool>\@novelApplication</xmp:CreatorTool>^^J}% +} +% +\ifthenelse{\equal{\@novelProducer}{} \OR \equal{\@novelProducer}{ }}{ + \gdef\@producerString{}% +}{ + \gdef\@producerString{\pad@vi<pdf:Producer>\@novelProducer</pdf:Producer>^^J}% +} +% +% Calculation of Dates and Times, which must be in a specific format. +% Each time you process to PDF, the current date/time is used, +% for all of the several metadata date/time strings. +\def\xmp@cDate{\pdfx@getYear} +{\catcode`\D=12 \catcode`\:=12 + \gdef\pdfx@getYear D:#1#2#3#4{\edef\pdfx@xYear{#1#2#3#4}\pdfx@getMonth} +} +\def\pdfx@getMonth#1#2{\edef\pdfx@xMonth{#1#2}\pdfx@getDay} +\def\pdfx@getDay#1#2{\edef\pdfx@xDay{#1#2}\pdfx@getHour} +\def\pdfx@getHour#1#2{\edef\pdfx@xHour{#1#2}\pdfx@getMin} +\def\pdfx@getMin#1#2{\edef\pdfx@xMin{#1#2}\pdfx@getSec} +\def\pdfx@getSec#1#2{\edef\pdfx@xSec{#1#2}\pdfx@getTZh} +\def\pdfx@getTZh{\futurelet\pdfx@next\pdfx@getTzh@branches} +% +{\catcode`\@=11 \catcode`\Z=12 \catcode`\+=12 \catcode`\-=12 % ends below +\gdef\pdfx@getTzh@branches{% + \ifx\pdfx@next Z\let\pdfx@getTzbranch\pdfx@getTznozone + \else\ifx\pdfx@next +\let\pdfx@getTzbranch\pdfx@getTzplus + \else\ifx\pdfx@next -\let\pdfx@getTzbranch\pdfx@getTzminus + \else\let\pdfx@getTzbranch\pdfx@getTzerror + \fi\fi\fi \pdfx@getTzbranch } +% +\catcode`\0=12 +\gdef\pdfx@getTznozone Z#1\pdfx@getTzend{% + \edef\pdfx@xTzh{+00}\edef\pdfx@xTzm{00}} +\gdef\pdfx@getTzplus +#1'#2'#3\pdfx@getTzend{% + \edef\pdfx@xTzh{+#1}\edef\pdfx@xTzm{#2}% + \ifx\relax#2\relax\def\pdfx@xTzm{00}\fi} +\gdef\pdfx@getTzminus -#1'#2'#3\pdfx@getTzend{% + \edef\pdfx@xTzh{-#1}\edef\pdfx@xTzm{#2}% + \ifx\relax#2\relax\def\pdfx@xTzm{00}\fi} +% +\expandafter\ifx\csname pdfcreationdate\endcsname\relax +\else + \expandafter\expandafter\expandafter\xmp@cDate\pdfcreationdate''\pdfx@getTzend + \xdef\pdfx@convDate{\pdfx@xYear\pdfx@xMonth\pdfx@xDay\pdfx@xHour + \pdfx@xMin\pdfx@xSec\pdfx@xTzh'\pdfx@xTzm'}% + \xdef\xmp@cDate{\pdfx@xYear-\pdfx@xMonth-\pdfx@xDay + T\pdfx@xHour:\pdfx@xMin:\pdfx@xSec\pdfx@xTzh:\pdfx@xTzm}% +\fi +}% End of \catcode`\@=11 etc. +\let\@modifyDate\xmp@cDate +\let\@createDate\xmp@cDate +\let\@metadataDate\xmp@cDate +% End dates and times. +% +%% End Prepare XMP metadata. + + + +%% WRITE THE XMP METADATA, UNLESS PDF/X IS OFF OR NO TITLE +%%------------------------------------------------------------------------------ +%% Inserts the prepared XMP metadata into XMP packet template, then writes +%% the result at the start of the PDF, right now, before the document. +% +\ifpdfx@isOFF\else + \if@gottitle + \begingroup + \makeatletter + \input{novel-xmppacket.sty} + \global\let\@xmpData\@xmpPacket % from the above file + \begingroup + \pdfcompresslevel=0 + \immediate\pdfobj stream attr {/Type /Metadata /Subtype /XML} {\@xmpData} + \pdfcatalog{/Metadata \the\pdflastobj\space 0 R} + \endgroup + \endgroup + % Creates external xml file, if requested: + \if@wantXMPasXML + \newwrite\file + \immediate\openout\file=\jobname-XMPasXML.xml + \immediate\write\file{<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>^^J} + \immediate\write\file{<!-- Ignore any message about not having style information. That is normal. -->^^J} + \immediate\write\file{<!-- Your viewer's font must be able to display any characters used in the XMP. -->^^J} + \immediate\write\file{<!-- For example, if your XMP has Cyrillic, then you need a Cyrillic-capable font. -->^^J} + \immediate\write\file{<!-- Any decorations (such as dashes in front of lines) are added by the viewer. Not in XMP. -->^^J} + \immediate\write\file{<!-- Note: xpacket begin="" contains the invisible 3-byte utf-8 BOM within its quotes. -->^^J} + \immediate\write\file{<!-- The above xml declaration, and these comments, are not part of the XMP packet. -->^^J} + \immediate\write\file{\@xmpData^^J} + \closeout\file + \fi + \fi +\fi +% +% +%% End write the XMP metadata. + + + +%% PREPARE PDF /INFO METADATA +%% ----------------------------------------------------------------------------- +%% PDF /Info is another form of metadata, older than XMP but still used. +%% It is NOT in utf-8 encoding. Depending on content, one of two encodings +%% will be automatically used: PDFDoc encoding if metadata uses only +%% characters within Latin-1, or utf-16 if metadata is not within Latin-1. +%% Either way, the input was utf-8 before processing. +%% In principle, PDF /Info is obsolete whenever PDF/X is used, because +%% XMP metadata is supposed to prevail through the printing workflow. +%% In practice, things don't always work that way. So, unless your PDF +%% has no metadata, essential items are re-encoded and copied to PDF /Info. +%% Other than encoding, XMP metadata and PDF /Info must be exactly the same. +%% All of those issues are handled automatically here. +%% The result is written at the end of the PDF, after the document. +% +% Macro for massaging encodings: +\def\@infotopdfstring#1#2{% + \ifx#2\@empty + \global\let#1\empty + \else + \begingroup + \hypersetup{pdfencoding=auto}% + \pdfstringdef#1{#2}% + \endgroup + \fi +} +% Now, massage the metadata: +\@infotopdfstring{\@infotitle}{\@title} +\@infotopdfstring{\@infoauthor}{\@author} +\@infotopdfstring{\@infoapplication}{\@novelApplication} +\@infotopdfstring{\@infoproducer}{\@novelProducer} +% +% Ensure Unicode glyph names: +\input{glyphtounicode.tex} % located in tex/generic/ +\input{novel-glyphtounicode.tex} % additional ligatures +\pdfgentounicode=1 +% End ensure Unicode glyph names. +% +%% End prepare PDF /Info. + + + +%% WRITE THE OUTPUT INTENT, UNLESS PDFX IS OFF. +%% ----------------------------------------------------------------------------- +% +\ifpdfx@isOFF\else + \begingroup + \edef\@pctchar{\expandafter\@gobble\string\%} % Escaped in TeX, not PDF. + \edef\@bchar{\expandafter\@gobble\string\\} % For use as escape, below. + \edef\0{\string\0} % Not sure why, but it works. + \edef\({\string\(} % PDF Catalog requires escaped parentheses. + \edef\){\string\)} % PDF Catalog requires escaped parentheses. + \catcode`\_ 12 % The *.icc file name might contain underscores. + % + \if@noembedicc\else + \IfFileExists{\@OIprofile}{% + \immediate\pdfobj stream attr{/N 4} file{\@OIprofile}% + \edef\OBJ@OI{\the\pdflastobj\space 0 R}% + }{% + \ClassError{novel}{Requested color profile *.icc not found}% + {Your Output Intent calls for a color profile *.icc file,^^J% + and you requested `embed-icc',^^J% + but the file could not be located.}% + } + \fi + \ifthenelse{\equal{\@OIcondition}{}}{ + \edef\@OIconditionString{}% + }{ + \edef\@OIconditionString{/OutputCondition (\@OIcondition)}% + } + \ifthenelse{\equal{\@OIidentifier}{}}{ + \edef\@OIidentifierString{}% + }{ + \edef\@OIidentifierString{/OutputConditionIdentifier (\@OIidentifier)}% + } + \ifthenelse{\equal{\@OIinfo}{}}{ + \edef\@OIinfoString{}% + }{ + \edef\@OIinfoString{/Info (\@OIinfo)}% + } + \ifthenelse{\equal{\@OIregistry}{}}{ + \edef\@OIregistryString{}% + }{ + \edef\@OIregistryString{/RegistryName (\@OIregistry)}% + } + \pdfcatalog{% + /OutputIntents [ <<% + /Type/OutputIntent% + /S/GTS_PDFX% + \@OIconditionString% + \@OIidentifierString% + \@OIinfoString% + \@OIregistryString% + \if@noembedicc\else/DestOutputProfile \OBJ@OI\fi% + >> ]% + }% + \endgroup +\fi +% +%% End write the output intent. + + + +%% DISABLE HYPERREF OPTIONS +%%------------------------------------------------------------------------------ +%% Prevents changes that will cause an incompatibility. +% +\Hy@DisableOption{pdfauthor}% +\Hy@DisableOption{pdftitle}% +\Hy@DisableOption{pdfsubject}% +\Hy@DisableOption{pdfcreator}% +\Hy@DisableOption{pdfcreationdate}% +\Hy@DisableOption{pdfmoddate}% +\Hy@DisableOption{pdfproducer}% +\Hy@DisableOption{pdfkeywords}% +% +%% End disable hyperref options. + + + +%% PREPARE PDF/Info +%% ----------------------------------------------------------------------------- +%% The \novel@PDFinfo command is called \AtBeginDocument. +% +\gdef\@novelPDFinfo{ % rather than \PDF@FinishDoc + \if@gottitle + \Hy@UseMaketitleInfos + \pdfinfo{ + \ifx\@infotitle\@empty\else /Title(\@infotitle)\fi + \ifx\@infoauthor\@empty\else /Author(\@infoauthor)\fi + \ifx\@infoapplication\@empty\else /Creator(\@infoapplication)\fi + \ifx\@pdfcreationdate\@empty + /CreationDate(D:\pdfx@convDate)% + \else + /CreationDate(\@pdfcreationdate)% + \fi + \ifx\@pdfmoddate\@empty + /ModDate(D:\pdfx@convDate)% + \else + /ModDate(\@pdfmoddate)% + \fi + \ifx\@infoproducer\@empty\else /Producer(\@infoproducer)\fi% + /Trapped/False% + \ifpdfx@isOFF\else + /GTS_PDFXVersion(\@PDFXversion)% + \if@gotConformance /GTS_PDFXConformance(\@PDFXconformance)\fi% + \fi + } + \fi +} +% +%% End prepare PDF/Info. + + + + +%% +%% End of file `novel-pdfx.sty'. + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel-xmppacket.sty b/Master/texmf-dist/tex/lualatex/novel/novel-xmppacket.sty new file mode 100644 index 00000000000..43f2df3502b --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel-xmppacket.sty @@ -0,0 +1,183 @@ +%% +%% This is file `novel-xmppacket.sty', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +%% ----------------------------------------------------------------------------- +%% +%% The descriptive properties of the namespaces, and the general format of XMP, +%% are public standards released by Adobe Systems Incorporated. +%% See http://www.adobe.com/products/xmp.html +%% +%% ----------------------------------------------------------------------------- +%% +%% +\ProvidesFile{novel-xmppacket.sty}% +[2017/03/01 v1.0.6 LaTeX file (novel XMP packet template)] +%% + + + +% This packet uses utf-8 BOM. +% The catcodes allow # _ ~ $ % & to be used as ordinary characters. +% The \edef and \let get rid of escape backslashes in front of those characters. +% NO COMMENTS AFTER THIS! Until \endgroup. + + + + + +\begingroup + +\lccode`\¤="FEFF +\lowercase{\gdef\@novelBOM{¤}} +\catcode`\#=12 +\catcode`\_=12 +\catcode`\~=12 +\catcode`\$=12 +\catcode`\%=12 +\catcode`\&=12 + +\edef\@pctchar{\expandafter\@gobble\string\%} +\let\%\@pctchar +\edef\@hashchar{\expandafter\@gobble\string\#} +\let\#\@hashchar +\edef\@ampchar{\expandafter\@gobble\string\&} +\let\&\@ampchar +\edef\@dollarchar{\expandafter\@gobble\string\$} +\let\$\@dollarchar +\edef\@underchar{\expandafter\@gobble\string\_} +\let\_\@underchar +\edef\@tildechar{\expandafter\@gobble\string\~} +\let\~\@tildechar + +\xdef\@xmpPacket{<?xpacket begin="\@novelBOM" id="W5M0MpCehiHzreSzNTczkc9d"?>^^J +<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:08:04\pad@iv\pad@iv">^^J +\pad@ii<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">^^J +\pad@iv<rdf:Description rdf:about=""^^J +\pad@viii xmlns:xmp="http://ns.adobe.com/xap/1.0/">^^J +\pad@vi<xmp:ModifyDate>\@modifyDate</xmp:ModifyDate>^^J +\pad@vi<xmp:CreateDate>\@createDate</xmp:CreateDate>^^J +\@applicationString +\pad@vi<xmp:MetadataDate>\@metadataDate</xmp:MetadataDate>^^J +\pad@iv</rdf:Description>^^J +\pad@iv<rdf:Description rdf:about=""^^J +\pad@viii xmlns:dc="http://purl.org/dc/elements/1.1/">^^J +\pad@vi<dc:format>application/pdf</dc:format>^^J +\@titleString +\@authorString +\pad@iv</rdf:Description>^^J +\pad@iv<rdf:Description rdf:about=""^^J +\pad@viii xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">^^J +\pad@vi<xmpMM:DocumentID>\@documentID</xmpMM:DocumentID>^^J +\pad@vi<xmpMM:InstanceID>\@instanceID</xmpMM:InstanceID>^^J +\pad@vi<xmpMM:RenditionClass>default</xmpMM:RenditionClass>^^J +\pad@vi<xmpMM:VersionID>1</xmpMM:VersionID>^^J +\pad@iv</rdf:Description>^^J +\pad@iv<rdf:Description rdf:about=""^^J +\pad@viii xmlns:pdf="http://ns.adobe.com/pdf/\@pdfVersion/">^^J +\@producerString +\pad@vi<pdf:Trapped>False</pdf:Trapped>^^J +\pad@iv</rdf:Description>^^J +\pad@iv<rdf:Description rdf:about=""^^J +\pad@viii xmlns:pdfx="http://ns.adobe.com/pdfx/\@pdfVersion/">^^J +\@verconfString +\pad@iv</rdf:Description>^^J +\pad@iv<rdf:Description rdf:about=""^^J +\pad@viii xmlns:pdfxid="http://www.npes.org/pdfx/ns/id/">^^J +\@pdfidString +\pad@iv</rdf:Description>^^J +\pad@iv<rdf:Description rdf:about=""^^J +\pad@viii xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"^^J +\pad@viii xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"^^J +\pad@viii xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#">^^J +\pad@vi<pdfaExtension:schemas>^^J +\pad@viii<rdf:Bag>^^J +\pad@x<rdf:li rdf:parseType="Resource">^^J +\pad@xii<pdfaSchema:namespaceURI>http://ns.adobe.com/pdf/\@pdfVersion/</pdfaSchema:namespaceURI>^^J +\pad@xii<pdfaSchema:prefix>pdf</pdfaSchema:prefix>^^J +\pad@xii<pdfaSchema:schema>Adobe PDF Schema</pdfaSchema:schema>^^J +\pad@xii<pdfaSchema:property>^^J +\pad@xiv<rdf:Seq>^^J +\pad@xvi<rdf:li rdf:parseType="Resource">^^J +\pad@xviii<pdfaProperty:category>internal</pdfaProperty:category>^^J +\pad@xviii<pdfaProperty:description>A name object indicating whether the document has been modified to include trapping information</pdfaProperty:description>^^J +\pad@xviii<pdfaProperty:name>Trapped</pdfaProperty:name>^^J +\pad@xviii<pdfaProperty:valueType>Text</pdfaProperty:valueType>^^J +\pad@xvi</rdf:li>^^J +\pad@xiv</rdf:Seq>^^J +\pad@xii</pdfaSchema:property>^^J +\pad@x</rdf:li>^^J +\pad@x<rdf:li rdf:parseType="Resource">^^J +\pad@xii<pdfaSchema:namespaceURI>http://ns.adobe.com/pdfx/\@pdfVersion/</pdfaSchema:namespaceURI>^^J +\pad@xii<pdfaSchema:prefix>pdfx</pdfaSchema:prefix>^^J +\pad@xii<pdfaSchema:schema>PDF/X ID Schema</pdfaSchema:schema>^^J +\pad@xii<pdfaSchema:property>^^J +\pad@xiv<rdf:Seq>^^J +\pad@xvi<rdf:li rdf:parseType="Resource">^^J +\pad@xviii<pdfaProperty:category>internal</pdfaProperty:category>^^J +\pad@xviii<pdfaProperty:description>ID of PDF/X standard</pdfaProperty:description>^^J +\pad@xviii<pdfaProperty:name>GTS_PDFXVersion</pdfaProperty:name>^^J +\pad@xviii<pdfaProperty:valueType>Text</pdfaProperty:valueType>^^J +\pad@xvi</rdf:li>^^J +\pad@xvi<rdf:li rdf:parseType="Resource">^^J +\pad@xviii<pdfaProperty:category>internal</pdfaProperty:category>^^J +\pad@xviii<pdfaProperty:description>Conformance level of PDF/X standard</pdfaProperty:description>^^J +\pad@xviii<pdfaProperty:name>GTS_PDFXConformance</pdfaProperty:name>^^J +\pad@xviii<pdfaProperty:valueType>Text</pdfaProperty:valueType>^^J +\pad@xvi</rdf:li>^^J +\pad@xiv</rdf:Seq>^^J +\pad@xii</pdfaSchema:property>^^J +\pad@x</rdf:li>^^J +\pad@x<rdf:li rdf:parseType="Resource">^^J +\pad@xii<pdfaSchema:namespaceURI>http://ns.adobe.com/xap/1.0/mm/</pdfaSchema:namespaceURI>^^J +\pad@xii<pdfaSchema:prefix>xmpMM</pdfaSchema:prefix>^^J +\pad@xii<pdfaSchema:schema>XMP Media Management Schema</pdfaSchema:schema>^^J +\pad@xii<pdfaSchema:property>^^J +\pad@xiv<rdf:Seq>^^J +\pad@xvi<rdf:li rdf:parseType="Resource">^^J +\pad@xviii<pdfaProperty:category>internal</pdfaProperty:category>^^J +\pad@xviii<pdfaProperty:description>UUID based identifier for specific incarnation of a document</pdfaProperty:description>^^J +\pad@xviii<pdfaProperty:name>InstanceID</pdfaProperty:name>^^J +\pad@xviii<pdfaProperty:valueType>URI</pdfaProperty:valueType>^^J +\pad@xvi</rdf:li>^^J +\pad@xiv</rdf:Seq>^^J +\pad@xii</pdfaSchema:property>^^J +\pad@x</rdf:li>^^J +\pad@x<rdf:li rdf:parseType="Resource">^^J +\pad@xii<pdfaSchema:namespaceURI>http://www.npes.org/pdfx/ns/id/</pdfaSchema:namespaceURI>^^J +\pad@xii<pdfaSchema:prefix>pdfxid</pdfaSchema:prefix>^^J +\pad@xii<pdfaSchema:schema>PDF/X ID Schema</pdfaSchema:schema>^^J +\pad@xii<pdfaSchema:property>^^J +\pad@xiv<rdf:Seq>^^J +\pad@xvi<rdf:li rdf:parseType="Resource">^^J +\pad@xviii<pdfaProperty:category>internal</pdfaProperty:category>^^J +\pad@xviii<pdfaProperty:description>ID of PDF/X standard</pdfaProperty:description>^^J +\pad@xviii<pdfaProperty:name>GTS_PDFXVersion</pdfaProperty:name>^^J +\pad@xviii<pdfaProperty:valueType>Text</pdfaProperty:valueType>^^J +\pad@xvi</rdf:li>^^J +\pad@xiv</rdf:Seq>^^J +\pad@xii</pdfaSchema:property>^^J +\pad@x</rdf:li>^^J +\pad@viii</rdf:Bag>^^J +\pad@vi</pdfaExtension:schemas>^^J +\pad@iv</rdf:Description>^^J +\pad@ii</rdf:RDF>^^J +</x:xmpmeta>^^J +\pad@dxii +<?xpacket end="w"?>} +\endgroup + + +%% +%% End of file `novel-xmppacket.sty'. + diff --git a/Master/texmf-dist/tex/lualatex/novel/novel.cls b/Master/texmf-dist/tex/lualatex/novel/novel.cls new file mode 100644 index 00000000000..f39aa7fa09e --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/novel/novel.cls @@ -0,0 +1,383 @@ +%% +%% This is file `novel.cls', part of class `novel'. +%% Copyright 2017 Robert Allgeyer. +%% anytthree [at] gmail.com +%% +%% This file may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +% Actually needs LuaLaTeX, at least version 0.95 from TeXLive 2016. +\ProvidesClass{novel}[2017/03/01 v1.0.6 LaTeX document class] +%% + + +%% DESCRIPTION: +%% Class `novel' is designed for print fiction: novels or short stories. +%% It cannot be used for e-books or for journal publication. +%% It is not suitable for most non-fiction, because routine academic features +%% such as bibiography and automatic sectioning are defeated. +%% +%% There are pre-configured layouts for the most commonly used choices of +%% trim size (finished book width and height), and internal layout consistent +%% with fiction. The user can over-ride the pre-configured settings. +%% +%% The class will automatically create PDF/X compliant files upon request, +%% using a self-contained command structure. +%% +%% LuaLaTeX is required, and input files must be encoded utf-8. +%% +%% Fonts are loaded by luaotfload and fontspec, and massaged by microtype. +%% For best results, use modern Open Type fonts, or TrueType fonts. +%% +%% The Libertinus font family, a fork of [Linux] Libertine/Biolinum, +%% is the default. Actually, I recommend it! In addition, an included +%% custom font, NovelDeco.otf, is used for special purposes. +%% + + +%% REQUIRE LUATEX and do some preliminary setup. +%% ----------------------------------------------------------------------------- +%% These are not user settings. +% +\RequirePackage{ifluatex} % LuaTeX is required. Not XeTeX, dvips, or pdfTeX. +\RequirePackage{luatex85} % Needed for compatibility when using LuaTeX 0.95 etc. +\RequirePackage{pdftexcmds} % compatibility +\ifluatex + % New with TeXlive 2016. Removes unnecessary File Data: + \pdfvariable suppressoptionalinfo 511 % writes only ID to PDF Catalog +\else + \ClassError{novel}{Must compile with LuaLaTeX 0.95+}{Sorry, LuaLaTeX only.% + No pdfTeX, dvips, or XeTeX.} +\fi +% +\RequirePackage{etoolbox} % general good stuff +\RequirePackage{xifthen} % improved ifthenelse handling +\RequirePackage{xstring} % parses strings +\RequirePackage{fp} % used everywhere for math calculations +\FPmessagesfalse % eliminates numerous friendly messages from the log +% +\pdfminorversion=3 % might be reset later, depending on settings +\gdef\thepdfminorversion{\pdfminorversion} +% +\RequirePackage{silence} % Used here: +% hyperref draft mode is always on, even when novel is not in draft mode: +\WarningFilter{hyperref}{Draft mode on} % So, get rid of the hyperref warning. +% Prevent complaints about no protrusion list for cmr, cmm, etc. in decimal pts: +\WarningFilter{microtype}{I cannot find a protrusion list} % It's not there! +% +\RequirePackage[relative]{textpos} % for inserting images +\RequirePackage{noindentafter} % for unindented chapter and scene starts +\RequirePackage{calc} % allows length expression calculations +\RequirePackage{changepage} % block indents, etc. +\RequirePackage{atbegshi} % for one-page header changes. Also used by hyperref. +\RequirePackage{letltxmacro} % for re-defining some macros +\RequirePackage{magaz} % special treatment of first lines +\RequirePackage{changepage} % for adjusted text widths. Do not use strict! +\RequirePackage{xparse} % for writing cool-looking commands +% +% In addition, the following packages are required, but they are not loaded now. +% They must wait for something else to happen first. They will be loaded +% with suitable arguments, when the time comes: +% fontspec -- in novel-LayoutSettings.sty +% unicode-math -- in novel-LayoutSettings.sty +% eso-pic -- in novel-CalculateLayout.sty +% polyglossia -- in novel-FontDefaults.sty +% microtype -- in novel-FontDefaults.sty +% hyperref -- in novel-pdfx.sty +% fancyhdr -- in novel.HeadFootStyles.sty +% xcolor -- lower in this page +% adjustbox -- lower on this page +% eso-pic -- lower on this page +%% + + +%% Process document class options. +%% ----------------------------------------------------------------------------- +% Allowed option list: +% draft xml shademargins graytext greytext cropmarks cropview closecrop +% Yes, I realize that this could have been done another way: +\gdef\@mycol{\@classoptionslist} +\StrDel{\@mycol}{ }[\@mycola] +\StrDel{\@mycola}{,}[\@mycolb] +\StrDel{\@mycolb}{draft}[\@mycolc] +\StrDel{\@mycolc}{xml}[\@mycold] +\StrDel{\@mycold}{shademargins}[\@mycole] +\StrDel{\@mycole}{graytext}[\@mycolf] +\StrDel{\@mycolf}{greytext}[\@mycolg] +\StrDel{\@mycolg}{cropmarks}[\@mycolh] +\StrDel{\@mycolh}{cropview}[\@mycoli] +\StrDel{\@mycoli}{closecrop}[\@mycolj] +% +\gdef\@mycolzzz{\@mycolj} % modify if others added +\ifthenelse{\equal{\@mycolzzz}{}}{}{ + \ClassWarning{novel}{Unrecognized class option: \@mycolzzz\space^^J% + The unrecognized option was ignored!^^J}% +} +% +% If used, option `draft' shows overflow rule. +\newif \if@useDraftMode +\setlength\overfullrule{0pt} +\DeclareOption{draft}{ + \setlength\overfullrule{6pt} + \@useDraftModetrue + \ClassWarning{novel}{Compiled using draft mode. Not for final release!^^J} +} +% If used, option `xml' creates a file `\jobname-XMPasXML.xml` that contains +% the XMP metadata with an xml declaration and comments at top. +% Only works when \SetPDFX is not `off'. +\newif \if@wantXMPasXML +\DeclareOption{xml}{ + \@wantXMPasXMLtrue +} +\DeclareOption{xmp}{ % in case you mis-type. + \ClassError{novel}{No class option `xmp'. Want `xml' ?^^J}% + {There is no class option named `xmp'. It is `xml'.^^J} +} +% Option `shademargins' does just that. Ignored unless in draft mode. +% Does not matter if `graytext' option in use. +\newif \if@shademargins +\DeclareOption{shademargins}{ + \@shademarginstrue +} +% Option `graytext' allows text in grayscale. Images unaffected. +% If this option is not used, all text will be K black. +\newif \if@graytext +\DeclareOption{graytext}{ + \@graytexttrue +} +% For the Brits: +\DeclareOption{greytext}{ + \@graytexttrue +} +% Usually you do NOT want crop (trim) marks. Configurable by \SetCropMarks[]{}. +\newif \if@cropmarks +\DeclareOption{cropmarks}{ + \@cropmarkstrue +} +% The cropview sets PDF CropBox equal to TrimBox instead of MediaBox. +% Only makes a difference when MediaBox is larger than TrimBox. +% Ignored unless in draft mode. +\newif \if@cropview +\DeclareOption{cropview}{ + \@cropviewtrue +} +% With closecrop, the TrimSize and margins are re-sized, to preserve the +% live area, but with reduced margins on all sides (same for verso/recto). +% This option is available only in draft mode, and disables shademargins. +% The purpose is to create a PDF that is more easily read on a handheld device, +% so you can think about edits while traveling. It is NOT an e-book, since +% it has no hyperlinks and is missing some features that an e-book should have. +\newif \if@closecrop +\DeclareOption{closecrop}{ + \@cropviewtrue\@closecroptrue +} +%% Note that document size and normal font size are not class options. +%% They are set by commands in the Preamble, and have default values. +% +\ProcessOptions\relax +% Disable some options, unless in draft mode: +\if@useDraftMode\else + \global\@shademarginsfalse + \global\@cropviewfalse + \global\@closecropfalse +\fi +% +\if@cropview + \global\@cropmarksfalse +\fi +% +\if@closecrop + \global\@cropviewtrue + \global\@shademarginsfalse + \global\@cropmarksfalse +\fi +% +%% end class options + + + +%% Activate xcolor, adjustbox, and eso-pic: +%% ----------------------------------------------------------------------------- +% The final book must be monochrome (black and white only) for all text +% and vector graphics, unless option `graytext' is used. +% Vector graphics are discouraged, in any case. See Page 9. +% You can use grayscale (single channel, not RGB gray) raster images. +% In draft mode only, the `shademargins' option +% requires grayscale, so it is temporarily enabled. +\newif \if@grayenabled +% +\if@useDraftMode + \RequirePackage[gray,hyperref]{xcolor} % allows some layout checks + \global\@grayenabledtrue +\else + \if@graytext + \RequirePackage[gray,hyperref]{xcolor} % black/white book block + \global\@grayenabledtrue + \else + \RequirePackage[monochrome,hyperref]{xcolor} % black/white book block + \fi +\fi +% adjustbox and eso-pic cannot precede xcolor. +\RequirePackage{adjustbox} % for scaling and moving +\RequirePackage{eso-pic} % background effects in draft mode +% +%% end activate xcolor and adjustbox + + + +%% Temporary normal font size +%% ----------------------------------------------------------------------------- +%% This normalsize is temporary, so that packages can load without complaint. +%% It will be modified later, during layout calculations. +\def\Current@FontSizeNum{10} +\def\Current@BaselineSkipNum{13} +\def\normalsize{% + \@setfontsize\normalsize{\Current@FontSizeNum}{\Current@BaselineSkipNum}% +} +\normalsize +% +%% end temporary normal point size and baselineskip + + + +%% Define commands used for File Data, including PDF/X Settings. +%% ----------------------------------------------------------------------------- +%% As used here, `File Data' refers to PDF metadata as found in PDF/Info +%% and in XMP. This class does not write it to the Catalog. +%% Defines commands such as \title{}, not necessarily the same as other TeX. +\RequirePackage{novel-FileData} +% +%% + + +%% Physical Layout Commands and Settings. +%% ----------------------------------------------------------------------------- +%% Define commands that over-ride the class option pre-configured settings. +%% Variety of miscellaneous layout settings such as \parsep, \parindent, etc. +\RequirePackage{novel-LayoutSettings} +% +%% + + +%% Additional Preamble Settings and Commands. +%% ----------------------------------------------------------------------------- +%% +% Macros for use in document body: +\input{novel-TextMacros.sty} +% Standard `fancyhdr' header footer styles: +\input{novel-HeadFootStyles.sty} +% Chapter and Scene styles: +\input{novel-ChapterScene.sty} +% Image placement: +\input{novel-Images.sty} +% Footnotes and endnotes: +\input{novel-Footnotes.sty} +%% + + +%% \AtEndPreamble sets defaults and calculates layout +%% ----------------------------------------------------------------------------- +% +\AtEndPreamble{ + \makeatletter % Necessary. Why? Who knows. + \input{novel-CalculateLayout.sty} + \input{novel-FontDefaults.sty} + \input{novel-pdfx.sty} + \AtBeginShipout{\gdef\@fnafter{}} + \makeatother +} +%% + + +%% \AtBeginDocument finishes the setup +%% ----------------------------------------------------------------------------- +% +% Error if certain packages were requested in the Preamble. +% This macro is invoked \AtBeginDocument. +\newif \ifshutoffblock % part of incompatible package blocking +% +\AtBeginDocument{ % + \defaultfontfeatures{} % reset + % Any other fonts will use these defaults: + \defaultfontfeatures{% + SmallCapsFeatures={Renderer=Basic},Kerning=On,% + Ligatures=TeX,% + }% + % + % Find some useful measurements: + \gdef\@normalxheight{\heightof{x}} + \setlength\normalxheight{\@normalxheight} + \global\normalxheight=\normalxheight + \gdef\@normalXheight{\heightof{X}} + \setlength\normalXheight{\@normalXheight} + \global\normalXheight=\normalXheight + % Activate user choice of whether or not to indent after scenebreak commands: + \if@indentAfterScenebreak\else + \NoIndentAfterCmd{\scenebreak} + \NoIndentAfterCmd{\sceneline} + \NoIndentAfterCmd{\scenestars} + \fi + % + \@activateHeadFootStyles % in file `novel-HeadFootStyles.sty' + \@novelPDFinfo % in file `novel-pdfx.sty'. + % Commands that cannot be used after Preamble: + \let\indentAfterScenebreak\relax + \let\title\relax + \let\author\relax + \let\subtitle\relax + % Disallow incompatible packages: + \ifshutoffblock + \gdef\sorry@no#1{} + \else + \gdef\sorry@no#1{\@ifpackageloaded{#1}{% + \ClassError{novel}{Sorry, package `#1' cannot be used}% + {The `novel' class does not allow use of package `#1'.^^J% + You must remove it from the Preamble, and also remove its commands^^J% + from the body of your document. In rare cases, the offending package^^J% + was loaded by some other package.^^J}% + }{}% + } + \fi + % + \sorry@no{pdfx} + \sorry@no{xmpincl} + \sorry@no{hyperxmp} + \sorry@no{pdfxmult} + \sorry@no{inputenc} + \sorry@no{fontenc} + \sorry@no{showkeys} + \sorry@no{wrapfigure} + \sorry@no{wrapfig} + \sorry@no{float} + \sorry@no{morefloats} + \sorry@no{footmisc} + \sorry@no{footnote} + \sorry@no{manyfoot} + \sorry@no{caption} + \sorry@no{subcaption} + \sorry@no{multirow} + \sorry@no{tabu} + \sorry@no{tabularx} + \sorry@no{tabulary} + \sorry@no{array} + \sorry@no{booktabs} + \sorry@no{eqparbox} + \sorry@no{pdfpages} + \sorry@no{nth} + \sorry@no{engord} + \sorry@no{endnotes} +} +%% + + + +%% +%% End of file `novel.cls' + |