3

Does anyone know how to create an edge-trigger symbol in LaTeX? I need to to show that some thing activates on the negative clock edge of a signal, but in a paragraph, not in a timing table.

Herr K.
  • 17,946
  • 4
  • 61
  • 118

2 Answers2

7

The tikz-timing package.

The \texttiming{} macro does the trick! Documentation in above PDF

I used \texttiming{[-,timing/slope=0]HL} specifically.

enter image description here

Mico
  • 506,678
2

I didn't find a symbol like that, but this can get you started. This solution adapts to the actual line height (\baselineskip). So doesn't really matter if you change the font size.

enter image description here

\documentclass{article}
\usepackage{tikz}

\newcommand\net{%
\begin{tikzpicture}[scale=0.3\baselineskip/18pt]
 \draw (0,1) -- (1,1) -- (1,0) -- (2,0);
\end{tikzpicture}%
}

\newcommand\netp{%
\begin{tikzpicture}[scale=0.3\baselineskip/18pt]
 \draw (0,1) -- (1,1) -- (1,0) -- (2,0) -- (2,1) -- (3,1);
\end{tikzpicture}%
}

\begin{document}

Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Negative edge trigger here \net\ and \netp\ and some text after. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.

\end{document}
masu
  • 6,571
  • Just as a small comment. The cleaner way to end a command like this is to use a backslash instead of the tilde. 'Negative edge trigger here \net\ and \netp' and if you don't want a space after it use {} – Ulle Dec 10 '13 at 08:35
  • @JohannesO is it a matter of taste or there are diffences in the output? – masu Dec 10 '13 at 08:41
  • 1
    A tilde gives you a non breakable space (tie two words together) and should be used in cases when things shouldn't be broken for example Dr.~Mustermann or a Figure~\ref{} that the number of the figure won't end up in the next line. So it is a misuse if you take the tilde to end the command to force a space. Also the space generated by the tilde is not stretchable and a tilde followed by a space would generate two spaces. – Ulle Dec 10 '13 at 09:13
  • @JohannesO thanks for the heads up. This happens when someone learns LaTeX from codes written by non-experienced users... – masu Dec 10 '13 at 09:45
  • 1
    Essential guide to Latex2e usage this is a small document with helpful advices for a clean usage of commands and packages. Maybe it is interesting for you. Also avaiable in other languages. – Ulle Dec 10 '13 at 10:01
  • 1
    All % but the one after { are not necessary, by the way. Instead of guessing a proper scale value you can directly use font-units em and ex to draw something that should scale with the text. – Qrrbrbirlbel Dec 10 '13 at 10:19
  • @Qrrbrbirlbel And which one should I use? em is a width, and ex is a height of a lowercase letter... – masu Dec 10 '13 at 10:38
  • @Qrrbrbirlbel I think \baselineskip is exactly the length I should use there. I could've put the 0.3/18pt in the coordinate fields, but it's better this way. – masu Dec 10 '13 at 14:51