@dataimago/css 0.1.0-alpha.21 → 0.1.0-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +241 -0
- package/dist/bin/dataimago-figures.mjs +703 -0
- package/dist/bin/dataimago-sync.mjs +299 -19
- package/dist/dataimago.css +9 -3
- package/dist/dataimago.min.css +1 -1
- package/dist/dataviz/dataimago-dataviz.css +1 -1
- package/dist/dataviz/dataimago-dataviz.json +2 -2
- package/dist/dataviz/dataimago-dataviz.tex +1 -1
- package/dist/dataviz/dataimago_dataviz.R +1 -1
- package/dist/figures/NotoSans-Bold.otf +0 -0
- package/dist/figures/NotoSans-BoldItalic.otf +0 -0
- package/dist/figures/NotoSans-Italic.otf +0 -0
- package/dist/figures/NotoSans-Regular.otf +0 -0
- package/dist/figures/NotoSansMath-Regular.ttf +0 -0
- package/dist/figures/OFL-NotoSans.txt +93 -0
- package/dist/figures/OFL-NotoSansMath.txt +93 -0
- package/dist/figures/dataimago-figure.sty +105 -0
- package/dist/figures/dataimago-tokens.sty +134 -0
- package/dist/fonts/cyrillic/OFL-NotoSans.txt +93 -0
- package/dist/fonts/cyrillic/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/cyrillic/fonts.css +27 -0
- package/dist/fonts/cyrillic/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/cyrillic/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/cyrillic/noto-sans.woff2 +0 -0
- package/dist/fonts/cyrillic-ext/OFL-NotoSans.txt +93 -0
- package/dist/fonts/cyrillic-ext/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/cyrillic-ext/fonts.css +27 -0
- package/dist/fonts/cyrillic-ext/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/cyrillic-ext/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/cyrillic-ext/noto-sans.woff2 +0 -0
- package/dist/fonts/greek/OFL-NotoSans.txt +93 -0
- package/dist/fonts/greek/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/greek/fonts.css +27 -0
- package/dist/fonts/greek/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/greek/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/greek/noto-sans.woff2 +0 -0
- package/dist/fonts/greek-ext/OFL-NotoSans.txt +93 -0
- package/dist/fonts/greek-ext/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/greek-ext/fonts.css +27 -0
- package/dist/fonts/greek-ext/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/greek-ext/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/greek-ext/noto-sans.woff2 +0 -0
- package/dist/fonts/josefin/OFL-JosefinSans.txt +93 -0
- package/dist/fonts/josefin/fonts.css +8 -0
- package/dist/fonts/josefin/josefin-sans.woff2 +0 -0
- package/dist/fonts/lang.css +181 -0
- package/dist/fonts/latin/OFL-NotoSans.txt +93 -0
- package/dist/fonts/latin/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/latin/fonts.css +27 -0
- package/dist/fonts/latin/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/latin/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/latin/noto-sans.woff2 +0 -0
- package/dist/fonts/latin-ext/OFL-NotoSans.txt +93 -0
- package/dist/fonts/latin-ext/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/latin-ext/fonts.css +27 -0
- package/dist/fonts/latin-ext/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/latin-ext/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/latin-ext/noto-sans.woff2 +0 -0
- package/dist/fonts/math/OFL-NotoSansMath.txt +93 -0
- package/dist/fonts/math/fonts.css +8 -0
- package/dist/fonts/math/noto-sans-math.woff2 +0 -0
- package/dist/fonts/pkg/GFL.txt +29 -0
- package/dist/fonts/pkg/README-lm.txt +27 -0
- package/dist/fonts/pkg/fonts.css +8 -0
- package/dist/fonts/pkg/lmsans10-regular.woff2 +0 -0
- package/dist/fonts/vietnamese/OFL-NotoSans.txt +93 -0
- package/dist/fonts/vietnamese/OFL-NotoSansMono.txt +93 -0
- package/dist/fonts/vietnamese/fonts.css +27 -0
- package/dist/fonts/vietnamese/noto-sans-italic.woff2 +0 -0
- package/dist/fonts/vietnamese/noto-sans-mono.woff2 +0 -0
- package/dist/fonts/vietnamese/noto-sans.woff2 +0 -0
- package/dist/latex/dataimago-tokens.sty +14 -2
- package/dist/latex/dataimago.sty +6 -1
- package/dist/outputs.json +114 -21
- package/dist/quarto/_extensions/dataimago/monograph/_extension.yml +35 -0
- package/dist/quarto/_extensions/dataimago/monograph/dataimago-base.sty +275 -0
- package/dist/quarto/_extensions/dataimago/monograph/dataimago-monograph.sty +270 -0
- package/dist/quarto/_extensions/dataimago/monograph/dataimago-tokens.sty +134 -0
- package/dist/quarto/_extensions/dataimago/monograph/filters/figure-plate.lua +52 -0
- package/dist/quarto/_extensions/dataimago/monograph/filters/matter.lua +170 -0
- package/dist/quarto/_extensions/dataimago/monograph/filters/pkg-name.lua +17 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/GFL.txt +29 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/JosefinSans-VF.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/NotoSans-Italic-VF.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/NotoSans-VF.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/NotoSansMath-Regular.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/NotoSansMono-VF.ttf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/OFL-JosefinSans.txt +93 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/OFL-NotoSans.txt +93 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/OFL-NotoSansMath.txt +93 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/OFL-NotoSansMono.txt +93 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/README-lm.txt +27 -0
- package/dist/quarto/_extensions/dataimago/monograph/fonts/lmsans10-regular.otf +0 -0
- package/dist/quarto/_extensions/dataimago/monograph/partials/before-body.tex +16 -0
- package/dist/quarto/_extensions/dataimago/monograph/partials/title.tex +27 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/_extension.yml +28 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/components.scss +243 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/dataimago-dark.scss +344 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/dataimago-light.scss +338 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/filters/landing.lua +233 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/filters/provenance.lua +212 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/hero-fallback.svg +53 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/pkgsite-hero.js +99 -0
- package/dist/quarto/_extensions/dataimago/pkgsite/pkgsite.scss +281 -0
- package/dist/quarto/components.scss +14 -1
- package/dist/quarto/dataimago-dark.scss +22 -6
- package/dist/quarto/dataimago-light.scss +16 -6
- package/dist/tailwind-preset.js +4 -4
- package/dist/templates/KNOWLEDGE-explorer.md +1 -1
- package/dist/templates/KNOWLEDGE-framework.md +1 -1
- package/dist/templates/KNOWLEDGE-research.md +1 -1
- package/dist/templates/quarto_website/README.md +4 -2
- package/dist/templates/quarto_website/_quarto.yml.template +4 -2
- package/dist/templates/quarto_website/about.qmd.template +1 -1
- package/dist/templates/quarto_website/assets/css/lang.css +181 -0
- package/dist/templates/quarto_website/assets/js/custom-anchors.js +1 -1
- package/dist/templates/quarto_website/assets/js/logo-switch.js +1 -1
- package/dist/templates/quarto_website/assets/js/scroll.js +1 -1
- package/dist/templates/quarto_website/ethics.qmd.template +1 -1
- package/dist/templates/quarto_website/index.qmd.template +1 -1
- package/dist/tokens.css +3 -3
- package/dist/tokens.scss +3 -3
- package/package.json +6 -3
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
% @dataimago/css@0.1.0-alpha.23 dist/quarto/_extensions/dataimago/monograph/dataimago-monograph.sty · sha256:53079215be3762f5491807f35ef5331bf47b5b343913cdc862b0efc65b3715b8 · generated from tokens; do not edit · restore: npx -p @dataimago/css@0.1.0-alpha.23 dataimago-sync
|
|
2
|
+
%%%
|
|
3
|
+
%%% dataimago-monograph.sty - the monograph layer over dataimago-base (memoir, LuaLaTeX)
|
|
4
|
+
%%%
|
|
5
|
+
%%% Chapters, sections, contents, page styles, the epigraph and the title page, ported from the LIwLD
|
|
6
|
+
%%% fork's memoir block (dataimago-no-ai-logo.sty). Load it after dataimago-base, in a memoir document:
|
|
7
|
+
%%%
|
|
8
|
+
%%% \documentclass[oneside,11pt,openany]{memoir}
|
|
9
|
+
%%% \usepackage{dataimago-base}
|
|
10
|
+
%%% \usepackage{dataimago-monograph}
|
|
11
|
+
%%%
|
|
12
|
+
%%% The dataimago/monograph Quarto extension does exactly that and fills the title macros from metadata.
|
|
13
|
+
%%%
|
|
14
|
+
%%% Heading faces (maintainer's "keep today's look" decision, Global Constraints). The fork's macro names
|
|
15
|
+
%%% keep their meaning; the weights are the ones the reference prints today:
|
|
16
|
+
%%%
|
|
17
|
+
%%% \HeadingFontBold 400 chapter number \HUGE, chapter title \huge, title page \Huge
|
|
18
|
+
%%% \HeadingFontMedium 400 section \Large, section number
|
|
19
|
+
%%% \HeadingFontSemiBold 600 title page subtitle \LARGE
|
|
20
|
+
%%% \HeadingFontRegular 400 subsection \large
|
|
21
|
+
%%% \HeadingFontSubsub 400 subsubsection \normalsize (the Josefin floor; the fork's \HeadingFontLight is 300)
|
|
22
|
+
%%% \HeadingFontLight 300 (unused: below the 400 heading floor, wiki/decisions/josefin-weight-floor.md)
|
|
23
|
+
%%% \HeadingFontExtraLight 200 (ExtraLight, the token weight; unused, kept for the fork's captions and labels)
|
|
24
|
+
%%%
|
|
25
|
+
%%% Title macros (all optional; a missing one prints nothing, no rule or gap):
|
|
26
|
+
%%% \diTitle \diSubtitle \diAuthors \diAffiliations \diVersion \diDate \diLicense
|
|
27
|
+
%%% \diLicenseUrl
|
|
28
|
+
%%%
|
|
29
|
+
\NeedsTeXFormat{LaTeX2e}
|
|
30
|
+
\ProvidesPackage{dataimago-monograph}[2026/10/31 dataimago monograph layer (memoir)]
|
|
31
|
+
|
|
32
|
+
\makeatletter
|
|
33
|
+
\@ifclassloaded{memoir}{}{%
|
|
34
|
+
\PackageError{dataimago-monograph}{This layer needs the memoir class}{%
|
|
35
|
+
Use \string\documentclass{memoir}; the article layer is for articles.}%
|
|
36
|
+
\expandafter\@@end}
|
|
37
|
+
\@ifpackageloaded{dataimago-base}{}{\RequirePackage{dataimago-base}}
|
|
38
|
+
|
|
39
|
+
%% ---- Heading faces ----------------------------------------------------------------------------------
|
|
40
|
+
\newcommand\HeadingFontBold{\diHeadingFont{400}}
|
|
41
|
+
\newcommand\HeadingFontMedium{\diHeadingFont{400}}
|
|
42
|
+
\newcommand\HeadingFontSemiBold{\diHeadingFont{600}}
|
|
43
|
+
\newcommand\HeadingFontRegular{\diHeadingFont{400}}
|
|
44
|
+
\newcommand\HeadingFontLight{\diHeadingFont{300}}
|
|
45
|
+
% The Josefin floor: no heading surface prints below 400 (wiki/decisions/josefin-weight-floor.md). LIwLD printed the
|
|
46
|
+
% subsubsection at 300; this layer prints it at the floor, and LIwLD's 300 goes to the maintainer at the comparison
|
|
47
|
+
% (wiki/decisions/pdf-format.md). Keeping 300 would need the floor ADR amended first.
|
|
48
|
+
\newcommand\diHeadingFloor{400}
|
|
49
|
+
\newcommand\HeadingFontSubsub{\diHeadingFont{\diHeadingFloor}}
|
|
50
|
+
\newcommand\HeadingFontExtraLight{\diHeadingFont{\diFontWeightExtralight}}
|
|
51
|
+
\let\HeadingFont\HeadingFontBold
|
|
52
|
+
|
|
53
|
+
%% ---- Page: letter stock, a 9 x 6.5in block, 1in margins (LIwLD _quarto.yml header) --------------------
|
|
54
|
+
\setstocksize{11in}{8.5in}
|
|
55
|
+
\settrimmedsize{11in}{8.5in}{*}
|
|
56
|
+
\settrims{0pt}{0pt}
|
|
57
|
+
\settypeblocksize{9.0in}{6.5in}{*}
|
|
58
|
+
\setlrmargins{1in}{*}{1}
|
|
59
|
+
\setulmargins{1in}{*}{*}
|
|
60
|
+
\setheadfoot{\onelineskip}{2\onelineskip}
|
|
61
|
+
\setheaderspaces{*}{2\onelineskip}{*}
|
|
62
|
+
\checkandfixthelayout
|
|
63
|
+
|
|
64
|
+
\setlength{\parskip}{0.3\baselineskip}
|
|
65
|
+
\setlength{\parindent}{14pt}
|
|
66
|
+
% Display-math skips: LIwLD prints memoir's own at 11pt (\normalsize resets any set here), so none are set.
|
|
67
|
+
|
|
68
|
+
%% ---- Divisions ---------------------------------------------------------------------------------------
|
|
69
|
+
\setsecnumdepth{subsubsection}
|
|
70
|
+
\maxsecnumdepth{subsubsection}
|
|
71
|
+
\settocdepth{section}
|
|
72
|
+
|
|
73
|
+
%% ---- Page styles -------------------------------------------------------------------------------------
|
|
74
|
+
\setlength{\headheight}{18pt}
|
|
75
|
+
\makepagestyle{dataimago}
|
|
76
|
+
\makeevenhead{dataimago}{\small\normalfont\color{ContentSecondary}\thepage}{}{\small\normalfont\color{ContentSecondary}\leftmark}
|
|
77
|
+
\makeoddhead{dataimago}{\small\normalfont\color{ContentSecondary}\leftmark}{}{\small\normalfont\color{ContentSecondary}\thepage}
|
|
78
|
+
\makeevenfoot{dataimago}{}{}{}
|
|
79
|
+
\makeoddfoot{dataimago}{}{}{}
|
|
80
|
+
\makeheadrule{dataimago}{\textwidth}{0.4pt}
|
|
81
|
+
|
|
82
|
+
\makepagestyle{plain}
|
|
83
|
+
\makeevenfoot{plain}{}{\small\normalfont\thepage}{}
|
|
84
|
+
\makeoddfoot{plain}{}{\small\normalfont\thepage}{}
|
|
85
|
+
|
|
86
|
+
\makepagestyle{frontmatter}
|
|
87
|
+
\makeevenfoot{frontmatter}{}{\small\normalfont\thepage}{}
|
|
88
|
+
\makeoddfoot{frontmatter}{}{\small\normalfont\thepage}{}
|
|
89
|
+
|
|
90
|
+
% Matter switches. \frontmatter (roman) opens with the frontmatter page style, \mainmatter (arabic) with
|
|
91
|
+
% the running-header style. The template writes \mainmatter itself ahead of the body, before the filter
|
|
92
|
+
% has placed the front matter chapters, so that call is set aside and the filter's \diMainmatter does it.
|
|
93
|
+
\let\di@frontmatter\frontmatter
|
|
94
|
+
\renewcommand\frontmatter{\di@frontmatter\pagestyle{frontmatter}}
|
|
95
|
+
\let\di@mainmatter\mainmatter
|
|
96
|
+
\newcommand\diMainmatter{\di@mainmatter\pagestyle{dataimago}}
|
|
97
|
+
\let\mainmatter\relax
|
|
98
|
+
\pagestyle{frontmatter}
|
|
99
|
+
|
|
100
|
+
% Header mark: the chapter number only where chapters are numbered.
|
|
101
|
+
\renewcommand{\chaptermark}[1]{\markboth{\if@mainmatter\thechapter.\ \fi#1}{}}
|
|
102
|
+
|
|
103
|
+
% The contents on a page of their own, and not listed in themselves: memoir's starred form leaves out the
|
|
104
|
+
% contents-line a plain \tableofcontents adds for its own title.
|
|
105
|
+
\renewcommand\tableofcontents{\clearpage\csname mem@tableofcontents\endcsname{01}}
|
|
106
|
+
|
|
107
|
+
%% ---- Spacing -----------------------------------------------------------------------------------------
|
|
108
|
+
\setlength{\beforechapskip}{0pt}
|
|
109
|
+
\setlength{\afterchapskip}{40pt}
|
|
110
|
+
\setbeforesecskip{-3.5ex plus -1ex minus -.2ex}
|
|
111
|
+
\setaftersecskip{2.3ex plus .2ex}
|
|
112
|
+
\setbeforesubsecskip{-3.25ex plus -1ex minus -.2ex}
|
|
113
|
+
\setaftersubsecskip{1.5ex plus .2ex}
|
|
114
|
+
|
|
115
|
+
%% ---- Contents ----------------------------------------------------------------------------------------
|
|
116
|
+
\renewcommand{\printtoctitle}[1]{\normalfont\Large\bfseries\color{ContentPrimary}#1}
|
|
117
|
+
\renewcommand{\cftchapterfont}{\normalfont\bfseries\color{ContentPrimary}}
|
|
118
|
+
\renewcommand{\cftchapterpagefont}{\normalfont\bfseries\color{ContentPrimary}}
|
|
119
|
+
\renewcommand{\cftsectionfont}{\normalfont\color{ContentPrimary}}
|
|
120
|
+
\renewcommand{\cftsectionpagefont}{\normalfont\color{ContentPrimary}}
|
|
121
|
+
\renewcommand{\cftchapterleader}{\color{ContentSecondary}\cftdotfill{\cftdotsep}}
|
|
122
|
+
\renewcommand{\cftsectionleader}{\color{ContentSecondary}\cftdotfill{\cftdotsep}}
|
|
123
|
+
\setlength{\cftbeforechapterskip}{0.8em}
|
|
124
|
+
\setlength{\cftbeforesectionskip}{0.3em}
|
|
125
|
+
\cftsetindents{section}{1.5em}{2.5em}
|
|
126
|
+
\cftsetindents{subsection}{4.0em}{3.5em}
|
|
127
|
+
\cftsetindents{subsubsection}{7.5em}{4.5em}
|
|
128
|
+
|
|
129
|
+
%% ---- Epigraph (on its own page; the extension fills \diEpigraph) -------------------------------------
|
|
130
|
+
\setlength{\epigraphwidth}{0.6\textwidth}
|
|
131
|
+
\setlength{\epigraphrule}{0pt}
|
|
132
|
+
\renewcommand{\textflush}{flushright}
|
|
133
|
+
\renewcommand{\epigraphsize}{\normalsize\itshape}
|
|
134
|
+
\newcommand\diEpigraphPage[2]{%
|
|
135
|
+
\clearpage\thispagestyle{empty}\vspace*{\fill}%
|
|
136
|
+
\epigraph{#1}{#2}%
|
|
137
|
+
\vspace*{\fill}\clearpage}
|
|
138
|
+
|
|
139
|
+
%% ---- Abstract, set as an unnumbered front-matter chapter --------------------------------------------
|
|
140
|
+
\newcommand\diAbstractChapter[1]{%
|
|
141
|
+
\chapter*{Abstract}\addcontentsline{toc}{chapter}{Abstract}%
|
|
142
|
+
\markboth{Abstract}{}%
|
|
143
|
+
#1\par}
|
|
144
|
+
|
|
145
|
+
%% ---- Chapter style: dataimago-ell ---------------------------------------------------------------------
|
|
146
|
+
\makechapterstyle{dataimago-ell}{%
|
|
147
|
+
\chapterstyle{default}
|
|
148
|
+
\renewcommand*{\chapnamefont}{\normalfont\large\HeadingFontBold\color{ContentSecondary}}
|
|
149
|
+
\renewcommand*{\chapnumfont}{\normalfont\HUGE\HeadingFontBold\color{ContentPrimary}}
|
|
150
|
+
\renewcommand*{\chaptitlefont}{\normalfont\huge\HeadingFontBold\color{ContentPrimary}}
|
|
151
|
+
% The width of "111" in the chapter-number face (Josefin Sans 400, \HUGE), measured once: 35.17358pt.
|
|
152
|
+
% A fixed length, so loading this style does not set text in Josefin and embed a face no heading uses.
|
|
153
|
+
\setlength{\chapindent}{35.17358pt}
|
|
154
|
+
\renewcommand*{\printchaptername}{}
|
|
155
|
+
\renewcommand*{\chapternamenum}{}
|
|
156
|
+
\renewcommand*{\printchapternum}{%
|
|
157
|
+
\begin{adjustwidth}{0pt}{-0.0\chapindent}
|
|
158
|
+
\raggedleft%
|
|
159
|
+
{\chapnumfont\color{ContentPrimary}\thechapter}%
|
|
160
|
+
\par\vspace{0.3\onelineskip}%
|
|
161
|
+
\end{adjustwidth}%
|
|
162
|
+
}
|
|
163
|
+
\renewcommand\printchapternonum{%
|
|
164
|
+
\vphantom{\chapnumfont 1}%
|
|
165
|
+
\afterchapternum%
|
|
166
|
+
}
|
|
167
|
+
\renewcommand*{\printchaptertitle}[1]{%
|
|
168
|
+
\begin{adjustwidth}{0pt}{-0.0\chapindent}
|
|
169
|
+
\setbox0=\vbox{%
|
|
170
|
+
\raggedleft%
|
|
171
|
+
{\chapnumfont\thechapter}%
|
|
172
|
+
\par\vspace{0.3\onelineskip}%
|
|
173
|
+
{\chaptitlefont\color{ContentPrimary}##1}%
|
|
174
|
+
\par\vspace{0.5\onelineskip}%
|
|
175
|
+
}%
|
|
176
|
+
\raggedleft%
|
|
177
|
+
{\chaptitlefont\color{ContentPrimary}##1}%
|
|
178
|
+
\par\vspace{0.5\onelineskip}%
|
|
179
|
+
\noindent\makebox[\linewidth][l]{\textcolor{BorderModerate}{%
|
|
180
|
+
\rule{\dimexpr\linewidth + 0.4\chapindent\relax}{0.4pt}%
|
|
181
|
+
\llap{\raisebox{0.4pt}[0pt][0pt]{\rule{0.4pt}{\ht0}}}%
|
|
182
|
+
}}%
|
|
183
|
+
\end{adjustwidth}
|
|
184
|
+
\par%
|
|
185
|
+
}
|
|
186
|
+
\renewcommand*{\afterchaptertitle}{%
|
|
187
|
+
\par\vspace{1.5\onelineskip}%
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
\chapterstyle{dataimago-ell}
|
|
191
|
+
|
|
192
|
+
%% ---- Sections ----------------------------------------------------------------------------------------
|
|
193
|
+
\setsecheadstyle{\Large\HeadingFontMedium\color{ContentPrimary}}
|
|
194
|
+
\setsubsecheadstyle{\large\HeadingFontRegular\color{ContentPrimary}}
|
|
195
|
+
\setsubsubsecheadstyle{\normalsize\HeadingFontSubsub\color{ContentPrimary}}
|
|
196
|
+
|
|
197
|
+
\renewcommand{\thesection}{\thechapter.\arabic{section}}
|
|
198
|
+
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
|
|
199
|
+
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
|
|
200
|
+
\renewcommand{\@seccntformat}[1]{%
|
|
201
|
+
\normalfont\HeadingFontMedium\textcolor{ContentSecondary}{\csname the#1\endcsname}\enspace}
|
|
202
|
+
|
|
203
|
+
%% ---- Title page (right-justified), built from the \di... macros -------------------------------------
|
|
204
|
+
% Each block prints, and spaces itself, only when its macro exists, so a work without a subtitle, version,
|
|
205
|
+
% date or licence has no empty line, rule or gap where it would have been.
|
|
206
|
+
\newif\ifdi@nometa
|
|
207
|
+
|
|
208
|
+
\newcommand\diLicenseLine{%
|
|
209
|
+
\ifcsname diLicenseUrl\endcsname
|
|
210
|
+
\href{\diLicenseUrl}{\diLicense}%
|
|
211
|
+
\else
|
|
212
|
+
\diLicense
|
|
213
|
+
\fi}
|
|
214
|
+
|
|
215
|
+
\newcommand\diMakeTitlePage{%
|
|
216
|
+
% Title page layout (measured): a 7in block with 0.75in margins each side, so it runs 0.25in past the body
|
|
217
|
+
% block on both edges (469pt body text width, 505pt here); the flush-right text ends 0.25in further right.
|
|
218
|
+
\settypeblocksize{9.0in}{7in}{*}
|
|
219
|
+
\setlrmargins{0.75in}{*}{1}
|
|
220
|
+
\setulmargins{1in}{*}{*}
|
|
221
|
+
\checkandfixthelayout
|
|
222
|
+
\begin{titlingpage}
|
|
223
|
+
\begin{flushright}
|
|
224
|
+
\vspace*{1.5cm}
|
|
225
|
+
\ifcsname diTitle\endcsname
|
|
226
|
+
{\HeadingFontBold\color{ContentPrimary}\Huge\diTitle\par}
|
|
227
|
+
\fi
|
|
228
|
+
\ifcsname diSubtitle\endcsname
|
|
229
|
+
\vspace{0.8em}
|
|
230
|
+
{\LARGE\HeadingFontSemiBold\color{ContentSecondary}\diSubtitle\par}
|
|
231
|
+
\fi
|
|
232
|
+
\ifcsname diAuthors\endcsname
|
|
233
|
+
\vspace{2em}
|
|
234
|
+
{\large\normalfont\diAuthors\par}
|
|
235
|
+
\fi
|
|
236
|
+
\ifcsname diAffiliations\endcsname
|
|
237
|
+
\vspace{1em}
|
|
238
|
+
{\small\color{ContentSecondary}\diAffiliations\par}
|
|
239
|
+
\fi
|
|
240
|
+
\di@nometatrue
|
|
241
|
+
\ifcsname diVersion\endcsname\di@nometafalse\fi
|
|
242
|
+
\ifcsname diDate\endcsname\di@nometafalse\fi
|
|
243
|
+
\ifcsname diLicense\endcsname\di@nometafalse\fi
|
|
244
|
+
\ifdi@nometa\else
|
|
245
|
+
\vspace{1.0in}
|
|
246
|
+
\ifcsname diVersion\endcsname
|
|
247
|
+
{\normalsize\color{ContentSecondary}\diVersion\par}
|
|
248
|
+
\vspace{0.2em}
|
|
249
|
+
\fi
|
|
250
|
+
\ifcsname diDate\endcsname
|
|
251
|
+
{\normalsize\color{ContentSecondary}\diDate\par}
|
|
252
|
+
\vspace{0.2em}
|
|
253
|
+
\fi
|
|
254
|
+
\ifcsname diLicense\endcsname
|
|
255
|
+
\vspace{0.5em}
|
|
256
|
+
{\small\color{ContentSecondary}\diLicenseLine\par}
|
|
257
|
+
\fi
|
|
258
|
+
\fi
|
|
259
|
+
\vfill
|
|
260
|
+
\end{flushright}
|
|
261
|
+
\end{titlingpage}
|
|
262
|
+
% Restore the body page layout.
|
|
263
|
+
\settypeblocksize{9.0in}{6.5in}{*}
|
|
264
|
+
\setlrmargins{1in}{*}{1}
|
|
265
|
+
\setulmargins{1in}{*}{*}
|
|
266
|
+
\checkandfixthelayout
|
|
267
|
+
\clearpage}
|
|
268
|
+
|
|
269
|
+
\makeatother
|
|
270
|
+
\endinput
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
% @dataimago/css@0.1.0-alpha.23 dist/quarto/_extensions/dataimago/monograph/dataimago-tokens.sty · sha256:e983c9b9467a7190049e5618f1c6fa3846f2964d65dd9860706d494c812a523f · generated from tokens; do not edit · restore: npx -p @dataimago/css@0.1.0-alpha.23 dataimago-sync
|
|
2
|
+
\NeedsTeXFormat{LaTeX2e}
|
|
3
|
+
\ProvidesPackage{dataimago-tokens}[dataimago design tokens, light mode]
|
|
4
|
+
\RequirePackage{xcolor}
|
|
5
|
+
|
|
6
|
+
% Colours: every color.* token, light mode, as opaque sRGB.
|
|
7
|
+
\definecolor{di-palette-ink-50}{HTML}{F5F5F4}
|
|
8
|
+
\definecolor{di-palette-ink-100}{HTML}{E7E5E4}
|
|
9
|
+
\definecolor{di-palette-ink-200}{HTML}{D6D3D1}
|
|
10
|
+
\definecolor{di-palette-ink-300}{HTML}{A8A29E}
|
|
11
|
+
\definecolor{di-palette-ink-400}{HTML}{78716C}
|
|
12
|
+
\definecolor{di-palette-ink-500}{HTML}{57534E}
|
|
13
|
+
\definecolor{di-palette-ink-600}{HTML}{44403C}
|
|
14
|
+
\definecolor{di-palette-ink-700}{HTML}{292524}
|
|
15
|
+
\definecolor{di-palette-ink-800}{HTML}{1C1917}
|
|
16
|
+
\definecolor{di-palette-ink-900}{HTML}{0C0A09}
|
|
17
|
+
\definecolor{di-palette-stone-50}{HTML}{F7F7F6}
|
|
18
|
+
\definecolor{di-palette-stone-100}{HTML}{EDEDEB}
|
|
19
|
+
\definecolor{di-palette-stone-200}{HTML}{DCDCDA}
|
|
20
|
+
\definecolor{di-palette-stone-300}{HTML}{C1C1BF}
|
|
21
|
+
\definecolor{di-palette-stone-400}{HTML}{A0A0A0}
|
|
22
|
+
\definecolor{di-palette-stone-500}{HTML}{7C7C7C}
|
|
23
|
+
\definecolor{di-palette-stone-600}{HTML}{5E5E5C}
|
|
24
|
+
\definecolor{di-palette-stone-700}{HTML}{424240}
|
|
25
|
+
\definecolor{di-palette-stone-800}{HTML}{292927}
|
|
26
|
+
\definecolor{di-palette-stone-900}{HTML}{14140F}
|
|
27
|
+
\definecolor{di-palette-forest-50}{HTML}{F0F1ED}
|
|
28
|
+
\definecolor{di-palette-forest-100}{HTML}{DDE0D4}
|
|
29
|
+
\definecolor{di-palette-forest-200}{HTML}{BDC4AD}
|
|
30
|
+
\definecolor{di-palette-forest-300}{HTML}{98A384}
|
|
31
|
+
\definecolor{di-palette-forest-400}{HTML}{7E8A6B}
|
|
32
|
+
\definecolor{di-palette-forest-500}{HTML}{5E6749}
|
|
33
|
+
\definecolor{di-palette-forest-600}{HTML}{4D5640}
|
|
34
|
+
\definecolor{di-palette-forest-700}{HTML}{434739}
|
|
35
|
+
\definecolor{di-palette-forest-800}{HTML}{363A2E}
|
|
36
|
+
\definecolor{di-palette-forest-900}{HTML}{1F2218}
|
|
37
|
+
\definecolor{di-palette-paper-50}{HTML}{FEFDFB}
|
|
38
|
+
\definecolor{di-palette-paper-100}{HTML}{FDF9F2}
|
|
39
|
+
\definecolor{di-palette-paper-200}{HTML}{FAF2E3}
|
|
40
|
+
\definecolor{di-palette-paper-300}{HTML}{F5E8CF}
|
|
41
|
+
\definecolor{di-palette-paper-400}{HTML}{EDD9B3}
|
|
42
|
+
\definecolor{di-palette-paper-500}{HTML}{E0C088}
|
|
43
|
+
\definecolor{di-palette-copper-50}{HTML}{FDF4EE}
|
|
44
|
+
\definecolor{di-palette-copper-100}{HTML}{FBE5D1}
|
|
45
|
+
\definecolor{di-palette-copper-200}{HTML}{F6C79C}
|
|
46
|
+
\definecolor{di-palette-copper-300}{HTML}{F0A467}
|
|
47
|
+
\definecolor{di-palette-copper-400}{HTML}{EA8441}
|
|
48
|
+
\definecolor{di-palette-copper-500}{HTML}{D46820}
|
|
49
|
+
\definecolor{di-palette-copper-600}{HTML}{B55017}
|
|
50
|
+
\definecolor{di-palette-copper-700}{HTML}{913D15}
|
|
51
|
+
\definecolor{di-palette-copper-800}{HTML}{753318}
|
|
52
|
+
\definecolor{di-palette-copper-900}{HTML}{612B16}
|
|
53
|
+
\definecolor{di-palette-accent-50}{HTML}{F0F8FC}
|
|
54
|
+
\definecolor{di-palette-accent-300}{HTML}{3498DB}
|
|
55
|
+
\definecolor{di-palette-accent-400}{HTML}{2980B9}
|
|
56
|
+
\definecolor{di-palette-accent-500}{HTML}{1F618D}
|
|
57
|
+
\definecolor{di-palette-accent-600}{HTML}{154D6F}
|
|
58
|
+
\definecolor{di-palette-accent-700}{HTML}{0F3A52}
|
|
59
|
+
\definecolor{di-palette-presentation-blue-50}{HTML}{F0F8FC}
|
|
60
|
+
\definecolor{di-palette-presentation-blue-500}{HTML}{3498DB}
|
|
61
|
+
\definecolor{di-palette-presentation-blue-600}{HTML}{2980B9}
|
|
62
|
+
\definecolor{di-palette-presentation-blue-700}{HTML}{1F618D}
|
|
63
|
+
\definecolor{di-functional-success}{HTML}{27AE60}
|
|
64
|
+
\definecolor{di-functional-warning}{HTML}{F39C12}
|
|
65
|
+
\definecolor{di-functional-error}{HTML}{E74C3C}
|
|
66
|
+
\definecolor{di-functional-info}{HTML}{3498DB}
|
|
67
|
+
\definecolor{di-surface-page}{HTML}{EDEDEB}
|
|
68
|
+
\definecolor{di-surface-page-scrolled}{HTML}{EDEDEB}
|
|
69
|
+
\definecolor{di-surface-elevated}{HTML}{F7F7F6}
|
|
70
|
+
\definecolor{di-surface-sunken}{HTML}{FAF2E3}
|
|
71
|
+
\definecolor{di-surface-navbar}{HTML}{EDEDEB}
|
|
72
|
+
\definecolor{di-surface-navbar-scrolled}{HTML}{EDEDEB}
|
|
73
|
+
\definecolor{di-surface-code}{HTML}{FAF2E3}
|
|
74
|
+
\definecolor{di-border-subtle}{HTML}{888785}
|
|
75
|
+
\definecolor{di-border-moderate}{HTML}{666563}
|
|
76
|
+
\definecolor{di-border-strong}{HTML}{444342}
|
|
77
|
+
\definecolor{di-border-card}{HTML}{666563}
|
|
78
|
+
\definecolor{di-border-code}{HTML}{D6D3D1}
|
|
79
|
+
\definecolor{di-content-primary}{HTML}{14140F}
|
|
80
|
+
\definecolor{di-content-secondary}{HTML}{6A6A6A}
|
|
81
|
+
\definecolor{di-content-muted}{HTML}{706964}
|
|
82
|
+
\definecolor{di-content-inverse}{HTML}{FDF9F2}
|
|
83
|
+
\definecolor{di-interactive-primary}{HTML}{434739}
|
|
84
|
+
\definecolor{di-interactive-hover}{HTML}{363A2E}
|
|
85
|
+
\definecolor{di-interactive-accent}{HTML}{1F618D}
|
|
86
|
+
\definecolor{di-interactive-focus}{HTML}{434739}
|
|
87
|
+
\definecolor{di-presentation-accent}{HTML}{3498DB}
|
|
88
|
+
\definecolor{di-presentation-accent-hover}{HTML}{2980B9}
|
|
89
|
+
\definecolor{di-vertical-accent-dissertation}{HTML}{B87333}
|
|
90
|
+
\definecolor{di-vertical-accent-rpkg}{HTML}{3B82F6}
|
|
91
|
+
\definecolor{di-vertical-accent-SGPc}{HTML}{5A6310}
|
|
92
|
+
\definecolor{di-brand-mark-red}{HTML}{CC0000}
|
|
93
|
+
\definecolor{di-dataviz-okabe-ito-orange}{HTML}{E69F00}
|
|
94
|
+
\definecolor{di-dataviz-okabe-ito-sky-blue}{HTML}{56B4E9}
|
|
95
|
+
\definecolor{di-dataviz-okabe-ito-bluish-green}{HTML}{009E73}
|
|
96
|
+
\definecolor{di-dataviz-okabe-ito-yellow}{HTML}{F0E442}
|
|
97
|
+
\definecolor{di-dataviz-okabe-ito-blue}{HTML}{0072B2}
|
|
98
|
+
\definecolor{di-dataviz-okabe-ito-vermillion}{HTML}{D55E00}
|
|
99
|
+
\definecolor{di-dataviz-okabe-ito-reddish-purple}{HTML}{CC79A7}
|
|
100
|
+
\definecolor{di-dataviz-okabe-ito-black}{HTML}{000000}
|
|
101
|
+
\definecolor{di-dataviz-categorical-1}{HTML}{E69F00}
|
|
102
|
+
\definecolor{di-dataviz-categorical-2}{HTML}{56B4E9}
|
|
103
|
+
\definecolor{di-dataviz-categorical-3}{HTML}{009E73}
|
|
104
|
+
\definecolor{di-dataviz-categorical-4}{HTML}{F0E442}
|
|
105
|
+
\definecolor{di-dataviz-categorical-5}{HTML}{0072B2}
|
|
106
|
+
\definecolor{di-dataviz-categorical-6}{HTML}{D55E00}
|
|
107
|
+
\definecolor{di-dataviz-categorical-7}{HTML}{CC79A7}
|
|
108
|
+
\definecolor{di-dataviz-categorical-8}{HTML}{000000}
|
|
109
|
+
\definecolor{di-dataviz-uncertainty-outer}{HTML}{D6D6D6}
|
|
110
|
+
\definecolor{di-dataviz-uncertainty-union}{HTML}{9E9E9E}
|
|
111
|
+
\definecolor{di-dataviz-uncertainty-inner}{HTML}{333333}
|
|
112
|
+
|
|
113
|
+
% Font families: the first family of each token stack.
|
|
114
|
+
\newcommand{\diFontFamilySans}{Noto Sans}
|
|
115
|
+
\newcommand{\diFontFamilyMono}{Noto Sans Mono}
|
|
116
|
+
\newcommand{\diFontFamilyDisplay}{Josefin Sans}
|
|
117
|
+
\newcommand{\diFontFamilyDisplayEditorial}{Josefin Sans}
|
|
118
|
+
\newcommand{\diFontFamilyDisplayDocumentation}{Noto Sans}
|
|
119
|
+
\newcommand{\diFontFamilyBrand}{Futura}
|
|
120
|
+
\newcommand{\diFontFamilyMath}{Noto Sans Math}
|
|
121
|
+
|
|
122
|
+
% Font weights: font.weight.* token numbers.
|
|
123
|
+
\newcommand{\diFontWeightExtralight}{200}
|
|
124
|
+
\newcommand{\diFontWeightLight}{300}
|
|
125
|
+
\newcommand{\diFontWeightRegular}{400}
|
|
126
|
+
\newcommand{\diFontWeightMedium}{500}
|
|
127
|
+
\newcommand{\diFontWeightSemibold}{600}
|
|
128
|
+
\newcommand{\diFontWeightBold}{700}
|
|
129
|
+
|
|
130
|
+
% Figure plate and frame (dark mode keeps the light plate).
|
|
131
|
+
\definecolor{di-figure-plate}{HTML}{F7F7F6}
|
|
132
|
+
\colorlet{di-figure-frame}{di-content-secondary}
|
|
133
|
+
|
|
134
|
+
\endinput
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
-- @dataimago/css@0.1.0-alpha.23 dist/quarto/_extensions/dataimago/monograph/filters/figure-plate.lua · sha256:e15f49117813b965ae44c22b6d68d60af6012bfc8cf2a6c1a6a43840c3194a75 · generated from tokens; do not edit · restore: npx -p @dataimago/css@0.1.0-alpha.23 dataimago-sync
|
|
2
|
+
-- figure-plate.lua
|
|
3
|
+
-- A figure marked .box sits on the plate with a frame, drawn by base's \diFigurePlate (tokens:
|
|
4
|
+
-- color.surface.elevated plate, color.content.secondary frame). Width defaults to \linewidth and
|
|
5
|
+
-- height is capped at 0.85\textheight so a tall figure scales down instead of overflowing the page.
|
|
6
|
+
-- .svg sources are read as .pdf (the figure build writes the PDF next to the SVG). PDF only.
|
|
7
|
+
|
|
8
|
+
function Image(img)
|
|
9
|
+
if not FORMAT:match("latex") then
|
|
10
|
+
return nil
|
|
11
|
+
end
|
|
12
|
+
if not img.classes:includes("box") then
|
|
13
|
+
return nil
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
local width = img.attributes["width"]
|
|
17
|
+
local height = img.attributes["height"]
|
|
18
|
+
local opts = {}
|
|
19
|
+
|
|
20
|
+
if not width and not height then
|
|
21
|
+
width = "100%"
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
-- A percentage is a fraction of \linewidth (width) or \textheight (height); a bare % would comment
|
|
25
|
+
-- out the rest of the line.
|
|
26
|
+
local function dimension(value, base)
|
|
27
|
+
local percent = value:match("^([%d%.]+)%%$")
|
|
28
|
+
if percent then
|
|
29
|
+
return (tonumber(percent) / 100) .. base
|
|
30
|
+
end
|
|
31
|
+
return value
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
-- The frame takes 2*\fboxsep + 2*\fboxrule off the width it is given.
|
|
35
|
+
local pad = "-2\\fboxsep-2\\fboxrule"
|
|
36
|
+
if width then
|
|
37
|
+
table.insert(opts, "width=\\dimexpr " .. dimension(width, "\\linewidth") .. pad .. "\\relax")
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
if height then
|
|
41
|
+
table.insert(opts, "height=\\dimexpr " .. dimension(height, "\\textheight") .. pad .. "\\relax")
|
|
42
|
+
else
|
|
43
|
+
table.insert(opts, "height=\\dimexpr 0.85\\textheight" .. pad .. "\\relax")
|
|
44
|
+
end
|
|
45
|
+
table.insert(opts, "keepaspectratio")
|
|
46
|
+
|
|
47
|
+
local src = img.src:gsub("%.svg$", ".pdf")
|
|
48
|
+
return pandoc.RawInline(
|
|
49
|
+
"latex",
|
|
50
|
+
"\\diFigurePlate{\\includegraphics[" .. table.concat(opts, ",") .. "]{" .. src .. "}}"
|
|
51
|
+
)
|
|
52
|
+
end
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
-- @dataimago/css@0.1.0-alpha.23 dist/quarto/_extensions/dataimago/monograph/filters/matter.lua · sha256:00812a4ff280c6f02f84c5d850f711be2dc8bd6ecba31d98f21ed9a4a61242ce · generated from tokens; do not edit · restore: npx -p @dataimago/css@0.1.0-alpha.23 dataimago-sync
|
|
2
|
+
-- matter.lua
|
|
3
|
+
-- Book matter from section classes. A level-1 section marked {.frontmatter}, {.appendix} or {.backmatter}
|
|
4
|
+
-- is gathered into its place whatever its position in the source: front matter before \mainmatter, the
|
|
5
|
+
-- main chapters, then appendices, then back matter, each group in document order. memoir's
|
|
6
|
+
-- \mainmatter / \appendix / \backmatter do the numbering (roman, arabic, lettered, none). \frontmatter
|
|
7
|
+
-- is emitted by the before-body partial, ahead of the title page, so the title page and contents count
|
|
8
|
+
-- in roman numerals too.
|
|
9
|
+
--
|
|
10
|
+
-- A matter class on a section nested inside a section of another matter class cannot be placed (an
|
|
11
|
+
-- {.appendix} inside {.frontmatter} would be numbered by whichever matter it landed in), so it stops
|
|
12
|
+
-- the render and names both sections. A matter class on a level-2 or deeper heading inside a main
|
|
13
|
+
-- chapter cannot be placed either (it would print as a body section), so it stops the render too.
|
|
14
|
+
-- PDF only; HTML is untouched.
|
|
15
|
+
--
|
|
16
|
+
-- Note: Quarto prints a "Should not have arrived here" stack trace after the filter's os.exit(1). The
|
|
17
|
+
-- message above it is the one to read; the trace is Quarto's own handling of the exit.
|
|
18
|
+
|
|
19
|
+
local MATTER = { frontmatter = true, appendix = true, backmatter = true }
|
|
20
|
+
|
|
21
|
+
local function matter_of(classes)
|
|
22
|
+
for _, c in ipairs(classes) do
|
|
23
|
+
if MATTER[c] then return c end
|
|
24
|
+
end
|
|
25
|
+
return nil
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
local function label(h)
|
|
29
|
+
return "\"" .. pandoc.utils.stringify(h.content) .. "\""
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
-- Search a unit's blocks for a nested section carrying a different matter class.
|
|
33
|
+
-- Quarto logs an error() from a filter and carries on, so a placement that cannot be right stops the
|
|
34
|
+
-- render by exiting non-zero after the message.
|
|
35
|
+
local function fail(msg)
|
|
36
|
+
io.stderr:write("ERROR: " .. msg .. "\n")
|
|
37
|
+
os.exit(1)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
local function check_nested(owner_kind, owner_name, blocks)
|
|
41
|
+
for _, b in ipairs(blocks) do
|
|
42
|
+
if b.t == "Header" and b.level > 1 then
|
|
43
|
+
local k = matter_of(b.classes)
|
|
44
|
+
if k and owner_kind == "main" then
|
|
45
|
+
fail("matter.lua: matter classes (.frontmatter/.appendix/.backmatter) go on level-1 headings; '" ..
|
|
46
|
+
pandoc.utils.stringify(b.content) .. "' is level " .. b.level .. " inside " .. owner_name ..
|
|
47
|
+
". Give it a level-1 heading of its own.")
|
|
48
|
+
elseif k and k ~= owner_kind then
|
|
49
|
+
fail("matter.lua: section " .. label(b) .. " is {." .. k .. "} but sits inside the {." ..
|
|
50
|
+
owner_kind .. "} section " .. owner_name .. ". Move it to its own top-level heading.")
|
|
51
|
+
end
|
|
52
|
+
elseif b.t == "Div" then
|
|
53
|
+
local k = matter_of(b.classes)
|
|
54
|
+
if k and owner_kind == "main" then
|
|
55
|
+
fail("matter.lua: matter classes (.frontmatter/.appendix/.backmatter) go on level-1 headings; a div marked {." ..
|
|
56
|
+
k .. "} sits inside " .. owner_name .. ".")
|
|
57
|
+
elseif k and k ~= owner_kind then
|
|
58
|
+
fail("matter.lua: a div marked {." .. k .. "} sits inside the {." .. owner_kind ..
|
|
59
|
+
"} section " .. owner_name .. ". Move it to its own top-level heading.")
|
|
60
|
+
end
|
|
61
|
+
check_nested(owner_kind, owner_name, b.content)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
local function raw(tex)
|
|
67
|
+
return pandoc.RawBlock("latex", tex)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
function Pandoc(doc)
|
|
71
|
+
if not FORMAT:match("latex") then
|
|
72
|
+
return nil
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
-- `dataimago-logo` is reserved (default off): no logo asset ships yet (follow-on pdf-title-logo).
|
|
76
|
+
-- Quarto's own `logo` key must be a string, so it cannot carry a boolean and is never read here.
|
|
77
|
+
local logo = doc.meta["dataimago-logo"]
|
|
78
|
+
if logo ~= nil and pandoc.utils.stringify(logo) == "true" then
|
|
79
|
+
io.stderr:write("WARNING: dataimago/monograph: `dataimago-logo: true` is reserved; no logo asset ships yet, so the title page prints none.\n")
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
-- `license-badge` is reserved the same way: no badge asset ships, so the licence line prints as text.
|
|
83
|
+
local badge = doc.meta["license-badge"]
|
|
84
|
+
if badge ~= nil and pandoc.utils.stringify(badge) == "true" then
|
|
85
|
+
io.stderr:write("WARNING: dataimago/monograph: `license-badge: true` is reserved; no licence badge ships yet, so the licence line prints as text.\n")
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
-- The epigraph may be a bare string: that is the text, with no attribution.
|
|
89
|
+
local ep = doc.meta.epigraph
|
|
90
|
+
local ept = ep ~= nil and pandoc.utils.type(ep)
|
|
91
|
+
if ept == "Inlines" or ept == "Blocks" or ept == "string" then
|
|
92
|
+
doc.meta.epigraph = pandoc.MetaMap({ text = ep })
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
-- The licence reaches the filter in whatever shape Quarto normalised it to: a bare string becomes a
|
|
96
|
+
-- list of {type, text, url} (and for a recognised Creative Commons licence the text is dropped and
|
|
97
|
+
-- only the url remains), a map stays a map. Settle it into `dataimago-license` = {text, url}.
|
|
98
|
+
local lic = doc.meta.license
|
|
99
|
+
if lic ~= nil then
|
|
100
|
+
local item = lic
|
|
101
|
+
if pandoc.utils.type(lic) == "List" then item = lic[1] end
|
|
102
|
+
local text, url = "", ""
|
|
103
|
+
local t = pandoc.utils.type(item)
|
|
104
|
+
if t == "Inlines" or t == "Blocks" or t == "string" then
|
|
105
|
+
text = pandoc.utils.stringify(item)
|
|
106
|
+
elseif type(item) == "table" then
|
|
107
|
+
if item.text then text = pandoc.utils.stringify(item.text) end
|
|
108
|
+
if item.url then url = pandoc.utils.stringify(item.url) end
|
|
109
|
+
end
|
|
110
|
+
if text == "" and url ~= "" then
|
|
111
|
+
local kind, version = url:match("creativecommons%.org/licenses/([%w%-]+)/([%d%.]+)")
|
|
112
|
+
text = kind and ("CC " .. kind:upper() .. " " .. version) or url
|
|
113
|
+
end
|
|
114
|
+
if text ~= "" then
|
|
115
|
+
doc.meta["dataimago-license"] = pandoc.MetaMap({ text = text, url = url ~= "" and url or nil })
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
-- Cut the body into units at level-1 headings. A unit is a heading and what follows it.
|
|
120
|
+
local units = {}
|
|
121
|
+
local current = { kind = "main", blocks = {} }
|
|
122
|
+
units[1] = current
|
|
123
|
+
local function open(kind, header)
|
|
124
|
+
current = { kind = kind, blocks = {}, header = header }
|
|
125
|
+
units[#units + 1] = current
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
for _, b in ipairs(doc.blocks) do
|
|
129
|
+
if b.t == "Header" and b.level == 1 then
|
|
130
|
+
open(matter_of(b.classes) or "main", b)
|
|
131
|
+
elseif b.t == "Div" and b.content[1] and b.content[1].t == "Header" and b.content[1].level == 1 then
|
|
132
|
+
-- section divs: the heading is the first child
|
|
133
|
+
open(matter_of(b.content[1].classes) or matter_of(b.classes) or "main", b.content[1])
|
|
134
|
+
end
|
|
135
|
+
current.blocks[#current.blocks + 1] = b
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
for _, u in ipairs(units) do
|
|
139
|
+
if u.header then
|
|
140
|
+
check_nested(u.kind, u.kind == "main" and ("chapter '" .. pandoc.utils.stringify(u.header.content) .. "'") or label(u.header), u.blocks)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
-- Blocks before the first level-1 heading belong to no chapter; a matter class there would print as a body section.
|
|
144
|
+
check_nested("main", "the text before the first level-1 heading", units[1].blocks)
|
|
145
|
+
|
|
146
|
+
local groups = { frontmatter = {}, main = {}, appendix = {}, backmatter = {} }
|
|
147
|
+
for _, u in ipairs(units) do
|
|
148
|
+
for _, b in ipairs(u.blocks) do
|
|
149
|
+
table.insert(groups[u.kind], b)
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
local out = {}
|
|
154
|
+
local function add(list)
|
|
155
|
+
for _, b in ipairs(list) do out[#out + 1] = b end
|
|
156
|
+
end
|
|
157
|
+
add(groups.frontmatter)
|
|
158
|
+
out[#out + 1] = raw("\\diMainmatter")
|
|
159
|
+
add(groups.main)
|
|
160
|
+
if #groups.appendix > 0 then
|
|
161
|
+
out[#out + 1] = raw("\\appendix")
|
|
162
|
+
add(groups.appendix)
|
|
163
|
+
end
|
|
164
|
+
if #groups.backmatter > 0 then
|
|
165
|
+
out[#out + 1] = raw("\\backmatter")
|
|
166
|
+
add(groups.backmatter)
|
|
167
|
+
end
|
|
168
|
+
doc.blocks = out
|
|
169
|
+
return doc
|
|
170
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
-- @dataimago/css@0.1.0-alpha.23 dist/quarto/_extensions/dataimago/monograph/filters/pkg-name.lua · sha256:fa5ff3d0bc7d8f04ed35b4f02925460e98e4cc077c50fc3ff5c39b13ddaae30e · generated from tokens; do not edit · restore: npx -p @dataimago/css@0.1.0-alpha.23 dataimago-sync
|
|
2
|
+
-- pkg-name.lua
|
|
3
|
+
-- Software names in the package face: [SGPc]{.pkg} and [R]{.pkg} render in \diPkg (Latin Modern Sans,
|
|
4
|
+
-- the one sanctioned exception to the house faces) in LaTeX/PDF. HTML keeps the span and its class.
|
|
5
|
+
|
|
6
|
+
function Span(el)
|
|
7
|
+
if not el.classes:includes("pkg") then
|
|
8
|
+
return nil
|
|
9
|
+
end
|
|
10
|
+
if FORMAT:match("latex") then
|
|
11
|
+
local out = { pandoc.RawInline("latex", "{\\diPkg ") }
|
|
12
|
+
for _, x in ipairs(el.content) do table.insert(out, x) end
|
|
13
|
+
table.insert(out, pandoc.RawInline("latex", "}"))
|
|
14
|
+
return out
|
|
15
|
+
end
|
|
16
|
+
return nil
|
|
17
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
% This is version 1.0, dated 22 June 2009, of the GUST Font License.
|
|
2
|
+
% (GUST is the Polish TeX Users Group, https://www.gust.org.pl)
|
|
3
|
+
%
|
|
4
|
+
% For the most recent version of this license see
|
|
5
|
+
% https://www.gust.org.pl/fonts/licenses/GUST-FONT-LICENSE.txt
|
|
6
|
+
% or
|
|
7
|
+
% https://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt
|
|
8
|
+
%
|
|
9
|
+
% This work may be distributed and/or modified under the conditions
|
|
10
|
+
% of the LaTeX Project Public License, either version 1.3c of this
|
|
11
|
+
% license or (at your option) any later version.
|
|
12
|
+
%
|
|
13
|
+
% Please also observe the following clause:
|
|
14
|
+
% 1) it is requested, but not legally required, that derived works be
|
|
15
|
+
% distributed only after changing the names of the fonts comprising this
|
|
16
|
+
% work and given in an accompanying "manifest", and that the
|
|
17
|
+
% files comprising the Work, as listed in the manifest, also be given
|
|
18
|
+
% new names. Any exceptions to this request are also given in the
|
|
19
|
+
% manifest.
|
|
20
|
+
%
|
|
21
|
+
% We recommend the manifest be given in a separate file named
|
|
22
|
+
% MANIFEST-<fontid>.txt, where <fontid> is some unique identification
|
|
23
|
+
% of the font family. If a separate "readme" file accompanies the Work,
|
|
24
|
+
% we recommend a name of the form README-<fontid>.txt.
|
|
25
|
+
%
|
|
26
|
+
% The latest version of the LaTeX Project Public License is in
|
|
27
|
+
% https://www.latex-project.org/lppl.txt and version 1.3c or later
|
|
28
|
+
% is part of all distributions of LaTeX version 2006/05/20 or later.
|
|
29
|
+
|