Created
June 9, 2020 01:26
-
-
Save wtsnjp/6590638f932f43a79dee41a684a82497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%#!platex | |
\documentclass[a4paper,dvipdfmx]{jsarticle} | |
\usepackage{bxjalipsum} | |
% \enabletoc するまで何も目次に表示させない | |
\setcounter{tocdepth}{-2} | |
% 目次記載を始めたい位置で \enabletoc を宣言する | |
\newcommand{\enabletoc}{% | |
% tocdepth カウンタの値はお好きなように | |
\addtocontents{toc}{\setcounter{tocdepth}{2}}} | |
\begin{document} | |
\tableofcontents | |
\section{ほげ} | |
\jalipsum[1-5]{wagahai} | |
\enabletoc % <----- この例では,ここで宣言 | |
\section{ふが} | |
\jalipsum[6-10]{wagahai} | |
\section{ぴよ} | |
\jalipsum[11-15]{wagahai} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment