0

The TikZ manual (p.37) says "You can also fill and draw a path at the same time using the \filldraw command. This will first draw the path, then fill it." But from the point of view of opaque ink, it actually first fills the path then then draws over it (appropriate to the name). If I specify both draw and fill for a path, this also happens (the order does not matter). So my question: how to first draw and then fill a given path (so that half of what is stroked is then covered by the fill)?

  • Welcome to TeX.SX!! It is really helpful if you can post code to show what you have tried. This both gives people a better idea of what you are asking and makes it much easier for us to help you. Ideally post a full minimal working examplethat starts with a \documentclass command, have a minimal preamble and then \begin{document}...\end{document}. The code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much more likely that they will! – Andrew Jul 6 '16 at 16:37
3

Using postaction to apply a second action to the same path (chances are high a similar question has been answered on SE) :

\documentclass{standalone} 
\usepackage{tikz}

\begin{document} 
\begin{tikzpicture}
\draw (-1,-1) -- (1,1);
\path[draw=red, line width=2mm,  postaction={fill=black, opacity=.4}] circle (1);
\end{tikzpicture}
\end{document}

enter image description here

For more complex paths (multipart paths in particular), you will probably have to use transparency groups (see pgf manual).

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.