半個世紀以來,「橫排」逐漸成爲出版物排版的主流。十年前,境內還能偶爾看到一些出版社以「直排」方式出版一些古籍圖書。目下,僅有境外幾家出版社偶爾還以「直排」方式出版一些文史讀物。前幾日瀏覽素材,看到過去十年間網絡上零零散散的基於 LaTeX 的中文直排方案,逐一分析下來,發覺大都需要完善需求、更新源碼。自己久不讀書,讀「直排」書的機會就更少了。近來因飲酒吹風而感冒閉門,趁着這般光景,嘗試整理出一份基於 XeLaTeX 與 XeCJK 的中文直書方案。
直排與現代排版需求
爲了更好吸納西學現代科學,方便排版公式、符號、插圖等頁面元素,變「直書」爲「橫書」實乃大勢所趨。一百年來,經過時間與實踐檢驗,這個問題早已有了的明確答案。
XeCJK 直書設置
在 XeCJK 中直書需要旋轉 PDF,並且原橫排環境中的樣式皆需調整以適應直排版式。以下爲需要調整的若干樣式。
總設置
%文檔類型加入landscape選項
\documentclass[a4paper,12pt,openany,landscape]{book}
%導入XeCJK Package
\usepackage[CJKchecksingle,AutoFallBack=true]{xeCJK}
%設定直排字體
\setCJKmainfont[Script=CJK,Vertical=RotatedGlyphs,RawFeature={vertical:+vert},BoldFont=H-SiuNiu-Bold,ItalicFont=HGBLight-H]{I.MingCP}
\defaultCJKfontfeatures{RawFeature={vertical:+vert}}
調正漢字基線
%漢字基線調整適應中英文混排
\let\CJKsymbolOrig\CJKsymbol
\let\CJKpunctsymbolOrig\CJKpunctsymbol
\newcommand*\CJKmovesymbol[1]{\raise.35em\hbox{\CJKsymbolOrig{#1}}}
\newcommand*\CJKmovepunctsymbol[1]{\raise.35em\hbox{\CJKpunctsymbolOrig{#1}}}
\newcommand*\CJKmove{\punctstyle{plain}
\let\CJKsymbol\CJKmovesymbol
\let\CJKpunctsymbol\CJKmovepunctsymbol}
%在\begin{document}後添加\CJKmove
\begin{document}
\CJKmove
目錄中的章節樣式
\titlecontents{chapter}[0em]{\addvspace{5pt}\fontsizec{0.7cm}\it} % for Chinese table of contents
{\rotatebox[origin=cc]{-270}{\ncircbs{\thecontentslabel}}~}
{\rotatebox[origin=cc]{-270}{\Alphcircwcu{21}}~\thecontentslabel\helfont}{\fontsizec{0.7cm}\color{black}\;\titlerule*[.5pc]{.}\;\zhnumsetup{style={Traditional,Financial}}\zhdigits{\thecontentspage}}
\titlecontents{section}[0cm]{\it}
{第{\thecontentslabel}節~~~}
{\rotatebox[origin=cc]{-270}{\Alphcircwcu{21}}~\thecontentslabel\helfont}{\titlerule*[.5pc]{.}\;\color{black}\zhnumsetup{style={Traditional,Financial}}\zhdigits{\thecontentspage}}
正文中的章節樣式
%%竖排章样式
\assignpagestyle{\chapter}{empty}%去掉章页面页码
\assignpagestyle{\chapter*}{empty}%去掉章页面页码
\newcommand{\mychapter}[1]{%
\color{myred}\HGBM\fontsize{37}{37}第~\rotatebox[x=0.715cm,origin=c]{-270}{\ncircbs{\thechapter}}~章{{\ZSKS·}#1}
}
\newcommand{\mychapterun}[1]{%
\color{myred}\fontsize{37}{37}\ding{109}~\akzfont\HGBM #1
}
\titleformat{\chapter}{}{}{0em}{\mychapter}% code preceding the title body (title body is taken as argument)
\titleformat{name=\chapter,numberless}{}{}{0pt}{\mychapterun}
\titlespacing{\chapter}
{0pt}{0pt}{36pt}
%%竖排節样式
\newcommand{\mysection}[1]{%
\color{myred}\MLan \fontsize{21}{21}第~{\thesection}~節~~~~ #1
}
\newcommand{\mysectionun}[1]{%
\color{myred}\fontsize{21}{21}\ding{109}~\akzfont\MLan #1
}
\titleformat{\section}{}{}{0mm}{\mysection}
\titleformat{name=\section,numberless}{}{}{0pt}{\mysectionun}
\titlespacing{\section}
{0pt}{12pt}{6pt}
插圖樣式設定
直排時,插圖不易調整,尤其是插圖的標題樣式。本文方案暫且處理如下。
\usepackage{wrapfig}
\usepackage{caption}
\captionsetup[wrapfigure]{font=small,labelfont=bf,textfont=it,aboveskip=6pt,belowskip=-1.02em,justification=raggedright,name={Fig.}}%,labelsep=period
\newcommand{\mafig}[2]{
\begin{wrapfigure}{O}[0pt]{0.2\textwidth}%[10]
\vspace{-6pt}
{\tcbincludegraphics[size=fbox,colframe=myred!50!black,colback=red!60!black,center title,drop fuzzy shadow,colback=myred,boxsep=3pt,arc=0pt,graphics options={scale=.5,angle=-270},title={\large\HGBR\helfont #2}]{#1}}
\vspace{-6pt}
\end{wrapfigure}
}
參考文獻設定
%採用gb7714-2015格式
\usepackage[backend = biber,bibstyle = gb7714-2015,citestyle=gb7714-2015ay,natbib=true,mcite=true,sorting=nyt,sortcites=true,autopunct=true,hyperref=true,abbreviate=false,backref=true]{biblatex}%國標2015文獻引用格式 %bibstyle = gb7714-2015,citestyle=gb7714-2015ay,bibstyle=alphabetic,%=gb7714-2015ay为(作者年份页码)样式引用
\addbibresource{bibliography.bib} % BibTeX bibliography file bibliography.bib
\defbibheading{bibempty}{}
\DefineBibliographyStrings{english}{%
backrefpage = {引用頁:},
backrefpages= {引用頁:},
}
%正文行文示例
……\cite[P178]{adornoRethinkingArchitectureReader1997}。
\textcite[P352]{haidegeerHeErDeLinShiDeChanShi2000}認爲……
%正文列印參考文獻
\printbibliography[heading=bibempty]
夾註樣式設置
%%%gezhu environment
\usepackage{zhulem}
\usepackage{gezhu}
\setgezhuraise{-3.5pt}
\setgezhulines{2}
\everygezhu{\linespread{1.2}\fontsize{9}{9}\HMOP\selectfont}
\newcommand{\gz}[1]{{\gezhu{#1}}}
%\newcommand{\gz}[1]{\disablepinyin\gezhu{\HMOP #1}\enablepinyin}
頁眉頁腳樣式
\usepackage{titleps} %詳細參見說明文檔
\newpagestyle{mapage}{% %numbered chapter
\sethead[\MLan\color{myred}\bottitlemarks{第{\thesection}節}~~~\sectiontitle]
[]
[{\MLan\color{myred}\rotatebox[x=0.225cm,origin=c]{-270}{\ncircbs{\thechapter}}~\chaptertitle《~\parttitle 編《~\thebooktitle《~第{\HGBM\color{black}\zhnumsetup{style={Traditional,Financial}}\zhdigits{\thepage}}頁}] %even head
{}
{}
{} %odd head
\setfoot[]
[]
[] %even foot
{\MLan\color{myred}\bottitlemarks{第{\thesection}節}~~~\sectiontitle}
{}
{{\MLan\color{myred}\rotatebox[x=0.225cm,origin=c]{-270}{\ncircbs{\thechapter}}~\chaptertitle《~\parttitle 編《~\thebooktitle《~第{\HGBM\color{black}\zhnumsetup{style={Traditional,Financial}}\zhdigits{\thepage}}頁}} %odd foot
}
\settitlemarks{part,chapter,section,subsection,subsubsection}
章節尾註樣式
\usepackage[page]{pagenote}%[page] Because of how TeX writes information to files, when the page option is used there must be no notes on the page where \printnotes or \printnotes* closes the ent file. If necessary, a \clearpage or similar must be used before the \print (標記注釋所在頁碼必須讓printnotes另起一頁,否則可能吃掉與\printnotes同頁的注釋^_^)
% 正文中的注释编号样式调整:圓圈數字
\renewcommand\notenumintext[1]{\rotatebox[origin=cc]{-270}{\textsuperscript{\footnotesize\ncircrds{#1}}}}
% 章节末尾的注释编号样式调整:方形黑底數字
\renewcommand\notenuminnotes[1]{\rotatebox[origin=cc]{-270}{\ncircbs{#1}}}
%尾註標記該註釋在正文出現的頁碼
\renewcommand{\pagename}{{P.}}
\makepagenote
索引样式設定
直排模式的索引與橫排並無多少區別,參考本站 Zhmakeindex and the Indices Creating of Chinese Books 一文即可。效果見下圖:
復原古籍印版樣式
這類字體近年來越來越多,許多沈睡在古籍中的字形得以重見天日。尤以
使用一些電子化的古籍印刷字體,如康熙字典體(《康熙字典》印刷所用字型)、聚珍仿宋(北宋刊本中的字型)、浙江民間書刻體之類,可以復原古籍原典部分印刷效果。下面兩副圖即大致以聚珍仿宋排版的圖書與電子化重排效果示意。
結語
上文簡單展示了以 XeCJK 與 XeLaTeX 製作中文直排版式的方案。此外,尚有基於 upLaTeX 以及較新的 Asiatic pTeX 的直排方案,可資參考。
The article was recently updated on Saturday, November 23, 2019, 18:24:51 by .