Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jauslin <ian.jauslin@roma1.infn.it>2015-06-23 17:09:50 +0000
committerIan Jauslin <ian.jauslin@roma1.infn.it>2015-06-23 17:09:50 +0000
commit0334c43102e38fa770b58ad5830dc6f8411d9642 (patch)
tree6e0c0440e3c1e74892492c800482883c6f4e04e0 /toolbox.sty
Initial commitv0.0
Diffstat (limited to 'toolbox.sty')
-rw-r--r--toolbox.sty36
1 files changed, 36 insertions, 0 deletions
diff --git a/toolbox.sty b/toolbox.sty
new file mode 100644
index 0000000..66f78c2
--- /dev/null
+++ b/toolbox.sty
@@ -0,0 +1,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}}
+