From 575aeba9045361bc3856c4ec57b4eae1e49f9360 Mon Sep 17 00:00:00 2001 From: Matt Jenkins Date: Thu, 27 Mar 2025 00:14:13 +0000 Subject: [PATCH] Added para, npara and note commands --- dec.cls | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dec.cls b/dec.cls index aa935df..a947987 100644 --- a/dec.cls +++ b/dec.cls @@ -23,6 +23,8 @@ \usepackage{longtable} \usepackage[utf8]{inputenc} \usepackage{pmboxdraw} +\usepackage{xparse} +\usepackage{xstring} \setlist{nosep} \setlist{parsep=0em, itemsep=0.5em,topsep=-0.8em} @@ -353,3 +355,20 @@ required to take measures to correct the interference. \newcommand{\tabref}[1]{\hyperref[table:#1]{Table #1}} \newcommand{\caution}[1]{{\fontfamily{phv}\selectfont\textbf{CAUTION:}}\hspace*{1em}\textit{#1}} +\newcommand{\note}[1]{{\fontfamily{phv}\selectfont\textbf{NOTE:}}\hspace*{1em}\textit{#1}} + +\newcommand{\para}[1]{% +\StrCount{#1}{.}[\@s]% +\IfEq{\@s}{0}{\hyperlink{chapter.#1}{Chapter #1}}{}% +\IfEq{\@s}{1}{\hyperlink{section.#1}{Paragraph #1}}{}% +\IfEq{\@s}{2}{\hyperlink{subsection.#1}{Paragraph #1}}{}% +\IfEq{\@s}{3}{\hyperlink{subsubsection.#1}{Paragraph #1}}{}% +} + +\newcommand{\npara}[1]{% +\StrCount{#1}{.}[\@s]% +\IfEq{\@s}{0}{\hyperlink{chapter.#1}{#1}}{}% +\IfEq{\@s}{1}{\hyperlink{section.#1}{#1}}{}% +\IfEq{\@s}{2}{\hyperlink{subsection.#1}{#1}}{}% +\IfEq{\@s}{3}{\hyperlink{subsubsection.#1}{#1}}{}% +}