summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/etoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-07-04 21:27:36 +0000
committerKarl Berry <karl@freefriends.org>2018-07-04 21:27:36 +0000
commitbaa1b33f09a2124bfd68ba5f26e347bc9e3f3170 (patch)
tree4e797fb3c767a76ff0be92181b9603a439679e76 /Master/texmf-dist/tex/latex/etoc
parent217bd854a745eab9aa3fd3d4c55f72e215e44afd (diff)
etoc (4jul18)
git-svn-id: svn://tug.org/texlive/trunk@48136 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/etoc')
-rw-r--r--Master/texmf-dist/tex/latex/etoc/etoc.sty58
1 files changed, 50 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/etoc/etoc.sty b/Master/texmf-dist/tex/latex/etoc/etoc.sty
index 9b6277c8b90..4cb310fe559 100644
--- a/Master/texmf-dist/tex/latex/etoc/etoc.sty
+++ b/Master/texmf-dist/tex/latex/etoc/etoc.sty
@@ -23,10 +23,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{etoc}
- [2018/06/15 v1.08o Completely customisable TOCs (JFB)]
+ [2018/07/04 v1.08p Completely customisable TOCs (JFB)]
%%
%% Package: etoc
-%% Version: 1.08o-2018/06/15
+%% Version: 1.08p-2018/07/04
%% License: LPPL 1.3c
%% Copyright (C) 2012-2018 Jean-Francois Burnol
%% <jfbu at free dot fr>
@@ -72,6 +72,7 @@
\newif\ifEtoc@notocifnotoc % 1.08e
\def\etocnotocifnotoc {\Etoc@checksemptinesstrue\Etoc@notocifnotoctrue }
\def\etoc@{\etoc@}
+\newif\ifEtoc@bracedname % 1.08p
\newcounter{etoc@tocid}
\newcounter{etoc@tocdepth}% 1.07g
\@ifclassloaded{memoir}{\def\Etoc@minf{-\thr@@}}{\def\Etoc@minf{-\tw@}}
@@ -343,12 +344,12 @@
\futurelet\Etoc@getthepage@token
\Etoc@getthepage #2\etoc@ % defines \etocthelinkedpage
\futurelet\Etoc@getnb@token
- \Etoc@getnb #1\relax\relax\etoc@ % sets number, name, and \etocthelink
+ \Etoc@@getnb #1\relax\relax\etoc@ % sets number, name, and \etocthelink
\ifEtoc@number
\else
\ifnum\Etoc@level=\m@ne
\futurelet\Etoc@getit@token
- \Etoc@getit #1\hspace\relax\etoc@ % additional job for parts
+ \Etoc@@getit #1\hspace\relax\etoc@ % additional job for parts
\fi
\fi
\Etoc@global\expandafter\let\csname etoclink \endcsname\etocthelink
@@ -376,6 +377,28 @@
{\expandafter\hyperlink \Etoc@tmp{#4}}%
\Etoc@global\edef\etocthelink##1{\noexpand\hyperlink\Etoc@tmp{##1}}%
}
+\def\Etoc@@getnb {%
+ \Etoc@bracednamefalse
+ \ifx\Etoc@getnb@token\bgroup
+ \expandafter\Etoc@getnb@checkifbraced
+ \else
+ \expandafter\Etoc@getnb
+ \fi
+}
+\def\Etoc@tworelax{\relax\relax}
+\def\Etoc@getnb@checkifbraced #1#2\etoc@ {%
+ \def\Etoc@tmp{#2}%
+ \ifx\Etoc@tmp\Etoc@tworelax
+ \expandafter\expandafter\expandafter\Etoc@getnb@nameisbraced
+ \expandafter\@firstofone
+ \else
+ \expandafter\Etoc@getnb
+ \fi {#1}#2\etoc@
+}
+\def\Etoc@getnb@nameisbraced {%
+ \Etoc@bracednametrue
+ \futurelet\Etoc@getnb@token\Etoc@getnb
+}
\def\Etoc@getnb {%
\ifx\Etoc@getnb@token\bgroup
\expandafter\Etoc@getnb@nohyp@nonbr
@@ -407,8 +430,13 @@
\Etoc@global\Etoc@numbertrue
\Etoc@global\def\etocthenumber {#2}%
\Etoc@global\def\etocthelinkednumber {#2}%
- \Etoc@global\def\etocthename {#3}%
- \Etoc@global\def\etocthelinkedname {#3}%
+ \ifEtoc@bracedname
+ \Etoc@global\def\etocthename {{#3}}%
+ \Etoc@global\def\etocthelinkedname {{#3}}%
+ \else
+ \Etoc@global\def\etocthename {#3}%
+ \Etoc@global\def\etocthelinkedname {#3}%
+ \fi
}
\def\Etoc@getnb@nohyp@nonbr #1\etoc@ {%
% \etocthename and \etocthelinkedname already defined in \Etoc@lxyz
@@ -455,6 +483,15 @@
\expandafter{\expandafter\hyperlink \Etoc@tmp{#3}}%
}
\let\Etoc@getnb@hyp@nonbr\Etoc@getnb@nohyp@nonbr
+\def\Etoc@@getit{%
+ \ifEtoc@bracedname
+ \expandafter\expandafter\expandafter\Etoc@getit@nameisbraced
+ \expandafter\@firstofone
+ \else
+ \expandafter\Etoc@getit
+ \fi
+}
+\def\Etoc@getit@nameisbraced {\futurelet\Etoc@getit@token\Etoc@getit }
\def\Etoc@getit {%
\if1\ifEtoc@hyperref
\ifx\hyper@linkstart\Etoc@getit@token1\else0\fi
@@ -474,8 +511,13 @@
\fi
}
\def\Etoc@getit@nohyp@getname #1\hspace\relax\etoc@ {%
- \Etoc@global\def\etocthename {#1}%
- \Etoc@global\def\etocthelinkedname {#1}%
+ \ifEtoc@bracedname
+ \Etoc@global\def\etocthename {{#1}}%
+ \Etoc@global\def\etocthelinkedname {{#1}}%
+ \else
+ \Etoc@global\def\etocthename {#1}%
+ \Etoc@global\def\etocthelinkedname {#1}%
+ \fi
}
\def\Etoc@getit@hyp #1#2#3#4#5#6\etoc@ {%
\edef\Etoc@tmp {{#3}}%