arrow is not the problem (actually it appears), but your nodes overlaps (are not displaced one against other) and consequently its length is zero pt. also you have errors in your code (undefined options) and since width of boxes are not defined, it use default width, e.g. text width ...
\documentclass[12pt,fleqn,twoside]{report}
\usepackage[many]{tcolorbox}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, % for arrows style
positioning % for positioning of boxes
}
\tcbset{%
boxrule=4pt,
colback=white, % background color
colframe=cyan, % frame colour
halign=center,
valign=center,
sharp corners=all,
center title,
lower separated=false,
fonttitle=\sffamily\bfseries\large,
width=4cm % added
}
% for show only picture
\usepackage[tightpage, active]{preview}
\setlength\PreviewBorder{3mm}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture}[node distance=2cm]
\node(NodeName1){
\begin{tcolorbox}[title=Box 1 Title]
Box 1 text
\end{tcolorbox}
};
\node(NodeName2) [right=of NodeName1] { % added position of second box
\begin{tcolorbox}[title=Box 2 Title]
Box 2 longer text text text text text
\end{tcolorbox}
};
\draw[blue, line width=2mm,-{Triangle[angle=60:1pt 3]}] (NodeName1) -- (NodeName2);
\end{tikzpicture}
\end{document}
see if obtained image is what you looking for:
edit:
code and explanation is slightly improved
align*
, being a vertical-mode environment, wants to introduce that vertical space between itself and what comes before it. A simple solution is to use aligned
instead, and place it inside centered, inline math, as in \centering$\begin{aligned}...\end{aligned}$
.
\documentclass[a4paper, 11pt]{book}
\usepackage[most]{tcolorbox}
\tcbset{framedboxfilled/.style={ enhanced jigsaw,
sharp corners,
colback=white!80!gray,
colbacktitle=white!80!gray,
fonttitle={\bfseries},
coltitle=black,
toprule=1pt, titlerule=1pt, bottomrule=1pt,
leftrule=0pt, rightrule=0pt, right=0pt,
left=-2pt,
}
}
\tcbset{framedboxoutline/.style={%
framedboxfilled,
colback=white,
colbacktitle=white,
}
}
\def\myboxstyle{framedboxoutline}
\newtcolorbox[auto counter,number within=section]{beispiel}[2][]{%
\myboxstyle,
title={Beispiel \thetcbcounter~#2},
}
\begin{document}
\section{Test}
\begin{beispiel}{XOR-Operator}
\centering$
\begin{aligned}
&b1 && = && 1000\ 1000\ 1101\ 1001_2\\
&b2 && = && 1111\ 0000\ 1010\ 1101_2\\
&\text{result}\ b_1 \oplus b_2 && = && 0111\ 1000\ 0111\ 0100_2
\end{aligned}$
\end{beispiel}
\begin{beispiel}{Schlüssel einer Substitutions Cipher}
\begin{center}
\begin{tabular}{p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}p{0pt}}
a & b & c & d & e & f & g & h & i & j & k & l & m & n & o & p & q & r & s & t & u & v & w & x & y & z\\
$\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ & $\downarrow$ \\
X &E &U &A &D &N &B &K &V &M &R &O &C &Q &F &S &Y &H &W &G &L &Z &I &J &P &T
\end{tabular}
\end{center}
\end{beispiel}
\end{document}
Best Answer
Here is the
tcbraster
way to place two (or more?) boxes side by side, by using thetcbraster
environment andraster columns=2
.Update with more options:
Any option, that is not specific to the
raster
library will be handed over to the rasteredtcolorbox
environments, as such, those options have not to be specified each time, but only once in the raster setup.Use
raster column skip
to increase the horizontal gap between the boxes: