निरंजन
I have the following code right now -


\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (3,0);
\draw (1.5,0) circle (5pt) node{a};
\end{tikzpicture}
\end{document}


If we see the output, the circle has the line inside it which I don't want. Also I don't want to draw the line in two parts (i.e.


\begin{tikzpicture}
\draw (0,0) -- (1.3,0);
\draw (1.7,0) -- (3,0);
\draw (1.5,0) circle (5pt) node{a};
\end{tikzpicture}

)

This code gives me the output exactly like I want, but I don't want to do that calculation manually and draw so many lines in my entire picture. How to have a circle which is opaque, but also with some text?
Skillmon
The following defines a circ path for the to syntax. There is most likely a better way to define it, but my Ti*k*Z skills are limited.

tex
\documentclass[tikz]{standalone}

\usetikzlibrary{calc}

\tikzset
{%
circ path/.style=%
{%
to path=%
{%
($(\tikztostart) - \pgfkeysvalueof{/tikz/circ path/pos}*(\tikztostart) + \pgfkeysvalueof{/tikz/circ path/pos}*(\tikztotarget)$)
node
[
draw, circle, inner sep=0pt,
minimum size={\pgfkeysvalueof{/tikz/circ path/size}}
]
(\pgfkeysvalueof{/tikz/circ path/name}) {#1}
(\tikztostart) -- (\pgfkeysvalueof{/tikz/circ path/name})
-- (\tikztotarget)
}%
}
,circ path/size/.initial = 10pt
,circ path/name/.initial = circ path centre
,circ path/pos/.initial = 0.5
}

\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (1.5cm-5pt,0) (1.5,0) circle(5pt) node {a} (1.5cm+5pt,0) -- (3,0);
\draw (0,1) to[circ path=a] (3,1);
\draw (0,2) to[circ path=b, circ path/name=mypoint] (3,3);
\draw (mypoint) to[circ path=c, circ path/pos=0.8] (3,4);
\end{tikzpicture}
\end{document}


![tikzcirc-1.png](/image?hash=3e6461fc1e0787716c9a34f44c529613b1f4612515ad63c0ebfc8467639cd103)
CarLaTeX
You could fill the node:


\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw (0,0) -- node[circle, fill=white, draw, inner sep=1.2pt]{a} (3,0);
\end{tikzpicture}
\end{document}


![2020-02-04 (2).png](/image?hash=ab1e916a083a500f3634216f3144dff8e48988e0a72f7ae6c8a27a4317c3e9f3)

निरंजन

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (3,0) -- (6,0) -- (9,0) ;