-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolumns.tex
More file actions
28 lines (26 loc) · 756 Bytes
/
Copy pathcolumns.tex
File metadata and controls
28 lines (26 loc) · 756 Bytes
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
\usepackage{environ}
\usepackage{multicol}
\newsavebox{\songbox}
\NewEnviron{song}{% can also have arguments
% \clearpage
% Add song title, at as argument etc.
%
% The content is \BODY
% Let's save it in normal single column mode:
\savebox{\songbox}{%
\begin{minipage}{\linewidth}%
\BODY
\end{minipage}%
}%
% To high? (Replace \textheight if required)
% \ht = hight, \dp = depth, both together is the total height
\ifnum\dimexpr\ht\songbox+\dp\songbox > \textheight
% Typeset again in two column mode:
\begin{multicols*}{2}%
\BODY
\end{multicols*}%
\else
% Size is already OK, so use the content of the saved box:
\usebox{\songbox}%
\fi
}