Skip to content

Commit

Permalink
Merge pull request #194 from BITNP/dev-fky
Browse files Browse the repository at this point in the history
fix: add pdf bookmarks for \chapter* (v3.2.1)
  • Loading branch information
fky2015 authored Dec 16, 2022
2 parents ffc4185 + f477e2d commit 58082a8
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ endif
.PHONY: all cls doc clean FORCE_MAKE copy

$(PACKAGE).pdf: cls FORCE_MAKE
$(LATEXMK) -xelatex $(PACKAGE).dtx
@$(LATEXMK) -xelatex $(PACKAGE).dtx

$(CLSFILE): $(SOURCES)
yes y | xetex $(PACKAGE).ins
Expand Down Expand Up @@ -70,13 +70,19 @@ copy: cls

# Generate scaffolds for overleaf
overleaf: doc FORCE_MAKE
# if $version is not specified, alert the user.
@if [ -z "$$version" ]; then \
echo -e "\e[32mPlease specify the version of the template you want to generate.\e[0m"; \
echo -e "\e[32mFor example: make overleaf version=1.0.0\e[0m"; \
exit 1; \
fi
git clean -fdx ./templates/
rm -rf overleaf
make copy
mkdir overleaf
ls templates | \
xargs -I {} bash -c \
"cp -r ./templates/{} overleaf && cp $(PACKAGE).pdf ./overleaf/{} && zip -r ./overleaf/{}.zip ./overleaf/{}"
"cp -r ./templates/{} overleaf && cp $(PACKAGE).pdf ./overleaf/{} && zip -r ./overleaf/BIThesis-{}-v$(version).zip ./overleaf/{}"

dev:
ls bithesis.dtx | entr -s 'yes y | make doc && make copy'
Expand Down
7 changes: 5 additions & 2 deletions bithesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2229,7 +2229,7 @@
\RequirePackage{tikz}
\RequirePackage{etoolbox}
% Hide color and border in hyperref.
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[hidelinks,bookmarksnumbered]{hyperref}
\RequirePackage{xcolor}
\RequirePackage{caption}
\RequirePackage{array}
Expand Down Expand Up @@ -3594,6 +3594,7 @@
\chapter{\c_@@_label_abstract_tl}
} {
\chapter*{\c_@@_label_abstract_tl}
\currentpdfbookmark{\c_@@_label_abstract_tl}{ch:abstract}
}
}
\vspace*{1mm}
Expand Down Expand Up @@ -3664,6 +3665,7 @@
\chapter{\c_@@_label_abstract_en_tl}
} {
\chapter*{\c_@@_label_abstract_en_tl}
\currentpdfbookmark{\c_@@_label_abstract_en_tl}{ch:abstract:en}
}
}
}
Expand Down Expand Up @@ -4034,14 +4036,15 @@
% \end{environment}

% \begin{environment}{symbols}
% 生成主要术语对照包
% 生成主要术语对照表
% \begin{macrocode}
\NewDocumentEnvironment {symbols} {}
{
\bool_if:NTF \l_@@_add_symbols_to_toc_bool {
\chapter{\c_@@_label_symbols_tl}
} {
\chapter*{\c_@@_label_symbols_tl}
\currentpdfbookmark{\c_@@_label_symbols_tl}{ch:symbols}
}
\zihao{-4}
\begin{itemize}[
Expand Down
5 changes: 4 additions & 1 deletion templates/graduate-thesis/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
\RequirePackage{multirow}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[hidelinks,bookmarksnumbered]{hyperref}
\RequirePackage{xcolor}
\RequirePackage{caption}
\RequirePackage{array}
Expand Down Expand Up @@ -1480,6 +1480,7 @@
\chapter{\c__bithesis_label_abstract_tl}
} {
\chapter*{\c__bithesis_label_abstract_tl}
\currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract}
}
}
\vspace*{1mm}
Expand Down Expand Up @@ -1544,6 +1545,7 @@
\chapter{\c__bithesis_label_abstract_en_tl}
} {
\chapter*{\c__bithesis_label_abstract_en_tl}
\currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en}
}
}
}
Expand Down Expand Up @@ -1861,6 +1863,7 @@
\chapter{\c__bithesis_label_symbols_tl}
} {
\chapter*{\c__bithesis_label_symbols_tl}
\currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols}
}
\zihao{-4}
\begin{itemize}[
Expand Down
5 changes: 4 additions & 1 deletion templates/paper-translation/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
\RequirePackage{multirow}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[hidelinks,bookmarksnumbered]{hyperref}
\RequirePackage{xcolor}
\RequirePackage{caption}
\RequirePackage{array}
Expand Down Expand Up @@ -1480,6 +1480,7 @@
\chapter{\c__bithesis_label_abstract_tl}
} {
\chapter*{\c__bithesis_label_abstract_tl}
\currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract}
}
}
\vspace*{1mm}
Expand Down Expand Up @@ -1544,6 +1545,7 @@
\chapter{\c__bithesis_label_abstract_en_tl}
} {
\chapter*{\c__bithesis_label_abstract_en_tl}
\currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en}
}
}
}
Expand Down Expand Up @@ -1861,6 +1863,7 @@
\chapter{\c__bithesis_label_symbols_tl}
} {
\chapter*{\c__bithesis_label_symbols_tl}
\currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols}
}
\zihao{-4}
\begin{itemize}[
Expand Down
5 changes: 4 additions & 1 deletion templates/undergraduate-thesis-en/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
\RequirePackage{multirow}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[hidelinks,bookmarksnumbered]{hyperref}
\RequirePackage{xcolor}
\RequirePackage{caption}
\RequirePackage{array}
Expand Down Expand Up @@ -1480,6 +1480,7 @@
\chapter{\c__bithesis_label_abstract_tl}
} {
\chapter*{\c__bithesis_label_abstract_tl}
\currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract}
}
}
\vspace*{1mm}
Expand Down Expand Up @@ -1544,6 +1545,7 @@
\chapter{\c__bithesis_label_abstract_en_tl}
} {
\chapter*{\c__bithesis_label_abstract_en_tl}
\currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en}
}
}
}
Expand Down Expand Up @@ -1861,6 +1863,7 @@
\chapter{\c__bithesis_label_symbols_tl}
} {
\chapter*{\c__bithesis_label_symbols_tl}
\currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols}
}
\zihao{-4}
\begin{itemize}[
Expand Down
5 changes: 4 additions & 1 deletion templates/undergraduate-thesis/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
\RequirePackage{multirow}
\RequirePackage{tikz}
\RequirePackage{etoolbox}
\RequirePackage[hidelinks]{hyperref}
\RequirePackage[hidelinks,bookmarksnumbered]{hyperref}
\RequirePackage{xcolor}
\RequirePackage{caption}
\RequirePackage{array}
Expand Down Expand Up @@ -1480,6 +1480,7 @@
\chapter{\c__bithesis_label_abstract_tl}
} {
\chapter*{\c__bithesis_label_abstract_tl}
\currentpdfbookmark{\c__bithesis_label_abstract_tl}{ch:abstract}
}
}
\vspace*{1mm}
Expand Down Expand Up @@ -1544,6 +1545,7 @@
\chapter{\c__bithesis_label_abstract_en_tl}
} {
\chapter*{\c__bithesis_label_abstract_en_tl}
\currentpdfbookmark{\c__bithesis_label_abstract_en_tl}{ch:abstract:en}
}
}
}
Expand Down Expand Up @@ -1861,6 +1863,7 @@
\chapter{\c__bithesis_label_symbols_tl}
} {
\chapter*{\c__bithesis_label_symbols_tl}
\currentpdfbookmark{\c__bithesis_label_symbols_tl}{ch:symbols}
}
\zihao{-4}
\begin{itemize}[
Expand Down

0 comments on commit 58082a8

Please sign in to comment.