Created
February 24, 2015 19:10
-
-
Save MarkusH/f037f44f60fc78bef98a to your computer and use it in GitHub Desktop.
Referencing custom environments with custom counters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\newcounter{mycounter} | |
\newenvironment{myenv}[2][]{ | |
\begin{adjustwidth}{30pt}{30pt}\widowpenalties 1 10000 | |
\refstepcounter{mycounter} | |
\begingroup | |
\GetTitleStringSetup{expand}% | |
\subsubsection*{Foo~\arabic{mycounter}: {#2}}% | |
\ifthenelse{\equal{#1}{}}{}{\label{foo:#1}}\vspace{-7.5pt} | |
\endgroup | |
\noindent\ignorespaces}{ | |
\end{adjustwidth}} | |
\newcommand{\myenvref}[1]{\emph{\nameref{foo:#1}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment