Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on tikz.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/tikz.e>
#           or at <http://angg.twu.net/e/tikz.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.tikz-upstream»		(to "tikz-upstream")
# «.pgf-upstream»		(to "pgf-upstream")
# «.isoterma»			(to "isoterma")
# «.block»			(to "block")
# «.tikz-cd»			(to "tikz-cd")
# «.luacode»			(to "luacode")
# «.mygrid»			(to "mygrid")
# «.dots-labels-vectors»	(to "dots-labels-vectors")
# «.nodes-and-arrows»		(to "nodes-and-arrows")
# «.pgfplots»			(to "pgfplots")
# «.dimension-too-large»	(to "dimension-too-large")



# (find-es "diagrams" "tikz")
# (find-es "xypic" "pgf")
# (find-angg ".emacs.papers" "pgf")
# http://en.wikipedia.org/wiki/PGF/TikZ
# http://tex.stackexchange.com/questions/2044/how-to-install-a-current-version-of-tikz
# http://www.gnuplotting.org/installing-the-tikz-terminal/


# http://tex.stackexchange.com/questions/108612/how-to-draw-this-pyramid-with-tex
# http://www.texample.net/tikz/examples/




#####
#
# tikz and pgf from upstream
# 2015dec06
#
#####

# «tikz-upstream» (to ".tikz-upstream")
# «pgf-upstream» (to ".pgf-upstream")
# http://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf
# http://mirrors.ctan.org/graphics/pgf/base.zip

# I am not using the upstream version (yet).
# Here is how I ungzip the manual from the Debian version:
# (find-es "xypic" "pgf")
# (find-es "xypic" "pgf" "zcat")




#####
#
# isoterma
# 2014may16
#
#####

# «isoterma» (to ".isoterma")
#*
# (eev-bounded)
% (defun d () (interactive) (find-xpdfpage "/tmp/tikz/test1.pdf"))

mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'
\documentclass{book}
\usepackage{tikz}
\begin{document}
%
\begin{figure}
\begin{center}
\begin{tikzpicture}
\draw[very thin,color=gray] (0,0) grid (6,5);
\draw[->] (0,0) -- (7,0) node[right] {$P$};
\draw[->] (0,0) -- (0,6) node[above,left] {$V$};
\draw[color=blue][domain=1.6:6][mark=x,mark indices={2,8,20},smooth
]
plot (\x,{8/\x})
node[right] {$\theta_{0}$};
\node at (2.6,4.7) {$(P_{A_{0}},V_{A_{0}})$};
\node at (3.5,3.1) {$(P^{\prime}_{A_{0}},V^{\prime}_{A_{0}})$};
\node at (5.3,2) {$(P^{\prime\prime}_{A_{0}},V^{\prime\prime}_{A_{0}})$};
\end{tikzpicture}
\label{isoterma}
\end{center}
\caption{Isoterma do sistema A em equilíbrio térmico com o
  sistema padrão C que se encontra na temperatura $\theta_{0}$.}
\label{isoterma}
\end{figure}
%
\end{document}
%%%

pdflatex test1.tex

#*





#*
# (eev-bounded)
# (defun c () (interactive) (eek "<f3>") (find-zsh0 "ee"))
# (defun d () (interactive) (find-xpdfpage "/tmp/tikz/test1.pdf"))
mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'
\documentclass{book}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=3]
  \draw[step=.5cm,gray,very thin] (-1.4,-1.4) grid (1.4,1.4);
  \draw (-1.5,0) -- (1.5,0);
  \draw (0,-1.5) -- (0,1.5);
  \draw (0,0) circle (1cm);
  \draw (3mm,0mm) arc (0:30:3mm);
\end{tikzpicture}

\begin{tikzpicture}[scale=0.3]
  \draw[step=1cm,gray,very thin] (-2,-3) grid (4,4);
  \draw[very thick] (-2,0) -- (4,0);
  \draw[very thick] (0,-3) -- (0,4);
  \draw (-1.5,0) -- (1.5,0);
  \draw (0,-1.5) -- (0,1.5);
  \draw (0,0) circle (1cm);
  \draw (3mm,0mm) arc (0:30:3mm);
\end{tikzpicture}

% (find-pgfmanualpage 35 "2.20     Repeating Things: For-Loops")
% (find-pgfmanualtext 35 "2.20     Repeating Things: For-Loops")

3 4

\begin{tikzpicture}[scale=0.5]
  \clip (-2 -0.4, -2 -0.4) rectangle (3 +0.4, 4 +0.4);
  \draw[very thick] (-10,0) -- (10,0);
  \draw[very thick] (0,-10) -- (0,10);
  \foreach \x in {-10,...,10} \draw (\x,-0.2) -- (\x,0.2);
  \foreach \y in {-10,...,10} \draw (-0.2,\y) -- (0.2,\y);
  %
  \draw (2,1) circle (0.2) node [anchor=west] {(2,1)};
\end{tikzpicture}



  % \foreach \x in {1,...,10} \draw (\x cm,0) circle (0.4cm);
  % \foreach \x in {1,2,3} {$x =\x$, }


\end{document}
%%%
pdflatex test1.tex && xpdf test1.pdf &
#*




#####
#
# block
# 2014may26
#
#####

# «block» (to ".block")
# (find-angg ".emacs.papers" "pgf")

#*
# (defun c  () (interactive) (eev-bounded) (find-zsh0 "ee"))
# (defun cc () (interactive) (eev-bounded) (find-zsh  "ee"))
# (defun d  () (interactive) (find-xpdfpage "/tmp/tikz/test1.pdf"))
mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'
\documentclass{book}
\usepackage{tikz}
\begin{document}
\tikzset{axis/.style=very thick}
\tikzset{tick/.style=thick}
\tikzset{grid/.style=gray,very thin}
\tikzset{dot/.style=circle,draw=red,fill=blue}
%
\begin{tikzpicture}[scale=0.5]
  \clip (-2-0.4, -3-0.4) rectangle (4+0.4, 5+0.4);
  \draw[step=1cm,grid] (-2,-3) grid (4,5);
  \draw[axis] (-10,0) -- (10,0);
  \draw[axis] (0,-10) -- (0,10);
  \foreach \x in {-10,...,10} \draw[tick] (\x,-0.2) -- (\x,0.2);
  \foreach \y in {-10,...,10} \draw[tick] (-0.2,\y) -- (0.2,\y);
  %
  \coordinate [label=left:\textcolor{blue}{$A$}] (A) at (0,1);
  \coordinate [label=right:\textcolor{blue}{$B$}] (B) at (3,2);
  \draw [thick] [->] (A) -- (B);
  \foreach \point in {A,B}
    \fill [black] (\point) circle (4pt);
\end{tikzpicture}

% (find-pgfmanualpage 35 "2.20     Repeating Things: For-Loops")
% (find-pgfmanualtext 35 "2.20     Repeating Things: For-Loops")

  % \foreach \x in {1,...,10} \draw (\x cm,0) circle (0.4cm);
  % \foreach \x in {1,2,3} {$x =\x$, }

\end{document}
%%%
pdflatex test1.tex
#*




#####
#
# tikz-cd
# 2015feb23
#
#####

# «tikz-cd» (to ".tikz-cd")
# http://mirrors.ibiblio.org/CTAN/graphics/pgf/contrib/tikz-cd/tikz-cd-doc.pdf




#####
#
# luacode
# 2014jun08
#
#####

# «luacode» (to ".luacode")
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)

#*
# (defun c  () (interactive) (eev-bounded) (find-zsh0 "ee"))
# (defun cc () (interactive) (eev-bounded) (find-zsh  "ee"))
# (defun d  () (interactive) (find-xpdfpage "/tmp/tikz/test1.pdf"))
# (find-angg ".emacs.papers" "tikz")

mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'
\documentclass{book}
\usepackage{tikz}
\usepackage{luacode}
\begin{document}
\tikzset{axis/.style=very thick}
\tikzset{tick/.style=thick}
\tikzset{grid/.style=gray,very thin}
%
\begin{luacode*}
xyfromuv0 = function (u,v) return u + v, u - v end
xyfromuv  = function (u,v) return (u + v)..","..(u - v) end
xyfromt0  = function (t)   return u + v, u - v end

strpath = function (xy, a, b, step)
    local T = {}
    for t=a,b,step do
      table.insert(T, string.format("(%d,%d)", xy(y)))
    end
    return table.concat(T, " -- ")
  end
\end{luacode*}
\def\xyfromuv#1#2{\directlua{xyfromuv(#1, #2)}}

\xyfromuv 4 {1/4}

\xyfromuv 8 {1/8}

\directlua{tex.print(strpath(function (t) return xyfromuv0(t, 1/t) end, 1, 2, 0.125))}

\begin{tikzpicture}[scale=0.5]
  \clip (-2-0.4, -3-0.4) rectangle (4+0.4, 5+0.4);
  \draw[step=1cm,grid] (-2,-3) grid (4,5);
  \draw[axis] (-10,0) -- (10,0);
  \draw[axis] (0,-10) -- (0,10);
  \foreach \x in {-10,...,10} \draw[tick] (\x,-0.2) -- (\x,0.2);
  \foreach \y in {-10,...,10} \draw[tick] (-0.2,\y) -- (0.2,\y);
  %
  \draw (\xyfromuv 2 {1/2}) -- (\xyfromuv 4 {1/4}) ;
  %
\end{tikzpicture}
\end{document}
%%%
lualatex test1.tex
#*




#####
#
# mygrid
# 2015apr02
#
#####

# «mygrid» (to ".mygrid")
# «dots-labels-vectors» (to ".dots-labels-vectors")
# (find-angg ".emacs.papers" "tikz")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'

\documentclass{book}
\usepackage{tikz}
\begin{document}

% mygrid
%
\tikzset{axis/.style=very thick}
\tikzset{tick/.style=thick}
\tikzset{grid/.style=gray!20,very thin}
%
\def\mygrid(#1,#2) (#3,#4){
  \clip              (#1-0.4, #2-0.4) rectangle (#3+0.4, #4+0.4);
  \draw[step=1,grid] (#1-0.2, #2-0.2) grid      (#3+0.2, #4+0.2);
  \draw[axis] (-10,0) -- (10,0);
  \draw[axis] (0,-10) -- (0,10);
  \foreach \x in {-10,...,10} \draw[tick] (\x,-0.2) -- (\x,0.2);
  \foreach \y in {-10,...,10} \draw[tick] (-0.2,\y) -- (0.2,\y);
}
%
\begin{tikzpicture}[scale=0.25]
  \mygrid (-2,-2) (2,6);
\end{tikzpicture}

% Dots, labels, vectors
%
\def\vv{\vec v}
\def\VEC#1{{\overrightarrow{(#1)}}}
%
\tikzset{anydot/.style={circle,inner sep=0pt,minimum size=1mm}}
\tikzset{opdot/.style={anydot, draw=black,fill=white}}
\tikzset{cldot/.style={anydot, draw=black,fill=black}}
%
\begin{tikzpicture}[scale=0.75,auto]
  \mygrid (-1,-1) (4,3);
  \node (A) at ( 1,1) [cldot,label=below:$A$] {};
  \node (B) at ( 3,2) [cldot,label=above:$B$] {};
  \draw [->] (A) to node [swap] {$\vv = \VEC{2,1}$} (B);
\end{tikzpicture}

\end{document}
%%%

pdflatex test1.tex
xpdf     test1.pdf

# (find-fline    "/tmp/tikz/test1.tex")
# (find-xpdfpage "/tmp/tikz/test1.pdf")







#####
#
# Nodes and arrows
# 2015mar12
#
#####

# «nodes-and-arrows» (to ".nodes-and-arrows")
# (find-angg ".emacs.papers" "tikz")
# (find-pgfmanualpage  41 "3.3     Introduction to Nodes")
# (find-pgfmanualtext  41 "3.3     Introduction to Nodes")
# (find-pgfmanualpage  43 "3.6    Node Size")
# (find-pgfmanualtext  43 "3.6    Node Size")
# (find-angg "LATEX/2015-1-C2-figuras1.tex")
# (find-angg "LATEX/2015-1-C2-figuras1.lua")

\begin{tikzpicture}
  [opdot/.style={circle,draw=black,fill=white,
                 inner sep=0pt,minimum size=1mm},
   cldot/.style={circle,draw=black,fill=black,thick,
                 inner sep=0pt,minimum size=1mm}]
  \node at ( 0,2) [opdot,label=left:$A$] {};
  \node at ( 0,1) [opdot] {};
  \node at ( 0,0) [opdot] {};
  \node at ( 1,1) [cldot] {};
  \node at (-1,1) [cldot] {};
\end{tikzpicture}



\tikzset{opdot/.style={circle,inner sep=0pt,minimum size=1mm,
                       draw=black,fill=white}}
\tikzset{cldot/.style={circle,inner sep=0pt,minimum size=1mm,
                       draw=black,fill=black,thick}}
\begin{tikzpicture}
  \node at ( 0,2) [opdot] {};
  \node at ( 0,1) [opdot] {};
  \node at ( 0,0) [opdot] {};
  \node at ( 1,1) [cldot] {};
  \node at (-1,1) [cldot] {};
\end{tikzpicture}




#####
#
# pgfplots
# 2016jan28
#
#####

# «pgfplots» (to ".pgfplots")
# (find-zsh "dmissing pgfplots")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-status   "texlive-pictures")
# (find-vldifile "texlive-pictures.list")
# (find-udfile   "texlive-pictures/")
# (find-status   "texlive-pictures-doc")
# (find-vldifile "texlive-pictures-doc.list")
# (find-udfile   "texlive-pictures-doc/")

# (find-udfile "texlive-doc/plain/pgfplots/")
# (find-fline "/usr/share/doc/texlive-doc/latex/tikzscale/")
# (find-fline "/usr/share/doc/texlive-doc/latex/pgfplots/")
# (find-fline "/usr/share/doc/texlive-doc/generic/pgfplots")


#####
#
# Dimension too large
# 2016jan28
#
#####

# «dimension-too-large» (to ".dimension-too-large")
# http://tex.stackexchange.com/questions/164277/dimension-too-large-in-pgf-plot
# http://tex.stackexchange.com/questions/33082/how-can-i-avoid-the-dimension-too-large-error-when-plotting-in-newer-pgf-versi
# http://tex.stackexchange.com/questions/170814/error-dimension-too-large-when-plotting-exponentials-with-tikz <- metapost
# http://tex.stackexchange.com/questions/13816/dimension-too-large-while-plotting-with-pgfplots

http://tex.stackexchange.com/questions/36169/pgfplots-and-calculations-without-fpu-dimension-too-large-with-fpu-illegal?rq=1
http://tex.stackexchange.com/questions/167914/pgfplots-dimension-too-large-returned-when-plotting-rational-function?rq=1










* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
function f(x,y) print(x/4 + y/2 - 1) end
f(0, 0)
f(2, -1)



#*
# (defun c  () (interactive) (eev-bounded) (find-zsh0 "ee"))
# (defun cc () (interactive) (eev-bounded) (find-zsh  "ee"))
# (defun d  () (interactive) (find-xpdfpage "/tmp/tikz/test1.pdf"))
# (find-angg ".emacs.papers" "tikz")

mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'
\documentclass{book}
\usepackage{tikz}
\begin{document}
\tikzset{axis/.style=very thick}
\tikzset{tick/.style=thick}
\tikzset{grid/.style=gray,very thin}
\usetikzlibrary{calc}
%

\def\xyfromuv#1#2{2*(#1)-2*(#2),2+(#1)+(#2)}
\def\xyfromt#1{\xyfromuv{#1}{1/(#1)}}
\def\twothree{2,3}
\xyfromt 1

\begin{tikzpicture}[scale=1]
  \clip (-4-0.4, -3-0.4) rectangle (4+0.4, 5+0.4);
  \draw[step=1cm,grid] (-4,-3) grid (4,5);
  \draw[axis] (-10,0) -- (10,0);
  \draw[axis] (0,-10) -- (0,10);
  \foreach \x in {-10,...,10} \draw[tick] (\x,-0.2) -- (\x,0.2);
  \foreach \y in {-10,...,10} \draw[tick] (-0.2,\y) -- (0.2,\y);
  \draw[color=blue] (-20,14) -- (20,-6);    % = U=1
  \draw (-20,12) -- (20,-8);    % = U=0
  \draw (-20,10) -- (20,-10);   % = U=-1
  \draw[axis,color=yellow] (1,2) -- (3,4);
  %\draw[axis,color=yellow] (\xyfromt 1) -- (\xyfromt 2);
  \draw[axis,color=yellow] (2*1, 3) -- (4, 5);
  \draw[axis,color=red] (\twothree) -- (4, 5);
  %
  \draw[color=orange] (20,14) -- (-20,-6);    % = V=1
  \draw (20,12) -- (-20,-8);    % = 0
  \draw (20,10) -- (-20,-10);   % = -1
  %
  \draw[color=red]    plot (\x,\x)             node[right] {$f(x) =x$};
  \draw[color=blue]   plot (\x,{sin(\x r)})    node[right] {$f(x) = \sin x$};
  \draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};
  %
  %  \draw (0,0) -- $(1,2) + (3,4)$;
  % (x,y)=(0,2)+u(2,1)+v(-2,1)
  % (x,y)=(2u-2v,2+u+v)
\end{tikzpicture}
\end{document}
%%%
pdflatex test1.tex
#*

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/tikz/
lualatex test1.tex








# (find-man "luatex")

#*
# (defun c  () (interactive) (eev-bounded) (find-zsh0 "ee"))
# (defun cc () (interactive) (eev-bounded) (find-zsh  "ee"))
# (defun d  () (interactive) (find-dvipage "/tmp/tikz/test1.dvi"))
# (find-angg ".emacs.papers" "tikz")

mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'
\documentclass{book}
\usepackage{luacode}
\usepackage{color}
\begin{document}

% (find-dn4ex "edrx08.sty" "colors")
%
\def\blue  #1{{\color{blue}#1}}
\def\red   #1{{\color{red}#1}}
\def\orange#1{{\color{orange}#1}}
\def\yellow#1{{\color{yellow}#1}}
\def\smashedvrule#1#2#3{\vrule width#1 height#2 depth#3 \kern-#1}
\def\bicolorhbox#1{{%
  \setbox0\hbox{#1}%
  \yellow{\smashedvrule{\wd0}{\ht0}{0pt}}%
  \orange{\smashedvrule{\wd0}{0pt}{\dp0}}%
  \box0%
  }}
\definecolor{orange}{rgb}{1,.64,0}

% (find-dn4ex "edrx08.sty" "dags")
%
\newdimen\mypictureunit
\setbox0=\hbox{\rm0}
\mypictureunit=.085\wd0
\mypictureunit=.084\wd0
%
\def\cput  (#1,#2)#3{\put(#1,#2){\hbox to 0pt{\hss           #3\hss}}}
\def\dagput(#1,#2)#3{\put(#1,#2){\hbox to 0pt{\hss\scriptsize#3\hss}}}
\def\dagpicture(#1,#2)(#3,#4)[#5]#6{{%
  \unitlength=\mypictureunit
  \lower #5\unitlength\hbox{%
    \begin{picture}(#1,#2)(#3,#4)
      #6
    \end{picture}%
  }}}
\def\cdagpicture(#1,#2)(#3,#4)[#5]#6{\bicolorhbox{}\dagpicture}


\mypictureunit=1em

$\dagpicture(3,4)(5,6)[0]{
   \dagput(0,0){0,0}
   \dagput(2,3){2,3}
}
$

% \dagpicture

\bicolorhbox{Hellp}


Hello
\end{document}
%%%
lualatex --output-format=dvi test1.tex

#*














#  Local Variables:
#  coding:               raw-text-unix
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: