Underleaf Logo
Underleaf
BlogPricing
Log InTry Free

Learn TikZ

Getting Started

  • What is TikZ?
  • TikZ for Beginners
  • Basic Setup

Lines and Paths in TikZ

Master the fundamental drawing commands for lines, curves, and complex paths in TikZ.

Drawing Straight Lines

The basic line command connects two points with a straight line:

Use -- cycle to close a path back to its starting point.

Line Style Options

OptionEffect
thin0.4pt line width
thick0.8pt line width
very thick1.2pt line width
ultra thick1.6pt line width
line width=2ptCustom line width
dashedDashed line
dottedDotted line
dash dotAlternating dash-dot
dash pattern=on 2pt off 1ptCustom dash pattern

Curved Lines with Bezier Curves

Create smooth curves using .. controls .. for Bezier curves:

Smooth Curves Through Points

Use plot[smooth] to draw curves through multiple points:

Horizontal and Vertical Lines

Use -| and |- for right-angle paths:

Rounded Corners

Add rounded corners to any path:

Arc Paths

Draw circular arcs with the arc command:

Grid Lines

Draw grids for reference or backgrounds:

Line Caps and Joins

Control how line ends and corners are drawn:

Double Lines

Create double lines (useful for roads, walls, etc.):

Next Steps

Continue learning TikZ drawing techniques:

  • Basic Shapes - Circles, rectangles, and polygons
  • Arrows - Arrow tips and styles
  • Colors and Styles - Color fills and custom styles

Try it free

Sketch it — AI draws the TikZ.

Upload a photo of a hand-drawn diagram, flowchart, or plot and Underleaf generates the TikZ code for you. 10 free credits every month, no credit card required.

Convert your diagram
A hand-drawn sketch converted into a clean TikZ diagram

Lines and Paths in TikZ

Master the fundamental drawing commands for lines, curves, and complex paths in TikZ.

Drawing Straight Lines

The basic line command connects two points with a straight line:

Use -- cycle to close a path back to its starting point.

Line Style Options

OptionEffect
thin0.4pt line width
thick0.8pt line width
very thick1.2pt line width
ultra thick1.6pt line width
line width=2ptCustom line width
dashedDashed line
dottedDotted line
dash dotAlternating dash-dot
dash pattern=on 2pt off 1ptCustom dash pattern

Curved Lines with Bezier Curves

Create smooth curves using .. controls .. for Bezier curves:

Smooth Curves Through Points

Use plot[smooth] to draw curves through multiple points:

Horizontal and Vertical Lines

Use -| and |- for right-angle paths:

Rounded Corners

Add rounded corners to any path:

Arc Paths

Draw circular arcs with the arc command:

Grid Lines

Draw grids for reference or backgrounds:

Line Caps and Joins

Control how line ends and corners are drawn:

Double Lines

Create double lines (useful for roads, walls, etc.):

Next Steps

Continue learning TikZ drawing techniques:

Underleaf Logo
Underleaf

Empowering students and researchers with AI-powered tools for academic writing.

Go to appContact us

Company

PricingBlogTutorialsConference TemplatesConference Deadlines

Free Tools

Image to LaTeXExcel to LaTeXArXiv to LaTeXTikZ GeneratorLaTeX Table GeneratorCitation GeneratorThesis GeneratorChrome ExtensionAll Tools

© 2026 Underleaf. All rights reserved.