org latex export change unnumbered section to be in toc and add section toc
This commit is contained in:
@@ -408,9 +408,9 @@ Replaces <<...>> with values defined in
|
|||||||
|
|
||||||
(add-to-list 'org-latex-classes
|
(add-to-list 'org-latex-classes
|
||||||
'("koma-article" "\\documentclass{scrartcl}"
|
'("koma-article" "\\documentclass{scrartcl}"
|
||||||
("\\section{%s}" . "\\section*{%s}")
|
("\\cleardoublepage\\section{%s}\\thispagestyle{plain}" . "\\def\\my_org_article_section{%s}\\cleardoublepage\\section*{\\my_org_article_section}\\phantomsection\\addcontentsline{toc}{section}{\\my_org_article_section}\\thispagestyle{plain}")
|
||||||
("\\subsection{%s}" . "\\subsection*{%s}")
|
("\\subsection{%s}" . "\\def\\my_org_article_subsection{%s}\\subsection*{\\my_org_article_subsection}\\phantomsection\\addcontentsline{toc}{subsection}{\\my_org_article_subsection}")
|
||||||
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
|
("\\subsubsection{%s}" . "\\def\\my_org_article_subsubsection{%s}\\subsubsection*{\\my_org_article_subsubsection}\\phantomsection\\addcontentsline{toc}{subsubsection}{\\my_org_article_subsubsection}")
|
||||||
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
("\\paragraph{%s}" . "\\paragraph*{%s}")
|
||||||
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
|
||||||
|
|
||||||
@@ -530,6 +530,29 @@ Replaces <<...>> with values defined in
|
|||||||
% first: pnumwidth, second: margin, default: 1.55em and 2.55em
|
% first: pnumwidth, second: margin, default: 1.55em and 2.55em
|
||||||
\\cftlocalchange{toc}{2em}{2.55em}
|
\\cftlocalchange{toc}{2em}{2.55em}
|
||||||
|
|
||||||
|
% section toc
|
||||||
|
% minitoc does not work with koma script therefore: %TODO clean old minitoc (and \\sectoc commmand) stuff, there is also a \\chaptertoc version online
|
||||||
|
\\makeatletter
|
||||||
|
\\newif\\ifusesectiontoc% Switch to tell \\addtocentrydefault to not only make entries to the toc-file but also to the current section-toc-file
|
||||||
|
\\newcommand*{\\sectiontoc}{% new command to generate and show a section toc
|
||||||
|
\\usesectiontoctrue% switch on section-toc-entries
|
||||||
|
\\edef\\ext@subtoc{toc\\thesection}% extension of the section-toc-file, e.g., toc1.1
|
||||||
|
\\expandafter\\DeclareNewTOC\\expandafter{\\ext@subtoc}% declare a new toc file
|
||||||
|
\\begin{minipage}{.9\\linewidth}
|
||||||
|
\\value{tocdepth}=\\subsectiontocdepth% we want entries down to subsection
|
||||||
|
\\expandafter\\listoftoc\\expandafter*\\expandafter{\\ext@subtoc}% show the toc without any heading
|
||||||
|
\\end{minipage}\\par
|
||||||
|
\\bigskipa\\noindent% add some vertical space after the toc and do not indent the following text
|
||||||
|
}
|
||||||
|
\\usepackage{xpatch}
|
||||||
|
\\xapptocmd\\addtocentrydefault{% patch the KOMA-Script's generic toc entry generator
|
||||||
|
\\ifusesectiontoc% if section toc entries should be generated
|
||||||
|
\\expandafter\\tocbasic@addxcontentsline\\expandafter{\\ext@subtoc}{#1}{#2}{#3}% do it
|
||||||
|
\\fi
|
||||||
|
}{}{}
|
||||||
|
\\xpretocmd\\section{\\usesectiontocfalse}{}{}% automatically switch of section toc entries at start of every \\section
|
||||||
|
\\makeatother
|
||||||
|
|
||||||
%\\usepackage{bigfoot} % footnote
|
%\\usepackage{bigfoot} % footnote
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user