Está en la página 1de 4

Taller 1

W. Arturo Osorio C.
GEOINFORMÁTICA
Profesor: Germán A. Prieto
15 de agosto de 2017

1. Uso de LATEX, parte I.


Reproducir el siguiente documento:

Figura 1: Documento para reproducir en LATEX.

Para hacerlo se deberán utilizar los comandos:

\setlength{\parindent}{}

\textit{}

1
\textcolor{red}{}

\begin{equation}
\end{equation}

\begin{eqnarray}
\end{eqnarray}

Siendo el resultado el siguiente:

The standard technique is to linearize the problem by considering small perturbations


to a target location

m = m0 + ∆m (1)
where m0 is the current guess as to the best location and m is a new location a small
distance away from m0 . The predicted times at m may be approximated using the first
term in the Taylor series expansion

∂tpi
tpi (m) = tpi (m0 ) + ∆mj (2)
∂mj
The residuals at the new location m are given by

ri (m) = ti − tpi (m)


∂tpi
= ti − tpi (m0 )
− ∆mj
∂mj
∂tpi
= ri (m0 ) − ∆mj (3)
∂mj

2. Uso de LATEX, parte II.


El paquete listings es un visualizador de código ampliamente usado en LATEXdebido a su
versatilidad al momento de personalizar elementos del código a escribir: color, tamaño,
fondo, etc. Además, trae soporte para varios lenguajes de programación y la posibilidad
de añadir elementos no incluidos o soportados a cada lenguaje.
1 #hola.py
2 #Mi primer programa de Python
3 print ( ’ ’ Hola Mundo ! ’ ’ )

2
Para escribir este script de python se perzonalizaron los colores y el significado de
los sı́mbolos de la siguiente manera:

%Paquete para código de programación

\usepackage{color}
\usepackage{listings}
\usepackage{setspace}

\definecolor{Code}{rgb}{0,0,0}
\definecolor{Decorators}{rgb}{0.5,0.5,0.5}
\definecolor{Numbers}{rgb}{0.5,0,0}
\definecolor{MatchingBrackets}{rgb}{0.25,0.5,0.5}
\definecolor{Keywords}{rgb}{0,0,1}
\definecolor{self}{rgb}{0,0,0}
\definecolor{Strings}{rgb}{0,0.63,0}
\definecolor{Comments}{rgb}{0,0.63,1}
\definecolor{Backquotes}{rgb}{0,0,0}
\definecolor{Classname}{rgb}{0,0,0}
\definecolor{FunctionName}{rgb}{0,0,0}
\definecolor{Operators}{rgb}{0,0,0}
\definecolor{Background}{rgb}{0.98,0.98,0.98}

\lstdefinelanguage{Python}{
numbers=left,
numberstyle=\footnotesize,
numbersep=1em,
xleftmargin=1em,
framextopmargin=2em,
framexbottommargin=2em,
showspaces=false,
showtabs=false,
showstringspaces=false,
frame=l,
tabsize=4,
% Básico
basicstyle=\ttfamily\small\setstretch{1},
backgroundcolor=\color{Background},
% Comentarios
commentstyle=\color{Comments}\slshape,
% Strings
stringstyle=\color{Strings},
morecomment=[s][\color{Strings}]{"""}{"""},

3
morecomment=[s][\color{Strings}]{’’’}{’’’},
% Palabras clave
morekeywords={import,from,class,def,for,while,if,is,in,elif,else,not,and,or,print,
keywordstyle={\color{Keywords}\bfseries},
% Otros
morekeywords={[2]@invariant,pylab,numpy,np,scipy},
keywordstyle={[2]\color{Decorators}\slshape},
emph={self},
emphstyle={\color{self}\slshape},
sensitive=false,
comment=[l]{\#},
morecomment=[s]{/*}{*/},
commentstyle=\color{purple}\ttfamily,
stringstyle=\color{red}\ttfamily,
%
}

Ası́, el código usado para escribir el ejemplo fue:

\lstset{language=Python, breaklines=true, basicstyle=\footnotesize}


\begin{lstlisting}
#hola.py
#Mi primer programa de Python
print (’’Hola Mundo!’’)
\end{lstlisting}

También podría gustarte