tikz.dev / tkz-euclide Manual

tkz-euclide

FAQ

52 FAQ

52.1 Most common errors

These are the mistakes I make most often myself, since the syntax has changed several times. This section will be expanded.

  • Forgetting the “s” of the macros that draw several objects, such as \tkzDrawSegments or \tkzDrawCircles: \tkzDrawPoint(A,B) is wrong, you need \tkzDrawPoints(A,B).

  • Since version 4, the unit is always the cm, so you must not write a unit: \tkzDrawCircle[R](O,3cm) becomes \tkzDrawCircle[R](O,3). The usual TikZ options keep their units, for example below right = 12pt; on the other hand, you write size=1.2 to set the radius of the arc in \tkzMarkAngle.

  • Parentheses instead of braces. A point that is created has its name between braces, while a point that is used, as an option or as an argument, has its name between parentheses: write \tkzGetPoint{A}, not \tkzGetPoint(A).

  • \tkzGetPoint{A} instead of \tkzGetFirstPoint{A}. When a macro gives two points, either retrieve both with \tkzGetPoints{A}{B}, or only one of them with \tkzGetFirstPoint{A} or \tkzGetSecondPoint{A}. These points can also be used with the references tkzFirstPointResult and tkzSecondPointResult. Some macros also give a third point, tkzPointResult.

  • Retrieve a result immediately: \tkzGetPoint, \tkzGetPoints or \tkzGetLength must follow the macro that computes the result, because the next calculation replaces it.

  • The order of the intersection points of a line and a circle, or of two circles, has sometimes changed between versions; this leads either to a wrong figure or to an error. The options common and near let you choose the point you want.

  • Mixing options and arguments: all the macros that use a circle need to know its radius. If the radius is given by a measure, the option includes R.

  • Angles are given in degrees, more rarely in radians.

  • A list of points must not be cut by a % at the end of a line: \tkzDrawSegments(A,B% followed by C,D) gives the point BC,D, because % also removes the space between the two points. Simply go to the next line without %.

  • The syntax of version 3 for special circles, for example \tkzDrawCircle[euler](A,B,C), no longer exists: define the circle with \tkzDefCircle[euler](A,B,C), retrieve its center and a point with \tkzGetPoints{N}{P}, then draw it with \tkzDrawCircle(N,P). Since version 5.14, the old syntax gives an error message.

  • If an error occurs in a calculation when passing arguments, it is better to do the calculation before calling the macro.

  • Do not mix the syntaxes of pgfmath and xfp. I have often chosen xfp; if you prefer pgfmath, do your calculations before passing the arguments.

  • The error “dimension too large” occurs in some cases, for example with \tkzDrawArc or \tkzMarkAngle and a very small angle: it comes from the library decorations when a mark is placed on the arc, even when the mark is absent. One way to avoid it is the option veclen (see section 31.6): in the scope where it is used, the function veclen is computed with xfp. Do not use intersection macros in this scope.

  • Since version 5.14, \tkzSetUpCompass[delta=...] no longer extends the arcs drawn with \tkzDrawArc: use \tkzSetUpArc[delta=...] for them.