1

I'm typesetting a diagram in beamer. It renders like this:

enter image description here

EDIT: the problem appears to be just the background color of the arrow. It's white and not transparent, therefore stands out on the black background.

This is the result I want:

enter image description here

Here's a MWE:

\documentclass[10pt, notheorems]{beamer}

\usepackage{tikz}
\usetikzlibrary{cd, arrows, decorations.pathmorphing}

\definecolor{colornormaltext}{HTML}{e5e8f8}
\definecolor{colorbg}{HTML}{101316}
\definecolor{colorgold}{HTML}{db9a46}

\setbeamercolor{background canvas}{bg=colorbg}
\setbeamercolor{normal text}{fg=colornormaltext}

\begin{document}
    \begin{frame}
        \begin{equation*}
            \begin{tikzcd}[ampersand replacement=\&]
                Sh_ W \&[-3ex] \&[-3ex] Sh_ V\\
                \& Msbl
                \arrow[""{name=0, anchor=center, inner sep=0}, "{f_*}"', shift right=2, from=1-1, to=1-3]
                \arrow[""{name=1, anchor=center, inner sep=0}, "{f^*}"', shift right=2, from=1-3, to=1-1]
                \arrow["{O_W}", from=2-2, to=1-1]
                \arrow[""{name=2, anchor=center, inner sep=0}, "{O_V}"', from=2-2, to=1-3]
                \arrow["\dashv"{anchor=center, rotate=-90}, draw=none, from=1, to=0]
                \arrow[shift left=2, Rightarrow, "\hat f", from=2, to=1-1]
            \end{tikzcd}
        \end{equation*}
    \end{frame}
\end{document}

The incriminated arrow is the very last one in the code:

\arrow[shift left=2, Rightarrow, "\hat f", from=2, to=1-1]
6
  • 6
    As always on the site, you are much more likely to get any help if you provide a full, but mminimal, self contained example that others can copy and test as is. Here we have to add a lot of stuff (what might not match your situation) in order to even test.
    – daleif
    Commented Mar 11, 2021 at 9:01
  • A normal \Rightarrow pointing where?
    – egreg
    Commented Mar 11, 2021 at 14:09
  • @egreg in the same direction. It's just rendered without that solid white.
    – seldon
    Commented Mar 11, 2021 at 16:15
  • @daleif right, I'm sorry. I'll edit my question later with a mwe
    – seldon
    Commented Mar 11, 2021 at 16:15
  • 1
    Any news? You receive two answers. Does any of them solve your problem? If does, please accept it, if not please inform us by comment, what is missed in received answers that their authors can correct them. Your question is no entirely clear.
    – Zarko
    Commented Mar 18, 2021 at 9:44

4 Answers 4

2

Found the answer in a different thread.

The tikz-cd environment has a setting for the background color, which you would need to set to black in your case, i.e. simply change

\begin{tikzcd}[ampersand replacement=\&]

to

\begin{tikzcd}[ampersand replacement=\&, background color=black]

and it gives the desired result.

1
  • That's it! Thanks a lot
    – seldon
    Commented Mar 30, 2021 at 9:57
3

Besides setting the background color to colorbg which is also necessary for other things (crossing over and description nodes), the great nfold library can be used that doesn't draw a thick line with the background color.

Code

\documentclass[10pt, notheorems]{beamer}
\usepackage{tikz}
\usetikzlibrary{cd, decorations.pathmorphing, nfold}
\definecolor{colornormaltext}{HTML}{e5e8f8}
\definecolor{colorbg}{HTML}{101316}
\definecolor{colorgold}{HTML}{db9a46}
\setbeamercolor{background canvas}{bg=colorbg}
\setbeamercolor{normal text}{fg=colornormaltext}
\tikzcdset{
  diagrams={/tikz/double/.append style=/tikz/nfold},% every cd should use nfold
  background color=colorbg
}
\begin{document}
\begin{frame}
\begin{equation*}
\begin{tikzcd}[column sep=small, ampersand replacement=\&]
Sh_W \&      \& Sh_V\\
     \& Msbl
\arrow["f_*"', shift right=2, from=1-1, to=1-3]
\arrow[from=1-1, to=1-3, draw=none, "\dashv" {rotate=-90, auto=false}]
\arrow["f^*"', shift right=2, from=1-3, to=1-1]
\arrow["{O_W}"  name=OW, from=2-2, to=1-1]
\arrow["{O_V}"' name=OV, from=2-2, to=1-3]
\arrow[Rightarrow, "\hat f" near start, from=OV, to=1-1, bend left=10]
\end{tikzcd}
\end{equation*}
\end{frame}
\end{document}

Output

enter image description here

1
  • You should provide complete MWE, not just fragment diagram code.
  • Your code fragment is a bit strange, so it is hart to understand what is your problem.
  • I just clean-up your code and try to reproduce showed image (without thick arrows which purpose is not clear)
\documentclass{beamer}
\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{frame}[fragile]
\frametitle{tikz-cd diagram}
\[
    \begin{tikzcd}[
    row sep = large,
arrow style = tikz,
          > = {Straight Barb[scale=0.8]}  
                    ]
Sh_{\mathrm{a.e.}}W_{\infty} \ar[rr,shift right=0.5em, "1_t*" ', "\bot"]
    &   & Sh_{\mathrm{a.e.}}W_t  \ar[ll,shift right=0.5em,"1^*_t" ']    \\
    & \mathsf{Msbl} \ar[ul, "\mathcal{O}_{\infty}"]
                    \ar[ur, "\mathcal{O}_t" ']
        &
\end{tikzcd}
\]
\end{frame}
\end{document}

enter image description here

Addendum:

It is still (unfortunately) not clear where arrow in the middle of diagram should be. Also if it need to be Rightarrow In case that it need to cross arrows from node 2-2 to 1-3 result can be ugly (to my opinion). So below are two examples of:

\documentclass{beamer}
\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{frame}[fragile]
\frametitle{tikz-cd diagram}
\[
    \begin{tikzcd}[
    row sep = large,
arrow style = tikz,
          > = {Straight Barb[scale=0.8]},
                    ]
Sh_{\mathrm{a.e.}}W_{\infty} \ar[rr,shift right=0.5em, "1_t*" ', "\bot"]
    &   & Sh_{\mathrm{a.e.}}W_t  \ar[ll,shift right=0.5em,"1^*_t" ']    \\
    & \mathsf{Msbl} \ar[ul, "\mathcal{O}_{\infty}"]
                    \ar[ur, ""{name=Ot,right}]
                    \ar[ur, "\mathcal{O}_t" ']
                    \ar[dashrightarrow, from=Ot, to=1-1,yshift=-1ex]
        &
\end{tikzcd}
\]
\end{frame}
\end{document}

enter image description here

or (only diagram code):

Sh_{\mathrm{a.e.}}W_{\infty} \ar[rr,shift right=0.5em, "1_t*" ', "\bot"]
    &   & Sh_{\mathrm{a.e.}}W_t  \ar[ll,shift right=0.5em,"1^*_t" ']    \\
    & \mathsf{Msbl} \ar[ul, "\mathcal{O}_{\infty}"]
                    \ar[ur, draw=none, ""{name=Ot,right}]
                    \ar[ur, "\mathcal{O}_t" ']
                    \ar[Rightarrow, crossing over, from=Ot, to=1-1,yshift=-1ex]
        &

enter image description here

or with Rightarrow inside diagram:

Sh_{\mathrm{a.e.}}W_{\infty} \ar[rr,shift right=0.5em, "1_t*" ', "\bot"]
    &   & Sh_{\mathrm{a.e.}}W_t  \ar[ll,shift right=0.5em,"1^*_t" ']    \\
    & \mathsf{Msbl} \ar[ul, "\mathcal{O}_{\infty}"]
                    \ar[ur, "\mathcal{O}_t" ', ""{name=Ot}]
                    \ar[Rightarrow,  from=Ot, to=1-1,yshift=-1ex]
        &

enter image description here

4
  • 1
    Hi Zarko, thanks for your effort. I hope the question is now more clear: the arrow in the middle is needed.
    – seldon
    Commented Mar 18, 2021 at 10:53
  • @mattecapu, does it need to cross arrow from "Mslb" to "SHa.e.Wt"?
    – Zarko
    Commented Mar 18, 2021 at 11:32
  • No, that's not the problem (or better: I now how to take care of that). The problem is in the color, as stated in the updated question. I don't understand why the arrow gets filled with white color, instead of being transparent.
    – seldon
    Commented Mar 18, 2021 at 14:48
  • @mattecapu, this arrow is actually compose composed from two arrows: first id black, over it is drawn for line width smaller white arrow.. So, what you like to have is not possible to obtain.
    – Zarko
    Commented Mar 18, 2021 at 17:36
0

I am not going to create MWE but have you tried adding \usetikzlibrary{arrows.meta} to your preamble? Then, try this:

\arrow[""{name=0, anchor=center, inner sep=0,latex-}, "{f_*}"', shift right=2, from=1-1, to=1-3]
1
  • Hi Nick, thanks for the suggestion. Unfortunately it doesn't work!
    – seldon
    Commented Mar 18, 2021 at 10:52

You must log in to answer this question.

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