Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jauslin <ian.jauslin@roma1.infn.it>2015-07-23 15:19:30 +0000
committerIan Jauslin <ian.jauslin@roma1.infn.it>2015-07-23 15:21:15 +0000
commit6e6a5d8d7d3c9fa38e105be275cfac6f6b8bf4fd (patch)
tree0633d578a2208f3109fb2095517803f77873c18b /toolbox.sty
Initial commitv0.0
Diffstat (limited to 'toolbox.sty')
-rw-r--r--toolbox.sty44
1 files changed, 44 insertions, 0 deletions
diff --git a/toolbox.sty b/toolbox.sty
new file mode 100644
index 0000000..3355557
--- /dev/null
+++ b/toolbox.sty
@@ -0,0 +1,44 @@
+%%
+%% 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%
+}
+
+
+%% larger skip
+\newskip\hugeskipamount
+ \hugeskipamount=24pt plus8pt minus8pt
+\def\hugeskip{\vskip\hugeskipamount}
+
+
+%% penalty before large blocks
+\def\preblock{
+ \penalty-500
+}
+
+%% 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
+\newlength\largearray@width
+\setlength\largearray@width\textwidth
+\addtolength\largearray@width{-10pt}
+\def\largearray{\begin{array}{@{}>{\displaystyle}l@{}}\hphantom{\hspace{\largearray@width}}\\[-.5cm]}
+\def\endlargearray{\end{array}}
+