Last active
December 25, 2015 05:59
-
-
Save sycobuny/6929118 to your computer and use it in GitHub Desktop.
Trying to figure out how to apply a nesting of \newenvironment in a manner reminiscent of OO inheritance (at least, that's the way it stacks in my brain)
This file contains hidden or 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
\newenvironment{someSection}{% | |
% some \newcommands go here | |
\header{Some Section}% | |
\addvspace{\vpad}% | |
\begin{adjustwidth}{\extraMargin}{\extraMargin}% | |
}{% | |
\end{adjustwidth}% | |
\addvspace{\vpad}% | |
} | |
\newenvironment{someOtherSection}{% | |
% some different \newcommands go here | |
\header{Some Other Section}% | |
\addvspace{\vpad}% | |
\begin{adjustwidth}{\extraMargin}{\extraMargin}% | |
}{% | |
\end{adjustwidth}% | |
\addvspace{\vpad}% | |
} | |
% having noticed that my \addvspace and adjustwidth environments were repeated, | |
% I decided to make the following environment, but I can't figure out how to | |
% apply it. | |
\newenvironment{thinpara}{% | |
\addvspace{\vpad}% | |
\begin{adjustwidth}{\extraMargin}{\extraMargin}% | |
}{% | |
\end{adjustwidth}% | |
\addvspace{\vpad}% | |
} | |
% it almost seems like macros that individually expand to \begin and \end | |
% would be easier/more possible in general: | |
\newcommand{\thinStart}{% | |
\addvspace{\vpad}% | |
\begin{adjustwidth}{\extraMargin}{\extraMargin}% | |
} | |
\newcommand{\thinEnd}{% | |
\end{adjustwidth}% | |
\addvspace{\vpad}% | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment