Skip to content

Instantly share code, notes, and snippets.

@langheran
Created August 16, 2019 18:53
Show Gist options
  • Save langheran/e8faee1cf50f11e06caaab76ef7cb9d8 to your computer and use it in GitHub Desktop.
Save langheran/e8faee1cf50f11e06caaab76ef7cb9d8 to your computer and use it in GitHub Desktop.
Condensed documents or books.
% !TEX spellcheck = en-US
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
\documentclass[a4paper, 12pt]{llncs}
\let\llncssubparagraph\subparagraph
\let\subparagraph\paragraph
\usepackage[compact]{titlesec}
\let\subparagraph\llncssubparagraph
\usepackage{geometry}
\geometry{left=2.5cm,right=2.5cm,top=1.5cm,bottom=1.5cm,headheight=15pt}
\setcounter{secnumdepth}{5}
\titleformat{\subsubsection}{\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}
\usepackage{titlesec}
\titlelabel{\thetitle.\quad}
\usepackage{etoolbox}
\patchcmd{\thebibliography}{*}{}{}{}
\usepackage{tocloft}
\renewcommand{\cftsecaftersnum}{.}
\renewcommand{\cftsecdotsep}{\cftdotsep}
\usepackage{float}
\usepackage{booktabs}
\usepackage[colorlinks]{hyperref}
\hypersetup{%
colorlinks = true,
linkcolor = green
}
\usepackage[pdftex]{graphicx}
\usepackage{caption}
\graphicspath{ {images/} }
\DeclareGraphicsExtensions{.png,.jpg}
\usepackage{listings}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\definecolor{mygreen}{RGB}{28,172,0}
\definecolor{mylilas}{RGB}{170,55,241}
\definecolor{mymauve}{RGB}{148,0,209}
\lstset{
language=Matlab,
basicstyle=\scriptsize\ttfamily\bfseries,
breaklines=true,
morekeywords={matlab2tikz},
keywordstyle=\color{blue},
morekeywords=[2]{1}, keywordstyle=[2]{\color{black}},
identifierstyle=\color{black},
stringstyle=\color{orange},
commentstyle=\color{mygreen},
showstringspaces=false,
numbers=left,
numberstyle={\tiny \color{black}},
numbersep=9pt,
}
\newcommand{\code}[1]{\texttt{#1}}
\usepackage{pdfpages}
\pagenumbering{arabic}
\pagestyle{plain}
\usepackage{mathtools}
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
\DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor}
\usepackage{amsmath}
\usepackage{algorithm}
%\usepackage[noend]{algpseudocode}
\usepackage{algpseudocode}
\algnewcommand\algorithmicinput{\textbf{Input:}}
\algnewcommand\INPUT{\item[\algorithmicinput]}
\algnewcommand\algorithmicoutput{\textbf{Output:}}
\algnewcommand\OUTPUT{\item[\algorithmicoutput]}
\let\emptyset\varnothing
\algblockdefx[Foreach]{Foreach}{EndForeach}[1]{\textbf{for each} #1 \textbf{do}}{\textbf{end for}}
\algblockdefx[ParallelFor]{ParallelFor}{EndParallelFor}[1]{\textbf{parallel for} #1 \textbf{do}}{\textbf{end for}}
\makeatletter
\ifthenelse{\equal{\ALG@noend}{t}}{\algtext*{EndForeach}}{}
\ifthenelse{\equal{\ALG@noend}{t}}{\algtext*{EndParallelFor}}{}
\makeatother
\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\makeatother
\usepackage[
bibstyle=numeric,
citestyle=authoryear-icomp,
sortlocale=en_EN,
natbib=true,
url=true,
doi=true,
eprint=true
]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{fancyhdr}
\usepackage{tikz}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\headheight}{15pt}
\newcommand{\changefont}{%
\fontsize{9}{11}\selectfont
}
\newcommand{\IncludePdf}[2]{
\clearpage
\setcounter{page}{1}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{#1}
\fancyfoot[C]{\thepage}
\includepdf[pages=-,nup=#2,landscape=false,pagecommand={}]{#1}
}
\newcommand{\IncludePdfLandscape}[4]{
\clearpage
\setcounter{page}{1}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[C]{\tikz[remember picture,overlay]
\node[outer sep=0cm,below,rotate=90] at (current page.west) {#1};}
\fancyfoot[C]{\tikz[remember picture,overlay]
\node[outer sep=0cm,above,rotate=90] at (current page.east) {\thepage};}
\includepdf[pages={#4},nup=#2,landscape=true,pagecommand={}#3]{#1}
}
\title{}
\author{Nisim Hurst}
\date{\today}
\usepackage{cleveref}
\crefname{lstlisting}{listing}{listings}
\Crefname{lstlisting}{Listing}{Listings}
\begin{document}
% 2x4, 4x4, 1x3, 1x2 , max
\IncludePdfLandscape{PGM.pdf}{2x4}{,clip,trim=30mm 15mm 20mm 10mm}{-} %trim=left bottom right top,clip
\IncludePdfLandscape{AWS-Certified-Solutions-Architect.pdf}{2x4}{,clip,trim=15mm 3mm 15mm 10mm}{-} %trim=left bottom right top,clip
\IncludePdfLandscape{AWS-in-Action.pdf}{2x4}{,clip,trim=18mm 10mm 18mm 5mm}{-} %trim=left bottom right top,clip
\IncludePdfLandscape{Assessment.pdf}{2x4}{,clip,trim=10mm 10mm 10mm 10mm}{-} %trim=left bottom right top,clip
\IncludePdfLandscape{TOGAF92.pdf}{2x4}{,clip,trim=20mm 10mm 20mm 5mm}{-} %trim=left bottom right top,clip
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment