LaTex 下的中文標題

說明

主要利用 titlesec 和 titletoc 來幫助,當然要更花俏也是可以 :)

example:

\usepackage{titlesec,titletoc}

\begin{CJK}{UTF8}{nsungu}

\CJKindent

% ————————————————————————— %
% 中文 title ,只能放在 begin CJK 之後
% ————————————————————————— %

\renewcommand{\tablename}{表~}
\renewcommand{\figurename}{圖~}
\renewcommand{\contentsname}{目~錄}
\renewcommand{\listfigurename}{圖~目~錄}
\renewcommand{\listtablename}{表~目~錄}
\renewcommand{\frefeqname}{式~}
\renewcommand{\freffigname}{圖~}
\renewcommand{\freftabname}{表~}
\renewcommand{\bibname}{參~考~文~獻}
\titleformat{\chapter}[display]{\centering\Huge\bf}{第\ \CJKnumber{\thechapter}\ 章}{0.2cm}{}

% 幫你算 123, 這段直接拿 CJK 下的 bg5.cap 的
\newcommand{\CJKnumber}[1]{\ifcase#1\or一\or二\or三\or四\or五\or六\or七\or八\or九\or十\fi}

% 換索引的 title
\titlecontents{chapter}
   [0em]
    {\large \bf}
   {第\CJKnumber{\thecontentslabel}章 }
   {}{\titlerule*{.}\contentspage}
\titlecontents{section}
   [4em]
   {}
   {\contentslabel{2em}}
   {}{\titlerule*{.} \contentspage}
\titlecontents{subsection}
   [8em]
   {}
   {\contentslabel{3em}}
   {}{\titlerule*{.} \contentspage}

ps. 這邊實在太少 post 了 XD , wiki 比較習慣 Orz

Leave a Reply