Let's say I have a document consisting mainly of ''task''-macros that are defined as following:
% bold titles
\newcommand{\mypar}[1]{{\bf #1:}}
%task decription template
\newcommand{\task}[3]{
\mypar{#1} #2 \\
\emph{Solution:} #3\\
}
Where #1 is supposed to be the title of a task, #2 its description and #3 its solution.
Is there a way to sort all such macros within the same section by their titles?
Should be a way I can also extend to other macros, e.g.
\newcommand{\code}[2]{
\subsubsection{#1}
\lstinputlisting{#2}
}
\newcommand{\npcode}[2]{
\newpage
\code{#1}{#2}
}
Where I would want to sort them by subsubsection titles.
%in your definitions) – David Carlisle Jan 25 '16 at 14:28