0

I wanted to draw this particular image in LaTeX but I don't know where to start:

weanted

I have no minimal working example I am just asking for directions please don't ridicule me.

10

Here is a Metapost solution that takes a different approach.

enter image description here

The shape is drawn as a very thick line and then the inside is erased.

prologues := 3;
outputtemplate := "%j%c.eps";
beginfig(1);
path s; s = ( (-1,1) -- (-1,-1) {dir -34} .. {dir 34} (1,-1) -- (1,1) ) scaled 1cm;
linecap := butt;
draw s withpen pencircle scaled 3pt;
draw s withpen pencircle scaled 2pt withcolor background;
endfig;
end.

Here are some links for more information about Metapost

I don't know of any technical drawing books that specifically deal with Metapost, but Knuth's own Metafont book is very helpful for learning the core of the MP language (since it is more or less identical to Metafont).

  • thanks alot for the answer. Mind if i ask where can I read about this stuff? a book perhaps? – Ricardo Veloz Jr Dec 15 '14 at 3:02
  • I'll update the answer with some references and links. – Thruston Dec 15 '14 at 9:17
17

And with TikZ:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw[double,double distance=1.5mm]
  (0,0) --
  ++(0,-6cm)
  arc[start angle=210,end angle=330,radius=4cm] --
  ++(0,6cm);
\end{tikzpicture}

\end{document}

enter image description here

  • thanks alot for the answer. Mind if i ask where can I read about this stuff? a book perhaps? – Ricardo Veloz Jr Dec 15 '14 at 3:03
  • @RicardoVelozJr You're welcome. For the powerful TikZ, you have the PGF/TikZ manual (texdoc pgf in a terminal, or in CTAN: mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf). – Gonzalo Medina Dec 15 '14 at 3:07
  • @RicardoVelozJr If you want "to close" the walls you can add line cap=round or line cap=rect in the options of draw command. And if you want to "fill" the walls in yellow, for example, you can use double=yellow option. – Kpym Dec 15 '14 at 15:07
7

A PSTricks solution:

\documentclass{article}

\usepackage{pstricks}

\begin{document}

\begin{pspicture}(4.46,5)
  % inner
  \psline(0.23,5)(0.23,1)
  \psarc(2.23,3){2.8284}{224.8}{315.2}
  \psline(4.23,5)(4.23,1)
  % outer
  \psline(0,5)(0,0.99)
  \psarc(2.23,3){3}{221.8}{318.2}
  \psline(4.46,5)(4.46,0.99)
\end{pspicture}

\end{document}

output

Notice that you can scale down the drawing using

\psset{unit = <a number less than 1>}

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.