\documentclass[DIV13]{scrartcl} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage[default,scale=0.95]{opensans} \usepackage[scaled=0.85]{beramono} \usepackage{listings,minted} \usepackage{grid-system} \usepackage{tabularx} \usepackage{booktabs} \usepackage{grid-system} \usepackage{xcolor} \definecolor{linkcolor}{rgb}{0, 0, 0.93} \usepackage[ hidelinks, colorlinks=true, urlcolor=linkcolor ]{hyperref} \setlength{\parindent}{0cm} \lstset{language=[LaTeX]tex,xleftmargin=2em} \title{Grid System} \author{Marcus Bitzl\\ \url{marcus@bitzl.com}} \renewcommand{\emph}[1]{\textcolor{red!65!black}{#1}} \begin{document} \maketitle \begin{abstract} 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. \end{abstract} \section{Usage} \subsection{Overview} %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. \medskip \subsection{Default use:} \minisec{Example:} \begin{minted}{latex} \begin{Row}% \begin{Cell}{2} This is a long row spanning two thirds of the text width. \end{Cell} \begin{Cell}{1} This is a long row spanning one third of the text width. \end{Cell} \end{Row} \end{minted} \minisec{Output:} \begin{Row}% \begin{Cell}{2} This is a long row spanning two thirds of the text width. This one cannot have footnotes. \end{Cell} \begin{Cell}{1} This is a long row spanning one third of the text width. \end{Cell} \end{Row} \clearpage \subsection{The (old) fallback} 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. \begin{lstlisting} \begin{row}{}% \begin{cell}{} ... \end{cell} \begin{cell}{} ... \end{cell} \end{row} \end{lstlisting} \minisec{Example:} \begin{lstlisting} \begin{row}{3}{2}% \begin{cell}{2} ... \end{cell} \begin{cell}{1} ... \end{cell} \end{row} \end{lstlisting} \minisec{Output:} \begin{row}{3}{2}% \begin{cell}{2} This is a long row spanning two thirds of the text width\footnote{Yes, really!}, telling your nothing\footnote{But it has footnotes, yeah!}. \end{cell} \begin{cell}{1} This is a long row spanning one third of the text width. \end{cell} \end{row} \bigskip Each cell is created using a \texttt{minipage} environment. In future versions the will be a switch to choose either minipages or parboxes. \section{Parameters} There is one optional parameter for the environment \texttt{row} right now: \medskip \begin{tabularx}{\linewidth}{llX}\toprule \textbf{Parameter} & \textbf{Default} & \textbf{Description},\\ \midrule cellsep & 1.75em & horizonal space between two cells.\\\bottomrule \end{tabularx} \section{Contribute} You want to contribute? Just fork me on Github, start discussions and send me you pull requests: \begin{center} \href{https://github.com/bitzl/latex-grid-system}{\tt bitzl/latex-grid-system} \end{center} \section{License} Copyright 2013 Marcus Bitzl \medskip Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at \medskip \hspace*{1.2em}\href{http://www.apache.org/licenses/LICENSE-2.0}{\texttt{http://www.apache.org/licenses/LICENSE-2.0}} \medskip Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. \section{Example} \begin{row}[cellsep=0.75cm]{3}{3} \begin{cell}{1} \section*{Overview} \vspace{-1.5ex} This shows what you can do with the \texttt{grid-system} package and three columns. \end{cell} \begin{cell}{1} \section*{Why use it?} \vspace{-1.5ex} 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. \end{cell} \begin{cell}{1} \section*{Contribute} \vspace{-1.5ex} You want to contribute? Just fork me on Github, start discussions and send me you pull requests: \begin{center} \href{https://github.com/bitzl/latex-grid-system}{\tt bitzl/latex-grid-system} \end{center} \end{cell} \end{row} \bigskip \begin{row}[cellsep=0.75cm]{3}{2} \begin{cell}{2} \section*{License} \vspace{-1.5ex} Copyright 2013 Marcus Bitzl \medskip Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at \medskip \hspace*{1.2em}\href{http://www.apache.org/licenses/LICENSE-2.0}{\texttt{http://www.apache.org/licenses/LICENSE-2.0}} \medskip Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. \end{cell}% \begin{cell}{1} \section*{Why use it?} \vspace{-1.5ex} 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. \end{cell} \end{row} \bigskip \begin{row}[cellsep=0.75cm]{3}{2} \begin{cell}{1} \section*{Short} \vspace{-1.5ex} This shows the capabilities of grid-system with three equal columns. \end{cell} \begin{cell}{2} \section*{Long} \vspace{-1.5ex} 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. \end{cell} \end{row} \end{document}