Advertisement
Guest User

Untitled

a guest
Aug 27th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 0.95 KB | None | 0 0
  1. \documentclass{article}
  2.  
  3. \setcounter{secnumdepth}{4}% Number up to \paragraph
  4.  
  5. \makeatletter
  6. \renewcommand{\thesubsubsection}{\arabic{subsubsection}}
  7. \renewcommand{\p@subsubsection}{\thesubsection.}
  8. \renewcommand{\theparagraph}{\arabic{paragraph}}
  9. \renewcommand{\p@paragraph}{\thesubsection.\thesubsubsection.}
  10. \renewcommand{\@seccntformat}[1]{%
  11.   \csname the#1\endcsname
  12.   \ifnum\pdfstrcmp{#1}{subsubsection}=0 .\fi% If this is a subsubsection, add a period
  13.   \ifnum\pdfstrcmp{#1}{paragraph}=0 .\fi% If this is a paragraph, add a period
  14.   \quad}
  15. \makeatother
  16.  
  17. \usepackage[nameinlink]{cleveref}
  18.  
  19. \crefformat{paragraph}{#2#1#3}
  20.  
  21. \begin{document}
  22.  
  23. \tableofcontents
  24.  
  25. \section{My Section}
  26.  
  27. \subsection{My subsection}
  28.  
  29. \subsubsection{My subsubsection}\label{sssec:mysubsubsection}
  30.  
  31. My section ref is: \Cref{sssec:mysubsubsection}.
  32.  
  33. \paragraph{My paragraph}\label{par:myparagraph}
  34.  
  35. My paragraph ref is: \Cref{par:myparagraph}.
  36.  
  37. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement