|
| 1 | +--- Configuration module for LuaLaTeX document |
| 2 | +-- |
| 3 | +-- This module provides a centralized configuration system for LaTeX document settings, |
| 4 | +-- asset management, references, and typesetting options. The configuration can be |
| 5 | +-- overridden by a user-specific configuration file in the repository root. |
| 6 | +-- |
| 7 | +-- @module configuration |
| 8 | +-- @return Configuration table |
| 9 | + |
| 10 | +local configuration = {} |
| 11 | + |
| 12 | +-- Build system configuration |
| 13 | +-- Controls output directories and build artifacts |
| 14 | +configuration.build = { |
| 15 | + -- Directory for intermediate build files (aux, log, etc.) |
| 16 | + dir = 'build/', |
| 17 | + -- Directory for final output files (PDFs) |
| 18 | + out = 'pdf/' |
| 19 | +} |
| 20 | + |
| 21 | +-- Asset management configuration |
| 22 | +-- Controls how external assets (images, tables, etc.) are handled |
| 23 | +configuration.assets = { |
| 24 | + -- Root directory for all assets |
| 25 | + root = 'assets/', |
| 26 | + -- Enable custom LaTeX macros for quick insertion of figures/tables/etc. |
| 27 | + shortcuts = true, |
| 28 | + -- Enable externalization of assets (caching processed versions) |
| 29 | + -- For externalization 'memoize' package is used. Note that this |
| 30 | + -- requires quite modern LaTeX version, as well as some external |
| 31 | + --- dependicies, like Perl and PDF::API2 library |
| 32 | + externalize = true, |
| 33 | + -- Asset type configurations: |
| 34 | + -- 'keep' - memoize puts files in the same directory as source |
| 35 | + -- 'build' - memoize puts files into build directory |
| 36 | + -- 'none' - disable memoization for this asset type |
| 37 | + dirs = { |
| 38 | + images = { path = 'images/', extern = 'keep' }, -- Raster/vector images |
| 39 | + tables = { path = 'tables/', extern = 'build' }, -- Data tables, CSV files |
| 40 | + diagrams = { path = 'diagrams/', extern = 'keep' }, -- Diagram source files |
| 41 | + listings = { path = 'listings/', extern = 'keep' } -- Code listings |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +-- References and bibliography configuration |
| 46 | +-- Manages citations, indexes, and knowledge graphs |
| 47 | +configuration.references = { |
| 48 | + enable = true, |
| 49 | + --- Tooling for references |
| 50 | + hyperref = { |
| 51 | + shortref = { |
| 52 | + {csname = 'picref', reftext = 'рис.'}, |
| 53 | + {csname = 'tabref', reftext = 'табл.'}, |
| 54 | + {csname = 'lstref', reftext = 'листинг'}, |
| 55 | + {csname = 'digref', reftext = 'диаг.'}, |
| 56 | + {csname = 'secref', reftext = 'разд.'} |
| 57 | + }, |
| 58 | + hypersetup = { |
| 59 | + breaklinks=true, |
| 60 | + hyperindex=true, |
| 61 | + colorlinks=true, |
| 62 | + hidelinks=false, |
| 63 | + hypertexnames='false', --- fix, cause right now false boolean filds are ignored |
| 64 | + unicode=true, |
| 65 | + pdfauthor={'Unknown Author'}, |
| 66 | + pdfsubject={'Document Subject'}, |
| 67 | + pdfkeywords={'keyword1, keyword2'}, |
| 68 | + pdftitle={'Document Title'}, |
| 69 | + bookmarksopen=false, |
| 70 | + linktocpage=true, |
| 71 | + plainpages=false, |
| 72 | + pdfpagelabels=true, |
| 73 | + -- Link colors |
| 74 | + urlcolor='blue', |
| 75 | + linkcolor='red', |
| 76 | + filecolor='red', |
| 77 | + citecolor='blue' |
| 78 | + } |
| 79 | + }, |
| 80 | + -- Bibliography sources configuration |
| 81 | + bibtex = { |
| 82 | + -- Base path for bibliography files |
| 83 | + path = 'assets/bibliography', |
| 84 | + style = 'numeric', |
| 85 | + -- List of bibliography databases with display names |
| 86 | + bibliographies = { |
| 87 | + { |
| 88 | + name = 'main', -- Main literature bibliography |
| 89 | + title = 'Список литературы', -- Main literature bibliography |
| 90 | + files = 'main.bib', |
| 91 | + }, |
| 92 | + -- { |
| 93 | + -- name = 'git', -- Software/online sources |
| 94 | + -- title = 'Репозитории, трекеры, обсуждения', -- Software/online sources |
| 95 | + -- files = { 'repos.bib', 'issues.bib' }, |
| 96 | + -- } |
| 97 | + } |
| 98 | + }, |
| 99 | + -- Index generation configuration (imakeidx package) |
| 100 | + indexes = { |
| 101 | + -- Enable index generation |
| 102 | + enable = true, |
| 103 | + -- imakeidx options |
| 104 | + build = {'makeindex'}, |
| 105 | + -- Configure individual indexes |
| 106 | + list = { |
| 107 | + -- Symbol index |
| 108 | + { |
| 109 | + name = 'notation', |
| 110 | + title = 'Список обозначений', |
| 111 | + intoc = true, |
| 112 | + --columns = 2, |
| 113 | + --columnsep = '15pt', |
| 114 | + --columnseprule = true, |
| 115 | + }, |
| 116 | + -- Main subject index |
| 117 | + { |
| 118 | + name = nil, |
| 119 | + title = 'Предметный указатель', |
| 120 | + intoc = true, |
| 121 | + } |
| 122 | + } |
| 123 | + }, |
| 124 | + -- Knowledge configuration (knowledge package) |
| 125 | + -- knowledge = { |
| 126 | + -- Enable knowledge graph functionality |
| 127 | + -- enable = true, |
| 128 | + -- Configuration file for knowledge package |
| 129 | + -- config = '.knowledgerc.tex' |
| 130 | + -- } |
| 131 | +} |
| 132 | + |
| 133 | +-- Float environment configuration |
| 134 | +-- Controls figures, tables, listings, and other floating elements |
| 135 | +configuration.floats = { |
| 136 | + -- Enable plugin for handling macroses |
| 137 | + enable = true, |
| 138 | + -- Graphics scaling and sizing options |
| 139 | + images = { |
| 140 | + -- Enable quiver package for commutative diagrams |
| 141 | + quiver = 'enabled', -- alternative is 'draft' or 'disabled' |
| 142 | + -- TODO: Enable drawio package for draw.io diagram integration |
| 143 | + -- drawio = 'enabled', -- alternative is 'draft' or 'disabled' |
| 144 | + |
| 145 | + -- Default caption position |
| 146 | + caption = 'below', |
| 147 | + -- Default width ratio to \linewidth for regular figures (0.0-1.0) |
| 148 | + figurewidth = 0.9, |
| 149 | + -- Default width ratio for wrapfigure environments (0.0-1.0) |
| 150 | + wrapfigurewidth = 0.4, |
| 151 | + --- Whether or not create separate list of figures |
| 152 | + makeidx = true, |
| 153 | + }, |
| 154 | + tables = { |
| 155 | + enables = true, |
| 156 | + caption = 'above', |
| 157 | + makeidx = true, |
| 158 | + }, |
| 159 | + -- Code listing configuration |
| 160 | + listing = { |
| 161 | + -- Enable listing environment support |
| 162 | + enable = true, |
| 163 | + caption = 'above', |
| 164 | + -- Enable syntax highlighting via pygmentize |
| 165 | + pygmentize = true, |
| 166 | + makeidx = true, |
| 167 | + }, |
| 168 | + -- Caption and labeling configuration |
| 169 | + captions = { |
| 170 | + -- Language for automatic captions (e.g., "Figure", "Table") |
| 171 | + lang = 'ru', |
| 172 | + } |
| 173 | +} |
| 174 | + |
| 175 | +-- Typesetting and text macros configuration |
| 176 | +-- Controls custom text formatting, shortcuts, and theorem environments |
| 177 | +configuration.typesetting = { |
| 178 | + -- Enable custom typesetting macros |
| 179 | + enable = true, |
| 180 | + |
| 181 | + -- Text shortcut configuration |
| 182 | + shortcuts = true, |
| 183 | + |
| 184 | + -- Formatting features |
| 185 | + formatting = { |
| 186 | + todo = true, |
| 187 | + ulem = true, |
| 188 | + }, |
| 189 | + -- Theorem and proof environment configuration |
| 190 | + theorems = { |
| 191 | + -- Enable theorem-like environments (theorem, lemma, proof, etc.) |
| 192 | + enable = true, |
| 193 | + --- Theorem naming style |
| 194 | + --- plain: |
| 195 | + --- theorem - numbered theorem |
| 196 | + --- theorem* - unnumbered theorem |
| 197 | + --- framed: |
| 198 | + --- Theorem - numbered theorem, framed |
| 199 | + --- Theorem* - unnumbered theorem, framed |
| 200 | + --- theorem - numbered theorem, not framed |
| 201 | + --- theorem* - unnumbered theorem, not framed |
| 202 | + thmstyle = 'framed', |
| 203 | + enviroments = { |
| 204 | + {envname = 'theorem', name = 'Теорема'}, |
| 205 | + {envname = 'lemma', name = 'Лемма'}, |
| 206 | + {envname = 'proposition', name = 'Предложение'}, |
| 207 | + {envname = 'definition', name = 'Определение'}, |
| 208 | + {envname = 'remark', name = 'Замечание'}, |
| 209 | + |
| 210 | + } |
| 211 | + } |
| 212 | +} |
| 213 | + |
| 214 | +-- Mathematical typesetting configuration |
| 215 | +-- Controls math macros, symbols, and specialized notation |
| 216 | +configuration.mathematics = { |
| 217 | + -- Enable mathematical typesetting macros |
| 218 | + enable = true, |
| 219 | + mathcommand = 'error', |
| 220 | + -- Mathematical domain-specific plugin configuration |
| 221 | + plugins = { |
| 222 | + -- Algebra plugin: groups, rings, fields, linear algebra |
| 223 | + algebra = { |
| 224 | + enable = true, -- Enable algebra macros |
| 225 | + --knowledgify = true, -- Generate knowledge graph entries |
| 226 | + --indexify = false, -- Add to index automatically |
| 227 | + }, |
| 228 | + -- Calculus plugin: limits, derivatives, integrals |
| 229 | + calculus = { |
| 230 | + enable = true, |
| 231 | + --knowledgify = true, |
| 232 | + --indexify = false |
| 233 | + }, |
| 234 | + -- Combinatorics plugin: combinations, permutations, graphs |
| 235 | + combinatorics = { |
| 236 | + enable = true, |
| 237 | + --knowledgify = true, |
| 238 | + --indexify = false |
| 239 | + }, |
| 240 | + -- Probability plugin: distributions, expectations, random variables |
| 241 | + probability = { |
| 242 | + enable = true, |
| 243 | + --knowledgify = true, |
| 244 | + --indexify = false, |
| 245 | + }, |
| 246 | + -- Foundations plugin: set theory, logic, category theory |
| 247 | + foundations = { |
| 248 | + enable = true, |
| 249 | + --knowledgify = true, |
| 250 | + --indexify = false |
| 251 | + }, |
| 252 | + -- Complexity plugin: Big-O notation, complexity classes |
| 253 | + complexity = { |
| 254 | + enable = false -- Disabled by default |
| 255 | + } |
| 256 | + } |
| 257 | +} |
| 258 | + |
| 259 | +return configuration |
0 commit comments