- #1
fatra2 said:Hi there,
Do you desperately want to draw a picture in LaTeX? If so, you can always do it in the figure environment: \begin{figure} \end{figure}. From this environment, you will need to tell LaTeX what, where, and how each piece of the drawing should be placed. As you can imagine, even for a very small figure, you need to add many, many, many commands, which become terribly cumbersome.
I suggest you to use a drawing environment, like gimp or xfig (opensource), to draw your pciture. Then you simply need to include it in your text wherever you want to. I believe you will save a lot of time and effort.
Cheers
S_David said:I have downloaded the pgf package, but I don't know where to start, its manual quite long and doesn't give you things in direct way, where I have to deliver my thesis soon.
\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
\begin{center}
\begin{tikzpicture}
% draw nodes (pgf/TikZ v2.00 manual sections 3.4, 3.7, 3.9)
\node (source) at (0,0) [circle,draw,label=below:Source] {$S$};
\node (relay) at (3,2) [circle,draw,label=below:Relay] {$R$};
\node (destination) at (6,0) [circle,draw,label=below:Destination] {$D$};
% connect nodes (pgf/TikZ v2.00 manual section 3.11)
\draw [->] (source.60) to node [auto] {$\alpha_1$} (relay.west);
\draw [->] (relay.east) to node [auto] {$\alpha_2$} (destination.120);
\draw [->] (source.east) to node [auto,swap] {$\alpha_0$} (destination.west);
\end{tikzpicture}
\end{center}
\caption{\label{fig:SRD} Source-relay-destination figure.}
\end{figure}
\end{document}
To draw figures in LaTeX, you can use the \includegraphics
command. This command allows you to insert an external image file into your document. You can also use packages like tikz
or pstricks
to create figures directly in LaTeX.
To resize a figure in LaTeX, you can use the \includegraphics
command with the width
or height
option. For example, \includegraphics[width=0.5\textwidth]{image.jpg}
will resize the image to half of the text width. Alternatively, you can use the \scalebox
command to resize the figure by a specific scaling factor.
The most commonly used format for figures in LaTeX is .eps
(Encapsulated PostScript) as it allows for high-quality vector graphics. However, you can also use other formats such as .pdf
, .png
, or .jpg
. It is recommended to use vector graphics whenever possible to maintain the quality of the figure when resizing.
To add captions to figures in LaTeX, you can use the \caption
command within a figure
environment. You can also use the \label
command to add a label to your figure, which can be referenced later in the text using the \ref
command.
Yes, you can draw diagrams and graphs in LaTeX using packages like tikz
, pstricks
, or pgfplots
. These packages offer a wide range of options for creating various types of diagrams and graphs, such as flowcharts, Venn diagrams, bar graphs, and more.