Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \setcounter{secnumdepth}{4}% Number up to \paragraph
- \makeatletter
- \renewcommand{\thesubsubsection}{\arabic{subsubsection}}
- \renewcommand{\p@subsubsection}{\thesubsection.}
- \renewcommand{\theparagraph}{\arabic{paragraph}}
- \renewcommand{\p@paragraph}{\thesubsection.\thesubsubsection.}
- \renewcommand{\@seccntformat}[1]{%
- \csname the#1\endcsname
- \ifnum\pdfstrcmp{#1}{subsubsection}=0 .\fi% If this is a subsubsection, add a period
- \ifnum\pdfstrcmp{#1}{paragraph}=0 .\fi% If this is a paragraph, add a period
- \quad}
- \makeatother
- \usepackage[nameinlink]{cleveref}
- \crefformat{paragraph}{#2#1#3}
- \begin{document}
- \tableofcontents
- \section{My Section}
- \subsection{My subsection}
- \subsubsection{My subsubsection}\label{sssec:mysubsubsection}
- My section ref is: \Cref{sssec:mysubsubsection}.
- \paragraph{My paragraph}\label{par:myparagraph}
- My paragraph ref is: \Cref{par:myparagraph}.
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement