Created
December 19, 2010 16:32
-
-
Save jhbabon/747457 to your computer and use it in GitHub Desktop.
Template for XeTeX documents
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
% Plantilla para documentos XeTeX | |
\documentclass[10pt]{report} | |
% LAYOUT | |
\usepackage[a4paper]{geometry} | |
%% Márgenes | |
\geometry{ | |
includeheadfoot, | |
twoside, | |
inner=2cm, | |
outer=1.5cm, | |
top=1.5cm, | |
bottom=1.5cm | |
} | |
% BABEL | |
\usepackage[spanish]{babel} | |
%% Para que el acento salga bien con la nueva tipografía | |
\addto\captionsspanish{ | |
\renewcommand{\chaptername}{Capítulo} | |
\renewcommand{\bibname}{Bibliografía} | |
\renewcommand{\lstlistingname}{Listado} | |
} | |
% TIPOGRAFÍA | |
\usepackage[none]{hyphenat} | |
\usepackage{fontspec} | |
\usepackage{xunicode} | |
\usepackage{xltxtra} | |
\defaultfontfeatures{Mapping=tex-text} % | |
%% Poner las tipografías que se quieran | |
\setromanfont[ | |
Ligatures={Common}, | |
BoldFont={Georgia Bold}, | |
ItalicFont={Georgia Italic} | |
]{Georgia} | |
\setsansfont[ | |
Ligatures={Common}, | |
BoldFont={Trebuchet MS Bold}, | |
ItalicFont={Trebuchet MS Italic} | |
]{Trebuchet MS} | |
\setmonofont[ | |
BoldFont={Liberation Mono Bold}, | |
ItalicFont={Liberation Mono Italic} | |
]{Liberation Mono} | |
% CABECERAS DE SECCIONES Y CAPÍTULOS | |
\usepackage{sectsty} | |
\allsectionsfont{\sffamily} | |
\subsubsectionfont{\sffamily\large} | |
% PDF SETUP | |
\usepackage[ | |
dvipdfm, | |
bookmarks, | |
colorlinks, | |
breaklinks, | |
pdftitle={Un título}, | |
pdfauthor={Un autor} | |
]{hyperref} | |
\hypersetup{ | |
linkcolor=black, | |
citecolor=blue, | |
filecolor=black, | |
urlcolor=blue | |
} | |
\usepackage{pdfsync} | |
% LISTING | |
%% Sacado de: | |
%% http://stackoverflow.com/questions/741985/latex-source-code-listing-like-in-professional-booksbooks | |
\usepackage{color} | |
\usepackage{xcolor} | |
\usepackage{listings} | |
\lstset{ | |
basicstyle=\footnotesize\ttfamily, | |
tabsize=2, | |
extendedchars=true, | |
breaklines=true, | |
keywordstyle=\color{red}, | |
commentstyle=\color{blue}, | |
frame=b, | |
stringstyle=\color{purple}, | |
showspaces=false, | |
showtabs=false, | |
xleftmargin=17pt, | |
framexleftmargin=17pt, | |
framexrightmargin=5pt, | |
framexbottommargin=4pt, | |
showstringspaces=false, | |
numbers=left, | |
numbersep=15pt, | |
numberstyle=\tiny\ttfamily, | |
numberfirstline=false, | |
breaklines=true, | |
} | |
%% minimizar fragmentado de listados | |
\lstnewenvironment{listing}[1][] | |
{\lstset{#1}\pagebreak[0]}{\pagebreak[0]} | |
\usepackage{caption} | |
\DeclareCaptionFont{white}{\color{white}} | |
\DeclareCaptionFormat{listing}{ | |
\colorbox[cmyk]{0.43, 0.35, 0.35,0.01}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}} | |
} | |
\captionsetup[lstlisting]{ | |
format=listing, | |
labelfont=white, | |
textfont=white, | |
singlelinecheck=false, | |
margin=0pt, | |
font={small} | |
} | |
\begin{document} | |
\tableofcontents | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment