1

I'm looking here for some examples of block diagrams, I was however wondering how can I insert a small "cut" in the signals arc and label it with the bitwidth.

Like the following

enter image description here

  • 1
    You can probably use a tikz decorations marking. – marsupilam Aug 11 '17 at 14:10
  • 3
    Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem maybe without "cut". – Bobyandbob Aug 11 '17 at 14:11
  • @marsupilam can you provide me a small example? (Just an arrow with a cut and a number, just as the picture I posted). – user8469759 Aug 16 '17 at 13:24
  • 1
    Similar: https://tex.stackexchange.com/questions/31453/ For the number, you can add a new node, or add a label to the node providing the slanted line, e.g. \draw[->] (a) -- node[strike out,draw,label=above:\tiny 4]{} (b);. (requires the shapes.misc library). – Torbjørn T. Aug 16 '17 at 14:15
  • @TorbjørnT. Let me try... – user8469759 Aug 16 '17 at 14:18
  • @TorbjørnT. It worked, the very last thing is that I'd like to attach a label, in the same fashion there's a number right next to the cut in my picture, can you give me this very last clue? – user8469759 Aug 16 '17 at 14:29
  • I did already in my last comment ... You'd just want to use left instead of above for the label: label=left:\tiny 4. – Torbjørn T. Aug 16 '17 at 14:33

1 Answers1

3

The "strike out" part has a good answer in How do I cancel/strike out a line?

To add the number you can for example add a label to the node, as in the first tikzpicture below. The second tikzpicture is exactly the same as the first, except that the options to the node is put in a style, for convenience.

output of code

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}
\begin{document}
\begin{tikzpicture}
  \node (a) {\(A\)};
  \node (b) at (0,-1) {\(B\)};
  \draw[->] (a) -- node[strike out,draw,-,label=left:\tiny 4]{} (b);
\end{tikzpicture}
\begin{tikzpicture}[dashwithlabel/.style={strike out,draw,-,label=#1}]
  \node (a) {\(A\)};
  \node (b) at (0,-1) {\(B\)};
  \draw[->] (a) -- node[dashwithlabel={left:\tiny 4}]{} (b);
\end{tikzpicture}
\end{document}
Torbjørn T.
  • 206,688