2015-06-23 17:09:50 +00:00
|
|
|
%%
|
|
|
|
%% A collection of useful commands
|
|
|
|
%%
|
|
|
|
|
|
|
|
%% can call commands even when they are not defined
|
|
|
|
\def\safe#1{%
|
|
|
|
\ifdefined#1%
|
|
|
|
#1%
|
|
|
|
\else%
|
|
|
|
{\color{red}\bf?}%
|
|
|
|
\fi%
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-23 17:14:51 +00:00
|
|
|
%% penalty before large blocks
|
2015-06-23 17:09:50 +00:00
|
|
|
\def\preblock{
|
2015-06-23 17:14:51 +00:00
|
|
|
\penalty-500
|
2015-06-23 17:09:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
%% listparpenalty prevents page breaks before lists
|
|
|
|
\newcount\prevparpenalty
|
|
|
|
\def\listparpenalty{
|
|
|
|
\prevparpenalty=\@beginparpenalty
|
|
|
|
\@beginparpenalty=10000
|
|
|
|
}
|
|
|
|
%% back to previous value
|
|
|
|
\def\unlistparpenalty{
|
|
|
|
\@beginparpenalty=\prevparpenalty
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
%% array spanning the entire line
|
|
|
|
\def\largearray{\begin{array}{@{}>{\displaystyle}l@{}}\hphantom{\hspace{\textwidth}}\\[-.5cm]}
|
|
|
|
\def\endlargearray{\end{array}}
|
|
|
|
|