5

I would like to include a small lightning bolt in a tikz diagram that I have. Is there something in an existing tikz library that I can use? I couldn't find anything in the tikz manual.

I'm using the IEEEtran package and submitting to an IEEE publication, so I'm not sure what happens if I use one from this list. I like the style of what's in the marvosym package.

Effectively, I'm looking for a symbol to insert instead of the circle in the diagram below:

\documentclass[conference]{IEEEtran}

\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
  \begin{figure}
    \begin{tikzpicture}
      \draw[very thick] (1.0, 2) -- (4.5,2);
      \draw (5,2) circle[x radius=0.5, y radius=0.5];
      \draw[very thick] (5.5, 2) -- (8.5,2);
      \draw[thick,->] (5,1) -- (5,2) node[below, pos=0] {Insert bolt symbol here};
    \end{tikzpicture}
  \end{figure}
\end{document}

EDIT: Clarification: I'm not looking for someone to help me draw such a symbol with draw or path (I can always do that), I'm more interested in learning about a library that would be useful in cases such as this.

zje
  • 1,281
  • 3
    Having asked 10 questions before, you could have know that an MWE is quite necessary... – yo' Dec 02 '14 at 21:52
  • 1
    You can use anything from any package but don't expect that if the journal is accepted it will be kept as vector graphics. – percusse Dec 02 '14 at 21:53
  • @tohecz I would provide an MWE if I knew where to start, but since I'm looking for a symbol, I'm not sure how to provide an example outside of what I referenced from the marvosym package. – zje Dec 02 '14 at 23:21
  • @zje You speak about IEEEtran, TikZ and diagram. You have obviously got some code where you just want to change a plain arrow to a fancy one, haven't you? – yo' Dec 02 '14 at 23:26
  • @tohecz I'm not exactly looking to swap a fancy arrow, I added some code to help add some context. I originally thought that a MWE wouldn't add much since I thought the answer would be more or less "try this package out." – zje Dec 02 '14 at 23:47
  • @zje Even if the answer was as simple as "it's \lightning from package xlightning", it would be much easier to come to this conclusion with MWE at hand. – yo' Dec 02 '14 at 23:49
  • 2
    Does this help (with @tohecz comment)? http://tex.stackexchange.com/questions/198462/the-lightning-symbol-in-an-equation-environment – Ethan Bolker Dec 03 '14 at 01:48
  • I don't understand this question any longer. You do not want, it seems, to use a symbol from a font. Nor, it appears, help drawing a lightning bolt. You say that you are 'more interested in learning about a library that would be useful in cases such as this' but I'm not sure what you have in mind. I doubt there is a lightningbolt library for TiKZ so you presumably mean something more generic. But what I haven't the foggiest idea. You could use one of the symbols in the linked question in a node. Or you could use a pic. Otherwise, is 'there is no such library' an acceptable answer? – cfr Dec 03 '14 at 02:41
  • @cfr I was looking for a library that would have this sort of thing, not an ultraspecific one to solve my problem, but something that would be useful for this and similar cases. Many times when I try to do something I find that someone else has already figured it out, so I tried looking to see if that was the case. I couldn't find anything, so I thought it couldn't hurt to ask. – zje Dec 03 '14 at 04:50

2 Answers2

7

Something like this?

enter image description here

\documentclass[conference]{IEEEtran}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
  \begin{figure}
    \begin{tikzpicture}
      \draw[very thick] (1.0, 2) -- (4.5,2);
%     \draw (5,2) circle[x radius=0.5, y radius=0.5];
      \draw[thick, ->] (5,2) +(0.05,0.5) -- +(-0.1,-0.1) -- +(0.1,0.1) -- +(0,-0.5);
      \draw[very thick] (5.5, 2) -- (8.5,2);
    \end{tikzpicture}
  \end{figure}
\end{document}
Jesse
  • 29,686
yo'
  • 51,322
5

Sorry but I still don't understand what's the problem with this:

\documentclass[conference]{IEEEtran}

\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{marvosym}

\begin{document}
  \begin{figure}
    \begin{tikzpicture}
      \draw[very thick] (1.0, 2) -- (4.5,2);
      \node at (5,2) {\Huge\Lightning};
      \draw[very thick] (5.5, 2) -- (8.5,2);
    \end{tikzpicture}
  \end{figure}
\end{document}

enter image description here

Under Document Properties-Fonts in PDF-XChange Viewer we can see:

enter image description here

So I suppose you won't have any problem submitting it to IEEE.

Ignasi
  • 136,588
  • When you do that and compile to pdf, is it imported as a font of some sort or is it treated like a vector graphic? The IEEE rules state that we have to use type 1 fonts, but I'm unsure if this qualifies. Thanks and sorry for the confusion! – zje Dec 03 '14 at 14:38
  • @zje Answer updated. Does it solve your doubt? – Ignasi Dec 03 '14 at 14:46
  • Yes, it does. And now I know how to check for Type 1 too, thanks! – zje Dec 03 '14 at 15:06
  • @zje Glad to help. You can find some other ways for checking fonts in http://tex.stackexchange.com/questions/45919/how-do-i-find-out-what-fonts-are-used-in-a-document-picture – Ignasi Dec 03 '14 at 15:17