% Copyright 2026 Open-Guji (https://github.com/open-guji) % % Licensed under the Apache License, Version 2.0 (the "License"); % you may not use this file except in compliance with the License. % You may obtain a copy of the License at % % http://www.apache.org/licenses/LICENSE-2.0 % % Unless required by applicable law or agreed to in writing, software % distributed under the License is distributed on an "AS IS" BASIS, % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % See the License for the specific language governing permissions and % limitations under the License. % luatex-cn-guji-default.cfg % Default configuration for guji (古籍 Ancient Chinese Book) % Black and white version of Siku Quanshu layout % ============================================================================= % Grid Calculation (same as SiKuQuanShu, derived from page geometry) % ============================================================================= % % Page dimensions: % paper-width = 1136pt (40cm), paper-height = 894.6pt (31.5cm) % margin: top=190.5pt (6.72cm), bottom=91.6pt (3.23cm), % left=133.2pt (4.7cm), right=133.2pt (4.7cm) % % Raw content area: % content-width = 1136 - 133.2 - 133.2 = 869.6pt % content-height = 894.6 - 190.5 - 91.6 = 612.5pt % % Border parameters: % outer-border-thickness = 2pt % outer-border-sep = 2pt % border-thickness = 0.4pt % border-padding-top = 2.8pt % border-padding-bottom = 2.8pt % % Width calculation: % Both sides outer border: 2 × (2pt + 2pt) = 8pt % Inner border thickness: 0.4pt % Available for grids: 869.6 - 8 - 0.4 = 861.2pt % grid-width = 861.2 / 17 ≈ 50.66pt % % Height calculation: % Both sides outer border: 2 × (2pt + 2pt) = 8pt % Inner border thickness: 0.4pt % Padding: 2.8pt × 2 = 5.6pt % Available for grids: 612.5 - 8 - 0.4 - 5.6 = 598.5pt % grid-height = 598.5 / 21 ≈ 28.5pt % % Column height (internal content area used by Lua): % height = 21 × grid-height = 21 × 28.5 ≈ 598.5pt % % ============================================================================= \gujiSetup{ % ========================================================================== % Page Geometry (Same as Siku Quanshu - Spread) % ========================================================================== paper-width = 1136pt, % 40cm paper-height = 894.6pt, % 31.5cm margin-top = 190.5pt, % 6.72cm margin-bottom = 91.6pt, % 3.23cm margin-left = 133.2pt, % 4.7cm margin-right = 133.2pt, % 4.7cm % ========================================================================== % Border Configuration (Black and White) % ========================================================================== border = true, outer-border = true, % Inner column border thickness border-thickness = 0.4pt, % Outer frame border thickness outer-border-thickness = 4pt, % Gap between outer border and inner content outer-border-sep = 3pt, % Padding inside column border (top and bottom) border-padding-top = 5pt, border-padding-bottom = 5pt, % ========================================================================== % Grid Configuration (17 cols x 21 chars) % ========================================================================== % Number of columns per half page (excluding Banxin center column) n-column = 8, % Number of characters per column (grid-height and height are auto-calculated) n-char = 21, % Grid width is still manual (depends on page width and column count) % Calculated: (content-width - outer-border-overhead - inner-border) / 17 grid-width = 50.66pt, % ========================================================================== % Banxin (版心) Configuration % ========================================================================== % Section ratios based on measurements: 65.8mm / 131.2mm / 36.2mm % Total: 65.8 + 131.2 + 36.2 = 233.2mm banxin-upper-ratio = 0.282, % 65.8 / 233.2 banxin-middle-ratio = 0.563, % 131.2 / 233.2 chapter-title-top-margin = 50pt, chapter-title-font-size = 15pt, chapter-title-grid-height = 55pt, lower-yuwei = false, % ========================================================================== % Typography % ========================================================================== font-size = 28pt, line-spacing = 28.5pt, % Font settings are optional - users can load fontspec and set fonts in their document % Example in your .tex file: % \usepackage{fontspec} % \setmainfont{JiGu}[RawFeature={+vert,+vrt2}, CharacterWidth=Full] % If not specified, LuaTeX will use the default font vertical-align = center, % Jiazhu (dual-column notes) alignment % Options: outward (default), inward, center, left, right jiazhu-align = outward, % ========================================================================== % Colors (Black and White) % ========================================================================== border-color = {0, 0, 0}, font-color = {0, 0, 0} } \endinput