# In LyX, how to get inline custom numbering?

I'am preparing manuscript for my students and i would like to add some numerated homework tasks.

For example:

1 section...
2 section...
2.1 subsection...
2.2 subsection...
2.2.1 subsubsection...
2.2.2 homework 1...
2.2.3 homework 2...
3 section...

In other word, I would prefer LyX to take care of those homework counting (1, 2, etc.).

Thanks, Predrag

## 1 Answer

How this can be done in LyX I don't know. However the code would be something like

\documentclass{article}

\newcounter{homework}
\newcommand{\homework}{\stepcounter{homework}\subsubsection{Homework \thehomework}}

\begin{document}

\section{Section}

\section{Section}

\subsection{Subsection}

\subsection{Subsection}

\subsubsection{Subsubsection}

\homework

\homework

\end{document}


• commands \newcounter{homework}, \stepcounter{homework} and \thehomework{} were something that i was looking for. Thanks a lot! – Predrag_M Oct 18 '18 at 13:32