I created/copied this piece of latex preamble code:
\makeatletter
\def\@lesson{}
\def\@lessonabbr{}
\newcommand{\lesson}[4]{
\ifthenelse{\isempty{#3}}{
\def\@lessonabbr{Les #1}
\def\@lesson{Lesson #1}
\def\@fullLesson{\hfill \small{#2}\hr \@lesson \hfill \small{#4} \\}
\subsection[\@lessonabbr]{\@fullLesson}
\label{\@lesson}
}{
\def\@lessonabbr{Les #1: #3}
\def\@lesson{Lesson #1: #3}
\def\@fullLesson{\hfill \small{#2}\hr \@lesson \hfill \small{#4} \\}
\subsection[\@lessonabbr]{\@fullLesson}
\label{\@lesson}
}
}
\makeatother
\lesson{1}{Mar 18 2022 Fri (16:40:24)}{Write an inequality from Graph}{Unit 2}
How would I make it automatically create a label for me by replacing the spaces with _ and making it all lowercased? I want to use the title of the lesson along with the lesson number. For this case, the label would look like this: les1:write_an_inequality_from_graph_unit_2
Any help will be greatly appreciated!
\label
. The point of\label
/\ref
is that they use an internal idenifier so you can edit the document, re-order sections, change titles, ... but the\ref
to the item still works.\small
does not take an argument so\small{#2}
is the same as\small #2
and makes all the following text small, not just#2