48 lines
1.4 KiB
TeX
48 lines
1.4 KiB
TeX
\NeedsTeXFormat{LaTeX2e}
|
|
\ProvidesPackage{PrimeTeX/CrossRef}[2025-07-09]
|
|
|
|
% Cross references
|
|
%#region
|
|
%\newcommand{\sectionRef}[2]{\ref{#1:#2}: #2}
|
|
\newcommand{\refChapter}[1]{Chapter \ref{ch:#1}}
|
|
\newcommand{\refAppendix}[1]{Appendix \ref{ch:#1}}
|
|
\newcommand{\refSection}[1]{Section \ref{sec:#1}}
|
|
\newcommand{\refSubsection}[1]{Subsection \ref{subsec:#1}}
|
|
\newcommand{\refSubsubsection}[1]{Sub-subsection \ref{sssec:#1}}
|
|
\newcommand{\refParagraph}[1]{Paragraph \ref{par:#1}}
|
|
\newcommand{\refSubparagraph}[1]{Subparagraph \ref{subpar:#1}}
|
|
\newcommand{\refTable}[1]{Table \ref{tbl:#1}}
|
|
\newcommand{\refFigure}[1]{Figure \ref{fig:#1}}
|
|
|
|
\newcommand{\lblGeneral}[4][]{
|
|
\if\relax\detokenize{#1}\relax % Check if #1 is empty string.
|
|
#3{#2}\label{#4:#2}
|
|
\else
|
|
#3{#2}\label{#4:#1}
|
|
\fi
|
|
}
|
|
\newcommand{\lblChapter}[2][]{
|
|
\lblGeneral[#1]{#2}{\chapter}{ch}
|
|
}
|
|
\newcommand{\lblSection}[2][]{
|
|
\lblGeneral[#1]{#2}{\section}{sec}
|
|
}
|
|
\newcommand{\lblSubsection}[2][]{
|
|
\lblGeneral[#1]{#2}{\subsection}{subsec}
|
|
}
|
|
\newcommand{\lblSubsubsection}[2][]{
|
|
\lblGeneral[#1]{#2}{\subsubsection}{sssec}
|
|
}
|
|
\newcommand{\lblParagraph}[2][]{
|
|
\lblGeneral[#1]{#2}{\paragraph}{par}
|
|
}
|
|
\newcommand{\lblSubparagraph}[2][]{
|
|
\lblGeneral[#1]{#2}{\subparagraph}{subpar}
|
|
}
|
|
\newcommand{\lblTable}[2][]{
|
|
\lblGeneral[#1]{#2}{\caption}{tbl}
|
|
}
|
|
\newcommand{\lblFigure}[2][]{
|
|
\lblGeneral[#1]{#2}{\caption}{fig}
|
|
}
|
|
%#endregion |