I'm trying to create a new command or environment or something to format what is essentially a section, but it needs to have it's own counter. I would like to not use any of the \section \subsection etc. as I go into the full depth that they provide.
The idea being I would type in something similar to...
\session{Hello World}
... and it would output something like (although centred) ...
Session 1 : Hello World
The command I've currently got is as follows:
\newcounter{sessioncounter}
\newcommand{\session}
{
\begin{center}
\begin{emph}
\begin{textbf}
\begin{Large}
Session \value{sessioncounter}\stepcounter{sessioncounter}:
}{
\end{Large}
\end{textbf}
\end{emph}
\end{center}
}
Trying this exactly, the Latex compiler throws the following error (note, this is before \begin{document} has even been called).
LaTeX Error: \begin{document} ended by \end{Large}
I've also tried creating a new environment by literally swapping out \newcommand{\session} to \newenvironment{session}. While this compiles, I get the following error on the line of \begin{session}.
Missing \endcsname inserted.
<to be read again>
\aftergroup
l.13 \begin{session}
Can anyone see where I'm going wrong? I presume by the error that newcommand can't be used exactly with this syntax for what I want; however, I'm also confused as to why the environment does not work either.
\newcommand
would define a command\session
you are defining an environment so\newenvironment{session}
(and unrelated but you want%
at the end of all the lines in the definition).