Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Starting from a more complex trial to add a new shape, I arrive to this minimal example which does not compile. I use PGF 2.10

\documentclass[12pt]{article}

\usepackage{tikz}
\pgfdeclareshape{minex}{}
\begin{document}
\begin{tikzpicture}
\node[minex] {};
\end{tikzpicture}
\end{document}

The received error message is :

ERROR: Package PGF Math Error: Unknown function `center' (in 'center').

TeX said:

See the PGF Math package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.7 \node[minex] {};
share|improve this question
add comment

2 Answers

Define at least a center anchor, then the error goes away:

\pgfdeclareshape{minex}{\anchor{center}{\pgfpointorigin}}
share|improve this answer
add comment

Add some definitions (inherited or not) :

\documentclass[12pt]{article}

\usepackage{tikz}
\pgfdeclareshape{minex}{
  \inheritsavedanchors[from=rectangle]
  \inheritanchorborder[from=rectangle]
  \inheritanchor[from=rectangle]{center}
  \inheritanchor[from=rectangle]{north}
  \inheritanchor[from=rectangle]{south}
  \inheritanchor[from=rectangle]{west}
  \inheritanchor[from=rectangle]{east}
  \inheritanchor[from=rectangle]{north west}
  \inheritanchor[from=rectangle]{south east}
  \inheritanchor[from=rectangle]{south west}
  \inheritanchor[from=rectangle]{north east}
  \inheritanchor[from=rectangle]{center}
  \inheritanchor[from=rectangle]{base}
  \inheritanchor[from=rectangle]{base east}
  \inheritanchor[from=rectangle]{base west}
  \inheritanchor[from=rectangle]{mid}
  \inheritanchor[from=rectangle]{mid east}
  \inheritanchor[from=rectangle]{mid west}
  %....
}   
\begin{document}
\begin{tikzpicture}
\node[shape=minex] {};
\end{tikzpicture}
\end{document} 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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