Skip to content

Instantly share code, notes, and snippets.

@y-yu
Created September 10, 2012 16:25
Show Gist options
  • Save y-yu/3691908 to your computer and use it in GitHub Desktop.
Save y-yu/3691908 to your computer and use it in GitHub Desktop.
bangou
\makeatletter
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
\else
\refstepcounter{#1}%
\protected@edef\@svsec{\@seccntformat{#1}\relax}%
\fi
\@tempskipa #5\relax
\ifdim \@tempskipa<\z@
\def\@svsechd{%
#6{#8}%
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\protect\numberline{\csname the#1\endcsname}%
\fi
#7}}% 目次にフルネームを載せるなら #8
\else
\begingroup
#6{\@hangfrom{\hskip #3\relax\@svsec}%
\interlinepenalty \@M #8\@@par}%
\endgroup
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\protect\numberline{\csname the#1\endcsname}%
\fi
#7}% 目次にフルネームを載せるならここは #8
\fi
\@xsect{#5}}
\makeatother
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment