|
|
2 ヶ月 前 | |
|---|---|---|
| .. | ||
| README.md | 2 ヶ月 前 | |
| README.template-source.md | 2 ヶ月 前 | |
| source.tex | 2 ヶ月 前 | |
Use this template when the user wants a Chinese technical book / engineering monograph / source-code reading book / algorithm or systems book in a polished LaTeX book format rather than a short HTML report.
Trigger examples:
Do not use this for academic thesis formatting; use templates/latex-academic-thesis/ and
docs/latex-academic-thesis-guide.md instead.
source.tex — compact generic scaffold with final technical-book style.source.tex includes a TikZ animal-style placeholder cover illustration. Replace that block with
an \includegraphics call only when the user supplies a real cover image.README.template-source.md — the source project README retained for context.The scaffold includes:
176mm × 250mm.\maketechbooktitleClassic that is not used by default.hyperref table of contents with black text and red number/page accents.listings and robust line breaking.xurl / \path|...| to prevent long API paths from overflowing.insightbox, pullquotebox, diagramBox, warningbox, theorem/definition/example boxes,
exercises.\fancydropcap{首}{段剩余文字} for chapter/section opening paragraphs.tabularx ragged columns (Y) for robust technical tables.mkdir -p /tmp/technical-book
cp templates/latex-technical-book/source.tex /tmp/technical-book/main.tex
mkdir -p /tmp/technical-book/figures /tmp/technical-book/chapters /tmp/technical-book/backmatter
Then edit:
main.tex:
\BookTitle\BookTitleDetail\BookAuthor\BookPublisher\BookYear\input{chapters/chapter01} etc. with the actual chapter files.source.tex only if the user supplied a cover illustration.\tableofcontents, hyperref, and \phantomsection entries intact so navigation remains
clickable.When source content is structured HTML pages:
p.dropcap or leading <span class="dropcap"> → \fancydropcap{...}{...} for Chinese prose
only; avoid ASCII/digit drop caps.div.pullquote, blockquote, .pull-quote → pullquotebox.ul.timeline / .year spans → diagramBox + description.arch-diagram, dep-flow, flow-diagram, flow-chain, path-diagram, flow-row → rebuild
as LaTeX/TikZ or a diagramBox; do not drop diagrams silently.code inline → \path|...| for ASCII paths/API names; plain escaped text for CJK-heavy inline
snippets.pre code → lstlisting with low-saturation highlighting.table → tabularx with Y columns, small font, reduced \tabcolsep.ul/ol feature lists → enumitem lists with red bullet/number accents.<img src="...">) but the file is missing, report it. Do not
invent that image; use a simple placeholder only when the user approves or supplies the asset.Preferred for this template: XeLaTeX via latexmk.
PATH="/usr/local/texlive/2026/bin/universal-darwin:$PATH" \
latexmk -xelatex -interaction=nonstopmode main.tex
Fallback manual chain:
xelatex -interaction=nonstopmode main.tex
bibtex main || true
makeindex main || true
xelatex -interaction=nonstopmode main.tex
xelatex -interaction=nonstopmode main.tex
Run these before delivery:
pdfinfo main.pdf | grep -E 'Pages|Page size'
grep -i "fatal\|undefined control sequence\|LaTeX Error" main.log
pdftotext main.pdf - | head -80
Expected:
176mm × 250mm unless the user requested A4.Overfull/Underfull hbox can occur in very long code paths or dense tables. Reduce by using
\path, smaller table font, tabularx Y columns, or manually splitting the cell.lettrine warnings mean a drop cap is too close to a page boundary. For final publishing, remove
\fancydropcap on that paragraph or insert a local page break.