Image

TODO lo que tienes que saber sobre LÍNEAS en LaTeX

Este video explico cómo darle estilo a un segmento, y convertirlo en Flecha, en resorte, en resistencia, modificar el grosor y el estilo de los terminales.

\documentclass[]{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{snakes}
\begin{document}
\begin{tikzpicture}
\coordinate (a) at (0,0);
\coordinate (b) at (2,1);
\draw[-] (a)--(b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[->] (a)--(b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[>->] (a)--(b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[<->, >=latex] (a)--(b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[<->, >=latex, double] (a)--(b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[<->, >=latex,red] (a) to[bend left=20] (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[<->, >=latex,blue] (a) to[bend right=45] (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[<->, >=latex,green] (a) -| (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[{[-]}] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[o-*] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[left hook-left hook] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[->, line width=10pt] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[round cap->, line width=10pt] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[round cap-butt cap, line width=10pt] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[triangle 90 cap-butt cap, line width=10pt] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[fast cap-triangle 90 cap reversed, line width=10pt] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
\tikzset{flecha1/.style={very thick,->,>=latex}}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[flecha1] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \tikzset{resorte/.style={decorate,draw=magenta,decoration={coil, amplitude=4pt, segment length=5pt}}}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[resorte] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \tikzset{zigz/.style={decorate,draw=magenta,decoration={zigzag, amplitude=4pt, segment length=5pt}}}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[zigz] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \tikzset{zigz/.style={decorate,draw=magenta,decoration={snake, amplitude=4pt, segment length=5pt}}}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[zigz] (a) -- (b);
\end{tikzpicture}
\begin{tikzpicture}
  \tikzset{zigz/.style={decorate,draw=magenta,decoration={random steps, amplitude=4pt, segment length=5pt}}}
  \coordinate (a) at (0,0);
  \coordinate (b) at (2,1);
  \draw[zigz] (a) -- (b);
\end{tikzpicture}
\end{document}
        

© Profesor Favián Arenas. 2023. Diseñado por HTML Codex