2

i'm using this tikz-based library to draw nodes and arrows between them (https://github.com/jluttine/tikz-bayesnet). I want to draw an arrow that has a vertical line tip (|) (which usually means inhibition). How can this be done in tikz?

this is the code that draws a regular arrow from node "A" to node "B" that I want to replace with |:

\documentclass{article}  
\usepackage{tikz}
\usetikzlibrary{bayesnet}

\begin{document}

\begin{figure*}[!h]
\centering
\begin{tikzpicture}
  % Define nodes
  \node[const] (A) {$A$};
  \node[const, below=1cm of A] (B) {$B$};
  % connect them
  %%% how to make this an arrow with | tip?
  \edge{A}{B};
 \end{tikzpicture}
\caption{}
\end{figure*}
\end{document}

to compile you need the bayesnet package from the above link.

4
  • While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries. Also missing is the definition of the const style, so a composing a a fully compilable MWE will help to flush out those details as well. Commented Jul 10, 2016 at 22:07
  • Welcome! Please complete your code so it can be compiled.
    – cfr
    Commented Jul 10, 2016 at 22:07
  • @cfr I updated the code to have MWE.
    – mvd
    Commented Jul 10, 2016 at 22:29
  • You don't need to download the library if you have e.g. TeX Live installed.
    – cfr
    Commented Jul 10, 2016 at 22:59

1 Answer 1

4

Do you want something like this?

custom arrow

\documentclass[tikz,border=10pt,multi]{standalone}
\usetikzlibrary{bayesnet,arrows.meta}
\begin{document}
\begin{tikzpicture}
  \node[const] (A) {$A$};
  \node[const, below=1cm of A] (B) {$B$};
  \edge [-Bar] {A}{B};
\end{tikzpicture}
\end{document}
4
  • yes! is there a way to make the arrow end a bit before (higher) than "B"?
    – mvd
    Commented Jul 10, 2016 at 23:15
  • Have you tried shorten >=2pt or whatever?
    – cfr
    Commented Jul 10, 2016 at 23:22
  • Oops, sorry for the quick response, without deep thinking. I will delete it soon.
    – Jesse
    Commented Jul 11, 2016 at 0:35
  • @Jesse No problem! Very easily done ;).
    – cfr
    Commented Jul 11, 2016 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .