0

This is a Cheat Sheet template from Overleaf’s templates.

The problem: Box 3 does not overflow properly (it should be entirely placed in column 2), and its contents continue to print towards the bottom, off-page.

(This issue is present for every such box on the bottom of every column)

(If I copy-paste Box3’s contents inside itself a few more times, then Box3 will properly overflow to column2)

Thanks for any help!

Demo: enter image description here

MWE:

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{url}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{esint}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{amsmath,amssymb}

\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\makeatletter

\newcommand*\bigcdot{\mathpalette\bigcdot@{.5}}
\newcommand*\bigcdot@[2]{\mathbin{\vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}}}
\makeatother

\title{130 Cheat Sheet}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}

\usepackage{lipsum}

\advance\topmargin-.8in
\advance\textheight3in
\advance\textwidth3in
\advance\oddsidemargin-1.5in
\advance\evensidemargin-1.5in
\parindent0pt
\parskip2pt
\newcommand{\hr}{\centerline{\rule{3.5in}{1pt}}}
%\colorbox[HTML]{e4e4e4}{\makebox[\textwidth-2\fboxsep][l]{texto}
\begin{document}

\begin{center}{\huge{\textbf{130 Final Exam Cheat Sheet}}}\\
Author name, Date
\end{center}
\begin{multicols*}{3}

\tikzstyle{mybox} = [draw=black, fill=white, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=10pt]
\tikzstyle{fancytitle} =[fill=black, text=white, font=\bfseries]


%------------ Box1 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.3\textwidth}
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    \end{minipage}
};
%------------ Box1 Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {Box 1 Title};
\end{tikzpicture}

%------------ Box2 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.3\textwidth}
    \lipsum[2-4]
    \end{minipage}
};
%------------ Box1 Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {Box 2 Title};
\end{tikzpicture}

%------------ Box3 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.3\textwidth}
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    \end{minipage}
};
%------------ Box3 Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {Box 3 Title};
\end{tikzpicture}

%------------ Box4 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.3\textwidth}
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    \end{minipage}
};
%------------ Box4 Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {Box 4 Title};
\end{tikzpicture}


\end{multicols*}
\end{document}

1 Answer 1

2

enter image description here

You loaded geometry but have not used it and instead use primitive assignments to set the layout. The typeset block specified by \textheight ends up being bigger than \paperheight which is used to set the pdf media size via \pdfpageheight increasing \paperheight produces the output shown.

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage{url}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{esint}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{amsmath,amssymb}

\usepackage{colortbl}
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage{amsmath,amssymb}
\usepackage{enumitem}
\makeatletter

\newcommand*\bigcdot{\mathpalette\bigcdot@{.5}}
\newcommand*\bigcdot@[2]{\mathbin{\vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}}}
\makeatother

\title{130 Cheat Sheet}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}

\usepackage{lipsum}

\advance\topmargin-.8in
\advance\textheight3in
\advance\paperheight1.5in

\advance\textwidth3in
\advance\oddsidemargin-1.5in
\advance\evensidemargin-1.5in
\parindent0pt
\parskip2pt 
\newcommand{\hr}{\centerline{\rule{3.5in}{1pt}}}
%\colorbox[HTML]{e4e4e4}{\makebox[\textwidth-2\fboxsep][l]{texto}
\begin{document}

\begin{center}{\huge{\textbf{130 Final Exam Cheat Sheet}}}\\
Author name, Date
\end{center}
\begin{multicols*}{3}

\tikzstyle{mybox} = [draw=black, fill=white, very thick,
    rectangle, rounded corners, inner sep=10pt, inner ysep=10pt]
\tikzstyle{fancytitle} =[fill=black, text=white, font=\bfseries]


%------------ Box1 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.3\textwidth}
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    \end{minipage}
};
%------------ Box1 Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {Box 1 Title};
\end{tikzpicture}

%------------ Box2 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.3\textwidth}
    \lipsum[2-4]
    \end{minipage}
};
%------------ Box1 Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {Box 2 Title};
\end{tikzpicture}

%------------ Box3 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.3\textwidth}
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    \end{minipage}
};
%------------ Box3 Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {Box 3 Title};
\end{tikzpicture}

%------------ Box4 ---------------
\begin{tikzpicture}
\node [mybox] (box){%
    \begin{minipage}{0.3\textwidth}
    $\frac{dT}{dt} = -k(T-T_o)$ \\
    $ T_o =$ outside temperature
    \end{minipage}
};
%------------ Box4 Header ---------------------
\node[fancytitle, right=10pt] at (box.north west) {Box 4 Title};
\end{tikzpicture}


\end{multicols*}
\end{document}
1
  • 1
    Ah, perfect. Thank you so much, and for the kind explanation. This solves it perfectly :)
    – puf
    Jun 28, 2022 at 1:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .