QuickLaTeX: tikZ graphics

QuickLaTeX is free online service which allows LaTeX usage on the web pages.

QuickLaTeX supports tikZ graphics since version 3.7.1.

User can insert tikZ code snippets directly on the page (in WordPress editor) between \begin{tikzpicture} ... \end{tikzpicture} commands. QuickLaTeX will render it into image and place on the page.

By default, tikz is not included into QuickLaTeX preamble, so user has to include tikz package in the local preamble manually using [+preamble] ... [/preamble] shortcodes.

Let’s check example of parabola plot created by Till Tantau. Source code is placed directly on the page (you can copy-paste this code in WordPress post):

\begin{tikzpicture}[scale=2]

% Include tikz into local preamble
[+preamble]
     \usepackage{tikz}
[/preamble]

  \shade[top color=blue,bottom color=gray!50] 
      (0,0) parabola (1.5,2.25) |- (0,0);
  \draw (1.05cm,2pt) node[above] 
      {$\displaystyle\int_0^{3/2} \!\!x^2\mathrm{d}x$};

  \draw[style=help lines] (0,0) grid (3.9,3.9)
       [step=0.25cm]      (1,2) grid +(1,1);

  \draw[->] (-0.2,0) -- (4,0) node[right] {$x$};
  \draw[->] (0,-0.2) -- (0,4) node[above] {$f(x)$};

  \foreach \x/\xtext in {1/1, 1.5/1\frac{1}{2}, 2/2, 3/3}
    \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {$\xtext$};

  \foreach \y/\ytext in {1/1, 2/2, 2.25/2\frac{1}{4}, 3/3}
    \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt) node[left] {$\ytext$};

  \draw (-.5,.25) parabola bend (0,0) (2,4) node[below right] {$x^2$};
\end{tikzpicture}

QuickLaTeX will render it on the page as:

Rendered by QuickLaTeX.com

A little more elaborate example is Rotated triangle by Martin Scharrer:

\begin{tikzpicture}
[+preamble]
     \usepackage[usenames,dvipsnames,pdftex]{xcolor}
     \usepackage{tikz,ifthen}
[/preamble]
    \coordinate (A) at (0,0);
    \coordinate (B) at (-60:12cm);
    \coordinate (C) at (240:12cm);
    \foreach \density in {20,30,...,160}{%
        \draw[fill=MidnightBlue!\density] (A)--(B)--(C)--cycle;
        \path
             (A) coordinate (X)
          -- (B) coordinate[pos=.15](A)
          -- (C) coordinate[pos=.15](B)
          -- (X) coordinate[pos=.15](C);
    }
\end{tikzpicture}

Rendered by QuickLaTeX.com

User can scale drawings with \begin{tikzpicture}[scale=N] .... \end{tikzpicture} as usual, e.g. [scale=0.5]:

Rendered by QuickLaTeX.com

1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00)
Loading ... Loading ...

Post a Comment

Your email is never published nor shared.

Use native LaTeX syntax to include formulas: $ ... $, \[ ... \], etc. Do not forget to preview comment before posting.

Also you may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting