使用 xeCJK 套件的 \newCJKfontfamily 指令﹐結合 titlesec 套件的 \titleformat
指令。
以前寫過一個使用 fontspec 結合 titlesec 的例子(xeCJK with titlesec 的使用方法
基本沒差)﹕
%!TEX program = xelatex
\documentclass{article}
\usepackage{titlesec}
\usepackage{fontspec}
\newfontfamily\arial{Arial}
\titleformat{\section}[hang]{\bfseries\arial}{\thesection}{1em}{}{}
\begin{document}
\section{This is Arial here}
\end{document}
供參考。
※ 引述《otakualfar (言亮臣)》之銘言:
: 想問一下 要如何在XeTeX下自動設定標題的字體
: 比方說 已經設定了 \setCJKmainfont{BiauKai}
: 但我希望\part{} \section{}
: 這些能夠不會因此被設定成BiauKai 而是能自己定義一個字型給這些類別
: 目前本魯是先用\setCJKmainfont{} 把標題設定成自己想要的字型
: 再\newfontfamily{}{} 把內文慢慢改成想要的字體
: 想問一下有沒有比較快的方法可以直接定義?