welcome: please sign in

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

Revision 2 as of 2013-11-17 19:19:29

location: Computer / Latex / BlockDiagramsTikZ

Block diagrams in TikZ format

Under Construction

This warning will be removed once all Anton's eps block diagrams have been ported to TikZ.

Background

Anton created a set of block diagrams in ps format, where text elements can be changed using \psfrag in latex. This page provides ports of these block diagrams to TikZ. The reason for creating these ports were:

Practical

A simple Example

TikZ is a programming language and a TikZ picture is a set of code. The below minimal example shows a .tex document, demonstrating the inclusion of a TikZ block diagram:

\documentclass{pm}
\usepackage{tikz}
\usetikzlibrary{narrow}
\tikzset{>=narrow}
\begin{document}
Figure~\ref{fig:block} shows an example block diagram.
\begin{figure}
\begin{tikzpicture}
\small
\tikzstyle{block} = [draw, rectangle ,minimum size=10mm,node distance=25mm]
\tikzstyle{sum} = [draw, circle,node distance=10mm, inner sep=0mm,minimum size=4mm]


\end{tikzpicture}
\caption{This is a block diagram.\label{fig:block}}
\end{figure}
\end{document}

If you think the TikZ code (\begin{tikzpicture to \end{tikzpicture}) clutters the .tex file, it can be placed in a separate file, e,g. mypicture.tikz, and inserted in the .tex file using the the command \input{mypicture.tikz}, which simply places the content of mypicture.tikz at the location of the commend.

The arrow style >=narrow is local to the department. If you do not have access to it on your computer, you may use >=latex instead, or download the file defining the style.

Scaling the block diagrams

A simple way to change the size, when including a TikZ picture is to add an extra argument to \begin{tikzpicture}. Here are some examples:

\begin{tikzpicture}[scale=0.6]

The above scales edges, but not the nodes, neither text.

\begin{tikzpicture}[scale=0.6, every node/.style={scale=0.6}

The above scales both nodes and edges, but not text.

\begin{tikzpicture}[transform canvas={scale=0.6}]

The above scales the whole picture.

More info

A lot can be found on online forums. There also exists an extremely well-written (but long!) manual for TikZ and a much more compact minimal introduction.

Note that you can draw almost anything in TikZ, not only block diagrams.

Block diagrams