LaTeX

Índex / Index

General

LyX sources

Other LaTeX editors

Instal·lació / Installation

  • Mageia
    • sudo dnf install latex texlive-dist

Ús / Usage


  • dvi pdf ps svg

    • okular toto.dvi
    • okular toto.pdf
    • okular toto.ps
    • gwenview toto.svg
    .tex latex toto.tex pdflatex toto.tex

    .dvi

    dvips toto.div dvisvgm toto.div
  • Create div
    • latex toto.tex
  • View div
    • okular toto.div
    • from div:
      • create ps:
        • dvips toto.div
      • create svg
        • dvisvgm toto.div
  • Create pdf
    • pdflatex toto.tex
  • allow running external programs (e.g. gnuplot)
  • when prompting an error:
    • ? \help
      Type <return> to proceed, S to scroll future error messages,
      R to run without stopping, Q to run quietly,
      I to insert something, E to edit your file,
      1 or ... or 9 to ignore the next 1 to 9 tokens of input,
      H for help, X to quit.
  • Standalone

Trucs / Tips

  • Document
    • \documentclass[a4paper,10pt]{article}
    • \documentclass[9pt,oneside]{article}
  • Codificació de fitxers de text / Text file coding
    • UTF-8
      • \usepackage[utf8]{inputenc}
    • Latin-1
      • \usepackage[latin1]{inputenc}
  • Sense numeració de pàgina:
    • \pagestyle{empty}
  • Llengua / Language (servirà, entre altres coses, perquè posi «Figura» i no «Figure» al peu de les figures)
    • \usepackage[catalan]{babel}
  • Marges / Margins
    • \addtolength{\textwidth}{3cm}
      \addtolength{\hoffset}{-2.5cm}
      \addtolength{\voffset}{-3cm}
      \addtolength{\textheight}{4cm}
  • Euro
    • \usepackage{eurosym}

      10\euro
  • Errors:
    • Missing $ inserted
      • pot provenir dels accents. Comproveu la codificació del fitxer i que hi hagi només un \usepackage[xxx]{inputenc}.
  • Commands
    • Commands
      • definition usage
        no parameters:
        \newcommand{\plusbinomial}{(x + y)^{j}}
        \plusbinomial
        3 mandatory parameters:
        \newcommand{\plusbinomial}[3]{(#2 + #3)^{#1}}
        \plusbinomial{j}{x}{y}
        3 parameters; the first one is optional, with default value "j":
        \newcommand{\plusbinomial}[3][j]{(#2 + #3)^{#1}}
        • without specifying the optional parameter (first parameter will be "j"):
          • \plusbinomial{x}{y}
        • specifying the optional parameter (first parameter forced to be "k"):
          • \plusbinomial[k]{x}{y}
        \newcommand{\toto}[2]{
          \pgfmathparse{#1 + #2}
          \pgfmathresult
        }
        \toto{3}{4}
  • Enllaços / Links (també funciona dins de TeXZilla/x-tex)
    • \href{url}{text}
  • Gràfics / Graphics
    • TikZ
      • TikZ package (overleaf)
      • The TikZ and PGF Packages - Manual for Version 3.1.9a ? 2022
      • The TikZ and PGF Packages Manual (pdf)
      • Paquets / Packages (CTAN T)
      • Biblioteques / Libraries
      • Exemples / Examples
      • Exemples / Examples

        \documentclass{standalone}
        \usepackage{tikz}
        %% \usetikzlibrary{...}
        \begin{document}
        \begin{tikzpicture}
        ...
        \end{tikzpicture}
        \end{document}
        ...
        es pot fer servir tikzpicture \begin{tikzpicture}[same_options_as_in_usepackage]
        ...
        \end{tikzpicture}
        • options for tikzpicture:
          • mydefinednode/.style={..., draw=green!60, fill=green!5, ...}
          • també es pot definir fora de tikzpicture amb:
            • \tikzset{mydefinednode/.style={..., draw=green!60, fill=green!5, ...}};
          • scale=3

        o bé una sola línia \tikz ...
        scoping
        \begin{scope}[thin]
        ...
        \end{scope}

        {[thin] ...}

        clip
        • \clip (-0.1,-0.2) rectangle (1.1,0.75);
        • \clip[draw] (0.5,0.5) circle (.6cm);

        coordenades
        • \coordinate (N) at (0,0);
        • \draw (0,0) coordinate (B) -- ..
        • ( <p> |- <q>) ( the intersection of a vertical line through p and a horizontal line through q)
        • current subpath start
        • cycle

        càlculs amb coordenades
        \usetikzlibrary{calc}
        \coordinate (Z) at (210:2);
        \coordinate (Zout) at ($(Z)+(0,-1)$);

        (latex)
        \def{\myvar}{some value}
        línia
        • \path[draw] ...
        • \draw[option,option] (x0,y0) -- (x1,y1);
        • \draw ... (angle:dist) ...
        • % cumulative
          \draw ... (x0,y0) -- ++(delta_x,delta_y) ...
        • % non cumulative
          \draw ... (x0,y0) -- +(delta_x,delta_y) ...
        • % dashed line
          \draw[dashed] ...

        • \draw[option,option] (mynode_id_1.south) -- (mynode_id_2.north)
          • options:
            • ->
            • gray
            • ...
            • thick
            • ...
            • color=red!60 (60% més clar que el red)
            • color=green!20!white (20% green + 80% white)
          • de coordenada a coordenada / from coordinate to coordinate:
            • (buit): no dibuixa res; només salta
            • -- línia recta
            • |- línia amb angle recte
            • -| línia amb angle recte
            • to[options]
              • to[out=90,in=180]
            • ...

        corba de Bézier \draw (-2,2) .. controls (-1,0) and (1,0) .. (2,2);
        línia amb marques periòdiques
        \usetikzlibrary {decorations.markings}
        \begin{document}
        \begin{tikzpicture}[
            decoration={
              markings,
              mark=at position 0.2 with {\arrow{latex}},
              mark=at position 0.8 with {\arrow{latex}}
            }
          ]

          % positive charge
          \node[draw,circle] (positive) at (-2,0) {+};

          % negative charge
          \node[draw,circle] (negative) at (2,0) {-};

          % electric field
          \draw[postaction={decorate}] (positive) -- (negative);
        \end{tikzpicture}
        \end{document}

        cercle, el·lipse, arc
        • \draw (cx,cy) circle [radius=2pt];
        • \draw (0,0) ellipse [x radius=20pt, y radius=10pt]; 
        • \path[fill,draw] ...
        • \filldraw[option,option] (cx,cy) circle (2pt);
          • options:
            • black
            • ...
        • \path[fill] ...
        • \fill[option,option] (cx,cy) ellipse (h_radius and v_radius)
        • \draw (3mm,0mm) arc[start angle=0, end angle=30, radius=3mm];
        • \draw[ultra thick, ->] (6.5,0) arc (0:220:1);

        rectangle, polígon tancat
        • \draw[blue, very thick] (0,0) rectangle (3,2);
        • \draw[orange, ultra thick] (4,0) -- (6,0) -- (5.7,2) -- cycle;
        • \usetikzlibrary {patterns}

        unió de formes
        •   % A u B
            \draw[pattern=horizontal lines,postaction={fill}]
            (0,0.5) -- (2,1) -- (2,2) -- (0,2) -- cycle
            (1.3,0) -- (1.3,2) -- (0,2) -- (0,0) -- cycle;

        angles arrodonits
        • \draw [rounded corners] (0,0) -- (1,1);

        paràbola
        • \draw (0,0) parabola (1,1);
        • \draw[x=1pt,y=1pt] (0,0) parabola bend (4,16) (6,12);

        sinus, cosinus
        • \draw (0,0) sin (1,1)

        graella
        • \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4);

        fletxes
        \begin{tikzpicture}[>=stealth]
        ...
        \end{picture}

        node: capsa amb text
        es pot especificar després de filldraw, ...
        • node[option,option,...] {text_label}
          • options
            • anchor=west
            • anchor=north east
            • below
            • below=2mm
            • inner sep=1pt
            • above
            • below right
            • circle
            • ellipse
            • rectangle
            • draw
            • sloped
            • ...
        • \draw (0,0) node(a) [draw] {A}  (1,1) node(b) [draw] {B};

        node
        • \node[mydefinednode] (mynode_id_1) [position_options] {my_text};
          • position_options (default)
            • above of=myfirstnode_id
          • position_options (\usetikzlibrary{positioning}):
            • above=of myfirsnode_id
            • right=of ...
            • below=of ...
        • \node ... at (x,y) {my_text};

        línies entre nodes


        arbre
        \node {root}
          child {node {left}}
          child {node {right}
            child {node {child}}
            child {node {child}}
          };

        angle
        \usetikzlibrary{angles,quotes}
        \usepackage{siunitx}
        \draw pic[draw,angle radius=8mm,angle eccentricity=0.6,"\ang{120}"] {angle = Y--N--X};


        pic
        \tikzset{
          seagull/.pic={
          % Code for a "seagull". Do you see it?...
          \draw (-3mm,0) to [bend left] (0,0) to [bend left] (3mm,0);
          }
        }
        \tikz { % different ways of placing pics
          \draw [help lines] (0,0) grid (3,2);
          \pic at (1,0) {seagull};
          \path (2,1) pic {seagull};
          \pic [at={(3,2)}] {seagull};
        }

        degradat
        variables
        ...
        bucle
        • \foreach ?variable? in {?list of values?} ?commands?
        • \foreach \x in {-1,-0.5,1}
            \draw[xshift=\x cm] (0pt,-1pt) -- (0pt,1pt);
        • \foreach \x in {1,...,10}
                  \draw (\x,0) circle (0.4cm);
        • \foreach \x in {-1,-0.5,...,1}
                 \draw (\x cm,-1pt) -- (\x cm,1pt);

        plot (without gnuplot)
        \begin{tikzpicture}
          \def \pi{3.141592}
          \def \xmax{3*\pi/2}
          \def \ymax{1}

          % grid
          \draw[very thin,color=gray] (-0.1,-\ymax) grid (\xmax,\ymax);

          % axis
          \draw[->] (-0.2,0) -- (\xmax+0.2,0) node[right] {$x$};
          \draw[->] (0,-\ymax-0.2) -- (0,\ymax+0.2) node[above] {$f(x)$};
         
          % sine
          % \x r means to convert '\x' from radians to degrees:
          \draw[color=blue,domain=0:\xmax] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$};
         
        \end{tikzpicture}

        plot (with gnuplot: pdflatex --shell-escape toto.tex)
        \begin{tikzpicture}
          \def \pi{3.141592}
          \def \xmax{3*\pi/2}
          \def \ymax{1}

          % grid
          \draw[very thin,color=gray] (-0.1,-\ymax) grid (\xmax,\ymax);

          % axis
          \draw[->] (-0.2,0) -- (\xmax+0.2,0) node[right] {$x$};
          \draw[->] (0,-\ymax-0.2) -- (0,\ymax+0.2) node[above] {$f(x)$};
         
          % sine
          \draw[color=blue,domain=0:\xmax] plot[id=sin] function{sin(x)} node[right] {$f(x) = \sin x$};
         
        \end{tikzpicture}

        Data visualization \usetikzlibrary {datavisualization.formats.functions}
         
          \datavisualization [school book axes, visualize as smooth line]
          data [format=function] {
            var x : interval [-2:2];
            func y = \value x*\value x + 1;
          };

        3d
        \documentclass{standalone}
        \usepackage{tikz}
        \usetikzlibrary{3d,arrows.meta}
        \begin{document}
        \begin{tikzpicture}[>=latex]

          \begin{scope}[canvas is zy plane at x=0]
            % Y axis
            \draw[->,gray] (0,0) -- (0,4) node[above] {Y};
          \end{scope}

          \begin{scope}[canvas is zx plane at y=0]
            % Z axis
            \draw[->
        ,gray] (0,0) -- (4,0) node[below] {Z};
          \end{scope}

          \begin{scope}[canvas is xy plane at z=0]
            % X axis
            \draw[->
        ,gray] (0,0) -- (4,0) node[right] {X};
          \end{scope}

        \end{tikzpicture}
        \end{document}

        paral·lelepípede 3d % to be used as \cube[yellow]{x0}{y0}{z0}{xside}{ysize}{zsize}
        \newcommand{\cube}[7][blue]{
          \coordinate (O) at (#2,#3,#4);

          % back
          \draw [fill=#1!10,very thin] (O) -- ++(#5,0,0) -- ++(0,#6,0) -- ++(-#5,0,0) -- cycle;
          % left
          \draw [fill=#1!10,very thin] (O) -- ++(0,#6,0) -- ++(0,0,#7) -- ++(0,-#6,0) -- cycle;
          % bottom
          \draw [fill=#1!10,very thin] (O) -- ++(#5,0,0) -- ++(0,0,#7) -- ++(-#5,0,0) -- cycle;
          % front
          \draw [fill=#1!10,very thin] (O) ++(0,0,#7) -- ++(#5,0,0) -- ++(0,#6,0) -- ++(-#5,0,0) -- cycle;
          % top
          \draw [fill=#1!30,very thin] (O) ++(0,#6,0) -- ++(#5,0,0) -- ++(0,0,#7) -- ++(-#5,0,0) -- cycle;
          % right
          \draw [fill=#1!40,very thin] (O) ++(#5,0,0) -- ++(0,#6,0) -- ++(0,0,#7) -- ++(0,-#6,0) -- cycle;
         
        }

        % red cube with origin (2,0,0) and dimensions (1,0.2,0.5)
        \cube[red]{2}{0}{0}{1}{0.2}{0.5};

        rotació sobre l'eix y \documentclass{standalone}
        \usepackage{tikz}
        \usetikzlibrary{3d,arrows.meta}
        \begin{document}
        \begin{tikzpicture}[>=latex,
            conductor/.style={line width=2pt,orange}]

          \begin{scope}[canvas is zy plane at x=0]
            % Y axis
            \draw[->,gray] (0,0) -- (0,4) node[above] {Y};
          \end{scope}

          \begin{scope}[canvas is zx plane at y=0]
            % Z axis
            \draw[->,gray] (0,0) -- (4,0) node[below] {Z};
          \end{scope}

          \begin{scope}[canvas is xy plane at z=0]
            % X axis
            \draw[->,gray] (0,0) -- (4,0) node[right] {X};

            % conductor
            %\draw[conductor] (0,0) -- (2,0);
          \end{scope}

          \foreach \angle in {0,30,60}
          {
            \begin{scope}[
                plane origin={(0,0,0)},
                plane x={({cos(\angle)},0,{sin(\angle)})},
                plane y={(0,1,0)},
                canvas is plane
              ]
              \draw[thick] (0,0) rectangle (1,1);
            \end{scope}
          }
        \end{tikzpicture}
        \end{document}

        animació
        • 26 Animations
        • funciona amb SVG (SMIL)
        • no funciona amb PDF
        • passos
          1. latex animacio.tex
          2. dvisvgm --zoom=-1 --exact --font-format=woff animacio
        \documentclass[dvisvgm]{standalone}
        \usepackage{tikz}
        \usetikzlibrary{animations}

        \begin{document}

        \tikz
        \node :fill opacity = { 0s="0", 5s="1" }
        :rotate = { 6s="0", 10s="360", repeats, restart=false}
        [fill = blue!20, draw = blue, ultra thick, circle]
        {Hello!};

        \end{document}
        • \tikz \node [fill, text = white, animate = {
            myself:fill = {0s = "red", 2s = "blue", begin on = click }}
          ] {Click me};
        • \tikz [animate = {a node:fill = {0s = "red", 2s = "blue",
            begin on = click}}
          ]
          \node (a node) [fill, text = white] {Click me};
        rotació
        càlculs % result = sqrt[n]{x}
        \def \x{27}
        \def \n{3}
        \pgfmathsetmacro{\result}{pow(\x,1/\n)}

        múltiples figures en un sol fitxer


        nombre complexos
        \usepackage{steinmetz}
        ... node{$a \phase{b}$}

    • ...
  • Circuits
    • CircuiTikz (based on TikZ)
      • CircuiTikz package (overleaf)
      • CircuTikZ manual (pdf)
      • Exemples / Examples
        • Circuit with resistors & Kirchhoff?s laws

        • \documentclass{standalone}
          \usepackage[
          options]{circuitikz}
          \begin{document}
          ...
          \end{document}
          • options:
            • european
            • siunitx
            • ...
          ...

          \begin{tikzpicture}[same_options_as_in_usepackage]
          ...
          \end{tikzpicture}


          \begin{circuitikz}[same_options_as_in_usepackage]
          ...
          \end{circuitikz}

          path-style component \draw (0,0) to[component_name=optional_component_label, options] (2,0);
          • options:
            • invert
            • labels, voltages, annotations, flows and currents
              • label: 
                • l=$R_1$ (by default: above)
                • l_=$R_1$ (forced below)
                • l^=$R_1$ (forced above)
              • modifiers:
                • ^ (above)
                • _ (below)
              • voltage: v=$v_1$
              • current: i=$i_1$
              • annotation: a=1<\kilo\ohm> (by default: below)
              • flow: f=... ()
              • two lines: l2=line1 and line2 ()
              • current and flow modifiers:
                • < ()
                • > ()
              • units (requires option siunitx)
                • a=$\SI{1}{\kilo\ohm}$
                • a=1<\kilo\ohm>
          • paths
            • to[short]
              • to[short, -*]
            • to[open]
          • batteries
            • to[battery]
            • to[battery1]
            • to[battery2]
          • resistor
            • to[R]
          • capacitor
            • to[capacitor]
          • inductor
            • to[L]
          • diode
            • to[empty diode]
            • to[full diode]
          • ...
          node-style component \draw (0,0) node[component_name,optional_options] (anchor) {text};
          • node[ground]
          • ...
    • ...
  • Química / Chemistry
  • Matemàtiques
    • Mathematical expressions
      • The Comprehensive LATEX Symbol List (pdf)
      • Símbols
      • Operators
      • Brackets and parenthesis
        • Brackets and Parentheses



        • to be used around:
          • \begin{array}...\end{array}
          they have to be in pairs (but can be mixed)
          empty
          a + b a + b \left. a + b \right. \left. a + b \right.
          parentheses ( a + b ) ( a + b ) \left( a + b \right) \left( a + b \right)
          brackets; square brackets [ a + b ] [ a + b ] \left[ a + b \right] \left[ a + b \right]
          braces; curly brackets \{ a + b \} \{ a + b \} \left\{ a + b \right\} \left\{ a + b \right\}
          angle brackets

          \langle a + b \rangle \langle a + b \rangle
          pipes; vertical bars | a + b | | a + b | \left| a + b \right| \left| a + b \right|
          double pipes; double vertical bars \| a + b \| \| a + b \| \left\| a + b \right\| \left\| a + b \right\|
      • Arrays



        • examples combined with brackets/parenthesis
          array (centred) \begin{array}{c}
          a + b + c = d \\
          e = f + g
          \end{array}
          \begin{array}{c} a + b + c = d \\ e = f + g \end{array} \left(
          \begin{array}{c}
          a + b + c = d \\
          e = f + g
          \end{array}
          \right\}
          \left( \begin{array}{c} a + b + c = d \\ e = f + g \end{array} \right\}
          array (left) \begin{array}{l}
          a + b + c = d \\
          e = f + g
          \end{array}
          \begin{array}{l} a + b + c = d \\ e = f + g \end{array}

          array (right) \begin{array}{r}
          a + b + c = d \\
          e = f + g
          \end{array}
          \begin{array}{r} a + b + c = d \\ e = f + g \end{array} \left.
          \begin{array}{r}
          a + b + c = d \\
          e = f + g
          \end{array}
          \right\}
          \left. \begin{array}{r} a + b + c = d \\ e = f + g \end{array} \right\}
          aligned
          (& is the reference)
          \begin{aligned}
          a + b + c &= d \\
          e &= f + g
          \end{aligned}
          \begin{aligned} a + b + c &= d \\ e &= f + g\end{aligned} \left[
          \begin{aligned}
          a + b + c &= d \\
          e &= f + g
          \end{aligned}
          \right]
          \left[ \begin{aligned} a + b + c &= d \\ e &= f + g\end{aligned} \right]
          aligned
          (& is the reference)
          \begin{aligned}
          a &+ b + c = d \\
          e = f &+ g
          \end{aligned}
          \begin{aligned} a &+ b + c = d \\ e = f &+ g\end{aligned}

          cases \begin{cases}
          a + b + c =d \\
          e = f + g
          \end{cases}
          \begin{cases} a + b + c =d \\ e = f + g \end{cases}

      • Matrius / Matrices
        • How to write matrices in Latex ? matrix, pmatrix, bmatrix, vmatrix, Vmatrix
        • ...



        • parenthesis \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} a & b \\ c & d \end{pmatrix}
          brackets \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} a & b \\ c & d \end{bmatrix}
          Braces \begin{Bmatrix} a & b \\ c & d \end{Bmatrix} \begin{Bmatrix} a & b \\ c & d \end{Bmatrix}
          verts \begin{vmatrix} a & b \\ c & d \end{vmatrix} \begin{vmatrix} a & b \\ c & d \end{vmatrix}
          double Verts \begin{Vmatrix} a & b \\ c & d \end{Vmatrix} \begin{Vmatrix} a & b \\ c & d \end{Vmatrix}
      • Integrals, sums and limits
      • Derivades / Derivatives
      • Fractions and Binomials
      • Subscripts and superscripts
      • Spacing

        mu (math unit) = 1/18 em
        \! -3

        1
        \, 3
        \: 4
        \; 5
        \ (space) space in normal text
        \quad 18 (current font size)
        \qquad 36
      • Transformades / Transforms


        • rendered
          Laplace / Lagrange \mathcal{L}\{f\} \mathcal{L}\{f\}
          Fourier \mathcal{L}\{f\} \mathcal{F}\{f\}
          Z-transform \mathcal{Z}\{f\} \mathcal{Z}\{f\}

      • rendered (MathML/TexZilla/x-tex)
        \boxed{a+b} \boxed{a+b}
        a^2+b^2=c^2 a^2+b^2=c^2
        \sqrt{x^5}
        \sqrt{x^5}
        \sqrt[3]{x^5} \sqrt[3]{x^5}
        \multiscripts{_a^b}{X}{_c^d} \multiscripts{_a^b}{X}{_c^d}
        \frac{a}{b}
        \frac{a}{b}
        \sin x \sin x
        \sin \left( x + \frac{\pi}{2} \right) \sin \left( x + \frac{\pi}{2} \right)
        e^x e^x
        \mathrm e^x \mathrm e^x
        \vec{a} \vec{a}
        \vec{a} \perp \vec{b} \vec{a} \perp \vec{b}
        \vec{a} \parallel \vec{b} \vec{a} \parallel \vec{b}
        \| \vec{a} \| \|\vec{a}\|
        \hat{A} \hat{A}
        \int_{0}^{+\infty} x^{t-1} e^{-x} dx \int_{0}^{+\infty} x^{t-1} e^{-x} dx
        \iint_D {dx dy} \iint_D {dx dy}
        A \in B A \in B
        A \cup B A \cup B
        A \cap B A \cap B
        \sum_{n=1}^{+\infty} \sum_{n=1}^{+\infty}
        \prod_{n=1}^\infty \prod_{n=1}^\infty
        \lim_{n \to \infty} \lim_{n \to \infty}
        x = \frac{-b\pm\sqrt{b^2-4ac}}{2a} x = \frac{-b\pm\sqrt{b^2-4ac}}{2a}
        e^{i\pi}+1=0 e^{i\pi}+1=0
        \multiscripts{_2}{F}{_3} \multiscripts{_2}{F}{_3}
        \binom{n}{k/2} \binom{n}{k/2}
        a_{i j} a_{i j}
        (derivades/derivatives)
        \frac{\mathrm{d}f}{\mathrm{d}x}
        \frac{\mathrm{d}f}{\mathrm{d}x}
        \frac{\partial^2}{\partial x^2} \frac{\partial^2}{\partial x^2}
        f(x) = \begin{cases}
        1/3 & \text{if} \quad 0 \leq x \leq 1; \\
        2/3 & \text{if} \quad 3 \leq x \leq 4; \\
        0 & \text{elsewhere}.
        \end{cases}
        f(x) = \begin{cases} 1/3 & \text{if} \quad 0 \leq x \leq 1; \\ 2/3 & \text{if} \quad 3 \leq x \leq 4; \\ 0 & \text{elsewhere}. \end{cases}
        \overset{k \, \text{times}}
        {\overbrace{x+\dots+x}}
        \overset{k \, \text{times}}{\overbrace{x+\dots+x}}
        \xrightarrow[\text{text on bottom}]{\text{text on top}} \xrightarrow[\text{text on bottom}]{\text{text on top}}
        \begin{pmatrix}
        a & b \\
        c & d
        \end{pmatrix}
        \begin{pmatrix} a & b \\ c & d \end{pmatrix}
        \begin{pmatrix}
        \begin{pmatrix} a & b \\ c & d \end{pmatrix} &
        \begin{pmatrix} e & f \\ g & h \end{pmatrix} \\
        0 &
        \begin{pmatrix} i & j \\ k & l \end{pmatrix}
        \end{pmatrix}
        \begin{pmatrix} \begin{pmatrix} a & b \\ c & d \end{pmatrix} & \begin{pmatrix} e & f \\ g & h \end{pmatrix} \\ 0 & \begin{pmatrix} i & j \\ k & l \end{pmatrix} \end{pmatrix}
        \begin{vmatrix}
        c_0 & c_1\\
        c_2 & c_3\\
        \end{vmatrix}
        \begin{vmatrix} c_0 & c_1\\ c_2 & c_3\\ \end{vmatrix}
        \det
        \begin{vmatrix}
        c_0 & c_1 & c_2 & \dots & c_n \\
        c_1 & c_2 & c_3 & \dots & c_{n+1} \\
        c_2 & c_3 & c_4 & \dots & c_{n+2} \\
        \vdots & \vdots & \vdots & & \vdots \\
        c_n & c_{n+1} & c_{n+2} & \dots & c_{2n}
        \end{vmatrix} > 0
        \det \begin{vmatrix} c_0 & c_1 & c_2 & \dots & c_n \\ c_1 & c_2 & c_3 & \dots & c_{n+1} \\ c_2 & c_3 & c_4 & \dots & c_{n+2} \\ \vdots & \vdots & \vdots & & \vdots \\ c_n & c_{n+1} & c_{n+2} & \dots & c_{2n} \end{vmatrix} > 0
        \mathbf{V}_1 \times \mathbf{V}_2 \mathbf{V}_1 \times \mathbf{V}_2
        {n \choose k} {n \choose k}
        \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789} \mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789}
        \mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789} \mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789}
        \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789} \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789}
        \Re \Re
        \Im \Im
        \triangleq \triangleq
        \stackrel{\text{(H)}}{=} \stackrel{\text{(H)}}{=}
        \equiv \equiv
    • Equacions amb numeració:
      • \begin{equation}
        ...
        \end{equation}
    • Sense numeració (dins del text):
      • $x=y$
    • Sense numeració (amsmath):
      • \usepackage{amsmath}

        \begin{equation*}
        ...
        \end{equation*}
      • \begin{eqnarray*}
        x=y \\
        y=z
        \end{eqnarray*}
    • Dins de "equation" no hi pot haver cap línia en blanc. Si hi és, donarà un error de tipus: "Underfull \hbox (badness 10000) in paragraph"
    • Diverses equacions / Several equations:
      • \usepackage{amsmath}
        \begin{eqnarray*}
          x = 3 \\
          y = x/2 = 1,5
        \end{eqnarray*}
      • Alineades / Aligned (*)
        • \usepackage{amsmath}
          \begin{align*}
            x &= 3 \\
            y &= x/2 = 1,5
          \end{align*}
      • Centrades / Centred
        • \usepackage{amsmath}
          \begin{gather*}
            x = 3 \\
            y = x/2 = 1,5
          \end{align*}
    • Funció definida per parts:
      • ...
    • Funció definida per parts (amsmath)
      • \usepackage{amsmath}
        \begin{equation*}
          |x| =
          \begin{cases}
          -x & \text{if } x < 0,\\
          0 & \text{if } x = 0,\\
          x & \text{if } x > 0.
          \end{cases}
        \end{equation*}
    • Claus només al final:
      • \left.
        \begin{array}{r}
          z=x^2+y^2 \\
          6=x^2+y^2+z^2
        \end{array}
        \right\}
  • Figures:
    • \usepackage{graphicx} farà que els següents formats de figures siguin suportats:
      • compilació amb pdflatex: .pdf, .png, .jpg
      • compilació amb latex: .eps
    • es poden convertir amb:
      • EPS->PDF: epstopdf
      • PDF->EPS: pdftops; ps2epsi; eps2eps (pdf2ps crea un fitxer ps molt gros)
  • Capçalera / Header:
    • Creeu un fitxer odg de mides: 18,5 x 3,5 (capcalera.odg)
    • Afegiu-hi algun logotip EPS o bé un PDF
    • Exporteu-lo com a PDF: capcalera.pdf
    • Incloeu-lo al vostre tex:
      • \usepackage{graphicx}

        \begin{figure}
          \begin{center}
            \includegraphics[width=18.5cm]{capcalera.pdf}
          \end{center}
        \end{figure}
  • Capses / Boxes
    • Dins d'un text / Inside a text:
      • \framebox{contingut}
    • Paràgraf / Paragraph
      • \parbox[position]{width}{contingut}
    • Dins d'una equació / Inside an equation:
      • \begin{eqnarray*}
        x=2/4\\
        \boxed{
        x=1/2
        }
        \end{eqnarray*}

BibTeX

LaTeX binaries

LaTeX styles

LaTeX utilities

Darrera modificació: 3 de març de 2024 / Last update: 3rd March 2024

Cap a casa / Back home.