\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{bilus} \pdfinfo{ /Title (clj-refactor.pdf) /Creator (Cheatography) /Author (bilus) /Subject (clj-refactor 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}{1D2370} \definecolor{LightBackground}{HTML}{F7F8FA} \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{clj-refactor Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{bilus} via \textcolor{DarkBackground}{\uline{cheatography.com/23535/cs/5250/}}} \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}bilus \\ \uline{cheatography.com/bilus} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 23rd September, 2015.\\ Updated 12th May, 2016.\\ 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*}{2} \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Namespaces}} \tn % Row 0 \SetRowColor{LightBackground} ai & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-import-to-ns"\}\}add import\{\{/link\}\} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} am & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-missing-libspec"\}\}add a missing libspec\{\{/link\}\} \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} ar & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-require-to-ns"\}\}add require\{\{/link\}\} \tn % Row Count 10 (+ 3) % Row 3 \SetRowColor{white} au & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-use-to-ns"\}\}add use\{\{/link\}\} \tn % Row Count 13 (+ 3) % Row 4 \SetRowColor{LightBackground} cn & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-clean-ns"\}\}clean namespace\{\{/link\}\} \tn % Row Count 16 (+ 3) % Row 5 \SetRowColor{white} mf & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-move-form"\}\}move forms to another namespace\{\{/link\}\} \tn % Row Count 20 (+ 4) % Row 6 \SetRowColor{LightBackground} rr & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-remove-unused-requires"\}\}remove unused requires\{\{/link\}\} \tn % Row Count 24 (+ 4) % Row 7 \SetRowColor{white} ru & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-remove-use"\}\}convert :use's to :require's\{\{/link\}\} \tn % Row Count 28 (+ 4) % Row 8 \SetRowColor{LightBackground} sn & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-sort-ns"\}\}sort ns form\{\{/link\}\} \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Namespaces (cont)}} \tn % Row 9 \SetRowColor{LightBackground} sr & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-stop-referring"\}\}stop referring\{\{/link\}\} \tn % Row Count 3 (+ 3) % Row 10 \SetRowColor{white} rd & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-remove-debug-fns"\}\}remove (debug) function invocations\{\{/link\}\} \tn % Row Count 7 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Hydra menus}} \tn % Row 0 \SetRowColor{LightBackground} hh & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/hydra-parent"\}\}parent menu\{\{/link\}\} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} hn & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/hydra-ns"\}\}namespace refactorings\{\{/link\}\} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} hc & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/hydra-code"\}\}code refactorings\{\{/link\}\} \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} hp & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/hydra-project"\}\}project refactorings\{\{/link\}\} \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} ht & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/hydra-top-level"\}\}top-level form refactorings\{\{/link\}\} \tn % Row Count 16 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Project}} \tn % Row 0 \SetRowColor{LightBackground} ap & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-declaration"\}\}add and hotload dependency\{\{/link\}\} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} hd & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-hotload-dependency"\}\}hotload dependency\{\{/link\}\} \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} pc & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-project-clean"\}\}run project clean functions\{\{/link\}\} \tn % Row Count 12 (+ 4) % Row 3 \SetRowColor{white} rf & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-rename-file-or-dir"\}\}remove file or dir\{\{/link\}\} \tn % Row Count 16 (+ 4) % Row 4 \SetRowColor{LightBackground} sp & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-sort-project-dependencies"\}\}sort dependencies\{\{/link\}\} \tn % Row Count 20 (+ 4) % Row 5 \SetRowColor{white} up & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-update-project-dependencies"\}\}update dependencies\{\{/link\}\} \tn % Row Count 24 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Symbols}} \tn % Row 0 \SetRowColor{LightBackground} as & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-stubs"\}\}add stubs\{\{/link\}\} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} cc & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-cycle-coll"\}\}cycle surrounding collection type\{\{/link\}\} \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} ci & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-cycle-if"\}\}cycle between if and if-not\{\{/link\}\} \tn % Row Count 11 (+ 4) % Row 3 \SetRowColor{white} cp & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-cycle-privacy"\}\}cycle privacy defn/defn-\{\{/link\}\} \tn % Row Count 15 (+ 4) % Row 4 \SetRowColor{LightBackground} dk & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-destructure-keys"\}\}destructure keys\{\{/link\}\} \tn % Row Count 19 (+ 4) % Row 5 \SetRowColor{white} ec & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-extract-constant"\}\}extract constant\{\{/link\}\} \tn % Row Count 23 (+ 4) % Row 6 \SetRowColor{LightBackground} ed & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-extract-def"\}\}extract def\{\{/link\}\} \tn % Row Count 26 (+ 3) % Row 7 \SetRowColor{white} ef & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-extract-function"\}\}extract function\{\{/link\}\} \tn % Row Count 30 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Symbols (cont)}} \tn % Row 8 \SetRowColor{LightBackground} el & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-expand-let"\}\}expand let\{\{/link\}\} \tn % Row Count 3 (+ 3) % Row 9 \SetRowColor{white} fe & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-create-fn-from-example"\}\}create function from example stub\{\{/link\}\} \tn % Row Count 7 (+ 4) % Row 10 \SetRowColor{LightBackground} fu & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-find-usages"\}\}find usages\{\{/link\}\} \tn % Row Count 10 (+ 3) % Row 11 \SetRowColor{white} il & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-introduce-let"\}\}introduce let\{\{/link\}\} \tn % Row Count 13 (+ 3) % Row 12 \SetRowColor{LightBackground} is & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-inline-symbol"\}\}inline symbol\{\{/link\}\} \tn % Row Count 16 (+ 3) % Row 13 \SetRowColor{white} mf & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-move-form"\}\}move form(s) to another ns\{\{/link\}\} \tn % Row Count 20 (+ 4) % Row 14 \SetRowColor{LightBackground} ml & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-move-to-let"\}\}move to let\{\{/link\}\} \tn % Row Count 23 (+ 3) % Row 15 \SetRowColor{white} pf & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-promote-function"\}\}promote function literal/fn/defn\{\{/link\}\} \tn % Row Count 27 (+ 4) % Row 16 \SetRowColor{LightBackground} rl & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-remove-let"\}\}remove let\{\{/link\}\} \tn % Row Count 30 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Symbols (cont)}} \tn % Row 17 \SetRowColor{LightBackground} rs & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-rename-symbol"\}\}rename symbol\{\{/link\}\} \tn % Row Count 3 (+ 3) % Row 18 \SetRowColor{white} tf & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-thread-first-all"\}\}wrap in -\textgreater{}\{\{/link\}\} \tn % Row Count 6 (+ 3) % Row 19 \SetRowColor{LightBackground} th & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-thread"\}\}thread another expression\{\{/link\}\} \tn % Row Count 10 (+ 4) % Row 20 \SetRowColor{white} tl & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-thread-last-all"\}\}wrap in -\textgreater{}\textgreater{}\{\{/link\}\} \tn % Row Count 13 (+ 3) % Row 21 \SetRowColor{LightBackground} ua & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-unwind-all"\}\}fully unwind threaded expression\{\{/link\}\} \tn % Row Count 17 (+ 4) % Row 22 \SetRowColor{white} uw & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-unwind-thread"\}\}unwind threaded expression\{\{/link\}\} \tn % Row Count 21 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.8 cm} x{7.2 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Misc}} \tn % Row 0 \SetRowColor{LightBackground} ? & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-describe-refactoring"\}\}describe refactoring\{\{/link\}\} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} sc & \{\{link="https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-show-changelog"\}\}show clj-refactor changelog\{\{/link\}\} \tn % Row Count 8 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}