加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

LaTeX技巧76:如何修改章节标题样式

(2009-11-18 20:25:35)
标签:

latex

标题

章节编号

修改样式

示例

分类: 小技巧

QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载

我们有时候想简单修改一个章节标题的样式,比如章节编号加一个框,下面我们简单举一个例子。

示例如下:

\documentclass{article}
\usepackage{times}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{207.0pt}
\setlength\fboxrule{1pt}

\renewcommand\thesubsection
    {\fbox{\thesection.\arabic{subsection}}}

\begin{document}
\setcounter{section}{3}
\subsection{A mistake}\label{wrong}
Referencing a subsection in this format
produces a funny result as we can see
looking at subsection~\ref{wrong}.
We get a boxed reference.
\end{document}

效果如图:

LaTeX技巧76:如何修改章节标题样式

示例二:

\documentclass{article}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{207.0pt}

\makeatletter
\renewcommand\subsection{\@startsection
 {subsection}{2}{0mm}%name, level, indent
 {-\baselineskip}%             beforeskip
 {0.5\baselineskip}%            afterskip
 {\normalfont\normalsize\itshape}}% style

\makeatother

% redefinition of \subsection shown below
\setcounter{section}{4} % simulate previous
                        % sections
\begin{document}
\ldots\ some text above.
\subsection{Example of a Section Heading}
The heading is set in normal-sized italic
and the separation from the preceding text
is exactly one baseline. The separation
from the text following is one-half
baseline and this text is not indented.
\end{document}

效果图:

LaTeX技巧76:如何修改章节标题样式

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有