Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move preamble to a separate file (finally)
- Loading branch information
Showing
2 changed files
with
221 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
% set fonts for nicer pdf view | ||
\IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} | ||
|
||
\fancyheadoffset{12pt} | ||
\renewcommand{\sectionmark}[1]{} % Don't use sections in headers | ||
\renewcommand{\subsectionmark}[1]{} % Don't use subsections in headers | ||
|
||
\usepackage{pdflscape} | ||
\usepackage{geometry} | ||
|
||
\newenvironment{wide}{ | ||
\pagebreak | ||
\newgeometry{ | ||
top=15mm, | ||
inner=15mm, | ||
outer=15mm, | ||
bottom=15mm, | ||
headheight=15pt, | ||
headsep=5mm, | ||
footnotesep=5mm, | ||
footskip=10mm} | ||
\begin{landscape} | ||
% Use TiKZ? | ||
% http://tex.stackexchange.com/questions/40501/using-restoregeometry-in-environment-next-page-runs-off-the-page-bottom/40503#40503 | ||
\setlength\LTcapwidth{\textwidth} % default: 4in (rather less than \textwidth...) | ||
\setlength\LTleft{0pt} % default: \parindent | ||
\setlength\LTright{0pt} % default: \fill | ||
}{ | ||
\end{landscape} | ||
\pagebreak | ||
\aftergroup\restoregeometry | ||
} | ||
|
||
\usepackage{color} | ||
\definecolor{updated}{rgb}{0.8,0.85,1} | ||
|
||
\usepackage{numprint} | ||
|
||
\providecommand{\versiononly}{(Unknown~document~version)} | ||
\providecommand{\versionandtoday}{\versiononly~--~\today} | ||
|
||
\providecommand{\recentlyupdated}{\emph\textsc\textcolor{updated}{ ~Updated!~ }} | ||
|
||
\usepackage{longtable} | ||
\usepackage{caption} | ||
\usepackage{pgfplotstable} | ||
\usepackage{booktabs} | ||
\usepackage{colortbl} | ||
\usepackage{array} | ||
\pgfplotsset{compat=1.11}% supress warning | ||
|
||
\pgfplotstableset{ | ||
% Write all longtable tables to disk. | ||
every table/.append style={outfile={.generated.report-table\@arabic\c@LT@tables.tex}}, | ||
% Use cached/written files as input. | ||
include outfiles, | ||
% Change to true to force re-generation. It's easier to just delete all generated files. | ||
force remake=false, | ||
} | ||
|
||
\newcolumntype{i}{>{\begin{pgfplotstablecoltype}[int detect]}r<{\end{pgfplotstablecoltype}}} | ||
\newcolumntype{f}{>{\begin{pgfplotstablecoltype}[fixed zerofill]}r<{\end{pgfplotstablecoltype}}} | ||
|
||
\newcommand{\tsvtablestyle}[0]{ | ||
\pgfplotstableset{ | ||
format=file, | ||
col sep=tab, | ||
multicolumn names={c}, | ||
column type=r, | ||
int detect, | ||
zerofill=true, | ||
precision=3, | ||
1000 sep={\ }, | ||
begin table=\begin{longtable*}, | ||
end table=\end{longtable*}, | ||
every odd row/.style={before row={\rowcolor[gray]{0.95}}}, | ||
every head row/.style={before row=\toprule,after row={ | ||
\toprule | ||
\addlinespace[0pt] | ||
\endhead | ||
}, | ||
}, | ||
every last row/.style={after row={ | ||
\bottomrule | ||
} | ||
}, | ||
} | ||
} | ||
|
||
\newcommand{\tsvtable}[3]{ | ||
\tsvtablestyle | ||
\pgfplotstabletypeset[ | ||
columns={#2},#3 | ||
]{#1} | ||
} | ||
|
||
\newcommand{\tsvtablestylewide}[1]{ | ||
\pgfplotstableset{ | ||
format=file, | ||
col sep=tab, | ||
multicolumn names={c}, | ||
column type=r, | ||
int detect, | ||
zerofill=true, | ||
precision=3, | ||
1000 sep={\ }, | ||
begin table=\begin{longtable}, | ||
end table=\end{longtable}, | ||
every odd row/.style={before row={\rowcolor[gray]{0.95}}}, | ||
every head row/.style={before row=\toprule,after row={ | ||
\toprule | ||
\addlinespace[0pt] | ||
\endhead | ||
}, | ||
}, | ||
every last row/.style={after row={ | ||
\bottomrule | ||
\caption{#1}} | ||
}, | ||
} | ||
} | ||
|
||
\newcommand{\tsvtablewide}[4]{ | ||
\tsvtablestylewide{#2} | ||
\pgfplotstabletypeset[ | ||
columns={#3},#4 | ||
]{#1} | ||
} | ||
|
||
\newcommand{\tsvtablewidedatasets}[4]{ | ||
\tsvtablestylewide{#2} | ||
\pgfplotstabletypeset[ | ||
columns={#3},every nth row={4[-1]}{after row={\addlinespace[0pt]\midrule\addlinespace[0pt]}},fixed,display columns/0/.style={string type, column type=l},display columns/1/.style={string type, column type=i},#4 | ||
]{#1} | ||
} | ||
|
||
\newenvironment{futurework}{ | ||
\begin{center} | ||
\begin{minipage}{.8\columnwidth} | ||
\hspace{12pt} | ||
\hrule | ||
\hspace{12pt} | ||
}{ | ||
\hspace{12pt} | ||
\hrule | ||
\hspace{12pt} | ||
\end{minipage} | ||
\end{center} | ||
} | ||
|
||
% Speed up pgfplots/tikz figure generation by caching results. | ||
% LyX needs to be configured per user; | ||
% In LyX Preferences, File Handling, Converters: | ||
% For LaTeX (pdflatex) -> PDF (pdflatex) set the Converted field to: | ||
% pdflatex -shell-escape $$i | ||
% (Adding -shell-escape is what is important.) | ||
\usepgfplotslibrary{external} | ||
% When using LyX, the command is executed in a temporary working directory; can't use a folder prefix. | ||
\tikzexternalize[prefix=.generated.] | ||
% Use to remake all or remake a single figure. | ||
%\tikzset{external/force remake} | ||
%\tikzset{external/remake next} | ||
|
||
\pgfplotsset{allDatasetsStackedXbar/.style= | ||
{ | ||
xbar stacked=plus, | ||
enlarge x limits=false, | ||
bar width=6pt, | ||
fill opacity=0.9, | ||
xmin=0, | ||
xmax=1, | ||
xtick={0,.2,.4,.6,.8,1}, | ||
minor xtick={.1,.3,.5,.7,.9}, | ||
xminorgrids=true, | ||
xmajorgrids=true, | ||
% The number style seems to have stopped working? | ||
xticklabel style={ | ||
/pgf/number format/fixed, | ||
/pgf/number format/precision=2 | ||
}, | ||
ytick=data, | ||
y dir=reverse, | ||
yticklabel pos=right, | ||
symbolic y coords={alexa.2014-09-01.random.10000-http,alexa.2014-09-01.random.10000-http-www,alexa.2014-09-01.random.10000-https,alexa.2014-09-01.random.10000-https-www,alexa.2014-09-01.top.10000-http,alexa.2014-09-01.top.10000-http-www,alexa.2014-09-01.top.10000-https,alexa.2014-09-01.top.10000-https-www,alexa.2014-09-01.top.dk.10000-http,alexa.2014-09-01.top.dk.10000-http-www,alexa.2014-09-01.top.dk.10000-https,alexa.2014-09-01.top.dk.10000-https-www,alexa.2014-09-01.top.se.10000-http,alexa.2014-09-01.top.se.10000-http-www,alexa.2014-09-01.top.se.10000-https,alexa.2014-09-01.top.se.10000-https-www,com.2014-08-29.random.10000-http,com.2014-08-29.random.10000-http-www,com.2014-08-29.random.10000-https,com.2014-08-29.random.10000-https-www,dk.2014-07-23.random.10000-http,dk.2014-07-23.random.10000-http-www,dk.2014-07-23.random.10000-https,dk.2014-07-23.random.10000-https-www,net.2014-08-29.random.10000-http,net.2014-08-29.random.10000-http-www,net.2014-08-29.random.10000-https,net.2014-08-29.random.10000-https-www,reach50.2014w35.se-http,reach50.2014w35.se-http-www,reach50.2014w35.se-https,reach50.2014w35.se-https-www,se.2014-07-10.random.100000-http,se.2014-07-10.random.100000-http-www,se.2014-07-10.random.100000-https,se.2014-07-10.random.100000-https-www,se.healthstatus.2013.counties-http,se.healthstatus.2013.counties-http-www,se.healthstatus.2013.counties-https,se.healthstatus.2013.counties-https-www,se.healthstatus.2013.domain-registrars-http,se.healthstatus.2013.domain-registrars-http-www,se.healthstatus.2013.domain-registrars-https,se.healthstatus.2013.domain-registrars-https-www,se.healthstatus.2013.financial-services-http,se.healthstatus.2013.financial-services-http-www,se.healthstatus.2013.financial-services-https,se.healthstatus.2013.financial-services-https-www,se.healthstatus.2013.gocs-http,se.healthstatus.2013.gocs-http-www,se.healthstatus.2013.gocs-https,se.healthstatus.2013.gocs-https-www,se.healthstatus.2013.higher-education-http,se.healthstatus.2013.higher-education-http-www,se.healthstatus.2013.higher-education-https,se.healthstatus.2013.higher-education-https-www,se.healthstatus.2013.isps-http,se.healthstatus.2013.isps-http-www,se.healthstatus.2013.isps-https,se.healthstatus.2013.isps-https-www,se.healthstatus.2013.media-http,se.healthstatus.2013.media-http-www,se.healthstatus.2013.media-https,se.healthstatus.2013.media-https-www,se.healthstatus.2013.municipalities-http,se.healthstatus.2013.municipalities-http-www,se.healthstatus.2013.municipalities-https,se.healthstatus.2013.municipalities-https-www,se.healthstatus.2013.public-authorities-http,se.healthstatus.2013.public-authorities-http-www,se.healthstatus.2013.public-authorities-https,se.healthstatus.2013.public-authorities-https-www}, | ||
legend image code/.code={% | ||
\draw[#1] (0pt,-4pt) rectangle (8pt,4pt); | ||
}, | ||
}, | ||
allDatasetsStackedXbarFullPage/.style= | ||
{ | ||
enlarge y limits=0.006, | ||
width=.6\textwidth, | ||
height=1.4\textwidth, | ||
font=\small | ||
} | ||
} | ||
|
||
\pgfplotsset{datasetsCDF/.style= | ||
{ | ||
xmin=0, | ||
xmax=1, | ||
ymin=0, | ||
ymax=1, | ||
grid=both, | ||
xtick={0,.1,...,1.1}, | ||
ytick={0,.1,...,1.1}, | ||
enlargelimits=false, | ||
% Marks 0% and 99%. | ||
mark repeat=99, | ||
legend pos=south east, | ||
legend style={ | ||
cells={anchor=west}, | ||
}, | ||
}, | ||
datasetsCDFFullPage/.style= | ||
{ | ||
width=\textwidth, | ||
height=1.425\textwidth, | ||
} | ||
} |
Oops, something went wrong.