Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

1 vote

How to make two nodes of same width? minimum width not working as expected!

It's easier to make this kind of box using the tcolorbox package, which is designed for this purpose and written with tikz. In this case, I'm using the raster library to create boxes of the same ...
AndréC's user avatar
  • 25.4k
2 votes

How to make two nodes of same width? minimum width not working as expected!

minimum width makes a node at least that wide. If the content is wider, the node may be wider. If you want to ensure the same width, use text width=<width> rather than minimum width=<width>...
cfr's user avatar
  • 202k
1 vote

Drawing an "atlas" map

Just drawing some interior shapes as closed paths then drawing unclosed paths between a control point in each of the shapes. \documentclass{article} \usepackage{tikz} \begin{document} \begin{...
David Carlisle's user avatar
2 votes
Accepted

Drawing an "atlas" map

Maybe you could play around with random steps. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \tikzset{ randomcircle/.style={ circle, draw, line ...
Sandy G's user avatar
  • 44.4k
4 votes

How to bring to front the "fit"ted rectangle?

Simply write the nodes in a single path and say that the last node is behind the path (I've added this to the s3 style).. \documentclass[border=5mm]{standalone} \usepackage{tikz} \usetikzlibrary{...
AndréC's user avatar
  • 25.4k
1 vote

How to draw Pascal's Triangle mod 3 with Tikz

With lualatex %!TEX TS-program = lualatex \documentclass{article} \usepackage{tikz,luacode} \begin{document} \begin{luacode} function Coeff (n,k) local Bnk = 1 for i = 1,k do Bnk = (n-i+1)*Bnk /...
Alain Matthes's user avatar
8 votes
Accepted

How to draw Pascal's Triangle mod 3 with Tikz

The \binomialcoefficient macro is not expandable: it has all the computations and can be used for printing the value, not for passing it for further computations. You can do the computation and use ...
egreg's user avatar
  • 1.1m
2 votes
Accepted

Tikz: Grouped Plot with Secondary y-axis

In case the groupplot is not required, how about this: \documentclass[tikz,border=7pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage{xcolor} \definecolor{buy_color}{RGB}{0, ...
Cameron Hudson's user avatar
2 votes

Drawing one branch of hyperbola with asymptotes in tikz

Since the function is sufficiently simple and in one variable, it would be better to use TikZ, to understand what you are doing and to be able to use on other occasions. The hyperbola you want is ...
Daniel N's user avatar
  • 5,757
6 votes
Accepted

How to make text appear in front of fill when using tikzmarknode?

\documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{arrows.meta, tikzmark} \tikzset{ arrow/.style={red, -{stealth[length=10mm, blue]}, line width=0.5mm, line cap=round}, lrarrow/.style={...
hpekristiansen's user avatar
6 votes

How to make text appear in front of fill when using tikzmarknode?

A workaround is to play with the blend mode. Try something like \tikzset{block1/.style={ rectangle, rounded corners, draw=red, fill=red!5, blend mode=overlay } } Full example: \...
jlab's user avatar
  • 3,277
1 vote

How to make text appear in front of fill when using tikzmarknode?

Like this ? to redraw the text on the node ? \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{arrows.meta, bending, tikzmark, positioning, fit, backgrounds} \tikzset{arrow/.style={...
JeT's user avatar
  • 3,525
1 vote

Parallel Lines arrow indicators not following line direction?

With tkz-euclide. There is no "triangle" branding. We can create it. But much less simple than zarko's code... \documentclass[border=5mm]{standalone} \usepackage{tkz-euclide} \...
pascal974's user avatar
  • 5,172
2 votes

Parallel Lines arrow indicators not following line direction?

What is the better way is quite questionable. So, the following MWE is pure tikz picture at least code is shorter in comparison with yours: \documentclass[margin=3mm]{standalone} \usepackage{tikz} \...
Zarko's user avatar
  • 298k
2 votes

Write a macro to draw a double line with different color for each single line by tikzpicture

The my pen has an argument that indicates the distance of overvaluation in relation to the initial path, which is not drawn. \documentclass[border=5mm]{standalone} \usepackage{tikz} \usetikzlibrary{...
AndréC's user avatar
  • 25.4k
0 votes

Write a macro to draw a double line with different color for each single line by tikzpicture

Like that: \documentclass{standalone} \usepackage{tikz} \tikzset{ linea_roja/.style = {draw=red, thick = 1pt}, linea_azul/.style = {draw=blue, thick = 1pt}} \begin{document} \begin{tikzpicture} ...
Jose G Lopez's user avatar
1 vote
Accepted

Adding angles to triangle and labelling them inside?

With tkz-euclide. Section 29.9. Mark a segment \tkzMarkSegment. I declare the points with \tkzDefPoints and I create the equiallateral triangle with \tkzDefTriangle[equilateral](O,A). \documentclass[...
pascal974's user avatar
  • 5,172
11 votes
Accepted

Colored ellipse in TikZ

\documentclass[tikz, border=1cm]{standalone} \begin{document} \begin{tikzpicture} \definecolor{einner}{RGB}{250,240,170} \definecolor{eouter}{RGB}{200,220,160} \definecolor{cinner}{RGB}{240,230,90} \...
hpekristiansen's user avatar
0 votes

Adding angles to triangle and labelling them inside?

UPDATE I have modified my code to look like the following: \documentclass[11pt]{article} \usepackage{tikz} \usetikzlibrary{shapes} \usetikzlibrary{decorations.markings} \usetikzlibrary{angles,quotes,...
Duncan Chrystal's user avatar
0 votes

Adding angles to triangle and labelling them inside?

Use the angles and quotes libraries. \documentclass[11pt,border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{angles,quotes} \begin{document} \begin{tikzpicture} \draw (0,0) coordinate (A) -- (...
cfr's user avatar
  • 202k
0 votes

How to draw a heptagon with node at the right positions

Almost a one-liner with the TikZ shapes.geometric library: \documentclass{article} \usepackage[showframe, papersize={5.5in,8.5in},margin=0.6in]{geometry} \usepackage{tikz} \usetikzlibrary{shapes....
sgmoye's user avatar
  • 8,851
1 vote

How to draw a heptagon with node at the right positions

You can use tkz-berge. I'll have to update this package, which is nearly 15 years old. \documentclass[margin = 12pt]{standalone} \usepackage{tkz-berge} \begin{document} \GraphInit[vstyle=Shade] \...
Alain Matthes's user avatar
3 votes
Accepted

How to draw a heptagon with node at the right positions

Since you used AI to come up with a solution, I asked the ducks from the TeX.SX duckpond and they just offered a solution based on the experimental l3draw package (but note that this is not TikZ, so ...
Jasper Habicht's user avatar
2 votes

How to draw a heptagon with node at the right positions

For nodes arranged in regular shapes, I usually employ loops. That can be daunting for someone new, but it can really shorten the length of your code. Here is my code: \documentclass{standalone} \...
Miloop's user avatar
  • 900
4 votes

Create a flowchart in latex

Here is a forest solution. \documentclass{article} \usepackage{forest} \useforestlibrary{edges} \begin{document} \begin{forest} forked edges, for tree={ grow'=0, align=center, minimum ...
Sandy G's user avatar
  • 44.4k
2 votes

Create a flowchart in latex

There are many ways to do it, e.g. using the child-approach from the pgfmanual, using package forest, using a matrix to place nodes, using tiklzlibrary positioning etc. When you are a beginner I ...
MS-SPO's user avatar
  • 12.8k
0 votes

How to draw a fancy box with an overlay rectangle enclosing the title box

To draw the Example-line, please see below an adaptaiton of a solution by Ignasi. Keys: ignore the title put the required nodes in the overlay section relate those nodes in their positions the way ...
MS-SPO's user avatar
  • 12.8k
1 vote
Accepted

How to draw a round corner non orthogonal line in TikZ LaTeX?

\draw[rounded corners=10pt,line width=3pt] (0,0)--(3,-5)--(3,-8);
Raffaele Santoro's user avatar

Top 50 recent answers are included