4

When compiling the pict2e code below I don't get the expected output of a red circle with a "white hole" (doughnut shaped figure). Instead it places one of the circles slightly off the specified center point.

\begin{picture}(80,80)
  {\color{xred}\put(40,40){\circle*{80}}}
  {\color{white}\put(40,40){\circle*{40}}}
  \put(40,40){\circle{80}}
  \put(40,40){\circle{40}}
\end{picture}

Output:

Output

Can anyone explain this seemingly strange behavior?

2 Answers 2

3

Please always post complete documents, not just fragments.

The colour specials interfere with picture commands attempts to ignore white space, it is safer to put them in the \put

enter image description here

\documentclass{article}

\usepackage{pict2e,color}

\begin{document}

\begin{picture}(80,80)
  \put(40,40){{\color{red}\circle*{80}}}
  \put(40,40){{\color{white}\circle*{40}}}
  \put(40,40){\circle{80}}
  \put(40,40){\circle{40}}
\end{picture}

\end{document}
2

You have spurious spaces in fact of the first {...} Use:

\begin{picture}(80,80)
  {\color{red}\put(40,40){\circle*{80}}}%
  {\color{white}\put(40,40){\circle*{40}}}%
  \put(40,40){\circle{80}}
  \put(40,40){\circle{40}}
\end{picture}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .