我创建/复制了这段乳胶前言代码:
\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}
我该如何让它自动为我创建标签,方法是将空格替换为 _ 并将其全部小写?我想使用课程标题和课程编号。在这种情况下,标签将如下所示:les1:write_an_inequality_from_graph_unit_2
任何帮助将不胜感激!