網頁

2014年3月20日 星期四

latex 使用 titlesec package 修改 section 標題時會影響 toc

解決方法

不使用titlesec,直接重新定義section 與 subsection

\makeatletter
\renewcommand{\section}{\@startsection
{section}%                   % the name
{1}%                         % the level
{\z@}%                       % the indent / 0mm
{-\baselineskip}%            % the before skip / -3.5ex \@plus -1ex \@minus -.2ex
{0.5\baselineskip}%          % the after skip / 2.3ex \@plus .2ex
{\hspace{25pt}\normalsize}} % the style
\makeatletter
\renewcommand{\subsection}{\@startsection
{subsection}%                   % the name
{1}%                         % the level
{\z@}%                       % the indent / 0mm
{-\baselineskip}%            % the before skip / -3.5ex \@plus -1ex \@minus -.2ex
{0.5\baselineskip}%          % the after skip / 2.3ex \@plus .2ex
{\hspace{50pt}\normalsize}} % the style

沒有留言:

張貼留言