From 3001b57464c3eb0845a0980ea99a79d61d63c4bf Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Mon, 6 Mar 2017 20:45:33 -0500 Subject: [PATCH] ADDED: Use native command for table of contents in LaTeX --- Sources/libMultiMarkdown/latex.c | 4 +- tests/MMD6Tests/Table of Contents.tex | 54 +-------------------------- 2 files changed, 2 insertions(+), 56 deletions(-) diff --git a/Sources/libMultiMarkdown/latex.c b/Sources/libMultiMarkdown/latex.c index b2a09b4..0a6d7e5 100644 --- a/Sources/libMultiMarkdown/latex.c +++ b/Sources/libMultiMarkdown/latex.c @@ -752,9 +752,7 @@ void mmd_export_token_latex(DString * out, const char * source, token * t, scrat temp_short = 0; temp_short2 = 0; pad(out, 2, scratch); - - mmd_export_toc_latex(out, source, scratch); - + print_const("\\tableofcontents"); scratch->padded = 0; break; case BRACE_DOUBLE_LEFT: diff --git a/tests/MMD6Tests/Table of Contents.tex b/tests/MMD6Tests/Table of Contents.tex index 4b4fb19..9b99b2b 100644 --- a/tests/MMD6Tests/Table of Contents.tex +++ b/tests/MMD6Tests/Table of Contents.tex @@ -2,59 +2,7 @@ \def\mytitle{Table of Contents} \input{mmd6-article-begin} -\begin{itemize} - -\item{} Second Level (\autoref{secondlevel}) - -\item{} First Level (\autoref{firstlevel}) - -\begin{itemize} - -\item{} Second Level b (\autoref{secondlevelb}) - -\begin{itemize} - -\item{} Third Level (\autoref{thirdlevel}) - -\end{itemize} - -\item{} Second Level c (\autoref{secondlevelc}) - -\end{itemize} - -\item{} First Level b (\autoref{firstlevelb}) - -\begin{itemize} - -\item{} Third Level b (\autoref{thirdlevelb}) - -\item{} Second level d (\autoref{secondleveld}) - -\begin{itemize} - -\item{} Third level d (\autoref{thirdleveld}) - -\begin{itemize} - -\item{} Fourth level d (\autoref{fourthleveld}) - -\end{itemize} - -\end{itemize} - -\end{itemize} - -\item{} First level (\autoref{firstlevele}) - -\begin{itemize} - -\item{} Second level (\autoref{secondlevele}) - -\end{itemize} - -\end{itemize} - - +\tableofcontents \chapter{Second Level } \label{secondlevel} -- 2.40.0