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.

I am running TikZ (pgf_210.tds), TeX 3.141592, and Fedora 14. I am working on Venn diagrams. The examples all do the right art work, but draw the set identification as in

\draw \firstcircle node[text=white, below] {$A$}
\draw \secondcircle note[text=white, above] {$B$}

on top of each other just left of the midpoint of the left arc of the intersection.

Any thoughts?


\begin{document}
%% From a tikz Venn example
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[fill=gray]
\begin{scope}
\clip (-2,-2) rectangle (2,2)
   (1,0) circle(1);  
\fill (0,0) circle (1);
\end{scope}

\begin{scope}
\clip (-2,-2) rectangle (2,2)
   (0,0) circle(1);
\fill (1,0) circle(1);
\end{scope}

draw (0,0) circle (1) (0,1) node [text=black,above] at (2,2) {$A$}
    (1,0) circle (1) (1,1) node [text=black,above] at (1,1) {$B$}
    (-2,-2) rectangle (3,3);
\end{tikzpicture}
\end{document}
share|improve this question
5  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  egreg Jun 26 '12 at 22:24
3  
This is most probably taken from texample.net/tikz/examples/venn-diagram –  percusse Jun 26 '12 at 23:23
    
Still no change. I suspect a compatibility problem, either my TeX/LaTeX package (version 3.14159) or (less likely) Fedora 14. I'll try getting a newer LaTeX version. Thanks for your attention. –  John Slimick Jun 29 '12 at 18:59
    
@JohnSlimick The key here is the version of your packages, not of TeX itself. Add \listfiles to your source and edit the resulting **File List** from the .log file into your answer. –  Joseph Wright Jun 29 '12 at 20:31
add comment

1 Answer

If I understand your question, you are not able to place the labels for the sets at the appropriate points. The easiest fix for this is to use the syntax node [<options>] {<node_text>}. It will automatically be placed relative to the last point in the path:

\draw 
    (0,0) circle (1) (0,1) node [text=black,above] {$A$}
    (1,0) circle (1) (1,1) node [text=black,above] {$B$}
    (-2,-2) rectangle (3,3);

which produces:

enter image description here

Note:

  • I have used three separate \draw commands as I think that is clearer, but the above syntax also works.

Code:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[fill=gray]
\begin{scope}
    \clip (-2,-2) rectangle (2,2) (1,0) circle(1);  
    \fill (0,0) circle (1);
\end{scope}

\begin{scope}
    \clip (-2,-2) rectangle (2,2) (0,0) circle(1);
    \fill (1,0) circle(1);
\end{scope}

\draw (0,0) circle (1) (0,1) node [text=black,above] {$A$};
\draw (1,0) circle (1) (1,1) node [text=black,above] {$B$};
\draw (-2,-2) rectangle (3,3);;
\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.