19.11.2014 Views

Edición de textos científicos con LaTeX - TEC Digital - Tecnológico ...

Edición de textos científicos con LaTeX - TEC Digital - Tecnológico ...

Edición de textos científicos con LaTeX - TEC Digital - Tecnológico ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

62 TEXTO EN MODO MATEMÁTICO<br />

Ejemplo 4.26 (Comando para minipage y para límite).<br />

\newcommand{\mpage}[2] { \begin{minipage}[b]{0.5 \textwidth}<br />

#1<br />

\end{minipage} \hfill \begin{minipage}[b]{0.5 \textwidth}<br />

#2<br />

\end{minipage}}<br />

\newcommand{\limite}[2] { \lim_{ #1 \rightarrow #2}}<br />

Así, el texto:<br />

\mpage{ % no se pue<strong>de</strong>n <strong>de</strong>jar renglones en blanco!<br />

\centering<br />

\inclu<strong>de</strong>graphics{images/ML_fig13.pdf}<br />

}{<br />

\[ \limite{n}{ \infty }{ \arctan (n) } \]<br />

}<br />

produce (compilando <strong>con</strong> PDFLATEX):<br />

lim arctan(n)<br />

n→∞<br />

Otros ejemplos son<br />

%Color, uso: {\colr texto}<br />

\newcommand{\colr}{\color{red}}<br />

%Texto <strong>con</strong> fuente helvetica, uso: \fhv{texto}<br />

\newcommand{\fhv}[1]{{\fontfamily{hv}\fontsize{9}{1}\selectfont{#1}}}<br />

%Entorno enumerate, uso \be \item... \item... \en<br />

\newcommand{\be}{\begin{enumerate}}<br />

\newcommand{\ee}{\end{enumerate}}<br />

4.17.1 Comandos <strong>con</strong> opciones<br />

Po<strong>de</strong>mos agregar opciones a nuestros comandos <strong>de</strong>jando algunos valores por <strong>de</strong>fault. Esto lo<br />

po<strong>de</strong>mos hacer <strong>con</strong> el paquete xargs: Ponemos \usepackage{xargs} en el preámbulo.<br />

El código para un comando <strong>con</strong> n parámetros sería algo como,<br />

newcommandx*\nombre[n][opcion1 = o1, opcion2 = o2,...]{código latex}<br />

Las opciones, si hubiera, se refieren al valor <strong>de</strong>fault <strong>de</strong> algunos o todos los parámetros.<br />

Un ejemplo clásico es el <strong>de</strong> crear un comando para abreviar una sucesión: x 0 , x 1 ,...x n . En este<br />

caso, es <strong>de</strong>seable que podamos tener un comando flexible que nos permita iniciar <strong>con</strong> subíndice

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!