Graphics, Figures & Tablestikz: lines with no thickness

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
theo moore
Posts: 72
Joined: Thu Jan 15, 2009 3:16 pm

tikz: lines with no thickness

Post by theo moore »

How do I create lines in pgf/tikz with no thickness? (They are used for positioning nodes). For example

Code: Select all

\begin{tikzpicture}
\draw[line width=0pt] (0,0) -- (1,1) 
node[pos=0.5] {$a$}; 
\end{tikzpicture}
does not seem to work. I want to just use the line for the positioning of the nodes, without actually having a line!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tikz: lines with no thickness

Post by localghost »

Code: Select all

\begin{tikzpicture}
  \path (0,0) -- (1,1) node[midway] {$a$};
\end{tikzpicture}
Beside a minimal working example (MWE) it seems to be very hard to get your final feedback on provided solutions.


Best regards
Thorsten
theo moore
Posts: 72
Joined: Thu Jan 15, 2009 3:16 pm

tikz: lines with no thickness

Post by theo moore »

localghost wrote:

Code: Select all

\begin{tikzpicture}
  \path (0,0) -- (1,1) node[midway] {$a$};
\end{tikzpicture}
Beside a minimal working example (MWE) it seems to be very hard to get your final feedback on provided solutions.


Best regards
Thorsten
Thorsten,

I apologise profusely for my neglect of threads past, and will make sure to follow up on issues I've raised. I hope you'll continue to provide your help.

As for this question, someone pointed out that
\path (0,0) -- (1,1) node[pos=0.5] {$a$};

A path statement does not draw anything unless specify a stroke or fill

\draw is actually just a shortcut for \path[draw] ...
...which solves my problem!
Post Reply