RSSAmplifier

Blog

TikZ.net

Graphics with TikZ in LaTeX

tikz.netRSS feed ↗30 posts

Latest posts

Confidence interval

The figures below illustrates the interpretation of the 95% confidence interval in frequentist bayesian: If we repeatedly take samples and construct a 95% confidence interval with the same method, about 95% of those intervals would contain the true parameter. The figure is inspired by this figure on the “Confidence interval” Wikipedia page . A nice explanation is given by the YouTuber DataMListic…

Amazon Limited-Time Deal: Save 26% on “LaTeX Graphics with TikZ”

For a few days, the book LaTeX Graphics with TikZ is available at a 26% discount on Amazon.com. Here’s the publisher’s promotion link: packt.link/SJhg7 Take a look at TikZ.org for code examples, sample content, and readers’ reviews. If you purchase the color-printed book, you can also download the PDF version for free from packt.link/free-ebook/9781804618233 .

LaTeX Book Giveaway: win a free book on LaTeX.org!

I just started a small giveaway on the LaTeX.org forum for the new 2026 edition of the LaTeX Beginner’s Guide . You can win: one printed copy (US/UK/Canada because of shipping logistics) and possibly two additional eBook copies worldwide The fun part is that it’s not just “click and win.” I wanted to make it more community-oriented, so participants are encouraged to write a short comment about…

Desargues’s theorem

This is an illustration of Desargues’s theorem. It says that two triangles are in perspective axially if and only if they are in perspective centrally. \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{calc,intersections} \begin{document} \begin{tikzpicture} \coordinate [label=above:$p$] (p) at (2,9); \coordinate [label=left:$u$] (u) at (0,3); \coordinate [label=left:$r$] (r) at…

Z + jets production in proton collisions

The production of a Z boson with jets in a hard scattering (HS) event in proton-proton collisions, illustrating also the beam-beam remnants (BBR), initial-state radiation (ISR), final-state radiation (FSR), double parton scattering (DPS), fragmentation/hadronization, hadron decay, photon conversion. This diagram was previously published in Chapter 4 of Experimental Particle Physics . Edit and…

Stereographically Nested Tori

I thought it would be cool to show how to make stereographically nested toroidal solenoids. Essentially, we make stereographically nested tori, and then we find their solenoid. In the code below there are functions which determine the two radii of the torus; namely, “radius” and “centershift”. Try setting different values for \toggleangle, and \frequency! Modifying the \toggleangle will produce…

Classification of composite materials

Classification of composite materials according to the type of materials used Classification des matériaux composites selon le type des matériaux utilisés \documentclass[tikz,border=10pt]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture}[ every node/.style = {draw, rectangle, rounded corners, align=center, minimum width =…

Steiner Circles

If you take the stereographic projection of a mesh sphere, you obtain Steiner circles. Interestingly, the map of any inscribed circle of the sphere under stereographic projection is a perfect circle on the plane. Unfortunately, due to the low sampling size, the smooth option can be a bit botched sometimes. The code is parameterized so that the user can specify Euler angle rotations of the sphere,…

Stereographic Projection in Spherical Coordinates

The stereographic projection of two antipodal points: \documentclass[ tikz ,border = 3.14mm ]{standalone} \usepackage{tikz-3dplot} \usetikzlibrary{ arrows.meta ,angles } \pgfmathdeclarefunction{sphereX}{2}{% % #1 - longitude % #1 - latitude \pgfmathparse{cos(#2) * cos(#1)}% } \pgfmathdeclarefunction{sphereY}{2}{% \pgfmathparse{cos(#2) * sin(#1)}% } \pgfmathdeclarefunction{sphereZ}{2}{%…

【新刊案内】『TikZによるLaTeXグラフィックス』 – New TikZ book in Japanese

In November 2024, a translation of the TikZ book written by Stefan Kottwitz has been released by Asakura Publishing. ​2024年11月に、Stefan Kottwitz著のTikZに関する書籍の翻訳版が朝倉書店から発売されました。LaTeXで画像を作るための実用的な入門書。TikZにより数学、科学、技術論文に図や画像を簡単に入れられる。アイデアやデータを可視化してプロフェッショナルな図表やプロットを2次元でも3次元でも表示できるようになるために。 本書の内容 第1章 「TikZで始める」…

An Interesting Stereographic Projection

This is an interesting stereographic projection that you get when you rotate 90-degree Steiner circles about their axis of symmetry. Animated GIF; you may need to click on it for running: This is an example LaTeX file for a particular value of \animationparameter, that you can run yourself here in the browser: \documentclass[ tikz ,border = 3.14mm ]{standalone} \usepackage{tikz-3dplot}…

Back-to-back topology & track multiplicity

Illustration of a back-to-back event topology of two τ leptons (to define acoplanarity or azimuthal separation Δφ in the transverse plane), and multiplicity of pileup (PU) and hard scattering (HS) tracks in a small window along the beam axis (z). Made for this CMS paper on the measurement of the γγ → ττ process in proton-proton collisions and the measurement…

CPU Command Bit Fields

Add Immediate Edit and compile if you like: \documentclass[border=3pt]{standalone} %%Fonts %\usepackage{fontspec} %\setmainfont[Mapping=tex-text]{JetBrains Mono} % Tikz \usepackage{tikz} \usetikzlibrary{calc} % Sizes \def\cellheight{30pt} \def\fieldlinewidth{0.7pt} \pgfmathsetlengthmacro{\scalefactor}{4pt} % Tikz Set \tikzset{ instr_field/.style={ draw, rectangle, line width = \fieldlinewidth,…

ARM CPU

Datapath \documentclass[border=3pt]{standalone} %%Fonts %\usepackage{fontspec} %\setmainfont[Mapping=tex-text]{Times New Roman} %\setmonofont[Mapping=tex-text]{JetBrains Mono} %Drawing \usepackage{tikz} %Tikz Library \usetikzlibrary{calc} % Align text in the center of nodes \tikzset{every text node part/.style={align=center}} % Circuits \usepackage{circuitikz} % Colors \usepackage{xcolor} %…

LogCabin: Distributed System Built on Raft

Consensus State \documentclass[border=2pt]{standalone} %% Fonts %\usepackage{fontspec} %% Default Features %\defaultfontfeatures{ % Mapping=tex-text, % Ligatures=TeX, %} %% Serif Font %\setmainfont[ % UprightFont=EBGaramond-Regular, % ItalicFont=EBGaramond-Italic, % BoldFont=EBGaramond-Bold, % BoldItalicFont=EBGaramond-BoldItalic, %]{EB Garamond} %% Mono Font %\setmonofont[ %…

CMS coordinate system

The conventional 3D coordinate system at the CMS detector with definition of the azimuthal angle φ. It is officially described in this paper . For more coordinate systems, please see the “coordinates” tag. For the definition of pseudorapidity, please see here . For more related figures, please see the Particle Physics category. For learning drawing 3D figures in TikZ, have a look at Chapter 40…

Minkowski diagrams & Lorentz transformations

This post contains Minkowski diagrams of flat spacetime with light cones to illustrate the causal structure, as well as graphical interpretations of Lorentz transformations (“boosts”), and more. Some figures were inspired by Very special relativity – An illustrated guide by Sander Bais. For more related figures made with TikZ, please see Relativity category. Like all diagrams on this website, they…

Penrose diagrams of Minkowski and Schwarzschild spacetime

Penrose diagram of Minkowski and Schwarzschild metrics to illustrate the causal structure of different spacetime geometries. Lightlike worldlines remain at 45 degrees as indicated by the photons and light cones, i.e. the diagrams are conformal. The grid indicates lines of constant r and t. Different types of infinities are indicated: lightlike, timelike, spacelike, postive/negative future and…

Kruskal diagrams of Schwarzschild black holes

Kruskal diagram of Schwarzschild spacetime with light cones to illustrate the causal structure. Using Kruskal-Szekeres coordinates, lightlike worldlines remain at 45 degrees, i.e. the diagrams are conformal. The grid indicates lines of constant r and t. The horizon is at r = 2GM (V = ±U), singularity at r = 0. For more related figures, please see Relativity category. Equations for the coordinate…

Quadrilateral hierarchy

Hasse diagrams illustrating how quadrilaterals are related, and marking congruent and right angles, as well as same length sides with a custom macro via pic . Inspired by this image on Wikimedia Commons. Most basic diagram to relate squares, rectangles, rhombi, trapezia / trapezoids using inclusive definitions: Including obtuse or acute trapezia: Grouping trapezia in boxes to make clear rectangles…

Neural networks

Some examples of neural network architectures: deep neural networks (DNNs), a deep convolutional neural network (CNN), an autoencoders (encoder+decoder), and the illustration of an activation function in neurons. Basic idea The full LaTeX code at the bottom of this post uses the listofitems library, so one can pre-define an array of the number of nodes in each layer, which is easier and more…

Taking an X-ray for the Head

This is a drawing of a head viewed from the top. The structures in 3 coronal levels are represented by a definite shape and color in each level. The head is exposed to an X-ray beam from an X-ray tube. The resulting shadow on an X-ray film is represented in a rectangle beside the main drawing. It is meant to help professionals in the medical/dental field to use the different elements used to…

LaTeX Cookbook second edition published

The second, improved, and extended edition of the LaTeX Cookbook was published this month, March 2024. The first edition, published in 2015, has been revised, and the code examples have been updated to work with the latest classes and packages of LaTeX in 2024. The new edition comes with additional examples that demonstrate tasks such as how to create fancy word clouds, program with Lua in LaTeX,…

Lead nucleus & Pb-Pb collisions

Nucleus of a (lead) isotope: Lead-lead (PbPb) collisions at the LHC with electromagnetic fields (note Lorentz-contraction): Indicating the impact parameter: Main idea At first I tried randomly assigning an angle and radius (sampling sqrt((rand+1)/2) for uniform distribution along the radius): This did not fill up so evenly as I wanted, so I tried to generate the nucleons uniformly on ring layers…

Earth seasons

Seasons of Earth due to Earth’s tilted axis of rotation w.r.t. its orbital plane. Main idea One can use pic to predefine a picture of Earth: \documentclass[border=3pt,tikz]{standalone} \tikzset{ pics/earth/.style={ % Earth in orbit (argument #1 = polar angle) code={ \message{^^JEarth polar angle=#1} \draw[black,very thin,fill=blue!50!cyan!50] (#1:{\ROx} and {\ROy}) circle(\RE); } } }…

Moore Finite State Machine

General Information Moore finite state machine that recognizes the word 10010. Over the arrows is the input that causes the transition. Also, the states of the FSM are drawn blue with the corresponding name and output inside of them. When the output is 1 then the FSM has recognized the sequence 10010. The second image depicts the circuit that implements the FSM described in the first one.…

Mealy Finite State Machine

Mealy finite state machine that recognizes the word 10010. Over the arrows are the input, that causes the transition, and the output, that is the result of the transition, denoted as “input, output”. If the output is 1 then the FSM has recognized the sequence 10010. Also, the states of the FSM are drawn blue with the corresponding name inside of them. \documentclass{standalone} \usepackage{tikz}…

Vending Machine

How to count to 25 cents with coins of 5, 10 and 25 cents. The circuit is constructed using FFs and OR, AND gates. \documentclass[border=3mm]{standalone} % Tikz \usepackage{tikz} \usetikzlibrary{arrows,shapes.gates.logic.US,shapes.gates.logic.IEC,calc} % Notation \usepackage{amsmath, siunitx} % Tikz Library \usetikzlibrary{calc} \tikzset{every picture/.style={line width=0.3mm}} % Circuitikz…

Non Deterministic Finite Automaton

How to convert a non-deterministic finite automaton that recognizes words with two or three 1s to an equivalent finite automaton. \documentclass[border=4pt]{standalone} \usepackage{tikz} \usetikzlibrary{automata, positioning, arrows, calc} \tikzset{ ->, % makes the edges directed >=stealth, % makes the arrow heads bold shorten >=2pt, shorten

FFT Algorithm Analysis

General Information The following two figures refer to the radix-2 FFT algorithm’s recursive tree. The first one depicts the recursive calls done in each stage, whereas the second pictorially outlines the intuition behind the bit-reversal permutation. Recursive Tree \documentclass{standalone} \usepackage[edges]{forest} \begin{document} \begin{forest} for tree={ draw, fill=gray!30, s sep+=3ex, l…