0

I'm using \section in one of my documents. However, I would like my sections to be numbered in the following way: "Step 1: -----", "Step 2: -----", etc. Is there a simple way to do this with the section command, while still having the steps automatically renumber themselves (i.e. so I can refer to the section numbers with \ref)?

1
  • 1
    Shall the reference to a section show Step 1 as well? What about the entry in the toc? What is ----- supposed to be? Commented Mar 31, 2018 at 17:49

2 Answers 2

2

A version which changes the \thesection command to include Step. As a result, it should be replaced everywhere. If you don't want that you'll have to change \thesubsection to not include Step. Also it would lead to problems if you use a ToC, as the width of Step 1: would be too wide.

\documentclass[]{article}
\usepackage{duckuments}
\renewcommand*\thesection{Step \arabic{section}:}
\renewcommand*\thesubsection{\arabic{section}.\arabic{subsection}}

\begin{document}
\duckument
\end{document}

enter image description here

1

A version with changing the section header and using cleveref to change the reference format to Step ... etc.

enter image description here

\documentclass{article}

\usepackage{cleveref}

\crefname{section}{step}{steps}
\Crefname{section}{Step}{Steps}

\newcommand{\sectionheadingformat}{%
  Step \thesection: -----\quad% 
}

\makeatletter
\let\latex@@seccntformat\@seccntformat
\renewcommand{\@seccntformat}[1]{%
  \ifnum0=\pdfstrcmp{#1}{section}%
  \sectionheadingformat%
  \else
  \latex@@seccntformat{#1}%
  \fi
}


\makeatother


\begin{document}
\tableofcontents

 Please see \Cref{foo:sec} or \Cref{other:sec}.

\section{Section} \label{foo:sec}
\subsection{Subsection}
\subsubsection{SubSubsection} 

\section{Other section} \label{other:sec}

\end{document}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.