At first I thought this was a problem of my pdf viewer. For example, with the code
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A & B
\arrow[Rightarrow, from=1-1, to=1-2]
\end{tikzcd}
\end{document}
The resulting Rightarrow seems to contain two small extra gray lines:
The problem has been addressed in this question a few months ago, where the author provided a complicated new style nRightarrow which appears to fix the problem (Rightarrow above, nRightarrow below):
However, the need for this new style nRightarrow mainly seems to come from other more complicated issues. Thus I would like to know that just for the problem of these two extra gray lines, is there an existing simpler solution by now?
Below is a MWE, in which I have copied the code of nRightarrow from the linked question.
\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{calc}
\newlength{\eqoffset}
\makeatletter
% relative coordinates: (0,0) is the arrow's tail, x points towards the head,
% y points perpendicular, unit distance is \eqoffset
\newcommand{\relptstart}[2]{($($(k0)!#1\eqoffset+\pgf@shorten@start@additional!0:(k1)$)!#2\eqoffset!90:(k1)$)}
% (0,0) is the arrow's tip, rest is the same
\newcommand{\relptend}[2]{($($(k1)!#1\eqoffset-\pgf@shorten@end@additional
-2\eqoffset-.5\pgflinewidth!180:(k0)$)!#2\eqoffset!-90:(k0)$)}
\tikzcdset{
nRightarrow/.style={line join=round,
no head,
/tikz/commutative diagrams/@shiftabletopath,
execute at begin to = {
% Do not use tikzcd@noda or tikzcd@x here, it causes interference.
% Use new names instead
\path (\tikztostart) -- (\tikztotarget) coordinate[pos=0] (k0) coordinate[pos=1] (k1);
\pgfpointnormalised{\pgfpointdiff{\pgfpointanchor{k1}{center}}{\pgfpointanchor{k0}{center}}}
\pgfgetlastxy{\kdx}{\kdy}
\tikzset{
to path={
% arrow body
% the .06 is from \pgftransformxshift{.06\pgfutil@tempdima}
\relptstart{0}{1}
-- \relptend{-.06}{1}
{
% correct vertical position, more central horizontal position
% [xshift=-\kdy\eqoffset, yshift=\kdx\eqoffset]
% matches original Rightarrow more closely
[xshift=-\kdy\eqoffset-\kdx(\eqoffset+.25\pgflinewidth),
yshift=\kdx\eqoffset-\kdy(\eqoffset+.25\pgflinewidth)]
\tikztonodes}
\relptstart{0}{-1}
-- \relptend{-.06}{-1}
% arrow tip
% fake the round cap by using round joins and drawing the path twice with a turnaround at the caps
\relptend{2}{0} % tip to top end
.. controls \relptend{1}{0.05} and \relptend{-0.75}{1.25} ..
\relptend{-1.4}{2.65} % top end back to tip
.. controls \relptend{-0.75}{1.25} and \relptend{1}{0.05} ..
\relptend{2}{0} % tip to bottom end
.. controls \relptend{1}{-0.05} and \relptend{-0.75}{-1.25} ..
\relptend{-1.4}{-2.65} % bottom end back to tip
.. controls \relptend{-0.75}{-1.25} and \relptend{1}{-0.05} ..
\relptend{2}{0}
% Add a degenerate path segment at the end so shorten < and shorten > are not applied again
(k1)
}}
}}
}
\setlength{\eqoffset}{.225ex}
\makeatother
\begin{document}
\begin{tikzcd}[column sep=large]
A & B
\arrow[Rightarrow, from=1-1, to=1-2]
\end{tikzcd}
\begin{tikzcd}[column sep=large]
A & B
\arrow[nRightarrow, from=1-1, to=1-2]
\end{tikzcd}
\end{document}






tikz-cdand implementation of how to draw parallel curves? – Qrrbrbirlbel Mar 12 '23 at 11:29