Debian Codegraph @

texmf-dist/doc/latex/grid-system/grid-system.tex

raw
1 \documentclass[DIV13]{scrartcl}
2
3 \usepackage[T1]{fontenc}
4 \usepackage[utf8]{inputenc}
5 \usepackage[english]{babel}
6
7 \usepackage[default,scale=0.95]{opensans}
8 \usepackage[scaled=0.85]{beramono}
9
10 \usepackage{listings,minted}
11 \usepackage{grid-system}
12 \usepackage{tabularx}
13 \usepackage{booktabs}
14 \usepackage{grid-system}
15
16 \usepackage{xcolor}
17 \definecolor{linkcolor}{rgb}{0, 0, 0.93}
18
19 \usepackage[
20 hidelinks,
21 colorlinks=true,
22 urlcolor=linkcolor
23 ]{hyperref}
24
25
26 \setlength{\parindent}{0cm}
27 \lstset{language=[LaTeX]tex,xleftmargin=2em}
28
29 \title{Grid System}
30 \author{Marcus Bitzl\\ \url{[email protected]}}
31
32 \renewcommand{\emph}[1]{\textcolor{red!65!black}{#1}}
33
34 \begin{document}
35 \maketitle
36
37 \begin{abstract}
38 Grid system is a package that implements grid-like layouts for \LaTeX, as it is commonly known from CSS. You can easily divide your horizontal space into equal parts and assign these to boxes containing your content.
39 \end{abstract}
40
41 \section{Usage}
42 \subsection{Overview}
43 %There are two methods to divide your row into multiple columns. The first one with uppercase \emph{Cell} and \emph{Row} is easier to use as it collects the content of the cells and calculates everything for you. As a result, it might break on certain contents (e.g. footnotes). For such cases, the second method with lowercase \emph{row} and \emph{cell} will work. These are more capable, but need more configuration.
44
45 \medskip
46
47 \subsection{Default use:}
48 \minisec{Example:}
49 \begin{minted}{latex}
50 \begin{Row}%
51 \begin{Cell}{2}
52 This is a long row spanning two thirds of the text width.
53 \end{Cell}
54 \begin{Cell}{1}
55 This is a long row spanning one third of the text width.
56 \end{Cell}
57 \end{Row}
58 \end{minted}
59
60 \minisec{Output:}
61 \begin{Row}%
62 \begin{Cell}{2}
63 This is a long row spanning two thirds of the text width. This one cannot have footnotes.
64 \end{Cell}
65 \begin{Cell}{1}
66 This is a long row spanning one third of the text width.
67 \end{Cell}
68 \end{Row}
69
70 \clearpage
71
72 \subsection{The (old) fallback}
73 In earlier implementations, the default interface from above would not work for many content. As this has changed, this fallback will become deprecated in the next version unless someone finds an important case to keep it.
74
75 \begin{lstlisting}
76 \begin{row}{<Total number of columns}{<Number of cells>}%
77 \begin{cell}{<Number of columns to span>}
78 ...
79 \end{cell}
80 \begin{cell}{<Number of columns to span>}
81 ...
82 \end{cell}
83 \end{row}
84 \end{lstlisting}
85
86 \minisec{Example:}
87 \begin{lstlisting}
88 \begin{row}{3}{2}%
89 \begin{cell}{2}
90 ...
91 \end{cell}
92 \begin{cell}{1}
93 ...
94 \end{cell}
95 \end{row}
96 \end{lstlisting}
97
98 \minisec{Output:}
99 \begin{row}{3}{2}%
100 \begin{cell}{2}
101 This is a long row spanning two thirds of the text width\footnote{Yes, really!}, telling your nothing\footnote{But it has footnotes, yeah!}.
102 \end{cell}
103 \begin{cell}{1}
104 This is a long row spanning one third of the text width.
105 \end{cell}
106 \end{row}
107
108 \bigskip
109
110 Each cell is created using a \texttt{minipage} environment. In future versions the will be a switch to choose either minipages or parboxes.
111
112 \section{Parameters}
113 There is one optional parameter for the environment \texttt{row} right now:
114
115 \medskip
116
117 \begin{tabularx}{\linewidth}{llX}\toprule
118 \textbf{Parameter} & \textbf{Default} & \textbf{Description},\\ \midrule
119 cellsep & 1.75em & horizonal space between two cells.\\\bottomrule
120 \end{tabularx}
121
122 \section{Contribute}
123 You want to contribute? Just fork me on Github, start discussions and send me you pull requests:
124 \begin{center}
125 \href{https://github.com/bitzl/latex-grid-system}{\tt bitzl/latex-grid-system}
126 \end{center}
127
128
129
130 \section{License}
131 Copyright 2013 Marcus Bitzl
132
133 \medskip
134
135 Licensed under the Apache License, Version 2.0 (the "License");
136 you may not use this file except in compliance with the License.
137 You may obtain a copy of the License at
138
139 \medskip
140
141 \hspace*{1.2em}\href{http://www.apache.org/licenses/LICENSE-2.0}{\texttt{http://www.apache.org/licenses/LICENSE-2.0}}
142
143 \medskip
144
145 Unless required by applicable law or agreed to in writing, software
146 distributed under the License is distributed on an "AS IS" BASIS,
147 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
148 See the License for the specific language governing permissions and
149 limitations under the License.
150
151
152 \section{Example}
153 \begin{row}[cellsep=0.75cm]{3}{3}
154 \begin{cell}{1}
155 \section*{Overview}
156 \vspace{-1.5ex}
157 This shows what you can do with the \texttt{grid-system} package and three columns.
158 \end{cell}
159 \begin{cell}{1}
160 \section*{Why use it?}
161 \vspace{-1.5ex}
162 Sometimes you need to split your text in several independent columns based on equal division of the available space. This package allows you to easily do so.
163 \end{cell}
164 \begin{cell}{1}
165 \section*{Contribute}
166 \vspace{-1.5ex}
167 You want to contribute? Just fork me on Github, start discussions and send me you pull requests:
168 \begin{center}
169 \href{https://github.com/bitzl/latex-grid-system}{\tt bitzl/latex-grid-system}
170 \end{center}
171 \end{cell}
172 \end{row}
173
174 \bigskip
175
176 \begin{row}[cellsep=0.75cm]{3}{2}
177 \begin{cell}{2}
178 \section*{License}
179 \vspace{-1.5ex}
180 Copyright 2013 Marcus Bitzl
181
182 \medskip
183
184 Licensed under the Apache License, Version 2.0 (the "License");
185 you may not use this file except in compliance with the License.
186 You may obtain a copy of the License at
187
188 \medskip
189
190 \hspace*{1.2em}\href{http://www.apache.org/licenses/LICENSE-2.0}{\texttt{http://www.apache.org/licenses/LICENSE-2.0}}
191
192 \medskip
193
194 Unless required by applicable law or agreed to in writing, software
195 distributed under the License is distributed on an "AS IS" BASIS,
196 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
197 See the License for the specific language governing permissions and
198 limitations under the License.
199 \end{cell}%
200 \begin{cell}{1}
201 \section*{Why use it?}
202 \vspace{-1.5ex}
203 Sometimes you need to split your text in several independent columns based on equal division of the available space. This package allows you to easily do so.
204 \end{cell}
205 \end{row}
206
207 \bigskip
208
209 \begin{row}[cellsep=0.75cm]{3}{2}
210 \begin{cell}{1}
211 \section*{Short}
212 \vspace{-1.5ex}
213 This shows the capabilities of grid-system with three equal columns.
214 \end{cell}
215 \begin{cell}{2}
216 \section*{Long}
217 \vspace{-1.5ex}
218 Sometimes you need to split your text in several independent columns based on equal division of the available space. This package allows you to easily do so.
219 \end{cell}
220 \end{row}
221
222 \end{document}