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 use TexShop, and I have successfully compiled an example which uses metapost code directly in LaTeX code ( by running pdflatex, then metapost, then finally pdflatex again). this code uses mpfic option

Now I want to use the venn ( http://ctan.org/tex-archive/graphics/metapost/contrib/macros/venn ) package in my document. But \usepackage{venn} is causing not found error, and any command without venn package is not working as well.

So how do I setup the usage of venn package with metapost. I have installed it already using TeX live utility.

share|improve this question
    
You can also make Venn diagrams with TikZ, see tex.stackexchange.com/questions/9681/… –  N.N. Aug 17 '11 at 12:20
add comment

1 Answer 1

I have never tried to include the source directly inside the .tex file but in case your trouble is with the metapost code it may help to start with a known-good stand-alone source.

I did this recently, so I suspect that it still works (although I have edited out some stuff I think is not needed so do let me know if it fails). Here is the input file. It draws the Venn diagram for the union.

% set.mp
%  MetaPost input file with chapter one pictures.
verbatimtex
%&latex
\documentclass{book}
\begin{document}
etex

input venn

outputtemplate := "%j-%2c.mps";
beginfig(0);
  draw_venn_two(false,true,true,true);
  % Label the sets (from pp 29 pf MetaPost manual)
  picture pa, pb;
  pa = thelabel(btex \tiny $A$ etex,   (.9venn_circle_left_shift,1.15venn_circle_top_shift));
  pb = thelabel(btex \tiny $B$ etex, (1.1venn_circle_right_shift,1.15venn_circle_top_shift));
  unfill bbox pa;
  draw pa;
  unfill bbox pb;
  draw pb;
endfig;

end

At a (Linux) command line I ran the four commands

  • mpost set.mp followed by
  • tex mproof set-00.mps followed by
  • dvips -Pwww -omproof.ps mproof finally followed by
  • gv mproof.ps;

this last pops up a viewer for the figure.

To include it in my doc I used this.

\begin{center}
  \includegraphics[width=0.33\textwidth]{set-00.mps}
\end{center}

This is inside Beamer. I don't see that I did anything special to get the graphicx system to recognize the .mps ending but I may have forgot the details; let me know.

(Edit: someone changed what I wrote and in particular dropped the necessary initial paragraph. I added something like it back.)

share|improve this answer
    
Could you please include a picture showing off the Venn diagrams your method outputs? You can just press the image icon in the editing dialogue to upload one. –  N.N. Aug 17 '11 at 13:25
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.