mirror of
https://github.com/ElegantLaTeX/ElegantBook.git
synced 2026-01-26 04:14:35 +08:00
hyperref toc clickable
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%
|
||||
% % !Mode:: "TeX:UTF-8"
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesClass{elegantbook}[2020/07/06 v4.0.2 ElegantBook document class]
|
||||
\ProvidesClass{elegantbook}[2020/07/29 v4.0.3 ElegantBook document class]
|
||||
|
||||
\RequirePackage{kvoptions}
|
||||
\RequirePackage{etoolbox}
|
||||
@@ -60,9 +60,11 @@
|
||||
\DeclareVoidOption{margintrue}{\ekv{marginpar=margintrue}}
|
||||
\DeclareVoidOption{marginfalse}{\ekv{marginpar=marginfalse}}
|
||||
|
||||
|
||||
\DeclareVoidOption{onecol}{\ekv{toc=onecol}}
|
||||
\DeclareVoidOption{twocol}{\ekv{toc=twocol}}
|
||||
|
||||
|
||||
% ----- Math option -----
|
||||
\newcommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}}
|
||||
|
||||
@@ -310,14 +312,7 @@
|
||||
\setlength{\footnotesep}{12pt}
|
||||
}
|
||||
|
||||
\ifdefstring{\ELEGANT@toc}{twocol}{
|
||||
\renewcommand{\tableofcontents}{%
|
||||
\setlength{\columnsep}{2em}
|
||||
%\setlength{\columnseprule}{.8pt}
|
||||
\begin{multicols}{2}[\chapter*{\contentsname}]%
|
||||
\@starttoc{toc}%
|
||||
\end{multicols}}
|
||||
}{\relax}
|
||||
|
||||
|
||||
|
||||
%% 常用宏包
|
||||
@@ -883,4 +878,22 @@
|
||||
\begin{enumerate}[label=\small\protect\circled{\arabic*}]}{
|
||||
\end{enumerate}}
|
||||
|
||||
\addbibresource[location=local]{reference.bib}
|
||||
\addbibresource[location=local]{reference.bib}
|
||||
|
||||
\renewcommand\tableofcontents{%
|
||||
\hypersetup{linktoc=all, linkcolor=black}
|
||||
\if@twocolumn
|
||||
\@restonecoltrue\onecolumn
|
||||
\else
|
||||
\@restonecolfalse
|
||||
\fi
|
||||
\chapter*{\contentsname
|
||||
\@mkboth{%
|
||||
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
|
||||
\ifdefstring{\ELEGANT@toc}{twocol}{
|
||||
\setlength{\columnsep}{2em}
|
||||
\begin{multicols}{2}%
|
||||
\@starttoc{toc}
|
||||
\end{multicols}}{
|
||||
\@starttoc{toc}}
|
||||
\if@restonecol\twocolumn\fi}
|
||||
Reference in New Issue
Block a user