\documentclass[10pt,a4paper]{article}

% Packages
\usepackage{fancyhdr}           % For header and footer
\usepackage{multicol}           % Allows multicols in tables
\usepackage{tabularx}           % Intelligent column widths
\usepackage{tabulary}           % Used in header and footer
\usepackage{hhline}             % Border under tables
\usepackage{graphicx}           % For images
\usepackage{xcolor}             % For hex colours
%\usepackage[utf8x]{inputenc}    % For unicode character support
\usepackage[T1]{fontenc}        % Without this we get weird character replacements
\usepackage{colortbl}           % For coloured tables
\usepackage{setspace}           % For line height
\usepackage{lastpage}           % Needed for total page number
\usepackage{seqsplit}           % Splits long words.
%\usepackage{opensans}          % Can't make this work so far. Shame. Would be lovely.
\usepackage[normalem]{ulem}     % For underlining links
% Most of the following are not required for the majority
% of cheat sheets but are needed for some symbol support.
\usepackage{amsmath}            % Symbols
\usepackage{MnSymbol}           % Symbols
\usepackage{wasysym}            % Symbols
%\usepackage[english,german,french,spanish,italian]{babel}              % Languages

% Document Info
\author{Chromodyne}
\pdfinfo{
  /Title (xmapedit.pdf)
  /Creator (Cheatography)
  /Author (Chromodyne)
  /Subject (XMapEdit Cheat Sheet)
}

% Lengths and widths
\addtolength{\textwidth}{6cm}
\addtolength{\textheight}{-1cm}
\addtolength{\hoffset}{-3cm}
\addtolength{\voffset}{-2cm}
\setlength{\tabcolsep}{0.2cm} % Space between columns
\setlength{\headsep}{-12pt} % Reduce space between header and content
\setlength{\headheight}{85pt} % If less, LaTeX automatically increases it
\renewcommand{\footrulewidth}{0pt} % Remove footer line
\renewcommand{\headrulewidth}{0pt} % Remove header line
\renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit
% This two commands together give roughly
% the right line height in the tables
\renewcommand{\arraystretch}{1.3}
\onehalfspacing

% Commands
\newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour
\newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols
\newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns
\newcommand{\tn}{\tabularnewline} % Required as custom column type in use

% Font and Colours
\definecolor{HeadBackground}{HTML}{333333}
\definecolor{FootBackground}{HTML}{666666}
\definecolor{TextColor}{HTML}{333333}
\definecolor{DarkBackground}{HTML}{530DA3}
\definecolor{LightBackground}{HTML}{F4EFF9}
\renewcommand{\familydefault}{\sfdefault}
\color{TextColor}

% Header and Footer
\pagestyle{fancy}
\fancyhead{} % Set header to blank
\fancyfoot{} % Set footer to blank
\fancyhead[L]{
\noindent
\begin{multicols}{3}
\begin{tabulary}{5.8cm}{C}
    \SetRowColor{DarkBackground}
    \vspace{-7pt}
    {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent
        \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}}
    }
\end{tabulary}
\columnbreak
\begin{tabulary}{11cm}{L}
    \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{XMapEdit Cheat Sheet}}}} \\
    \normalsize{by \textcolor{DarkBackground}{Chromodyne} via \textcolor{DarkBackground}{\uline{cheatography.com/200022/cs/42256/}}}
\end{tabulary}
\end{multicols}}

\fancyfoot[L]{ \footnotesize
\noindent
\begin{multicols}{3}
\begin{tabulary}{5.8cm}{LL}
  \SetRowColor{FootBackground}
  \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}}  \\
  \vspace{-2pt}Chromodyne \\
  \uline{cheatography.com/chromodyne} \\
  \end{tabulary}
\vfill
\columnbreak
\begin{tabulary}{5.8cm}{L}
  \SetRowColor{FootBackground}
  \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}}  \\
   \vspace{-2pt}Not Yet Published.\\
   Updated 2nd February, 2024.\\
   Page {\thepage} of \pageref{LastPage}.
\end{tabulary}
\vfill
\columnbreak
\begin{tabulary}{5.8cm}{L}
  \SetRowColor{FootBackground}
  \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}}  \\
  \SetRowColor{white}
  \vspace{-5pt}
  %\includegraphics[width=48px,height=48px]{dave.jpeg}
  Measure your website readability!\\
  www.readability-score.com
\end{tabulary}
\end{multicols}}




\begin{document}
\raggedright
\raggedcolumns

% Set font size to small. Switch to any value
% from this page to resize cheat sheet text:
% www.emerson.emory.edu/services/latex/latex_169.html
\footnotesize % Small font.

\begin{multicols*}{3}

\begin{tabularx}{5.377cm}{X}
\SetRowColor{DarkBackground}
\mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{All Modes}}  \tn
% Row 0
\SetRowColor{LightBackground}
\mymulticolumn{1}{x{5.377cm}}{} \tn 
% Row Count 0 (+ 0)
\hhline{>{\arrayrulecolor{DarkBackground}}-}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{General}}  \tn
% Row 0
\SetRowColor{LightBackground}
ESC & Open XMapEdit menu. \tn 
% Row Count 1 (+ 1)
% Row 1
\SetRowColor{white}
\textasciitilde{} & Enable command panel. \tn 
% Row Count 2 (+ 1)
% Row 2
\SetRowColor{LightBackground}
Numpad Enter & Swap between 2D \& 3D mode. \tn 
% Row Count 4 (+ 2)
% Row 3
\SetRowColor{white}
F12 & Toggle speaker beeps. \tn 
% Row Count 5 (+ 1)
% Row 4
\SetRowColor{LightBackground}
Ctrl + Home & Search for sprites, sectors, or walls. \tn 
% Row Count 7 (+ 2)
% Row 5
\SetRowColor{white}
Ctrl + B & Toggle camera blocking. \tn 
% Row Count 8 (+ 1)
% Row 6
\SetRowColor{LightBackground}
Alt + CapsLock & Toggle clipping mode. \tn 
% Row Count 10 (+ 2)
% Row 7
\SetRowColor{white}
Alt + F11 & Cycle between HUD types. \tn 
% Row Count 11 (+ 1)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.29402 cm} x{3.68298 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Movement}}  \tn
% Row 0
\SetRowColor{LightBackground}
Arrow Keys & Moves camera. Hold SHIFT to increase rate. \tn 
% Row Count 2 (+ 2)
% Row 1
\SetRowColor{white}
RMB & Move camera in 2D mode. \tn 
% Row Count 3 (+ 1)
% Row 2
\SetRowColor{LightBackground}
Scroll Lock & Snap player start to current camera position. \tn 
% Row Count 5 (+ 2)
% Row 3
\SetRowColor{white}
Alt + CapsLock & Toggle clipping mode. \tn 
% Row Count 7 (+ 2)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.14471 cm} x{3.83229 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Sectors}}  \tn
% Row 0
\SetRowColor{LightBackground}
J & Join a child sector. Creates child sector. \tn 
% Row Count 2 (+ 2)
% Row 1
\SetRowColor{white}
Shift + J & Join selected child sector. \tn 
% Row Count 3 (+ 1)
% Row 2
\SetRowColor{LightBackground}
R-Ctrl + Del & Deletes a parent sector OR turns a child sector into a parent. \tn 
% Row Count 6 (+ 3)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.4931 cm} x{3.4839 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Walls}}  \tn
% Row 0
\SetRowColor{LightBackground}
B & Toggle blocking flag. \tn 
% Row Count 1 (+ 1)
% Row 1
\SetRowColor{white}
Shft + B & Toggle one-sided blocking. \tn 
% Row Count 2 (+ 1)
% Row 2
\SetRowColor{LightBackground}
H & Toggle hitscan flag. \tn 
% Row Count 3 (+ 1)
% Row 3
\SetRowColor{white}
1 & Toggle mask \tn 
% Row Count 4 (+ 1)
% Row 4
\SetRowColor{LightBackground}
M & Toggle mask \tn 
% Row Count 5 (+ 1)
% Row 5
\SetRowColor{white}
R-Shift + M & Toggle one-sided mask. \tn 
% Row Count 6 (+ 1)
% Row 6
\SetRowColor{LightBackground}
K & Marks a wall for movement. \tn 
% Row Count 7 (+ 1)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.64241 cm} x{3.33459 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Sprites}}  \tn
% Row 0
\SetRowColor{LightBackground}
S & Insert a sprite. \tn 
% Row Count 1 (+ 1)
% Row 1
\SetRowColor{white}
Shift + S & Open "special sprites" menu. \tn 
% Row Count 3 (+ 2)
% Row 2
\SetRowColor{LightBackground}
B & Toggle block flag. \tn 
% Row Count 4 (+ 1)
% Row 3
\SetRowColor{white}
H & Toggle hitscan flag. \tn 
% Row Count 5 (+ 1)
% Row 4
\SetRowColor{LightBackground}
I & Toggle invisibility flag. \tn 
% Row Count 6 (+ 1)
% Row 5
\SetRowColor{white}
Ctrl + I & Toggles hiding of invisible sprites in edtior. \tn 
% Row Count 8 (+ 2)
% Row 6
\SetRowColor{LightBackground}
K & Marks a sprite for movement. \tn 
% Row Count 10 (+ 2)
% Row 7
\SetRowColor{white}
E & Changes sprite status. \tn 
% Row Count 11 (+ 1)
% Row 8
\SetRowColor{LightBackground}
Ctrl + O & Push sprite to nearests wall. \tn 
% Row Count 13 (+ 2)
% Row 9
\SetRowColor{white}
R & Make a sprite wall or floor/ceiling sprite. \tn 
% Row Count 15 (+ 2)
% Row 10
\SetRowColor{LightBackground}
1 & Toggle one-sided flag. \tn 
% Row Count 16 (+ 1)
% Row 11
\SetRowColor{white}
Del & Delete sprite. \tn 
% Row Count 17 (+ 1)
% Row 12
\SetRowColor{LightBackground}
, OR . & Set sprite orientation and angle simulatenously. Hold SHIFT to increase precision. \tn 
% Row Count 21 (+ 4)
% Row 13
\SetRowColor{white}
; OR ' & Rotates selected sprites 45 degrees. \tn 
% Row Count 23 (+ 2)
% Row 14
\SetRowColor{LightBackground}
Ctrl + ; OR Ctrl + ' & Rotates selected sprites 22.5 degrees. \tn 
% Row Count 25 (+ 2)
% Row 15
\SetRowColor{white}
Alt + D & Change clipping distance. \tn 
% Row Count 26 (+ 1)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{X}
\SetRowColor{DarkBackground}
\mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{2D Mode Only}}  \tn
% Row 0
\SetRowColor{LightBackground}
\mymulticolumn{1}{x{5.377cm}}{} \tn 
% Row Count 0 (+ 0)
\hhline{>{\arrayrulecolor{DarkBackground}}-}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{X}
\SetRowColor{DarkBackground}
\mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{3D Mode Only}}  \tn
% Row 0
\SetRowColor{LightBackground}
\mymulticolumn{1}{x{5.377cm}}{} \tn 
% Row Count 0 (+ 0)
\hhline{>{\arrayrulecolor{DarkBackground}}-}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.29402 cm} x{3.68298 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{General}}  \tn
% Row 0
\SetRowColor{LightBackground}
Ctrl + T & Toggle sprite captions. \tn 
% Row Count 1 (+ 1)
% Row 1
\SetRowColor{white}
Alt + W & Insert a comment. \tn 
% Row Count 2 (+ 1)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.24425 cm} x{3.73275 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Selection}}  \tn
% Row 0
\SetRowColor{LightBackground}
R-Shift + LMB & Box select groups of sprites or veritices by dragging with LMB. Press R-Shift again to deselect. \tn 
% Row Count 4 (+ 4)
% Row 1
\SetRowColor{white}
L-Alt + MMB & Select an individual sprite. ESC to deselect sprites from group. \tn 
% Row Count 7 (+ 3)
% Row 2
\SetRowColor{LightBackground}
R-Alt & Select a group of sectors. Press again to deselect. \tn 
% Row Count 9 (+ 2)
% Row 3
\SetRowColor{white}
Shift + MMB & Select an individual sector. \tn 
% Row Count 11 (+ 2)
% Row 4
\SetRowColor{LightBackground}
. / , & Rotate sector by 45 degrees. \tn 
% Row Count 12 (+ 1)
% Row 5
\SetRowColor{white}
Shift + . / ' & Rotate sector by 22.5 degrees. \tn 
% Row Count 14 (+ 2)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.44333 cm} x{3.53367 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Sprites}}  \tn
% Row 0
\SetRowColor{LightBackground}
LMB (Hold) & Move sprite. \tn 
% Row Count 1 (+ 1)
% Row 1
\SetRowColor{white}
Alt + H & Hi-tag. \tn 
% Row Count 2 (+ 1)
% Row 2
\SetRowColor{LightBackground}
Alt + T & Lo-tag. \tn 
% Row Count 3 (+ 1)
% Row 3
\SetRowColor{white}
Ctrl + Num +/- & Change yellow SFX radius by 20. \tn 
% Row Count 5 (+ 2)
% Row 4
\SetRowColor{LightBackground}
Alt + Num +/- & Change brown SFX radius by 20. \tn 
% Row Count 7 (+ 2)
% Row 5
\SetRowColor{white}
Alt + MWheel & Cycle through overlapping sprites. \tn 
% Row Count 9 (+ 2)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.24425 cm} x{3.73275 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Grid}}  \tn
% Row 0
\SetRowColor{LightBackground}
A & Zoom-in grid. \tn 
% Row Count 1 (+ 1)
% Row 1
\SetRowColor{white}
Z & Zoom-out grid. \tn 
% Row Count 2 (+ 1)
% Row 2
\SetRowColor{LightBackground}
MWheel & Zoom in and out. \tn 
% Row Count 3 (+ 1)
% Row 3
\SetRowColor{white}
G & Change grid size. \tn 
% Row Count 4 (+ 1)
% Row 4
\SetRowColor{LightBackground}
Shift + G & Access extra grid sizes. \tn 
% Row Count 5 (+ 1)
% Row 5
\SetRowColor{white}
Alt + G & Toggle grid. \tn 
% Row Count 6 (+ 1)
% Row 6
\SetRowColor{LightBackground}
Ctrl + G & Toggle auto-grid. \tn 
% Row Count 7 (+ 1)
% Row 7
\SetRowColor{white}
L & Toggle snap-to-grid. \tn 
% Row Count 8 (+ 1)
% Row 8
\SetRowColor{LightBackground}
F11 & Toggle texture map preview. \tn 
% Row Count 9 (+ 1)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{0.89586 cm} x{4.08114 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Editing}}  \tn
% Row 0
\SetRowColor{LightBackground}
F7 & Traces a sector's outgoing trigger. \tn 
% Row Count 2 (+ 2)
% Row 1
\SetRowColor{white}
F8 & Traces a wall's/sprite's outgoing trigger. \tn 
% Row Count 4 (+ 2)
% Row 2
\SetRowColor{LightBackground}
Alt + F7 & Traces a sector's incoming trigger. \tn 
% Row Count 6 (+ 2)
% Row 3
\SetRowColor{white}
Alt + F8 & Traces a wall's/sprite's incoming trigger. \tn 
% Row Count 8 (+ 2)
% Row 4
\SetRowColor{LightBackground}
Q & Connect 2 XObjects by using RX/TX values. \tn 
% Row Count 10 (+ 2)
% Row 5
\SetRowColor{white}
Shift + Q & Uses a RX/TX value from an XObject and connects it to another XObject wihtout RX/TX values. \tn 
% Row Count 13 (+ 3)
% Row 6
\SetRowColor{LightBackground}
F10 & Assigns new TX/RX IDs. \tn 
% Row Count 14 (+ 1)
% Row 7
\SetRowColor{white}
Ctrl + H & Hi-tag. \tn 
% Row Count 16 (+ 2)
% Row 8
\SetRowColor{LightBackground}
T & Lo-tag. \tn 
% Row Count 17 (+ 1)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{0.89586 cm} x{4.08114 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Sectors}}  \tn
% Row 0
\SetRowColor{LightBackground}
\seqsplit{Spacebar} & Enter sector draw mode. \tn 
% Row Count 2 (+ 2)
% Row 1
\SetRowColor{white}
\seqsplit{Backspace} & While drawing a sector, removes the last vertex inserted. \tn 
% Row Count 4 (+ 2)
% Row 2
\SetRowColor{LightBackground}
Alt + S & Creates a child sector. \tn 
% Row Count 5 (+ 1)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}

\begin{tabularx}{5.377cm}{x{1.89126 cm} x{3.08574 cm} }
\SetRowColor{DarkBackground}
\mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Walls}}  \tn
% Row 0
\SetRowColor{LightBackground}
C & Curve tool. \tn 
% Row Count 1 (+ 1)
% Row 1
\SetRowColor{white}
NumPad + / - {[}Curve Tool{]} & Increase number of vertices when using curve tool.. \tn 
% Row Count 4 (+ 3)
% Row 2
\SetRowColor{LightBackground}
\mymulticolumn{2}{x{5.377cm}}{Enter {[}Curve Tool{]}} \tn 
% Row Count 5 (+ 1)
% Row 3
\SetRowColor{white}
Insert & Insert a vertex. \tn 
% Row Count 6 (+ 1)
% Row 4
\SetRowColor{LightBackground}
F & Set first wall to change sector slope orientation. \tn 
% Row Count 9 (+ 3)
% Row 5
\SetRowColor{white}
X & Override sector auto-alignment. \tn 
% Row Count 11 (+ 2)
% Row 6
\SetRowColor{LightBackground}
L-Alt + X & Disable sector auto-alignment for selected walls. \tn 
% Row Count 14 (+ 3)
% Row 7
\SetRowColor{white}
Alt + T & Lo-tag. \tn 
% Row Count 15 (+ 1)
% Row 8
\SetRowColor{LightBackground}
Ctrl + H & Hi-tag. \tn 
% Row Count 16 (+ 1)
\hhline{>{\arrayrulecolor{DarkBackground}}--}
\end{tabularx}
\par\addvspace{1.3em}


% That's all folks
\end{multicols*}

\end{document}