作者SmallBeeWayn (喵喵叫的蜜蜂猫)
看板LaTeX
标题[问题] 中文章节标题
时间Tue Oct 12 12:47:02 2010
虽然理论上应该用 titlesec 配合 titleformat
可是不管我怎麽弄...就是会编错
错误信息是 Nested titles,怎麽Google都找不到相关资料
最後只好用更底层的操作去处理
使用系统: Win7x64, MiKTeX 2.9, XeCJK
目标: 如下的呈现
一、范例章
1 范例节
二、
三、
1
2
=========普通的方法
\setcounter{secnumdepth}{2}
\renewcommand{\thesection}{\CJKnumber{\arabic{section}}、}
\renewcommand{\thesubsection}{\arabic{subsection}}
不过这样原始的\quad还是会在,只好找更底层的方法
=========底层的方法
\setcounter{secnumdepth}{2}
\makeatletter
\def\@seccntformat#1{\@ifundefined{
#1@cntformat}%
{\csname the#1\endcsname\quad} % default
{\csname
#1@cntformat\endcsname} % individual control
}
\def\section@cntformat{\CJKnumber{\thesection}、}
\def\subsection@cntformat{\arabic{subsection}\quad}
\makeatother
这样的话就能达到目标
==================
不过可以的话我比较希望是解决titlesec的问题
底层的操作怕以後做索引会出问题
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.116.180.163
1F:→ andrew43:这真的是用 titlesec 就可以了. 贴上你失败的原始码吧. 10/12 14:39
\documentclass[11pt,a4paper,notitlepage]{article}
\usepackage{color}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{float}
\usepackage{multirow} %表直行
\usepackage{siunitx} %标准符号
\usepackage[BoldFont,SlantFont,CJKnumber,CJKchecksingle]{xeCJK}
\usepackage[pdfborder={0 0 0},bookmarksnumbered=true]{hyperref}
\usepackage{type1cm}
\usepackage[plain]{fancyref}
\setCJKmainfont{标楷体}
\setromanfont{Times New Roman}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\usepackage[margin=2cm,noheadfoot]{geometry} %BMES 2010 标准 边距2cm
\columnwidth 7.75cm %BMES 2010 标准 栏宽7.75cm
\pagestyle{empty} %BMES 2010 标准 无页首页尾
\setcounter{secnumdepth}{2}
\makeatletter
\def\@seccntformat#1{\@ifundefined{
#1@cntformat}%
{\csname the#1\endcsname\quad}% default
{\csname
#1@cntformat\endcsname}% individual control
}
\def\section@cntformat{\CJKnumber{\thesection}、}
\def\subsection@cntformat{\arabic{subsection}\quad}
\makeatother
\renewcommand\figurename{图~}
\renewcommand\tablename{表~}
\renewcommand\refname{\section{参考文献}}
\renewcommand{\arraystretch}{1.2} % 表格行距 x1.2
\begin{document}
==============中略=============
\bibliographystyle{p1}
\bibliography{p1}
\end{multicols}
\end{document}
※ 编辑: SmallBeeWayn 来自: 122.116.180.163 (10/13 02:13)