- Export to
tikz
:
The resulting code is an absolute horror. But it does compile to what was displayed (there might be some edge cases).
\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{zzttqq}{rgb}{0.6,0.2,0}
\definecolor{qqqqff}{rgb}{0,0,1}
\definecolor{cqcqcq}{rgb}{0.75,0.75,0.75}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\draw [color=cqcqcq,dash pattern=on 1pt off 1pt, xstep=1.0cm,ystep=1.0cm] (0,-10) grid (10,0);
\draw[->,color=black] (0,0) -- (10,0);
\foreach \x in {,1,2,3,4,5,6,7,8,9}
\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->,color=black] (0,-10) -- (0,0);
\foreach \y in {-10,-9,-8,-7,-6,-5,-4,-3,-2,-1}
\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
\draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
\clip(0,-10) rectangle (10,0);
\fill[line width=1.2pt,color=zzttqq,fill=zzttqq,fill opacity=0.1] (9.2,-2.18) -- (2.56,-2.12) -- (5.08,-5.16) -- cycle;
\draw [line width=1.2pt,color=zzttqq] (9.2,-2.18)-- (2.56,-2.12);
\draw [line width=1.2pt,color=zzttqq] (2.56,-2.12)-- (5.08,-5.16);
\draw [line width=1.2pt,color=zzttqq] (5.08,-5.16)-- (9.2,-2.18);
\begin{scriptsize}
\fill [color=qqqqff] (9.2,-2.18) circle (1.5pt);
\draw[color=qqqqff] (9.36,-1.92) node {$A$};
\fill [color=qqqqff] (2.56,-2.12) circle (1.5pt);
\draw[color=qqqqff] (2.72,-1.86) node {$B$};
\fill [color=qqqqff] (5.08,-5.16) circle (1.5pt);
\draw[color=qqqqff] (5.24,-4.9) node {$C$};
\draw[color=zzttqq] (7.4,-3.78) node {$b$};
\end{scriptsize}
\end{tikzpicture}
\end{document}
- add a node and the desired equation.
\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{zzttqq}{rgb}{0.6,0.2,0}
\definecolor{qqqqff}{rgb}{0,0,1}
\definecolor{cqcqcq}{rgb}{0.75,0.75,0.75}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\draw [color=cqcqcq,dash pattern=on 1pt off 1pt, xstep=1.0cm,ystep=1.0cm] (0,-10) grid (10,0);
\draw[->,color=black] (0,0) -- (10,0);
\foreach \x in {,1,2,3,4,5,6,7,8,9}
\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->,color=black] (0,-10) -- (0,0);
\foreach \y in {-10,-9,-8,-7,-6,-5,-4,-3,-2,-1}
\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
\draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
\clip(0,-10) rectangle (10,0);
\fill[line width=1.2pt,color=zzttqq,fill=zzttqq,fill opacity=0.1] (9.2,-2.18) -- (2.56,-2.12) -- (5.08,-5.16) -- cycle;
\draw [line width=1.2pt,color=zzttqq] (9.2,-2.18)-- (2.56,-2.12);
\draw [line width=1.2pt,color=zzttqq] (2.56,-2.12)-- (5.08,-5.16);
\draw [line width=1.2pt,color=zzttqq] (5.08,-5.16)-- (9.2,-2.18);
\begin{scriptsize}
\fill [color=qqqqff] (9.2,-2.18) circle (1.5pt);
\draw[color=qqqqff] (9.36,-1.92) node {$A$};
\fill [color=qqqqff] (2.56,-2.12) circle (1.5pt);
\draw[color=qqqqff] (2.72,-1.86) node {$B$};
\fill [color=qqqqff] (5.08,-5.16) circle (1.5pt);
\draw[color=qqqqff] (5.24,-4.9) node {$C$};
\draw[color=zzttqq] (7.4,-3.78) node {$b$};
\end{scriptsize}
% adding some reference to some equation
\node at (8,-5){Applying equation \ref{eq-2}};
\end{tikzpicture}
According to the right Pythagorean theorem:
\begin{equation}\label{eq-1}
a^2 + b^2 = c^2
\end{equation}
According to the wrong Pythagorean theorem:
\begin{equation}\label{eq-2}
a + b = c
\end{equation}
\end{document}
Result:
EDIT:
Request: write the equation but don't display it, yet keep it referenced.
Answer: use the textpos
package and wrap your equation in a textblock
environment:
%\usepackage{textpos} <--- in the preambule
According to the wrong Pythagorean theorem:
\begin{textblock}{width}(X_offset, Y_offset)
\begin{equation}\label{eq-2}
a + b = c
\end{equation}
\end{textblock}
You can use (X_offset, Y_offset)
to "yeet" the equation out of the paper, for e.g. (10,10)
.
Result:
The equation can't be found in the pdf, but it is written in the LaTeX source.
align
or similar environments fromamsmath
in a node (though you will need to set atext width
) or just use theequation
counter directly. You will, of course, place\label
s to later refer to them.overpic
and something like\refstepcounter{equation}(\theequation)
to print the faked tag.