# [Tex/LaTex] generate simple cylindrical shape with text in latex (tikz)

tikz-pgf

I am attempting to generate the following diagram in latex:

I've been using the tikz package, which although its capabilities seem to be endless, it does have a rather steep learning curve. I am currently learning how to generate simple diagrams including circles, arrows, squares, and have no idea how to include text yet. I am working through the manual so I will eventually have a good understanding of the tool, but as of yet, the diagram shown is beyond my capabilities. Could someone specify how I should go around generating this diagram? Many thanks for your help.

For starters, you can do something like the one below.

\documentclass[tikz]{standalone}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}[>=latex,shorten >=2pt,shorten <=2pt,shape aspect=1]
\node (A) [cylinder, shape border rotate=90, draw,minimum height=3cm,minimum width=2cm]
{A};
\draw [<->] (A.before top) -- (A.after top) node [midway, above,fill=white] {$A_0$};
\end{tikzpicture}
\end{document}


You can read the appropriate documentation in the pgf manual

You can also manually draw your cylinder like the one below.

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) ellipse (1.25 and 0.5);
\draw (-1.25,0) -- (-1.25,-3.5);
\draw (-1.25,-3.5) arc (180:360:1.25 and 0.5);
\draw [dashed] (-1.25,-3.5) arc (180:360:1.25 and -0.5);
\draw (1.25,-3.5) -- (1.25,0);
\fill [gray,opacity=0.5] (-1.25,0) -- (-1.25,-3.5) arc (180:360:1.25 and 0.5) -- (1.25,0) arc (0:180:1.25 and -0.5);
\end{tikzpicture}
\end{document}