forked from mhunicken/icpc-team-notebook-el-vasito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preamble.tex
85 lines (78 loc) · 3.03 KB
/
preamble.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
\documentclass[10pt,landscape,twocolumn,a4paper,notitlepage]{article}
\usepackage{hyperref}
\usepackage[english, activeacute]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{listings}
\usepackage{amssymb}
\usepackage[usenames,dvipsnames]{color}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{amsmath}
\usepackage{makeidx}
%%% Margenes
\setlength{\columnsep}{0.25in} % default=10pt
\setlength{\columnseprule}{0.5pt} % default=0pt (no line)
\addtolength{\textheight}{2.35in}
\addtolength{\topmargin}{-0.9in} % ~ -0.5 del incremento anterior
\addtolength{\textwidth}{1.1in}
\addtolength{\oddsidemargin}{-0.55in} % -0.5 del incremento anterior
\setlength{\headsep}{0.08in}
\setlength{\parskip}{0in}
\setlength{\headheight}{15pt}
\setlength{\parindent}{0mm}
%%% Encabezado y pie de pagina
\pagestyle{fancy}
\fancyhead[LO]{\textbf{\title}}
\fancyhead[C]{\leftmark\ -\ \rightmark}
\fancyhead[RO]{Page \thepage\ of \pageref{LastPage}}
\renewcommand{\headrulewidth}{0.4pt}
\fancyfoot{}
\definecolor{darkblue}{rgb}{0,0,0.4}
%%% Configuracion de Listings
\lstloadlanguages{C++}
\lstnewenvironment{code}
{%\lstset{ numbers=none, frame=lines, basicstyle=\small\ttfamily, }%
\csname lst@SetFirstLabel\endcsname}
{\csname lst@SaveFirstLabel\endcsname}
\lstset{% general command to set parameter(s)
language=C++, basicstyle=\small\ttfamily, keywordstyle=\slshape,
emph=[1]{tipo,usa}, emphstyle={[1]\sffamily\bfseries},
morekeywords={tint,forn,forsn,fore},
basewidth={0.47em,0.40em},
columns=fixed, fontadjust, resetmargins, xrightmargin=5pt, xleftmargin=15pt,
flexiblecolumns=false, tabsize=2, breaklines, breakatwhitespace=false, extendedchars=true,
numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=9pt,
frame=l, framesep=3pt,
basicstyle=\ttfamily,
keywordstyle=\color{darkblue}\ttfamily,
stringstyle=\color{magenta}\ttfamily,
commentstyle=\color{RedOrange}\ttfamily,
morecomment=[l][\color{OliveGreen}]{\#}
}
\lstdefinestyle{C++}{
language=C++, basicstyle=\small\ttfamily, keywordstyle=\slshape,
emph=[1]{tipo,usa,tipo2}, emphstyle={[1]\sffamily\bfseries},
morekeywords={tint,forn,forsn,fore},
basewidth={0.47em,0.40em},
columns=fixed, fontadjust, resetmargins, xrightmargin=5pt, xleftmargin=15pt,
flexiblecolumns=false, tabsize=2, breaklines, breakatwhitespace=false, extendedchars=true,
numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=9pt,
frame=l, framesep=3pt,
basicstyle=\ttfamily,
keywordstyle=\color{darkblue}\ttfamily,
stringstyle=\color{magenta}\ttfamily,
commentstyle=\color{RedOrange}\ttfamily,
morecomment=[l][\color{OliveGreen}]{\#}
}
%%% Macros
\def\nbtitle#1{\begin{Large}\begin{center}\textbf{#1}\end{center}\end{Large}}
\def\nbsection#1{\section{#1}}
\def\nbsubsection#1{\subsection{#1}}
\def\nbcoment#1{\begin{small}\textbf{#1}\end{small}}
\newcommand{\comb}[2]{\left( \begin{array}{c} #1 \\ #2 \end{array}\right)}
\def\complexity#1{\texorpdfstring{$\mathcal{O}(#1)$}{O(#1)}}
\newcommand\cppfile[2][]{
\lstinputlisting[style=C++,linerange={#1}]{#2}
}