Skip to content

Commit fb3ba5b

Browse files
committed
feat(toggles): add LINKBOXES toggle
Signed-off-by: Jonas Dujava <[email protected]>
1 parent 093c4e6 commit fb3ba5b

5 files changed

Lines changed: 19 additions & 0 deletions

File tree

chapters/Usage.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ \chapter{Usage of \TeXtured{}} \label{ch:Usage}
6363
\begin{itemize}
6464
\item \textsf{Extra Margin} \textcolor{gray}{(default:\,\texttt{disabled})} --- the \emph{Draft} document will include extra right margin (for notes and corrections) when you enable it using \custommacro{\EXTRAMARGINtrue}.
6565
\end{itemize}
66+
\item \textsf{Link Boxes} \textcolor{gray}{(default:\,\texttt{enabled})} --- drawing of link/reference boxes can be disabled by \custommacro{\LINKBOXESfalse} command (improves compilation time).
6667
\item \textsf{Censored Version} \textcolor{gray}{(default:\,\texttt{disabled})} --- if you want to censor chosen parts of the document, include the \custommacro{\CENSORtrue} line.
6768
\item \textsf{Include Only \ldots{}} --- if you want to compile only a subset of chapters, you can utilize the \custommacro{\includeonlysmart} command. \qedhere*
6869
\end{itemize}

preamble/hacks/custom-reference-boxes.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
\NewTCBox{\hrefbox}{!O{}}{link,hrefbox,#1}
2626
\NewTCBox{\citebox}{!O{}}{link,citebox,#1}
2727

28+
\ifLINKBOXES\else
29+
\RenewDocumentCommand{\refbox} {O{} m}{#2}
30+
\RenewDocumentCommand{\pagebox}{O{} m}{#2}
31+
\RenewDocumentCommand{\hrefbox}{O{} m}{#2}
32+
\RenewDocumentCommand{\citebox}{O{} m}{#2}
33+
\fi
34+
2835
%% Save the original link commands
2936
\NewCommandCopy{\hrefold}{\href}
3037
\NewCommandCopy{\urlold}{\url}

preamble/misc/packages-macros.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717
\NewTCBox{\macrobox}{!O{}}{link,macrobox,#1}
1818
\NewTCBox{\custommacrobox}{!O{}}{link,custommacrobox,#1}
1919

20+
\ifLINKBOXES\else
21+
\RenewDocumentCommand{\packagebox}{O{} m}{#2}
22+
\RenewDocumentCommand{\filebox}{O{} m}{#2}
23+
\RenewDocumentCommand{\dirbox}{O{} m}{#2}
24+
\RenewDocumentCommand{\macrobox}{O{} m}{#2}
25+
\RenewDocumentCommand{\custommacrobox}{O{} m}{#2}
26+
\fi
27+
2028
\NewDocumentCommand{\package}{m}{%
2129
% \href{https://texdoc.org/pkg/#1}
2230
\hrefold{https://ctan.org/pkg/#1}{%

preamble/toggles.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
\newif\ifFANCY %% whether to enable some more fancy stylistic choices
44
\newif\ifWIP %% whether to enable debug commands, todos, etc.
55
\newif\ifEXTRAMARGIN %% whether WIP mode has extra right margin
6+
\newif\ifLINKBOXES %% whether to enable reference/citation/link boxes
67
\newif\ifCENSOR %% whether to censor denoted passages
78

89
\FANCYtrue %% by default, enable fancy features
10+
\LINKBOXEStrue %% by default, enable boxes for references/citations/links

thesis.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
%% NOTE: Comment out the following lines for the final version
1919
\WIPtrue % THIS IS A WORK-IN-PROGRESS VERSION
2020
% \EXTRAMARGINtrue % add extra right margin in WIP version (for notes/corrections)
21+
% \LINKBOXESfalse % disable reference/link boxes for faster compilations
2122
\CENSORtrue % THIS IS A CENSORED VERSION
2223

2324
%% Preamble - data, packages, macros, and more

0 commit comments

Comments
 (0)