Adjusting lstlisting frame size - latex

I was wondering how I can adjust the frame size of an lstlisting to my beamer code. This is my code:
\lstset{
backgroundcolor=\color{white},
basicstyle=\scriptsize,
breakatwhitespace=false,
breaklines=true,
commentstyle = \textit,
deletekeywords={...},
escapeinside={\%*}{*)},
extendedchars=true,
frame=single,
keepspaces=true,
language=R,
otherkeywords={*,...},
numbers=left,
numbersep=5pt,
numberstyle=\tiny\color{mygray},
rulecolor=\color{black},
showspaces=false,
showstringspaces=false,
showtabs=false,
stepnumber=2,
tabsize=2,
}
\begin{lstlisting} [title = \lstname \scriptsize bla]
library(ggplot2)
qplot(x, y, data =, color =, shape =, fill=, alpha=, geom=, method=, formula=, facets=,
xlim=, ylim=, xlab=, ylab=, main=, sub=)
\end{lstlisting}
What I get is:
But what I would actually like to have is this:
I used to get the frame of the second picture before but I changed my settings in \lstset and now it doesn't work anymore and I cannot find any source that explains how to resize my frame.
I'd be really glad if anybody knew the answer!

Related

Why am I getting a "=" symbol at the pdf table of contents

If you notice, I get a the equal symbol before every reference the document have in the pdf.
Unable to find if this is of some optional setting which I should do!
And the below is my preamble and some part of the document.
% In the preamble:
% arara: lualatex: { synctex: on }
% arara: biber
% arara: makeglossaries
% arara: makeindex
% arara: lualatex: { synctex: on }
% arara: lualatex: { synctex: on }
% !TeX root = MasterThesis.tex
% !TeX encoding = utf8
% !TeX spellcheck = en_US
\documentclass[12pt, a4paper, oneside, openany]{scrbook}
%\pagestyle{headings}
\usepackage{fontspec}
\fontspec{Times New Roman}
\usepackage{url}
\usepackage[colorlinks=true,linkcolor=black]{hyperref}
\linespread{1.5}
\usepackage[toc, acronym]{glossaries}
\makeglossaries
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage[a4paper]{geometry}
\title{Seamless Firmware Update Over the Air}
\author{Vijay Bhargava B}
\date{February 2023}
\pdfstringdefDisableCommands{%
\def\\{}%
\def\texttt#1{<#1>}%
}
\setcounter{tocdepth}{3}
\renewcommand{\contentsname}{Table of Contents}
\usepackage{titletoc}
\newcommand{\setupname}[1][\chaptername]{
\titlecontents{chapter}[0pt]{\vspace{1ex}}{\bfseries#1~\thecontentslabel:\quad}{\bfseries}{\bfseries\hfill\contentspage}[]
}
\begin{document}
\maketitle
%\pagenumbering{roman} %start roman page number
%\setcounter{page}{1}
\include{00_1_Declaration_honest}
\setlength{\parindent}{0pt}
\include{00_1_Abstract}
\setupname
\tableofcontents
%\pagenumbering{arabic}
%\setcounter{page}{1}
The above part is the preamble and some part of the document.

How to change the font size of my Latex document

I found this latex template that has no font-size attribute, but the writing is just too small to be read.
Hope you can help me figuring out how to change the font size, the template has a file called arxiv.sty that contains:
\NeedsTeXFormat{LaTeX2e}
\ProcessOptions\relax
% fonts
\renewcommand{\rmdefault}{ptm}
\renewcommand{\sfdefault}{phv}
% set page geometry
\usepackage[verbose=true,letterpaper]{geometry}
\AtBeginDocument{
\newgeometry{
textheight=9in,
textwidth=6.5in,
top=1in,
headheight=14pt,
headsep=25pt,
footskip=30pt
}
}
\widowpenalty=10000
\clubpenalty=10000
\flushbottom
\sloppy
\usepackage{fancyhdr}
\fancyhf{}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyheadoffset{0pt}
\rhead{\scshape \today}
\cfoot{\thepage}
%Handling Keywords
\def\keywordname{{\bfseries \emph Keywords}}%
\def\keywords#1{\par\addvspace\medskipamount{\rightskip=0pt plus1cm
\def\and{\ifhmode\unskip\nobreak\fi\ $\cdot$
}\noindent\keywordname\enspace\ignorespaces#1\par}}
% font sizes with reduced leading
\renewcommand{\normalsize}{%
\#setfontsize\normalsize\#xpt\#xipt
\abovedisplayskip 7\p# \#plus 2\p# \#minus 5\p#
\abovedisplayshortskip \z# \#plus 3\p#
\belowdisplayskip \abovedisplayskip
\belowdisplayshortskip 4\p# \#plus 3\p# \#minus 3\p#
}
\normalsize
\renewcommand{\small}{%
\#setfontsize\small\#ixpt\#xpt
\abovedisplayskip 6\p# \#plus 1.5\p# \#minus 4\p#
\abovedisplayshortskip \z# \#plus 2\p#
\belowdisplayskip \abovedisplayskip
\belowdisplayshortskip 3\p# \#plus 2\p# \#minus 2\p#
}
\renewcommand{\footnotesize}{\#setfontsize\footnotesize\#ixpt\#xpt}
\renewcommand{\scriptsize}{\#setfontsize\scriptsize\#viipt\#viiipt}
\renewcommand{\tiny}{\#setfontsize\tiny\#vipt\#viipt}
\renewcommand{\large}{\#setfontsize\large\#xiipt{14}}
\renewcommand{\Large}{\#setfontsize\Large\#xivpt{16}}
\renewcommand{\LARGE}{\#setfontsize\LARGE\#xviipt{20}}
\renewcommand{\huge}{\#setfontsize\huge\#xxpt{23}}
\renewcommand{\Huge}{\#setfontsize\Huge\#xxvpt{28}}
% sections with less space
\providecommand{\section}{}
\renewcommand{\section}{%
\#startsection{section}{1}{\z#}%
{-2.0ex \#plus -0.5ex \#minus -0.2ex}%
{ 1.5ex \#plus 0.3ex \#minus 0.2ex}%
{\large\bf\raggedright}%
}
\providecommand{\subsection}{}
\renewcommand{\subsection}{%
\#startsection{subsection}{2}{\z#}%
{-1.8ex \#plus -0.5ex \#minus -0.2ex}%
{ 0.8ex \#plus 0.2ex}%
{\normalsize\bf\raggedright}%
}
\providecommand{\subsubsection}{}
\renewcommand{\subsubsection}{%
\#startsection{subsubsection}{3}{\z#}%
{-1.5ex \#plus -0.5ex \#minus -0.2ex}%
{ 0.5ex \#plus 0.2ex}%
{\normalsize\bf\raggedright}%
}
\providecommand{\paragraph}{}
\renewcommand{\paragraph}{%
\#startsection{paragraph}{4}{\z#}%
{1.5ex \#plus 0.5ex \#minus 0.2ex}%
{-1em}%
{\normalsize\bf}%
}
\providecommand{\subparagraph}{}
\renewcommand{\subparagraph}{%
\#startsection{subparagraph}{5}{\z#}%
{1.5ex \#plus 0.5ex \#minus 0.2ex}%
{-1em}%
{\normalsize\bf}%
}
\providecommand{\subsubsubsection}{}
\renewcommand{\subsubsubsection}{%
\vskip5pt{\noindent\normalsize\rm\raggedright}%
}
% float placement
\renewcommand{\topfraction }{0.85}
\renewcommand{\bottomfraction }{0.4}
\renewcommand{\textfraction }{0.1}
\renewcommand{\floatpagefraction}{0.7}
\newlength{\#abovecaptionskip}\setlength{\#abovecaptionskip}{7\p#}
\newlength{\#belowcaptionskip}\setlength{\#belowcaptionskip}{\z#}
\setlength{\abovecaptionskip}{\#abovecaptionskip}
\setlength{\belowcaptionskip}{\#belowcaptionskip}
% swap above/belowcaptionskip lengths for tables
\renewenvironment{table}
{\setlength{\abovecaptionskip}{\#belowcaptionskip}%
\setlength{\belowcaptionskip}{\#abovecaptionskip}%
\#float{table}}
{\end#float}
% footnote formatting
\setlength{\footnotesep }{6.65\p#}
\setlength{\skip\footins}{9\p# \#plus 4\p# \#minus 2\p#}
\renewcommand{\footnoterule}{\kern-3\p# \hrule width 12pc \kern 2.6\p#}
\setcounter{footnote}{0}
% paragraph formatting
\setlength{\parindent}{\z#}
\setlength{\parskip }{5.5\p#}
% list formatting
\setlength{\topsep }{4\p# \#plus 1\p# \#minus 2\p#}
\setlength{\partopsep }{1\p# \#plus 0.5\p# \#minus 0.5\p#}
\setlength{\itemsep }{2\p# \#plus 1\p# \#minus 0.5\p#}
\setlength{\parsep }{2\p# \#plus 1\p# \#minus 0.5\p#}
\setlength{\leftmargin }{3pc}
\setlength{\leftmargini }{\leftmargin}
\setlength{\leftmarginii }{2em}
\setlength{\leftmarginiii}{1.5em}
\setlength{\leftmarginiv }{1.0em}
\setlength{\leftmarginv }{0.5em}
\def\#listi {\leftmargin\leftmargini}
\def\#listii {\leftmargin\leftmarginii
\labelwidth\leftmarginii
\advance\labelwidth-\labelsep
\topsep 2\p# \#plus 1\p# \#minus 0.5\p#
\parsep 1\p# \#plus 0.5\p# \#minus 0.5\p#
\itemsep \parsep}
\def\#listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii
\advance\labelwidth-\labelsep
\topsep 1\p# \#plus 0.5\p# \#minus 0.5\p#
\parsep \z#
\partopsep 0.5\p# \#plus 0\p# \#minus 0.5\p#
\itemsep \topsep}
\def\#listiv {\leftmargin\leftmarginiv
\labelwidth\leftmarginiv
\advance\labelwidth-\labelsep}
\def\#listv {\leftmargin\leftmarginv
\labelwidth\leftmarginv
\advance\labelwidth-\labelsep}
\def\#listvi {\leftmargin\leftmarginvi
\labelwidth\leftmarginvi
\advance\labelwidth-\labelsep}
% create title
\providecommand{\maketitle}{}
\renewcommand{\maketitle}{%
\par
\begingroup
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
% for perfect author name centering
\renewcommand{\#makefnmark}{\hbox to \z#{$^{\#thefnmark}$\hss}}
% The footnote-mark was overlapping the footnote-text,
% added the following to fix this problem (MK)
\long\def\#makefntext##1{%
\parindent 1em\noindent
\hbox to 1.8em{\hss $\m#th ^{\#thefnmark}$}##1
}
\thispagestyle{empty}
\#maketitle
\#thanks
%\#notice
\endgroup
\let\maketitle\relax
\let\thanks\relax
}
% rules for title box at top of first page
\newcommand{\#toptitlebar}{
\hrule height 2\p#
\vskip 0.25in
\vskip -\parskip%
}
\newcommand{\#bottomtitlebar}{
\vskip 0.29in
\vskip -\parskip
\hrule height 2\p#
\vskip 0.09in%
}
% create title (includes both anonymized and non-anonymized versions)
\providecommand{\#maketitle}{}
\renewcommand{\#maketitle}{%
\vbox{%
\hsize\textwidth
\linewidth\hsize
\vskip 0.1in
\#toptitlebar
\centering
{\LARGE\sc \#title\par}
\#bottomtitlebar
\textsc{}\\
\vskip 0.1in
\def\And{%
\end{tabular}\hfil\linebreak[0]\hfil%
\begin{tabular}[t]{c}\bf\rule{\z#}{24\p#}\ignorespaces%
}
\def\AND{%
\end{tabular}\hfil\linebreak[4]\hfil%
\begin{tabular}[t]{c}\bf\rule{\z#}{24\p#}\ignorespaces%
}
\begin{tabular}[t]{c}\bf\rule{\z#}{24\p#}\#author\end{tabular}%
\vskip 0.4in \#minus 0.1in \center{\today} \vskip 0.2in
}
}
% add conference notice to bottom of first page
\newcommand{\ftype#noticebox}{8}
\newcommand{\#notice}{%
% give a bit of extra room back to authors on first page
\enlargethispage{2\baselineskip}%
\#float{noticebox}[b]%
\footnotesize\#noticestring%
\end#float%
}
% abstract styling
\renewenvironment{abstract}
{
\centerline
{\large \bfseries \scshape Abstract}
\begin{quote}
}
{
\end{quote}
}
\endinput
and the template.tex file that contains the code below but no attributes telling about the font-size:
\documentclass{article}
\usepackage{float}
\usepackage{arxiv}
\usepackage{graphicx}
\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc} % use 8-bit T1 fonts
\usepackage{hyperref} % hyperlinks
\usepackage{url} % simple URL typesetting
\usepackage{booktabs} % professional-quality tables
\usepackage{amsfonts} % blackboard math symbols
\usepackage{nicefrac} % compact symbols for 1/2, etc.
\usepackage{microtype} % microtypography
\usepackage{lipsum}
\title{
You can overwrite the font settings of the .sty file by loading size11.clo or size12.clo afterwards.
These files will create nice matching sets of font sizes, so that it not only changes the size of the formal text but also adjust other sizes like \large etc. to get an harmonic result.
\documentclass{article}
\usepackage{float}
\usepackage{arxiv}
\usepackage{graphicx}
\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc} % use 8-bit T1 fonts
\usepackage{hyperref} % hyperlinks
\usepackage{url} % simple URL typesetting
\usepackage{booktabs} % professional-quality tables
\usepackage{amsfonts} % blackboard math symbols
\usepackage{nicefrac} % compact symbols for 1/2, etc.
\usepackage{microtype} % microtypography
\usepackage{lipsum}
\title{test}
\makeatletter
%\input{size11.clo}
\input{size12.clo}
\makeatother
\begin{document}
\lipsum
\end{document}

How do you remove white space between title and table?

I tried asking this somewhere else as well, but I am having trouble removing the white space between the title of my table and the actual table. This doesn't happen when in my regular rmarkdown article, but when I knit to beamer for my presentation it produces these bizarre white spaces. Anyone know why?
mean.party.class <- dat3 %>%
group_by(party2, class2) %>%
filter (party2 !="Indep" & class != "IDK")%>%
summarise_at(vars(DL, DU, RL, RU, L, U, D, R), funs(mean(., na.rm=TRUE)))
knitr::kable(mean.party.class, col.names=c("Party ID", "Class", "DL", "DU", "RL", "RU", "L", "U", "D" , "R"), digits=2, caption = "Mean Trust Per Group (Party and Social Class Identity)", "latex", booktabs = T) %>%
kable_styling( full_width = F, position = "left", latex_options = "scale_down", bootstrap_options = c("striped", "hover")) %>% footnote(
general = c("1. D= Democrat, R=Republican, L=Lower Class, U = Upper Class; ", "2. Independents dropped")) %>% row_spec(0,bold=TRUE)
Here is an example
---
title: "Example"
author: "Its me"
date: "6/12/2020"
always_allow_html: true
header-includes:
- \usepackage{booktabs}
- \usepackage{longtable}
- \usepackage{tabu}
- \usepackage{threeparttable}
- \usepackage{adjustbox}
- \usepackage{caption} \captionsetup[table]{skip=0pt}
- \usepackage[font=small,skip=0pt]{caption}
- \usepackage{tikz}
- \usepackage{float}
- \usetikzlibrary{arrows,shapes,positioning}
output:
beamer_presentation:
theme: "Berkeley"
colortheme: "dolphin"
fonttheme: "structurebold"
slide_level: 2
#incremental: true
---
```{r}
setwd("~/Google Drive/UC Davis /R stuff")
```
```{r, include=FALSE}
library(rticles)
library(kableExtra)
library(knitr)
library(plyr)
library(dplyr)
library(gdata)
library(ggplot2)
library(MASS)
library(corrplot)
library(haven)
library(factoextra)
library(ggplot2)
library(ggrepel)
library(viridis)
library(lattice)
library(optiscale)
library(acepack)
library(psych)
library(smacof)
library(MCMCpack)
library(basicspace)
library(boot)
library(pscl)
library(wnominate)
library(RColorBrewer)
library(sjPlot)
```
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
```{r, include= FALSE}
#load cars
data("mtcars")
head(mtcars, 2)
```
```{r, include= FALSE}
mean.mpg <- mtcars %>%
summarise_at(vars(mpg), funs(mean(., na.rm=TRUE)))
```
## there it is
```{r}
knitr::kable(mean.mpg, col.names=c("mpg"), digits=2, caption = "This is a table", "latex", booktabs = T, escape=F) %>%
kable_styling(full_width = T, position = "left", latex_options = "scale_down", bootstrap_options = c("striped", "hover")) %>% footnote(
general = c("1. test 1", "2. test 2"))%>%
row_spec(0,bold=TRUE)
```
If you add keep_tex: true to your header you can edit the resulting .tex file to remove the multiple causes of the additional space:
remove the unnecessary and often harmful \resizebox{\linewidth}{!}{...} around the table
remove the caption package (which is unnecessarily loaded multiple times)
remove the parskip package
\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[ignorenonframetext,]{beamer}
\usepackage{pgfpages}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{caption label separator}{: }
\setbeamercolor{caption name}{fg=normal text.fg}
\beamertemplatenavigationsymbolsempty
% Prevent slide breaks in the middle of a paragraph:
\widowpenalties 1 10000
\raggedbottom
\setbeamertemplate{part page}{
\centering
\begin{beamercolorbox}[sep=16pt,center]{part title}
\usebeamerfont{part title}\insertpart\par
\end{beamercolorbox}
}
\setbeamertemplate{section page}{
\centering
\begin{beamercolorbox}[sep=12pt,center]{part title}
\usebeamerfont{section title}\insertsection\par
\end{beamercolorbox}
}
\setbeamertemplate{subsection page}{
\centering
\begin{beamercolorbox}[sep=8pt,center]{part title}
\usebeamerfont{subsection title}\insertsubsection\par
\end{beamercolorbox}
}
\AtBeginPart{
\frame{\partpage}
}
\AtBeginSection{
\ifbibliography
\else
\frame{\sectionpage}
\fi
}
\AtBeginSubsection{
\frame{\subsectionpage}
}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provides euro and other symbols
\else % if luatex or xelatex
\usepackage{unicode-math}
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\fi
\usetheme[]{Berkeley}
\usecolortheme{dolphin}
\usefonttheme{structurebold}
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\IfFileExists{parskip.sty}{%
%\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
}
\usepackage{hyperref}
\hypersetup{
pdftitle={Example},
pdfauthor={Its me},
pdfborder={0 0 0},
breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
\newif\ifbibliography
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
% set default figure placement to htbp
\makeatletter
\def\fps#figure{htbp}
\makeatother
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{adjustbox}
%\usepackage{caption}
%\captionsetup[table]{skip=0pt}
%\usepackage[font=small,skip=0pt]{caption}
\usepackage{tikz}
\usepackage{float}
\usetikzlibrary{arrows,shapes,positioning}
\title{Example}
\author{Its me}
\date{6/12/2020}
\begin{document}
\frame{\titlepage}
\begin{frame}{there it is}
\protect\hypertarget{there-it-is}{}
\begin{table}
\caption{\label{tab:unnamed-chunk-4}This is a table}
%\resizebox{\linewidth}{!}{
\begin{tabu} to \linewidth {>{\raggedleft}X}
\toprule
\textbf{mpg}\\
\midrule
20.09\\
\bottomrule
\multicolumn{1}{l}{\textit{Note: }}\\
\multicolumn{1}{l}{1. test 1}\\
\multicolumn{1}{l}{2. test 2}\\
\end{tabu}
%}
\end{table}
\end{frame}
\end{document}
(I would stay away from tabu and use a normal table instead)

Setting Tikz Boarder Globally | Latex

With the following Code I am able to set the boarder for current page, but how can I make the boarder available to all pages without explicitly setting it on every page.
% !TeX TS-program = xelatex % | xelatex %
\documentclass[12pt, a4paper]{article}
\usepackage[left=3.3cm,right=2.3cm,top=2.3cm,bottom=2.3cm, footskip=42pt]{geometry}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[remember picture, overlay]
\draw[line width=3pt] ($(current page.north west)+(2.5cm,-1.5cm)$) rectangle ($(current page.south east)+(-1.5cm,1.5cm)$);
\draw[line width=1pt] ($(current page.north west)+(2.6cm,-1.6cm)$) rectangle ($(current page.south east)+(-1.6cm,1.6cm)$);
\fill[red] (current page.center) circle (0.1);
\node[font=\Large\bfseries, text width=5cm,align=center] at (current page.center) {
\uppercase{Note -- 1}
\vspace{24pt}
\uppercase{Data analysis}
};
\end{tikzpicture}
\newpage
test
\end{document}
One possibility is to use the eso-pic package:
% !TeX TS-program = xelatex % | xelatex %
\documentclass[12pt, a4paper]{article}
\usepackage[left=3.3cm,right=2.3cm,top=2.3cm,bottom=2.3cm, footskip=42pt]{geometry}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{eso-pic}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[remember picture, overlay]
\draw[line width=3pt] ($(current page.north west)+(2.5cm,-1.5cm)$) rectangle ($(current page.south east)+(-1.5cm,1.5cm)$);
\draw[line width=1pt] ($(current page.north west)+(2.6cm,-1.6cm)$) rectangle ($(current page.south east)+(-1.6cm,1.6cm)$);
\end{tikzpicture}%
}
\begin{document}
\begin{tikzpicture}[remember picture, overlay]
\fill[red] (current page.center) circle (0.1);
\node[font=\Large\bfseries, text width=5cm,align=center] at (current page.center) {
\uppercase{Note -- 1}
\vspace{24pt}
\uppercase{Data analysis}
};
\end{tikzpicture}
\newpage
test
\end{document}

Latex Letter template with sidebar

I'm looking for someone who can tell me how to make this letter template in LaTeX, i currently using a template made in word. I'm wondering where it's possible to make the same template in LaTeX.
Background info:
Two fonts are used: Garamond and Arial
Fontsize: 12 and 16
Must support Tabular, minipage and figure environment
My normal preamble is the following (which i have used a lot of time writing):
\documentclass[10pt,a4paper]{extarticle}
\usepackage{fontspec}
\usepackage{titlesec}
\usepackage{titling}
\usepackage{listings}
\usepackage{caption}
%\usepackage[helvet]{sfmath}
% commands from fontspec
\defaultfontfeatures{Ligatures=TeX}
\setmainfont[Scale=1.2]{Garamond}
\newfontfamily\gmd{Garamond}
\newfontfamily\DTL{DTL Argo}
\newfontfamily\subsubsectionfont{Helvetica Neue}
%
\titleformat{\section}[hang]{}{\thesection}{1.8cm}{}[{\titlerule[0.4pt]}]
\titleformat{\subsection}[hang]{}{\thesubsection}{1.6cm}{}
\titleformat{\subsubsection}[hang]{\bfseries}{\thesubsubsection}{1.4cm}{}
% commands from titlesec
\newcommand*{\Stor}{\#setfontsize\Stor{30pt}{30pt}}
\titleformat*{\section}{\gmd\fontsize{28pt}{30pt}\selectfont}
\titleformat*{\subsection}{\gmd\fontsize{18pt}{18pt}\selectfont}
\titleformat*{\subsubsection}{\bfseries\fontsize{14pt}{14pt}\subsubsectionfont}
% Document properties
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{geometry}
\geometry{margin=1.3in}
\geometry{top=1.4in}
\geometry{bottom=1.4in}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{2}
\usepackage{float}
\usepackage{newfloat}
\usepackage{amsmath, amssymb}
\usepackage{fixltx2e}
\usepackage[hang,nooneline]{subfigure}
\usepackage[danish]{babel}
\usepackage{multirow}
\setlength{\parindent}{0em}
\usepackage{color}
\usepackage{natbib}
\usepackage{arydshln}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{graphicx}
\usepackage{lastpage}
\usepackage{enumitem}
\usepackage{etoolbox}
\usepackage{caption}
\usepackage{xcolor}
\usepackage{xcolor,colortbl}
\usepackage{adjustbox}
\usepackage{mdframed}
% Footnote font
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newfontfamily\gmd{Garamond}
%\patchcmd{\#footnotetext}{\footnotesize}{\normalsize\gmd}{}{}
\let\footnotesize\small
\makeatother
\usepackage[hang]{footmisc}
\setlength\footnotemargin{7.05pt}
\renewcommand{\footnoterule}{%
\kern 3pt
\hrule width \textwidth height 0.4pt
\kern 2.6pt
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
%\numberwithin{figure}{section}
%\numberwithin{table}{section}
%\numberwithin{program}{section}
%\numberwithin{boks}{section}
%\numberwithin{equation}{section}
% Colors and lines
%\definecolor{fm}{RGB}{248,244,230}
\definecolor{fm}{RGB}{248,247,217}
\definecolor{borsen}{RGB}{254,232,215}
\definecolor{dblue}{RGB}{4,19,73}
%\definecolor{Grå}{RGB}{128,128,128}
\definecolor{Grå}{RGB}{217,217,217}
\newcommand{\gline}{\arrayrulecolor{Grå}\hline}
\newcommand{\HRule}{\rule{\linewidth}{0.25mm}}
\newcommand{\HHRule}{\rule{\linewidth}{1.5mm}}
\newcommand{\tabitem}{\par\hspace*{\labelsep}\textbullet\hspace*{\labelsep}}
\arrayrulecolor{Grå}
\DeclareCaptionFont{dblue}{\color{dblue}}
\DeclareCaptionFont{black}{\color{black}}
% commands from caption
\usepackage[document]{ragged2e}
\usepackage[width={\textwidth}, margin=11pt , aboveskip=20pt, belowskip=6pt, font=footnotesize, labelfont={bf,dblue}, textfont={bf,black}, tableposition=top, figureposition=top,justification=RaggedRight,singlelinecheck=false, labelsep={newline}]{caption}%
\newfontfamily\tablefont[Numbers={Monospaced,Lining}]{Arial}
\AtBeginEnvironment{table}{\setmainfont[Color=black, Numbers={Proportional,OldStyle}]{Arial}}
\AtBeginEnvironment{figure}{\setmainfont[Color=black, Numbers={Proportional,OldStyle}]{Arial}}
\AtBeginEnvironment{boks}{\setmainfont[Color=black, Numbers={Proportional,OldStyle}]{Arial}}
%%%%%%%%%%%%%%%%%% Liste %%%%%%%%%%%%%%%%%%
\setlist[description]{
style=multiline,
font=\normalfont\gmd, % set the label font
align=parleft,
topsep=5pt,
labelwidth={0.06\textwidth},
leftmargin=!,
parsep=0pt,
before=\gmd
}
%%%%%%%%%%%%%%%%%%%%CEPOS Figure%%%%%%%%%%%%%%
\usepackage{url}
\usepackage{threeparttable}
\usepackage{tabularx,booktabs}
\usepackage{tabulary}
\belowrulesep=0pt
\aboverulesep=0pt
\renewcommand{\arraystretch}{1.4}
%%%%%%%%%%%%%%%%%%%% Finansministeriets figur %%%%%%%%%%%%%%%%%
\newenvironment{fmfigur}[4]{
\begin{figure}[htbp!]
\centering
\begin{adjustbox}{minipage=\textwidth,bgcolor=fm}
\rule{\textwidth}{0.4pt}
\begin{tabular}{#{\extracolsep{\fill}} #{}c#{}}
\begin{minipage}[t]{\textwidth}
\captionof{figure}{#1}\label{#2}
\end{minipage}
\\
\begin{minipage}[t]{\textwidth}
\centering
\includegraphics[width=0.9\textwidth]{bil/#2.pdf}
\end{minipage}
\end{tabular}
\rule{\textwidth}{0.4pt}
\end{adjustbox} \vspace{-0.5em}
\begin{center}
\begin{adjustbox}{minipage=0.95\textwidth}
{\gmd\small
\begin{description}
\item[{\ Anm.}:]#3
\item[{\ Kilde}:]#4
\end{description}}
\end{adjustbox} \vspace{-1.75em}
\end{center}
\end{figure}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% Finansministeriets Side by Side figurer %%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\FMADAM}[6]{
\begin{table}[htpb!]
\begin{adjustbox}{minipage=\textwidth,bgcolor=fm}
\rule{\textwidth}{0.4pt}\vspace{-1pt} \arrayrulecolor{black}
\begin{tabular}{#{\extracolsep{\fill}} #{}c#{} | #{}c#{} }
\begin{minipage}[t]{0.5\textwidth}
\captionof{figure}{#1}\label{#2}
\end{minipage}
&
\begin{minipage}[t]{0.5\textwidth}
\captionof{figure}{#3}\label{#4}
\end{minipage}
\\
\begin{minipage}[t]{0.5\textwidth}
\centering
\includegraphics[width=0.9\linewidth,keepaspectratio=true]{bil/#2.pdf}
\end{minipage}
&
\begin{minipage}[t]{0.5\textwidth}
\centering
\includegraphics[width=0.9\linewidth,keepaspectratio=true]{bil/#4.pdf}
\end{minipage}
\vspace{-1pt}
\end{tabular}
\rule{\textwidth}{0.4pt}
\end{adjustbox} \vspace{-0.5em}
\begin{center}
\begin{adjustbox}{minipage=0.95\textwidth}
{\gmd\small
\begin{description}
\item[{\ Anm.}:]#5
\item[{\ Kilde}:]#6
\end{description}}
\end{adjustbox} \vspace{-1.75em}
\end{center}
\end{table}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareFloatingEnvironment[
fileext=lop,
name=Program
]{program}
% announce the float to subcaption and create the subprogram environment
\DeclareCaptionSubType{program}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareFloatingEnvironment[
fileext=lop,
name=Boks
]{boks}
% announce the float to subcaption and create the subprogram environment
\DeclareCaptionSubType{boks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%FMTable%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\fmboks}[5]{
\begin{boks}[htbp!]
\begin{adjustbox}{minipage=\textwidth,bgcolor=fm}
\rule{\textwidth}{0.4pt}
\begin{minipage}[t]{\textwidth}
\caption{#1}\label{boks:#2}
\end{minipage}
\fontsize{8pt}{9pt}\selectfont\centering
\begin{tabulary}{0.95\textwidth}{#{\extracolsep{\fill}}#{}L#{}}
\onehalfspacing \fontsize{8pt}{9pt}\selectfont
#3
\end{tabulary}
\rule{\textwidth}{0.4pt}
\end{adjustbox} \vspace{-0.5em}
\begin{center}
\begin{adjustbox}{minipage=0.95\textwidth}
{\gmd\small
\begin{description}
\item[{\ Anm.}:]#4
\item[{\ Kilde}:]#5
\end{description}}
\end{adjustbox} \vspace{-1.75em}
\end{center}
\end{boks}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%FMTable%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\fmtable}[5]{
\begin{table}[htbp!]
\begin{adjustbox}{minipage=\textwidth,bgcolor=fm}
\rule{\textwidth}{0.4pt}
\begin{minipage}[t]{\textwidth}
\caption{#1}\label{tab:#2}
\end{minipage}
\begin{center}
\begingroup
\fontsize{8pt}{9pt}\selectfont\arrayrulecolor{Grå}
#3
\endgroup
\end{center}
\rule{\textwidth}{0.4pt}
\end{adjustbox} \vspace{-0.5em}
\begin{center}
\begin{adjustbox}{minipage=0.95\textwidth}
{\gmd\small
\begin{description}
\item[{\ Anm.}:]#4
\item[{\ Kilde}:]#5
\end{description}}
\end{adjustbox} \vspace{-1.75em}
\end{center}
\end{table}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeindex
\patchcmd{\footrule}{\hrule}{\color{dblue}\hrule}{}{}
\patchcmd{\headrule}{\hrule}{\color{dblue}\hrule}{}{}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\headrulewidth}{0pt}
\makeindex
\DeclareMathOperator{\dlog}{dlog\!}
\DeclareMathOperator{\dd}{d\!}
\newcommand{\gmdit}[1]{\textit{\gmd #1}}
\newcommand{\abs}[1]{\lvert #1 \rvert}
\newcommand{\lrarrow}{\Leftrightarrow}
\newcommand{\degree}{\text{\textdegree}}
\newcommand{\rarrow}{\Rightarrow}
\newcommand{\larrow}{\Leftarrow}
\newcommand{\udarrow}{\Updownarrow}
\newcommand{\bsm}{\left[ \begin{smallmatrix}}
\newcommand{\esm}{\end{smallmatrix} \right]}
\newcommand{\shiftline}{\newline \newline}
\newcommand{\PD}{\partial}
\newcommand{\grad}{\nabla}
\newcommand{\lb}{\left(}
\newcommand{\rb}{\right)}
\newcommand{\ohm}{\Omega}
\newcommand{\Sun}{\ensuremath{\odot}}
\newcommand{\g}{\cdot}
\newcommand{\limit}{\lim_{n \rightarrow \infty}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\mat}[1]{
\begin{align*}
\centering
#1
\end{align*}}
\newcommand{\matnr}[1]{
\begin{align}
\centering
#1
\end{align}}
\usepackage{setspace}
\renewcommand{\baselinestretch}{1.4}
\fancyhead[R]{{Ivan Erik Kragh}\\{(+45) 60 68 13 05}} % predefined ()
\fancyhead[L]{Opdatering: Ulighed og Working Poor (juli, 2016)} % 1. sectionname
\lfoot{\small }
\chead{\ }
%\rhead{\small Ivan Erik Kragh\\(+45) 60 68 13 05}
\cfoot{Side \thepage\ af \pageref{LastPage}}
\rfoot{ik#kraghinvest.dk}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\textwidth=12in
\begin{document}
\begin{tabular}{p{6cm}p{4cm}p{6cm}}
Navin & &28 September\\
Firma & &2016
\end{tabular}
\textwidth=8in
{\bf Kaer Navin}\\
\small
\vspace{2cm}
% here you can enter your paragraph
This is what I get when I type to see the test page. That
must be crazy.
\vspace{3cm}
Med\\
\line(1,0) {100}\\
Tl: 123 456
\vfill
\hspace{2cm}Kevin etc.
\end{document}
% I think this format will be useful to you.

Resources