I want to draw Olympic rings and used the code from here, which is,
% Olympic rings
% Author: Paul Gaborit
\documentclass[a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\definecolor{r1}{RGB}{0,129,188}
\definecolor{r2}{RGB}{252,177,49}
\definecolor{r3}{RGB}{35,34,35}
\definecolor{r4}{RGB}{0,157,87}
\definecolor{r5}{RGB}{238,50,78}
\begin{scope}
\clip (-6,2) rectangle (6,-.9);
\foreach \col/\xp/\yp in {
r5/4/0, r4/2/-1.8, r3/0/0,
r2/-2/-1.8, r1/-4/0
} {
\path[draw=white,line width=.08cm,
fill=\col,even odd rule]
(\xp, \yp) circle (1.9cm)
(\xp, \yp) circle (1.5cm);
}
\end{scope}
\begin{scope}
\clip (-6,-.9) rectangle (6,-3.8);
\foreach \col/\xp/\yp in {
r1/-4/0, r2/-2/-1.8, r3/0/0,
r4/2/-1.8, r5/4/0
} {
\path[draw=white,line width=.08cm,
fill=\col,even odd rule]
(\xp, \yp) circle (1.9cm)
(\xp, \yp) circle (1.5cm);
}
\end{scope}
\end{tikzpicture}
\end{document}
But I am getting a faint straight line in the middle of the PDF file. You can see the line in the lower half of the black ring properly. How to remove this?
I have tried the solution suggested by Paul Gaborit in Improve PSTricks code for drawing of the Olympic flag, but the problem is still there. I am running pdflatex on my code. By any chance is it creating the faint line in the middle of the image?
Edit
Here is the output I am getting by using Heiko Oberdiek's suggestion and running Latex + dvips + ps2pdf on the following code,
\nofiles % .aux file is not needed
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{hobby}
\newcommand*{\xshift}{169.5538bp}
\newcommand*{\yshift}{-71.7013bp}
\newcommand*{\radius}{71.6821bp}
\newcommand*{\whitelinewidth}{3.762bp}
\newcommand*{\colorlinewidth}{12.9041bp}
\definecolor{color@A}{cmyk}{1, .25, 0, 0}
\definecolor{color@B}{cmyk}{0, .342, .91, 0}
\definecolor{color@C}{cmyk}{0, 0, 0, 1}
\definecolor{color@D}{cmyk}{1, 0, .91, .06}
\definecolor{color@E}{cmyk}{0, .94, .65, 0}
\begin{document}
\begin{tikzpicture}[
use Hobby shortcut,
every path/.style = {
line width = \whitelinewidth,
double distance = \colorlinewidth,
white,
},
]
% define center coordinates for the five rings
\path
(0,0) coordinate (center@A)
++(\xshift, 0) coordinate (center@C)
++(\xshift, 0) coordinate (center@E)
($(center@A)!.5!(center@C)$) ++(0, \yshift) coordinate (center@B)
++(\xshift, 0) coordinate (center@D)
;
% \drawring draws the first part of the ring with blank parts
\newcommand*{\drawring}[4]{%
\draw[
save Hobby path = {path@#1},
double = {color@#1},
overlay,
]
(center@#1)
+([closed] 225:\radius) .. +([#2] 315:\radius) ..
+([#3] 45:\radius) .. +([#4] 135:\radius)
;
}
% \finishring draws the blank parts of the rings
\newcommand*{\finishring}[1]{%
\draw[
double = {color@#1},
restore and use Hobby path = {path@#1}{
disjoint,
invert soft blanks
},
];
}
\drawring{A}{}{blank=soft}{}
\drawring{B}{}{}{blank=soft}
\drawring{C}{}{blank=soft}{}
\finishring{B}
\finishring{A}
\drawring{E}{blank=soft}{}{}
\drawring{D}{}{}{}
\finishring{C}
\finishring{E}
% set calculated bounding box
\useasboundingbox
let \n{r} = {\radius + \colorlinewidth/2}
in
(center@A) +(-\n{r}, \n{r}) % upper left corner
(center@B -| center@E) +(\n{r}, -\n{r}) % lower right corner
;
\end{tikzpicture}
\end{document}
The output I get is,
Please notice that each ring contains two faint lines except the green one.





pdflatexon my code. By any chance is it creating the line? – ddas Aug 07 '16 at 07:08pdflatex,latex+dvips+ps2pdf,xelatex. Only a recent LuaTeX needs an additional\RequirePackage{luatex85}at the begin of file, because of the severe incompatibility changes of LuaTeX. – Heiko Oberdiek Aug 07 '16 at 07:29