見出し・目次の番号をつけたくないorアレンジしたいとき

【本文】「見出し」の番号を消したあとの、「小見出し」の番号をいじって目次で綺麗に表示したい.

こんなとき

・6章の見出しを「おわりに」にしたら、節の小見出しの番号が「5.8」になって、前の章番号・節番号を引き継いで困る.
・でも、\subsection*{1 ねこ社会の現状}でやると、目次に表示した時微妙に空白の空き方がズレて嫌.

【対処方法】

  • ¥chapter*{おわりに}:章見出しの番号を消す.

  • ¥addcontentsline{toc}{chapter}{おわりに}:目次に「おわりに」の章を表示させる.

  • ¥setcounter{section}{0}:1つ目の{}に番号を表示したい階層(section, subsectionなど}を、2つ目の{}に表示したい番号の1つ前の数字を入れる.

  • ¥renewcommand{¥thesection}{¥arabic{section}¥inhibitxspcode`ね=3}:「`」のあとに見出しの頭文字.

 

%%%%%%%%%%%%%%%%%%
¥chapter*{おわりに}
¥addcontentsline{toc}{chapter}{おわりに}
%%%%%%%%%%%%%%%%%%
本章では、

%%%%%%%%%%%%%%%%%%

¥setcounter{section}{0}
¥renewcommand{¥thesection}{¥arabic{section}¥inhibitxspcode`ね=3}
¥section{ねこ社会の現状}

%%%%%%%%%%%%%%%%%%

 

【参考】

http://d.hatena.ne.jp/pyopyopyo/20050116/p3

http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1322

http://ascii.asciimw.jp/pb/ptex/help/inhibitxspcode.html