[問題] sectionname?!

作者: s60984 (Angus)   2014-09-16 00:13:12
各位先進好:
以下是我的latex檔
\documentclass[12pt]{article}
\usepackage{amsmath,amssymb,amsthm,mathrsfs}
\usepackage{fontspec} %加這個就可以設定字體
\usepackage{xeCJK} %讓中英文字體分開設置
\setCJKmainfont{標楷體} %設定中文為系統上的字型,而英文不去更動,使用原TeX字型
\XeTeXlinebreaklocale "zh" %這兩行一定要加,中文才能自動換行
\XeTeXlinebreakskip = 0pt plus 1pt %這兩行一定要加,中文才能自動換行
%%%%%%%%%%%%%%%%
\renewcommand{\contentsname}{目錄}
\renewcommand{\thesection}{\arabic{section}}
\usepackage{titlesec,titletoc,CJK,CJKnumb}
\titleformat{\section}[hang] {\Large\bfseries}{第\CJKnumber{\thesection}小節}
{1em}{}[]
\titleformat{\subsection}[hang] {\normalsize\bfseries}{第
\CJKnumber{\thesection}小節} {1em}{}[]
\titlecontents{section}[2em] {}{\normalfont\normalsize\makebox[6em][l]
{第\CJKnumber{\thecontentslabel}小節}}{} {\titlerule*[0.7pc]{.}\contentspage}
\titlecontents{subsection}[4em]{} {\normalfont\normalsize\makebox[6em][l]
{}}{} {\titlerule*[0.7pc]{.}\contentspage}
%%%%%%%%%%%%%%%%
\begin{document}
\tableofcontents
\clearpage
\section{統計}
\clearpage
\subsection{參考答案}
\clearpage
\section{機率}
\clearpage
\subsection{參考答案}
\end{document}
編譯後會第三頁得到
第一小節 參考答案
但我想將
\titleformat{\subsection}[hang] {\normalsize\bfseries}{第
\CJKnumber{\thesection}小節} {1em}{}[]
改成
\titleformat{\subsection}[hang] {\normalsize\bfseries}{第
\CJKnumber{\thesection}小節 \Sectionname} {1em}{}[]
想得到「第一小節 統計 參考答案」
結果無法編譯
請問是否有任何可行的方式滿足我的要求

Links booklink

Contact Us: admin [ a t ] ucptt.com