1

The code below only works without the utf8 option of the inputenc package or by removing the apostrophe from M’ and N’,

\documentclass[a4paper, 12pt, twoside]{book}
\usepackage[brazil]{babel}
\usepackage[utf8]{inputenc}
\usepackage{tikz,tkz-euclide,tkz-base}
\usetkzobj{all}
\usetikzlibrary{babel, quotes}

\begin{document}

\begin{tikzpicture}[scale=1.25]
\tkzInit[ymin=-3]
\tkzClip[space=1]
\tkzDefPoint(0,0){A}
\tkzDefPoint(8,0){B}
\tkzDefPoint(3.5,10){I}
\tkzDefMidPoint(A,B) \tkzGetPoint{O}
\tkzDefPointBy[projection=onto A--B](I) \tkzGetPoint{J}
\tkzInterLC(I,A)(O,A) \tkzGetPoints{M’}{M}
\tkzInterLC(I,B)(O,A) \tkzGetPoints{N}{N’}
\tkzDrawCircle[diameter](A,B)
\tkzDrawSegments(I,A I,B A,B B,M A,N)
\tkzMarkRightAngles(A,M,B A,N,B)
\tkzDrawSegment[style=dashed,color=blue](I,J)
\tkzShowTransformation[projection=onto A--B,color=red,size=3,gap=-3](I)
\tkzDrawPoints[color=red](M,N)
\tkzDrawPoints[color=blue](O,A,B,I)
\tkzLabelPoints(O) \tkzLabelPoints[above right](N,I)
\tkzLabelPoints[below left](M,A)
\end{tikzpicture}

\end{document}

Error message

Missing \endcsname inserted. \tkzInterLC(I,A)(O,A) \tkzGetPoints{M’}{M}
Extra \endcsname. \tkzInterLC(I,A)(O,A) \tkzGetPoints{M’}{M}
Missing \endcsname inserted. \tkzInterLC(I,A)(O,A) \tkzGetPoints{M’}{M}
Missing \endcsname inserted. \tkzInterLC(I,A)(O,A) \tkzGetPoints{M’}{M}
Missing \endcsname inserted. \tkzInterLC(I,A)(O,A) \tkzGetPoints{M’}{M}
Missing \endcsname inserted. \tkzInterLC(I,A)(O,A) \tkzGetPoints{M’}{M}
Missing \endcsname inserted. \tkzInterLC(I,A)(O,A) \tkzGetPoints{M’}{M}
Missing \endcsname inserted. \tkzInterLC(I,B)(O,A) \tkzGetPoints{N}{N’}
Extra \endcsname. \tkzInterLC(I,B)(O,A) \tkzGetPoints{N}{N’}
Missing \endcsname inserted. \tkzInterLC(I,B)(O,A) \tkzGetPoints{N}{N’}
Missing \endcsname inserted. \tkzInterLC(I,B)(O,A) \tkzGetPoints{N}{N’}
Missing \endcsname inserted. \tkzInterLC(I,B)(O,A) \tkzGetPoints{N}{N’}
Missing \endcsname inserted. \tkzInterLC(I,B)(O,A) \tkzGetPoints{N}{N’}
Missing \endcsname inserted. \tkzInterLC(I,B)(O,A) \tkzGetPoints{N}{N’}
Use of \pgf@sh@ma@N doesn't match its definition. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Extra \endcsname. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Use of \pgf@sh@ns@N doesn't match its definition. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Package PGF Math Error: Unknown function `center' (in 'center'). \tkzDrawSegments(I,A I,B A,B B,M A,N)
Use of \pgf@sh@ns@N doesn't match its definition. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Use of \pgf@sh@nt@N doesn't match its definition. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Argument of \xcolor@ has an extra }. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Paragraph ended before \xcolor@ was complete. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Argument of \@next has an extra }. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Paragraph ended before \@next was complete. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Package tikz Error: Giving up on this path. Did you forget a semicolon?. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Missing } inserted. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Missing } inserted. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Missing $ inserted. \tkzDrawSegments(I,A I,B A,B B,M A,N)
Use of \pgf@sh@ma@N doesn't match its definition. \tkzMarkRightAngles(A,M,B A,N,B)
Extra \endcsname. \tkzMarkRightAngles(A,M,B A,N,B)
Use of \pgf@sh@ns@N doesn't match its definition. \tkzMarkRightAngles(A,M,B A,N,B)
Package PGF Math Error: Unknown function `center' (in 'center'). \tkzMarkRightAngles(A,M,B A,N,B)
Use of \pgf@sh@ns@N doesn't match its definition. \tkzMarkRightAngles(A,M,B A,N,B)
Use of \pgf@sh@nt@N doesn't match its definition. \tkzMarkRightAngles(A,M,B A,N,B)
Argument of \xcolor@ has an extra }. \tkzMarkRightAngles(A,M,B A,N,B)
Paragraph ended before \xcolor@ was complete. \tkzMarkRightAngles(A,M,B A,N,B)
Incomplete \iffalse; all text was ignored after line 22.
  • 3
    Use M' (with the ASCII apostrophe). – egreg Mar 24 '17 at 23:37
  • For example, there is a command from the tkz-euclide package, \ tkzDefPointsBy [<local options>] ( 〈 liste de pts 〉 ){ 〈 liste de pts 〉 }, which automatically generates the second list by adding apostroph to the points in the first list. Besides other situations that would be useful for me to solve this problem – Marcelo Rodrigues Mar 24 '17 at 23:42
  • 1
    Unfortunately, when you copy-paste from a PDF you often get the wrong character in this case. – egreg Mar 24 '17 at 23:44
3

It often happens that copying code from a PDF file leads to incorrect TeX markup.

For instance, if I copy the code on page 40 of the manual for tkz-euclide (version 1.16c) and paste it here, I get

\begin{tikzpicture}[scale=2]
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(2,-1){A}
  \tkzDefPoint(2,2){B}
  \tkzDefPointsBy[symmetry=center O](B,A){}
  \tkzDrawLine(A,A’)
  \tkzDrawLine(B,B’)
  \tkzMarkAngle[mark=s,arc=lll,size=2 cm,mkcolor=red](A,O,B)
  \tkzLabelAngle[pos=1,circle,draw,fill=blue!10](A,O,B){$60^{\circ}$}
\end{tikzpicture}

This is invalid code, unfortunately: the font tries to be smart and advertises the apostrophe to be U+2019 RIGHT SINGLE QUOTATION MARK, whereas the code intended it to be U+0027 APOSTROPHE.

There’s not much you can do, unfortunately, except replacing with '. The valid code is

\begin{tikzpicture}[scale=2]
  \tkzDefPoint(0,0){O}
  \tkzDefPoint(2,-1){A}
  \tkzDefPoint(2,2){B}
  \tkzDefPointsBy[symmetry=center O](B,A){}
  \tkzDrawLine(A,A')
  \tkzDrawLine(B,B')
  \tkzMarkAngle[mark=s,arc=lll,size=2 cm,mkcolor=red](A,O,B)
  \tkzLabelAngle[pos=1,circle,draw,fill=blue!10](A,O,B){$60^{\circ}$}
\end{tikzpicture}

Your example features the very same problem.

  • I understand. It is that in the tkz-euclide manual the author uses utf8 and the examples codes appear with , I was in doubt if it would be working with . In pgmanual also appears used to reverse the position of the label – Marcelo Rodrigues Mar 25 '17 at 17:49
  • 1
    @MarceloRodrigues It does not depend on the encoding of the input, but only on PDF properties. The apostrophe in the manual of PGF falls into the same case. – egreg Mar 25 '17 at 17:51

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.