Ian Jauslin
summaryrefslogtreecommitdiff
blob: 66f78c245ac471d7150859773e6679f560a10d2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
%%
%% 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%
}


%% add infinitely extendable glue before large blocks (e.g. figures)
\def\preblock{
  \vfil
  \hbox{}
}

%% 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}}