I moved my perfectly fine tikzpicture
into an external file on its own. But rendering it as a standalone document seems to disregard the xcolor
package, even though I included that as well.
I'm rendering this on Overleaf with pdfLaTeX, and I have tried switching between the different compilers, although without luck.
\documentclass[float=false,crop=true,dvipnames]{standalone}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing,calligraphy,3d}
\tikzset{every picture/.style={thick,
>=stealth,
decoration={calligraphic brace,
amplitude=3pt,
raise=4pt}}}
\newcommand\bs[1]{\boldsymbol{#1}}
\begin{document}
\begin{tikzpicture}[x={(10:.9cm)},y={(90:1cm)},z={(-45:.6cm)}]
\draw [->] (-1,0,0)
-- ( 0,0,0) coordinate (0_A)
-- ( 1,0,0) coordinate (P1_A)
-- ( 2,0,0) coordinate (P2_A)
-- node[sloped,above=6pt,pos=0,Peach]{$\bs{+}$}
( 3,0,0) coordinate (P3_A)
-- ( 5,0,0) node[right]{};
\fill (0_A) circle (1.5pt);
\fill (P1_A) circle (1.5pt);
\fill (P2_A) circle (1.5pt);
\fill (P3_A) circle (1.5pt);
\draw [->,ultra thick,Peach]
(2,0,0) -- (3,0,0);
\draw [decorate,pen colour={Peach},ultra thick]
(2,0,0) -- node[sloped,above=6pt,Peach]{$\bs{b}$} (3,0,0);
\draw [->,ultra thick,RoyalBlue]
(0,0,0) -- (2,0,0);
\draw [decorate,pen colour={RoyalBlue},ultra thick]
(0,0,0) -- node[sloped,above=6pt,RoyalBlue]{$\bs{a}$} (2,0,0);
\draw (0_A) circle (2.5pt);
\draw [->,ultra thick,Gray]
(0,-.05,0) -- (1,-.05,0);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fill [RoyalBlue,opacity=.2] (0,0,0) -- (3,0,0) -- (3,0,1) --(0,0,1) -- cycle;
\draw [->] (-1,0,1)
-- ( 0,0,1) coordinate (0_B)
-- ( 1,0,1) coordinate (P1_B)
-- ( 2,0,1) coordinate (P2_B)
-- ( 3,0,1) coordinate (P3_B)
-- ( 5,0,1) node[right]{};
\fill (0_B) circle (1.5pt);
\fill (P1_B) circle (1.5pt);
\fill (P2_B) circle (1.5pt);
\fill (P3_B) circle (1.5pt);
\draw [->,ultra thick,RoyalBlue]
(0,0,1) -- (3,0,1);
\draw [decorate,decoration={mirror},pen colour={RoyalBlue},ultra thick]
(0,0,1) -- node[sloped,below=4pt,RoyalBlue]{$\bs{\;a'}$} (3,0,1);
\draw (0_B) circle (2.5pt);
\end{tikzpicture}
\end{document}
\bs
?\documentclass[tikz, dvipsnames]{standalone}
, removingxcolor
(it is loaded bytikz
) andtikz
from preamble and after addingusepackage{bm}
to preamble instead of\bs
(as shortenes for\boldsymbol
) use\bm
.