4

I'm working on a mac, I use the package TikZ and it works. But I have problems when I want use ellipse or diamond ex :

\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[ellipse] {Ellipse};
\end{tikzpicture}
\end{document}

If somebody could help me thank you !

  • 1
    Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – Claudio Fiandrino Sep 12 '14 at 14:58
3

You have to use \usetikzlibrary{shapes.geometric} as the shape ellipse is defined by it.

\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node[ellipse,draw] {Ellipse};       %% draw just to show the shape

\node[diamond,draw] at (0,-3) {Diamond};
\end{tikzpicture}
\end{document}

enter image description here

2

Just for fun as usual.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-node}

\begin{document}
\begin{pspicture}(8,8)
    \rput(2,6){\ovalnode{A}{PSTricks}}
    \rput(6,2){\dianode{B}{TikZ}}
    \ncline{<-}{A}{B}\nbput[nrot=:U]{inheritance direction}
\end{pspicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.