Académique Documents
Professionnel Documents
Culture Documents
escritura cientı́fica en
LATEX 2ε
David Gómez-Castro
Diciembre 2018
1 Instalación
3 Fórmulas
Distintos tipos de fórmulas
Sı́mbolos
Matrices
Diagramas
4 Teoremas
9 Presentaciones en Beamer
Sesión 6:
10 Gráficos avanzados
Dibujo libre
Representación de funciones
Representación de datos
Url
Google. Si no: lmgtfy.com
TEX Stack Exchange
The not so short introduction to LaTeX2e (actualmente en 139
minutos)
Bienvenido a LATEX
Por eso, LATEX se escribe en documentos de texto “sin formato” con una
cabecera que dice cómo será el formato (tipo de letra, espaciados,
márgenes, tı́tulos...).
ARTICLE
erately exclude ambiguous cases, such as systems with degenerate Constructing such a Hamiltonian constitutes the main technical work
ground states. A Hamiltonian that is gapped or gapless according to of our result. (These properties of Hu(ϕ) are unaffected if we multiply
the above definitions is recognized as such throughout the literature. hu(ϕ) by an arbitrary fixed rational number β, no matter how small.)
We show that the spectral gap problem is undecidable even given that (2) It requires a gapless Hamiltonian Hd with translationally invariant
1 Las principales the Hamiltonian either has a unique ground state and a spectral gap of local interactions hd and a ground state energy of zero. (Recall that by
magnitude one, or has continuous spectrum above the ground state. ‘gapless’ we mean continuous spectrum above the ground state, not
doi:10.1038/nature16059
We prove this by showing that the halting problem for Turing merely a vanishing spectral gap.) There are many well-known examples
revistas del
Undecidability of the spectral gap
machines can be encoded in the spectral gap problem, implying that of such Hamiltonians, for example, that associated with the critical
the latter is at least as hard as the former. A Turing machine is a simple, XY model1.
abstract model of computation in which a head reads and writes sym- Given Hamiltonians with these properties, we construct a new trans-
mundo: Nature, bols
Toby from some finite
S. Cubitt 1,2 alphabet
, David on an infinite
Perez-Garcia & Michael M. Wolf5 or lationally invariant Hamiltonian, with local interactions h(ϕ), that is
3,4 tape and moves left
right, following a finite set of rules. The halting problem asks: given an gapped or gapless depending on the value of ϕ. The local Hilbert space
initial input written on the tape, does the Turing machine halt? Turing of h(ϕ) is the tensor product of those of hu and hd together with one
Science, PNAS, proved that this problem is undecidable12; we relate it to the spectral additional energy level: H = |0〉 ⊕ H u ⊗ H d . We take the interaction
gap Theproblem in thegap—the
spectral followingenergyway. difference between the ground state h(i, j) between
and first nearest-neighbour
excited state of asites i and j to be
system—is central to quantum
many-body physics. Many challenging open problems, such as the Haldane conjecture, the question of the ,existence
and the Yang–Mills gaph(conjecture, ϕ )(i , j ) = |0〉〈0concern
|(i ) ⊗ (! −|spectral h(ui , j )(These
0〉〈0|)(j ) +gaps. ϕ ) ⊗ !(diand
j)
a rational
topological spin liquid phases,
explicitlyareconstruct
particular a dimension
cases of
2
d, dthe 2
× dgeneral
matrices A, B, C and
spectral gap problem: given + the (iHamiltonian
, j)
! u ⊗ hd (i , j ) of a quantum many-body
other(1 )
system, is itnumber
gappedβ or > 0,gapless?
which can be chosen
Here we prove to be that
as small thisasis an undecidable problem. Specifically, we construct families
desired, such that spin systems on a two-dimensional lattice withThe
of quantum translationally invariant,
spectrum of the new Hamiltonian H is nearest-neighbour interactions,
2 Todas las revistas (ii)
A iswhich
(i)for
B and
such
(iii)
Hermitian,
asCthehave
D is Hermitian,
with matrix
integer matrix
existence
elements
the spectral gap problem is undecidable.
elements; and
of algebraically
in Z + β Z + β
2
Z ; This result extends to undecidability of other low-energy properties,
decaying ground-state correlations. specTheH = {0} proof ∪ {spec
combines Hu(ϕ ) +Hamiltonian
specHd } ∪ S complexity (2)
techniques withwith matrix elements
aperiodic tilings, to in construct
{0, 1, β}. a Hamiltonian whose ground state encodes the evolution of a quantum
For each positive integer n, define the local interactions of a transla-Turingwith S ≥ 1 (see Supplementary
spectral gapInformation forthedetails). Recalling that
de Matemáticas phase-estimation
tionally
lattice
invariant,
algorithm
nearest-neighbour
followed
Hamiltonian
as is gapped or gapless, and that there exist models for which
model
by a universal
H(n) on a 2D square we
machine.
chose
the ground
H
corresponding ‘halting problem’. Our result implies that there exists no algorithm to determine whether an arbitraryif d
The
to be gapless,
state energy
the presence
we see
density ofof
or absence
depends on
immediately
Huatends
spectral
from
to zero
outcome
equation
gapfrom
of the
(2) that
below (so that
is independent
λ0(Hu) < 0), then H(ϕ) is gapless; if Hu has a strictly positive ground
hof the axioms of mathematics.
1(n ) = α(n )Π state energy density (so that λ0(Hu) diverges to +∞), then it has a
3 Los profesores en h row = D
Thehcol spectral gap n) † important (n)| †
spectral gap
This Although
≥1,
construction
as required
one ismay rather
(see Fig.
general:
2).
by the
choosing different hd, wein
(e i πisϕ(one
B +ofe−πthe
i ϕ(most Cphysicali 2−| ϕproperties hard. be able to solve spectral gap problem
n) −| ϕ(n)|
=A+β B + e i π2 + e−π C )
of a quantum many-body system, determining much of its low- obtain specific undecidability
cases, our result of implies
any physical that itproperty
is, in general, that logically
distinguishes
impossi-a
sus apuntes (en energy
where ϕ(physics.
n ) = n/2Gapped
example,contains
expansion
|n |−1 is the
massive the
systems
excitations
rationalexhibit
number
and short-range
binary digits
non-critical
whose binary
of n after the correlations),
behaviourfraction
decimal point,whereas
(for Hamiltonian
|ϕ(n)|
ble to determine from whether
a gappedasystem
has two meanings, and we prove both.
systemwith a unique
is gapped productThis
or gapless. ground state.
statement
phase transitions
denotes the numberoccur when
of digits theexpansion,
in this spectral gap α(n) vanishes
≤ β is an and the sys- Encoding
algebraic computation
(1) The spectral gap problem in ground states undecidable: there
is algorithmically
la UCM y en tem exhibits
number
long-range
denote
that iscritical
computable
correlations).
Hermitian
behaviour
conjugation.
from(for
Many
n, Πexample,
Then
massless
is a projector andexcitations
the daggers
seminal results in condensed matter into
and Tocannotconstruct existthe
the local
actions,
anyHamiltonian
algorithm that,
interactions
determines whetherhu(ϕ)the
Hu(ϕ),given wea encode
of resultant
description
the Hamiltonian.
model isThe
the halting problem
of the local
halting
gapped
inter-
prob-
or gapless.
theory
(i) theprove
local that specificstrength
interaction systems are is ≤1gapped
(that or is,gapless,
h1(n ) ,forh row exam- lem
, hcol (n )concerns
This is
≤the1 same the dynamics
sense in which of a classical
the halting system—a
problemTuring machine.
is undecidable 12
.
todas partes) h1(n ) , h row , hple,
col(n that
extended
) ≤ 1);Heisenberg chain is gapless for half-integer spin1 (later To relate
the
to higherTuring
(ii) if the universal dimensions
machine 2
),halts
or that the 1D
on input AKLT
n, the (Affleck– quantum
Hamiltonian
(2) The it to
any consistent
the ground
spectral
system—we recursive
state energy
gap problem
construct
density—a static
is axiomatically
a Hamiltonian
axiomatization
property given
independent:
whose ground
of mathematics,
of a
therestate
exist
Kennedy–Lieb–Tasaki)
H(n) is gapped with γ ≥ 1; and model is gapped3. Similarly, many famous encodes particular the quantum
entire history of the computation
many-body Hamiltonians carried out bythe
for which thepresence
Turing
and long-standing open problems in theoretical physics concern the or absence of the spectral gap is not determined by these axioms. This
2 0presence
8 | NAT U orR absence
E | V O L of 5 2a8spectral
| 1 0 D Egap.C E MA BE paradigmatic
R 2015 example is is the form of undecidability encountered in Gödel’s incompleteness
13 reserved
the antiferromagnetic Heisenberg model in 1D with
© 2015 integerPublishers
Macmillan spins. Limited.
theorem .
All rights
The ‘Haldane conjecture’ that this model is gapped, first formulated
in 1983 , has yet to be rigorously proven despite strong supporting Precise statement of results
4
5
numerical evidence . The same question in the case of 2D non-bipartite It is important to be precise in what we mean by the spectral gap prob-
6
lattices such as the kagome lattice was posed in 1973 . Numerical lem. To this end, we must first specify the systems we are considering.
evidence7 strongly indicates that these systems may be topological Because we are proving undecidability, the simpler the system, the
David Gómez-Castro (UCM) Introducción a L TEX 2ε
spin liquids. This problem has attracted substantial A Diciembre 2018
attention8 because stronger the result. We restrict ourselves to nearest-neighbour, trans- 8 / 80
Descargar e instalar LATEX
1
Los usuarios de Linux lo pueden descargar por terminal
David Gómez-Castro (UCM) Introducción a LATEX 2ε Diciembre 2018 10 / 80
TeXstudio
Los archivos de LATEX son archivos de texto (plano) con extension .tex.
Aquı́ es donde decidimos que tipo de archivo latex queremos escribir, hay
diferentes tipos de documentos
Código
\documentclass{<style>}
\begin{document}
% El texto
\end{document}
Aquı́ es donde decidimos qué tipo de archivo latex queremos escribir, hay
diferentes tipos de documentos
Código [hola-mundo.tex]
\documentclass{article}
\begin{document}
Hola Mundo
\end{document}
latex hola-mundo.tex
Código
\documentclass{<style>}
\begin{document}
% El texto
\end{document}
Aquı́ es donde decidimos que tipo de archivo latex queremos escribir, hay
diferentes tipos de documentos
Código
\documentclass{<style>}
<style>:
1 article Para artı́culos % Configuracion del archivo
cortos. Acepta partes,
secciones y subsecciones \begin{document}
% El texto
\end{document}
Aquı́ es donde decidimos que tipo de archivo latex queremos escribir, hay
diferentes tipos de documentos
Código
<style>: \documentclass{<style>}
\end{document}
Código
\documentclass{<style>}
% El texto
\end{document}
Código
\documentclass{article}
\usepackage{amsmath}
3
X
\begin{document} ai = 1. (1)
i=1
\begin{equation}
\sum_{i=1}ˆ3 a_i = 1.
\end{equation}
\end{document}
David Gómez-Castro (UCM) Introducción a LATEX 2ε Diciembre 2018 21 / 80
Creando comandos
Código
\documentclass{standalone}
\newcommand{\deciralgo}[1]
{Esto es lo que digo: ‘‘#1’’. Esto es lo que digo: “Hola”. Y no me arrepiento.
Y no me arrepiento.}
\begin{document}
\deciralgo{Hola}
\end{document}
Código
\documentclass{<style>}
Para indicarle al compilar que
hemos hecho eso escribimos. \usepackage[utf8]{inputenc}
\begin{document}
Código
\documentclass{<style>}
Para indicarle al compilar que
hemos hecho eso escribimos. \usepackage[spanish]{babel}
\begin{document}
Código [modular.tex]
\documentclass{standalone}
\begin{document}
\input{modulo1.tex}
\input{modulo2.tex}
\end{document} Un texto. Otro texto.
Figura: Resultado de compilar
Código [modulo1.tex] modular.tex
Un texto.
Código [modulo2.tex]
Otro texto.
David Gómez-Castro (UCM) Introducción a LATEX 2ε Diciembre 2018 26 / 80
Aspecto de un primer documento
Código (ejemplo1.tex)
\documentclass{article} Mi trabajo a LATEX
Yo
Y mi amigo
\begin{document}
\maketitle
\end{document}
2
El sistema ShareLatex es ahora parte de Overleaf
David Gómez-Castro (UCM) Introducción a LATEX 2ε Diciembre 2018 28 / 80
Sesión II
1 En lı́nea Código
Puedo escribir $eˆ{i\pi } + 1
= 0$
Puedo escribir e iπ + 1 = 0
Código
1 En lı́nea Puedo escribir
2 Presentada $$ eˆ{i\pi } + 1 = 0$$
Puedo escribir
e iπ + 1 = 0
Código
Puedo escribir
1 En lı́nea \begin{equation}
2 Presentada eˆ{i\pi} + 1 = 0
3 equation \end{equation}
Puedo escribir
e iπ + 1 = 0 (1)
Código
Puedo escribir
\begin{align}
1 En lı́nea eˆ{i\pi} + 1 &= 0 \\
2 Presentada eˆ{i\pi} &= -1
\end{align}
3 equation
4 align Puedo escribir
e iπ + 1 = 0 (1)
iπ
e = −1 (2)
a
+ + ε \varepsilon \frac{a}{b}
√b
− - δ \delta a \sqrt{a}
× \times ∂ \partial ab {a}ˆ{b}
÷ \div Ω \Omega
· \cdot π \pi
⊕ \oplus
⊗ \otimes
Código e iπ + 1 = 0
eˆ{i\pi} + 1 = 0
Puedo escribir la ecuación de
Código Euler e iπ + 1 = 0 en lı́nea o
Puedo escribir la ecuación presentada
de Euler $eˆ{i \pi} + 1 = 0$
en lı́nea o presentada e iπ + 1 = 0
$$ eˆ{i\pi} + 1 = 0$$
para que quede mejor para que quede mejor
Código máx
$$\max_{\substack{y \in \Omega \\ |y| > 1}}$$ y ∈Ω
|y |>1
Código
$$
\begin{pmatrix} 1 2 3
4 5
1 & 2 & 3 \\
4 & 5 & \\ 6 7
6 & & 7
\end{pmatrix}
$$
Código
$$
\begin{bmatrix} 1 2 3
4 5
1 & 2 & 3 \\
4 & 5 & \\ 6 7
6 & & 7
\end{bmatrix}
$$
Este paquete se emplea para hacer todo tipo de gráficos, por ejemplo el
diagrama
A
f /B
g
g◦f
C
Tiene infinidad de opciones.
Código A B
\xymatrix{
A & B \\
& C C
}
Se puede introducir una xymatrix dentro o fuera de fórmulas, pero
deberemos tener cuidado con el contenido.
f
! y
B _ /C id
D
f
! y
B _ /C id
D
Código (ejercicio3.tex)
$$
\xymatrix{
A \ar@/_2ex/[ddr] \ar[dr]|f \ar@/ˆ2ex/[drr] \\
& B \ar@{-->}[r] \ar@{ˆ(->}[d] & C\ar@(dr,ur)[]_{id} \\
& D
}
$$
\abstractname Abstract
\appendixname Appendix
\bibname Bibliography (report,book)
\chaptername Chapter (report,book)
\contentsname Contents
\figurename Figure (for captions)
\indexname Index
\listfigurename List of Figures
\listtablename List of Tables
\tablename Table (for caption)
Código (ejemplo2.tex)
\documentclass{article}
\usepackage{amsthm}
\end{document}
El teorema de la divergencia
Un estudiante
10 de abril de 2013
1. El teorema
El teorema de la divergencia de Gauss se enuncia de la siguiente manera
2. Ejercicios
Ejercicio 1. Este ejercicio
Por defecto LATEX los coloca donde menos moleste: en el lugar del texto donde
hemos colocado el código, al principio de la página o al final de la página.
Por defecto LATEX los coloca donde menos moleste: en el lugar del texto donde
hemos colocado el código, al principio de la página o al final de la página.
Código
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\includegraphics[scale=0.5]
{gauss.pdf} Figure 1: Gauss
\caption{Gauss}
\end{figure}
\end{document}
a) l: izquierda Código
b) c: centrado \begin{tabular}{<align>| ... }
c) r: derecha cuadro1 & cuadro2 & ... \\
\hline\\
...
\end{tabular}
Código
\begin{table}
\begin{tabular}{c|l r|} 1 2 3
1 & 2 & 3 \\ 4 5
\hline 6 7
4 & 5 & \\
6 & & 7 Cuadro: Mi tabla
\end{tabular}
\caption{Mi tabla}
\end{table}
Código
\documentclass{standalone}
\usepackage{listings}
\end{document}
Código [ejemplo-c-2.tex]
\documentclass{standalone}
\usepackage{listings}
#include<s t d i o . h>
\begin{document} main ( )
\lstinputlisting[language=C++]{codigo2.cpp}
{
\end{document}
p r i n t f ( ” H e l l o World” ) ;
}
Código [codigo2.cpp]
#include<stdio.h> Figura: Resultado de compilar
main() ejemplo-c-2.tex
{
printf("Hello World");
}
\lstset{language=C++,
keywordstyle=\color{blue},
stringstyle=\color{red}, #i n c l u d e <s t d i o . h>
commentstyle=\color{green}, main ( )
morecomment=[l][\color{magenta}]{\#} {
} p r i n t f ( ” H e l l o World” ) ;
\begin{lstlisting} }
#include<stdio.h>
main() Figura: Resultado de compilar
{
printf("Hello World");
}
\end{lstlisting}
\end{document}
David Gómez-Castro (UCM) Introducción a LATEX 2ε Diciembre 2018 55 / 80
Añadir código MATLAB
MathWorks ofrece un paquete (a descargar aquı́) para incluir código con
formato de matlab
Código[Ejemplo de mcode]
\documentclass{standalone}
\usepackage{listing}
\usepackage{xcolor}
\usepackage{mcode}
% Mi codigo matlab
\begin{document} a = 1;
\lstinputlisting{codigo1.m}
\end{document} Figura: Resultado de compilar
ejemplo-mcode.tex
Código[codigo1.m]
% Mi codigo matlab
a = 1;
Para empezar una nueva sección con tı́tulo basta con indicarlo y dar un
tı́tulo utilizando los siguientes comandos:
-1 \part {titulo}
0 \chapter {titulo}
1 \section {titulo}
2 \subsection {titulo}
3 \subsubsection {titulo}
4 \paragraph {titulo}
5 \subparagraph {titulo}
Para empezar una nueva sección con tı́tulo basta con indicarlo y dar un
tı́tulo utilizando los siguientes comandos:
-1 \part {titulo}
0 \chapter {titulo}
1 \section {titulo}
2 \subsection {titulo}
3 \subsubsection {titulo}
4 \paragraph {titulo}
5 \subparagraph {titulo}
Se puede generar el ı́ndice introduciendo \tableofcontents . Este
comando admite parámetros optativos.
Para empezar una nueva sección con tı́tulo basta con indicarlo y dar un
tı́tulo utilizando los siguientes comandos:
-1 \part {titulo}
0 \chapter {titulo}
1 \section {titulo}
2 \subsection {titulo}
3 \subsubsection {titulo}
4 \paragraph {titulo}
5 \subparagraph {titulo}
Se puede generar el ı́ndice introduciendo \tableofcontents . Este
comando admite parámetros optativos.
Código
\usepackage{fancyhdr}
\pagestyle{<style>}
<style>:
Encabezado Pie de página
empty Vacı́o Vacı́o
plain Vacı́o Número de página centrado
headings Nombre del capı́tulo y número de página Vacı́o
myheadings Número de página y otros Vacı́o
fancy Capı́tulo y sección Número de página
[...]
\begin{document}
[...]
%% ************************* Capitulos *************************
%% Se recomienda escribir cada capitulo en un archivo distinto
%% para evitar grandes tamano de archivos
% Capitulo 2
\input{cap2/cap2}
% Capitulo 3
%\input{cap3/cap3}
Referencias
Código
\begin{figure}
Código
\begin{<thm>} \label{<label>} \includegraphics{<path>}
\caption{<caption>}
\end{<thm>} \label{<label>}
\end{figure}
Figura 1: Euclides
Solución
\documentclass{article} Ejercicio: Escribir el código
\usepackage[spanish]{babel} correspondiente a la siguiente salida:
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\begin{document}
\begin{thm} \label{thm:euclides}
No hay primo mayor que el resto
\end{thm}
\begin{figure}[h!]
\centering
\includegraphics[scale=0.5]{euclides.pdf} Figura 1: Euclides
\end{document}
\begin{thm} \label{thm:euclides}
No hay primo mayor que el resto
\end{thm}
\begin{figure}[h!]
\centering Figura 1: Euclides
\includegraphics[scale=0.5]{euclides.pdf}
Euclides, al que podemos ver en la Figura 1, propuso y demostró el Teorema 1.
\caption{Euclides}
\label{fig:euclides}
\end{figure}
Euclides, al que podemos ver en la
\Cref{fig:euclides}, propuso
y demostró el \Cref{thm:euclides}.
\end{document}
Código
\documentclass{article}
\begin{document}
\begin{thebibliography}{9} References
\bibitem{latexcompanion} [1] Michel Goossens, Frank Mittelbach, and Alexander Samarin. The LATEX
Michel Goossens, Frank Mittelbach, Companion. Addison-Wesley, Reading, Massachusetts, 1993.
and Alexander Samarin. [2] Albert Einstein. Zur Elektrodynamik bewegter Körper. (German) [On the
electrodynamics of moving bodies]. Annalen der Physik, 322(10):891921,
\textit{The \LaTeX\ Companion}. 1905.
Addison-Wesley, Reading, Massachusetts, 1993. [3] Wikipedia
http://www.wikipedia.com
\bibitem{einstein}
Albert Einstein.
\textit{Zur Elektrodynamik bewegter K{\"o}rper}.
(German)
[{On the electrodynamics of moving bodies}].
Annalen der Physik, 322(10):891{921, 1905.
\bibitem{wikipedia}
Wikipedia
\\\texttt{http://www.wikipedia.com}
\end{thebibliography}
\end{document}
Código
[ejemplo-bibliografia.bib]
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}.
({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik", Observación. Bibtex, al compilar,
volume = "322",
number = "10",
genera un archivo .bbl que contiene
pages = "891--921",
year = "1905",
una bibliografı́a nativa.
DOI = "http://dx.doi.org/10.1002/andp.19053221004"
}
Código
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\mode<presentation>
\usetheme{Warsaw}
\usecolortheme{seahorse}
\title{Mi presentacion}
\author{Yo}
\date{\today}
Código
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsthm}
\usepackage{graphicx}
\newtheorem{thm}{Teorema}
\mode<presentation>
\usetheme{Warsaw}
\usecolortheme{seahorse}
\title{Mi presentacion}
\author{Yo}
\date{\today}
Código
\begin{document}
\begin{frame}
% Texto de la diapositiva
\end{frame}
\end{document}
Código
1 Cuadros \begin{frame}
\begin{block}{Bloque}
Texto en un bloque
\end{block}
\end{frame}
Código
\begin{frame}
\begin{figure}
1 Cuadros
\centering
2 Imágenes \includegraphics[scale=0.5]
{gauss.pdf}
\caption{Gauss}
\end{figure}
\end{frame}
Código
\begin{frame}
\begin{thm}
1 Cuadros
Un teorema...
2 Imágenes \end{thm}
\begin{proof}
3 Teoremas
Y su prueba ...
\end{proof}
\end{frame}
Gráficos avanzados
Código
\documentclass{standalone} % say
\usepackage{tikz}
\begin{document}
Trabajaremos con
\begin{tikzpicture}
\draw (-1.5,0) -- (1.5,0); Trabajaremos con .
\draw (0,-1.5) -- (0,1.5);
\end{tikzpicture}. Figura: Resultado de compilar
\end{document}
Código
\begin{tikzpicture}
\draw[->] (-1.5,0) -- (1.5,0);
\draw[dashed] (0,-1.5) -- (0,1.5);
\draw[green] (0,0) circle (1cm);
\end{tikzpicture}
\path[draw,thick]
(1) edge node {} (2)
(2) edge node {} (3)
(3) edge node {} (1);
\end{tikzpicture}
\end{document}
2 3
det A
∆=0 ∆=0: det A= 14 (Tr A)2
uniform center
motion
sink source
Tr A
Código
8
\documentclass{standalone}
\usepackage{pgfplots} 6
4
\begin{document}
\begin{tikzpicture} 2
\begin{axis}[xmax=9,ymax=9,samples=50] 0
\addplot[blue] (x,x*x);
−2
\addplot[red] (x*x,x);
\end{axis} −4
−4 −2 0 2 4 6 8
\end{tikzpicture}
\end{document}
Figura: Resultado de compilar
\begin{document}
6
\begin{tikzpicture}
\begin{axis}
\addplot
4
table [x=a, y=c, col sep=comma]
{data.csv};
\end{axis}
\end{tikzpicture} 2
\end{document}
1 2 3 4 5
Código [data.csv]
a,b,c,d Figura: Resultado de compilar
1,4,5,1
2,3,1,5
3,5,6,1
4,1,4,9
5,3,4,7