-5

I want to draw a diagram like this picture in the middle of my page.

the picture of the diagram

how can I do that?

8

I don't think you need a sledge hammer like tikzpicture for this diagram:

\documentclass{article}
\usepackage{amsmath}
\usepackage{rotating}
\newcommand\longvertarrow[1][]{\rotatebox{-90}{$\xrightarrow{\hspace{4em}}$#1}}

\begin{document}

\begin{tabular}{c}
File of program\\[-1.5ex]
\longvertarrow[~] \\
\fbox{\enspace Pre processor\enspace}\\[-1ex]
\longvertarrow \\
Source program
\end{tabular}

\end{document} 

enter image description here

  • 4
    +1 for the creativity and for showing that something can be done without tikz – Moriambar May 7 '17 at 13:40
10

Please always read manuals first. That helps a lot, especially since you are asking for tikz basis knowledge.

picture

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}
    \begin{tikzpicture}
        \node[draw=none] (a) {File of program};
        \node[draw=black,below=2 of a] (b) {Pre processor};
        \node[draw=none,below=2 of b] (c) {Source program};
        \draw[->] (a) -- (b);
        \draw[->] (b) -- (c);
    \end{tikzpicture}
\end{document}

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.