(→Acentos y eñes) |
(→Acentos y eñes) |
||
Línea 29: | Línea 29: | ||
} | } | ||
</source> | </source> | ||
+ | ==Figuras== | ||
+ | [http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions] | ||
+ | <source lang="latex"> | ||
+ | \begin{figure} | ||
+ | \centering | ||
+ | \begin{framed} % Si queremos un recuadro | ||
+ | \includegraphics[width=\textwidth]{chick} | ||
+ | \end{framed} | ||
+ | \caption{Ejemplos} | ||
+ | \label{fig:ejemplos} | ||
+ | \end{figure} | ||
+ | </source> | ||
+ | ===Subfiguras con subcaption=== | ||
+ | Existen 3 paquetes para hacer subfiguras, el más moderno es subcaption: | ||
+ | <source lang="latex"> | ||
+ | \begin{figure} | ||
+ | \centering | ||
+ | \begin{framed} | ||
+ | \begin{subfigure}[b]{0.45\textwidth} | ||
+ | \begin{lstlisting}[language=bash] | ||
+ | ./programa.bin "3 2 5 + *" | ||
+ | \end{lstlisting} | ||
+ | Imprime:\\ | ||
+ | \texttt{21} | ||
+ | \subcaption{} | ||
+ | \end{subfigure}\rule{.1pt}{65pt} % Línea vertical | ||
+ | \begin{subfigure}[b]{0.45\textwidth} | ||
+ | \begin{lstlisting}[language=bash] | ||
+ | ./programa.bin "2 5 *" "4 5 +" | ||
+ | \end{lstlisting} | ||
+ | Imprime:\\ | ||
+ | \texttt{10}\\ | ||
+ | \texttt{9} | ||
+ | \subcaption{} | ||
+ | \end{subfigure}\\ | ||
+ | \rule{1\textwidth}{.1pt} % Línea horizontal | ||
+ | \begin{subfigure}[b]{1\textwidth} % Subfigura al 100% de ancho | ||
+ | \begin{lstlisting}[language=bash] | ||
+ | ./programa.bin | ||
+ | \end{lstlisting} | ||
+ | Imprime:\\ | ||
+ | \texttt{Uso: ./programa.bin expresión\_en\_npi [expresión\_en\_npi [...]]} | ||
+ | \subcaption{} | ||
+ | \end{subfigure} | ||
+ | \end{framed} | ||
+ | \caption{Ejemplos} | ||
+ | \label{fig:ejemplos} | ||
+ | \end{figure | ||
+ | </source> | ||
+ | |||
+ | ==Gráficos== | ||
+ | [http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics] |
Poner todo un documentos en español lleva varios pasos:
\usepackage[spanish,es-tabla,es-noquoting]{babel} % Idioma y codificación del texto \usepackage[utf8x]{inputenc} % Codificación del archivo %% La tipografía tiene que soportar tildes, no todas lo hacen %% \usepackage{courier} % Courier para tipografía monoespaciada \usepackage[T1]{fontenc} %% Si se usa hyperref + utf8x para establecer el título, autor, etc... %% \PrerenderUnicode{á} \PrerenderUnicode{é} \PrerenderUnicode{í} \PrerenderUnicode{ó} \PrerenderUnicode{ú} \PrerenderUnicode{ñ} %% Los listings precisan parámetros especiales, sino puede fallar la generación del PDF %% \lstset{ extendedchars=true, inputencoding=utf8x, literate={á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {ñ}{{\~n}}1 }
\begin{figure} \centering \begin{framed} % Si queremos un recuadro \includegraphics[width=\textwidth]{chick} \end{framed} \caption{Ejemplos} \label{fig:ejemplos} \end{figure}
Existen 3 paquetes para hacer subfiguras, el más moderno es subcaption:
\begin{figure} \centering \begin{framed} \begin{subfigure}[b]{0.45\textwidth} \begin{lstlisting}[language=bash] ./programa.bin "3 2 5 + *" \end{lstlisting} Imprime:\\ \texttt{21} \subcaption{} \end{subfigure}\rule{.1pt}{65pt} % Línea vertical \begin{subfigure}[b]{0.45\textwidth} \begin{lstlisting}[language=bash] ./programa.bin "2 5 *" "4 5 +" \end{lstlisting} Imprime:\\ \texttt{10}\\ \texttt{9} \subcaption{} \end{subfigure}\\ \rule{1\textwidth}{.1pt} % Línea horizontal \begin{subfigure}[b]{1\textwidth} % Subfigura al 100% de ancho \begin{lstlisting}[language=bash] ./programa.bin \end{lstlisting} Imprime:\\ \texttt{Uso: ./programa.bin expresión\_en\_npi [expresión\_en\_npi [...]]} \subcaption{} \end{subfigure} \end{framed} \caption{Ejemplos} \label{fig:ejemplos} \end{figure