• TikZ pattern is invisible in WinEdtPDF but visible in other PDF viewers
    by kabenyuk on September 27, 2026 at 3:47 pm

    I have come across an interesting difference in how the same PDF is displayed by different PDF viewers. Consider the following MWE: \documentclass{article} \usepackage{nl-interval} \begin{document} \begin{tikzpicture} \nlAxisX{-3}{3} \nlnuminf[pattern=north west lines]{0}[]{o}[.4] \end{tikzpicture} \begin{tikzpicture} \nlAxisX{-3}{3} \nlinfnum[pattern=north west lines]{0}[]{o}[.4] \end{tikzpicture} \end{document} In WinEdtPDF the hatched areas produced by pattern=north west lines are not displayed at all. Changing the zoom level does not make any difference. However, the very same PDF is displayed correctly in Adobe Acrobat and in other PDF viewers, where the hatching is clearly visible. In the image, the right panel shows the WinEdtPDF rendering, while the left panel shows the Acrobat rendering. My setup is: WinEdtPDF: Build 20230519 (v. 1.1), 64-bit WinEdt: Build 20230519 (v. 11.1), 64-bit Windows 10 Does anyone know what might be causing this behavior? I have also reported this to the WinEdt developers here: https://github.com/WinEdt-Team/WinEdt-Support/discussions/131

  • Override a PGF key .initial value for a new shape
    by karlh on September 25, 2026 at 12:00 am

    Is it possible to set shape border rotate to a new default for a particular shape? For example, say I want to define a shape (which I'll call trapezoid in the MWE) that is essentially a trapezium but it is rotated by 180° by default. For example, \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \pgfdeclareshape{trapezoid}{% \nodeparts{text}% \inheritsavedanchors[from=trapezium]% \inheritbackgroundpath[from=trapezium]% \inheritanchorborder[from=trapezium]% \inheritanchor[from=trapezium]{text}% \inheritanchor[from=trapezium]{center}% \inheritanchor[from=trapezium]{north}% \inheritanchor[from=trapezium]{south}% \inheritanchor[from=trapezium]{east}% \inheritanchor[from=trapezium]{west}% \inheritanchor[from=trapezium]{north west}% \inheritanchor[from=trapezium]{north east}% \inheritanchor[from=trapezium]{south west}% \inheritanchor[from=trapezium]{south east}% \behindbackgroundpath{% \pgfpathmoveto{\lowerleftpoint}% \pgfpathlineto{\upperrightpoint}% }% }% \begin{document} \begin{tikzpicture} \node [draw,trapezium,minimum size=1cm] {}; \node [draw=blue,trapezoid,minimum size=1cm,name=s] at (0,-1.25) {}; \node [draw=orange,trapezoid,minimum size=1cm,shape border rotate=180] at (0,-2.5) {}; % \foreach \anchor/\placement/\color in {north/above/orange,south/below/teal, % east/right/red,west/left/green,50/above/violet} % \draw [color=\color,shift=(s.\anchor)] plot [mark=x] coordinates {(0,0)}; \end{tikzpicture} \end{document} but both the blue and the orange shapes should be the same. Alternatively, the blue one could be narrow-end-on-top, and the orange one rotates 180° more and looks like the black one. Options I have considered: Define a new shape and a new set of keys to go with it that are very similar to trapezium except upside-down (this is the worst option) Define trapezoid as a style that calls another shape (say, decorated trapezium or some such) whose only real purpose is to set another default value of shape border rotate Create an anchor that reads another key (say, trapezoid rotate) that determines what the user wants the new angle to be, then sets shape border rotate to something based on that. I am hoping there is another way, something like issuing \changepgfinitialvalue inside the shape definition so that the initial value changes for that shape (and only that shape). Is there? Clarification: what I want is a shape (I used trapezium here, but it could be something else) that looks similar to an existing one, but has extra things drawn on it, an appendage of some sort, etc., but the base shape is rotated with respect to the original. If there is a way to do this so that the user who calls, say, shape=trapezoid instead of just trapezoid without reverting the orientation, that would be my preference. In other words, inherit everything from a shape, build on it with \beforebackgroundpath, \foregroundpath, and such, and change the default orientation.

  • Drawing a rectangular box in three different orientations with TikZ
    by Sebastiano on September 24, 2026 at 7:26 pm

    I am preparing some physics exercises about pressure, and I would like to illustrate a rectangular box that can be placed on each of its three different faces. In this way, the same box would have three different base areas, while its dimensions remain unchanged. For example, my box has dimensions: 23 cm, 24 cm, 46 cm I would like to create the three possible orientations of the box with TikZ, so that in each drawing a different face is touching the ground. At the moment, I have this code for one orientation: \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture}[x=0.027cm,y=-0.027cm,line width=0.35pt,draw=black!75] \draw (77,123)--(77,199)--(146,231)--(281,163)--(281,110); \draw (146,156)--(146,231); \draw (212,55)--(212,122); \draw (77,123)--(60,84)--(126,117)--(146,156)--cycle; \draw (77,123)--(51,96)--(186,27)--(212,55)--(109,109); \draw (212,55)--(232,16)--(301,48)--(281,87)--cycle; \draw (146,156)--(281,87)--(319,91)--(184,160)--cycle; \draw[<->] (66,126)--(66,198); \draw[<->] (72,210)--(141,242); \draw[<->] (151,242)--(286,173); \node[rotate=-90,inner sep=0pt,font=\small] at (57,160) {23 cm}; \node[rotate=-25,inner sep=0pt,font=\small] at (101,233) {24 cm}; \node[rotate=27,inner sep=0pt,font=\small] at (227,213) {46 cm}; \end{tikzpicture} \end{center} \end{document} Is there a relatively simple way to modify this code (or to define a reusable TikZ command) so that I can obtain the other two orientations of the same box, with the 23 cm, 24 cm, and 46 cm dimensions exchanged accordingly? Ideally, I would like to be able to write something like \boxorientation{23}{24}{46} and obtain the corresponding drawing, or otherwise have a convenient way to generate the three possible orientations. The purpose is to use the drawings in physics exercises about pressure, where the students have to calculate the pressure exerted by the box when it rests on each of its three possible bases.

  • How can I position one node chain relative to another?
    by EnronEvolved on September 23, 2026 at 12:17 pm

    I'm trying to arrange a collection of nodes using \graph, which will be used to define a series of spath3 knot strands. However, the default cartesian placement strategy doesn't work very well for my purposes, as node chains that I intend to "tee off" from other nodes are placed at a constant width. It's possible to get what I want with the following code, but it's obviously rather fragile: \documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs} \begin{document} \begin{tikzpicture} \graph[nodes={draw, as={}}]{ a -> b -> c, {[placement/width=1, placement/depth=1, grow down] b -> d -> f -> g}, {[placement/width=2, placement/depth=2, grow right] f -> p}, }; \end{tikzpicture} \end{document} How can I achieve the same effect by specifying the node rather than the width and depth?

  • TikZ 3D: different planes within one path
    by Wrzlprmft on September 20, 2026 at 10:29 am

    Suppose, I want to draw a 3D cylinder using TikZ’ 3D library. If I just want to draw the outline, it’s straightforward, as I can draw each line in a separate command: \documentclass[tikz]{standalone} \usetikzlibrary{3d} \begin{document} \begin{tikzpicture}[z={(0.5cm,0.2cm)}] \newcommand{\atan}{26.565} % the visually rightmost angle \newcommand{\radius}{2} \newcommand{\height}{3} % top \draw[canvas is xz plane at y=0] (\atan:\radius) arc(\atan:\atan-180:\radius) coordinate(top left); % left \draw (top left) -- ++(0,-\height); % bottom \draw[canvas is xz plane at y=-\height] (\atan-180:\radius) arc(\atan-180:\atan:\radius) coordinate(bottom right); % right \draw (bottom right) -- ++(0,\height); % back of top face \draw[canvas is xz plane at y=0,red] (\atan:\radius) arc(\atan:\atan+180:\radius); \end{tikzpicture} This gives me: Now, if I want to fill the faces of the cylinder, I cannot simply adapt the above as the planes are changing all the time. Changing coordinate systems mid-command as described here doesn’t work (or I am using it wrong). How can I do this? I prefer answers that are generalisable and where it is clear what the current coordinate system is at any point (like the above solution). For reference, the desired output is something like this:

  • Scalebox and tikz
    by Carl on September 17, 2026 at 10:46 am

    I want to reduce the dimension of the formula in the image, keeping the arrow pointing to the green square containing ’2’. It works fine without \scalebox. However, using this command a displacement of the arrow's endpoint emerges... how can I solve this? With thanks. Below, find my code (compiled via LuaLatex): \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{tikzmark,calc,positioning,fit,arrows,shapes,backgrounds,shapes.geometric,arrows.meta,patterns.meta,decorations.pathreplacing} \begin{document} \begin{frame} \begin{equation*} \text{\scalebox{0.95}{$f(t) = \left\{ \begin{array}{l} x \; \; \text{if $t < 0$ or $t = 1.05\tikzmarknode[fill=green,inner sep = 2pt,outer sep=1pt]{a}{2}3$} \\[10pt] y, \; \; \text{otherwise} \end{array} \right.$}} \end{equation*} \begin{tikzpicture}[remember picture,overlay] \node[inner sep=2pt] (b) [above right=3.0cm and 4.0cm of current page.center]{$z$}; \path[<-] (a) edge [out=90,in=180] (b); \end{tikzpicture} \end{frame} \end{document}

  • `ball color` with `fill opacity` for transparency would make the color darken with 3D object, any other schemes?
    by Explorer on September 16, 2026 at 5:28 pm

    Lead-in Claim: this part might be quite personal, but to show why, I decide to post it. The content was borrowed from here. Let's consider the following two series of images, just focus on the style: Group 1: Bright and Brilliant Group 2: Depressing and Gloomy Noted that was my personal perspective, I perferred the bright group. I like the real 3D style provided by ball color, It looks both professional and sophisticated. But not so good for me with opacity, it make the image looks seems a little bit depressing. So I was looking for any schemes with opacity that would not make the image too dark... Consider the pfradin's comment here and here, the difference: The real difference between the two groups is transparency. It is not luadraw that handles the ball color and fill opacity options, but TikZ, since it is responsible for the rendering. I therefore suggest you look into TikZ. Code Here below is my follow-up TikZ question: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \node {case1:hidden}; \fill[magenta] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case1':hidden}; \fill[magenta,opacity=0.5] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case2:hidden}; \fill[ball color=magenta] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case2':hidden}; \fill[ball color=magenta,opacity=0.5] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case3:hidden}; \fill[left color=magenta!25, right color=magenta] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case3':hidden}; \fill[left color=magenta!25, right color=magenta,opacity=0.5] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case4:hidden}; \fill[inner color=magenta!25, outer color=magenta] circle[radius=3cm]; \end{tikzpicture} \begin{tikzpicture} \node {case4':hidden}; \fill[inner color=magenta!25, outer color=magenta,opacity=0.5] circle[radius=3cm]; \end{tikzpicture} \end{document} Here below is the version with tikz-3dplot: \documentclass[tikz,border=10pt]{standalone} \usepackage{tikz-3dplot} \begin{document} \tdplotsetmaincoords{70}{110} \begin{tikzpicture}[tdplot_main_coords] \begin{scope}[x={(1cm,0)}, y={(0,1cm)}] \node {hidden}; \shade[inner color=magenta!25, outer color=magenta] (0,0) circle (3cm); \end{scope} \end{tikzpicture} \begin{tikzpicture}[tdplot_main_coords] \begin{scope}[x={(1cm,0)}, y={(0,1cm)}] \node {hidden}; \shade[inner color=magenta!25, outer color=magenta,opacity=0.5] (0,0) circle (3cm); \end{scope} \end{tikzpicture} \end{document} It didn't get the things gloomy: My purpose Since my comment here, I think the ball color was excellent with opaque 3D-object. But if thing changed transparent, that was not looks quite good(claim again, just personal option-based perspective), I want the transparent magenta sphere(actually circle)'s color scheme looks like: the bright one. Or in the following sketch, I want the dark orange was changed to light orange: Questions (sorry, option-based questuon, but not the key point here, no need to answer, but I wonder any preferences?) Would you prefer the Group A(bright-opaque 3D) instead of the Group B(dark-opacity 3D)? Is that possible for ball color and fill opacity not to make things darken and gloomy? How many shading stretagies could be used(provided with TikZ/pgf) to simulate the light and shadow of 3d-object? Is that exists one that would darken the color(It looks like tikz-3dplot used one)? Is that possible to support another shading color scheme similar to tikz-3dplot to mimic 3D with luadraw instead of the ball color now?

  • How to enlarge the bounding box of `tblr` with `tikz` if the `overlay` get out of the `tblr` itself?
    by Explorer on September 16, 2026 at 3:47 pm

    Just for fun, I try to mimic this question with tikz-extension with tabularray: \documentclass{article} \usepackage{tabularray} \UseTblrLibrary{tikz} \begin{document} \begin{tblr}{ colspec={*{3}{Q[c,m,12mm]}}, hlines,vlines, } multiple lines & b & c \\ d & multiple lines & f \\ g & h & i \\ \end{tblr} \bigskip \begin{tblr}{ colspec={*{3}{Q[c,m,12mm]}}, % hlines,vlines, rows={rowsep=+5pt}, columns={colsep=+5pt}, } multiple lines & b & c \\ d & multiple lines & f \\ g & h & i \begin{tblrtikzabove}% \foreach \i in {1,...,\arabic{rowcount}}{ \foreach \j in {1,...,\arabic{colcount}}{ \coordinate (A) at ([xshift=+2pt,yshift=-2pt]h\i-|v\j); \coordinate (B) at ([xshift=-2pt,yshift=+2pt]h\inteval{\i+1}-|v\inteval{\j+1}); \draw[cyan] (A) rectangle (B); } } \draw[magenta] ([xshift=-1.5pt,yshift=+1.5pt]h1-|v1) rectangle ([xshift=+1.5pt,yshift=-1.5pt]h\inteval{\arabic{rowcount}+1}-|v\inteval{\arabic{colcount}+1}); \end{tblrtikzabove}% \end{tblr} \end{document} However, the bounding box was not enlarged with the overlay. It looks not a good idea to do so with tabularray...? Now I turn to focus, if we need to draw something outside the tblr, how to enlarge the corresponding bounding box? Edit Now let's only focues the bounding box, similar to this post(?), following example: \documentclass{article} \usepackage{showframe} \setlength{\parindent}{0pt} \usepackage{tabularray} \UseTblrLibrary{tikz} \usetikzlibrary{bending} \begin{document} \begin{tblr}{colspec={*{3}{Q[c,m,12mm]}},hlines,vlines} multiple lines & b & c \\ d & multiple lines & f \\ g & h & i \begin{tblrtikzabove}% \draw[ultra thick,cyan,-latex] (1-1.north west) to[bend right] (3-1.south west); \end{tblrtikzabove}% \end{tblr} \bigskip some text% \begin{tblr}{colspec={*{3}{Q[c,m,12mm]}},hlines,vlines} multiple lines & b & c \\ d & multiple lines & f \\ g & h & i \begin{tblrtikzabove}% \draw[ultra thick,cyan,-latex] (1-1.north west) to[bend right] (3-1.south west); \end{tblrtikzabove}% \end{tblr} \end{document} The "some text" was overlapped with the arrow outside the tblr, my focus here, was how to enlarge the bounding box of tblr in similar case?

  • TIkZ: draw only a group/scope from a larger TikZ picture?
    by Thibault de Villèle on September 14, 2026 at 9:30 am

    I have a large TikZ picture showing the different steps from a pipeline. I have grouped different steps inside their own scope, to make it easier to differentiate paths and file names (which have similar names). In the main text, I describe the different steps of the pipeline. My advisor suggested putting the picture of the steps I'm describing in a small picture next to the paragraphs (as the description goes on for a while). Here is a MWE, which should convey what I want to to in my document: \documentclass{scrarticle} \KOMAoption{parskip}{half-} \usepackage{tikz} \usetikzlibrary{arrows.meta, fit, math, positioning} \begin{document} \begin{filecontents}[overwrite]{pipeline.tikz} \begin{tikzpicture}[x = 1cm, y = 1cm, inner sep=0pt, outer sep=0pt]% \begin{scope}[local bounding box=setup]% \draw[red,fill=red!90!white] (-2, 0) circle [radius=1cm];% \end{scope}% \begin{scope}[local bounding box=result]% \draw[blue,fill=blue!90!white] (1.5, -1) rectangle (3.5, 1);% \end{scope}% \draw[->,thick] ([xshift=5mm]setup.east) -- ([xshift=-5mm]result.west);% \end{tikzpicture}% \end{filecontents} \begin{figure}% \centering% \input{pipeline.tikz}% \caption{The whole pipeline.}% \label{fig/pipeline}% \end{figure}% This text is supposed to explain the pipeline: \begin{itemize} \begin{minipage}{.7\textwidth}% \item% This is the first step of the pipeline. A long text is supposed to explain what exactly is going on, which can be quite long. Sometimes, the description goes on for more than three lines! \end{minipage}\hfill% \begin{minipage}{.28\textwidth}% \centering% \includegraphics[width=.8\textwidth,height=2\baselineskip]{example-image-a}\\% Should be the scope \texttt{setup} from figure 1. \end{minipage}\\% \begin{minipage}{.7\textwidth}% \item% This is the second step of the pipeline. An even longer text is supposed to explain what exactly is going on, which can be quite long. And even then, three lines are the minimum; sometimes I get crazy and get to four lines! \end{minipage}\hfill% \begin{minipage}{.28\textwidth}% \centering% \includegraphics[width=.8\textwidth,height=2\baselineskip]{example-image-b}\\% Should be the scope \texttt{result} from figure 1. \end{minipage} \end{itemize} \end{document} Which gives the following (LuaLaTeX from TeXLive 2026): Is there a way to tell TikZ to only draw a certain scope from a larger TikZ picture ? Or should I maybe do an export of the steps in a PDF file and only include them when necessary ? I'm looking for a TeX/TikZ-only solution to avoid having picture contents "out of sync", since I will have to tweak the larger pipeline picture a bit. Note: As far as I can tell, the spy library (related question here) cannot help me here, as my text should live outside of the TikZ picture.

  • Issue in getting ribbon effects using Latex on Arrow in the infographics
    by Kashi on September 12, 2026 at 8:31 am

    I am trying to create the this Infographic Image using Latextikz library: However, I am unable to get the ribbon effects for the arrow hiding behind the information card. Here is my example code: \documentclass[tikz]{standalone} \usepackage[T1]{fontenc} \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} \usetikzlibrary{shadows,calc} % ---- Colour palette (sampled from the source infographic) ---- \definecolor{ifsiBlue}{HTML}{5B9BD5} \definecolor{ifsiGreen}{HTML}{7F9B72} \definecolor{ifsiTeal}{HTML}{1D9AA6} \definecolor{ifsiOrange}{HTML}{E8912D} \definecolor{ifsiNavy}{HTML}{1B3A8C} \definecolor{ifsiDark}{HTML}{2B2B2B} \definecolor{ifsiRule}{HTML}{8A8A8A} % ---- Ribbon-arrow shape, drawn pointing in the +x direction, then rotated --- \newcommand{\ribbonShape}{% (0,-0.6) rectangle (3.0,0.6); (3.0,-1.2) -- (4.6,0) -- (3.0,1.2) -- cycle; } \newcommand{\ribbonArrow}[4]{% \begin{scope}[shift={(#1,#2)}, rotate=#3] % ---- soft contained drop shadow (concentric, same direction, growing blur) ---- \foreach \r/\op in {0.30/0.05, 0.22/0.07, 0.15/0.10, 0.09/0.14} { \begin{scope}[shift={(\r,-\r)}] \fill[black, opacity=\op, rounded corners=1pt] (0,-0.62) rectangle (3.0,0.62); \fill[black, opacity=\op] (3.0,-1.22) -- (4.62,0) -- (3.0,1.22) -- cycle; \fill[black, opacity=\op] (0,-0.62) -- (-0.58,-0.30) -- (-0.58,0.30) -- (0,0.62) -- cycle; \end{scope} } % ---- fold flap (darker underside), drawn behind the body ---- \fill[#4!52!black] (0,-0.6) -- (-0.58,-0.30) -- (-0.58,0.30) -- (0,0.6) -- cycle; \draw[#4!30!white, line width=0.7pt] (-0.58,-0.30) -- (0,-0.6); % ---- main ribbon body ---- \fill[#4] (0,-0.6) rectangle (3.0,0.6); % ---- arrow head ---- \fill[#4] (3.0,-1.2) -- (4.6,0) -- (3.0,1.2) -- cycle; % ---- thin highlight along the top edge for a touch of depth ---- \draw[#4!35!white, line width=0.6pt] (0,0.6) -- (3.0,0.6) -- (4.6,0); \end{scope} } \begin{document} \begin{tikzpicture}[ font=\sffamily, >=stealth ] % ============ Canvas: 34 wide x 20 tall ============ \useasboundingbox (0,0) rectangle (34,20); % ============ Four ribbon arrows: confined to the centre band, converging on the middle ============ \ribbonArrow{12.2}{15.9}{-45}{ifsiBlue} % top-left -> points down-right toward centre \ribbonArrow{21.8}{15.9}{225}{ifsiGreen} % top-right -> points down-left toward centre \ribbonArrow{12.2}{4.1}{45}{ifsiTeal} % bottom-left -> points up-right toward centre \ribbonArrow{21.8}{4.1}{135}{ifsiOrange} % bottom-right -> points up-left toward centre % ============ TOP-LEFT: Islamic Banking ============ \node[anchor=east, text=ifsiBlue, font=\sffamily\bfseries\fontsize{50}{50}\selectfont] at (5.6,16.15) {9.7\%}; \draw[ifsiRule, line width=0.7pt] (5.95,15.35) -- (5.95,16.95); \node[anchor=north west, text=ifsiDark, align=left, font=\sffamily\fontsize{18}{20}\selectfont] at (6.3,17.15) {Islamic Banking\\[2pt] YoY Growth}; \node[anchor=north west, text=ifsiDark, font=\sffamily\bfseries\fontsize{17}{17}\selectfont] at (6.3,15.45) {69.3\% of IFSI}; % bank icon \begin{scope}[shift={(10.7,16.15)}, ifsiRule, line width=1.1pt] \draw (-0.5,-0.38) -- (0.5,-0.38); \draw (-0.34,-0.38) -- (-0.34,0.09); \draw (-0.12,-0.38) -- (-0.12,0.09); \draw (0.11,-0.38) -- (0.11,0.09); \draw (0.33,-0.38) -- (0.33,0.09); \draw (-0.55,0.09) -- (0.55,0.09) -- (0,0.52) -- (-0.55,0.09) -- cycle; \draw[->] (-0.24,0.38) -- (-0.24,-0.62); \draw[->] (0.02,0.38) -- (0.02,-0.62); \end{scope} % ============ TOP-RIGHT: Sukuk Outstanding ============ \node[anchor=west, text=ifsiGreen, font=\sffamily\bfseries\fontsize{50}{50}\selectfont] at (28.4,16.15) {21.8\%}; \draw[ifsiRule, line width=0.7pt] (28.05,15.35) -- (28.05,16.95); \node[anchor=north east, text=ifsiDark, align=right, font=\sffamily\fontsize{18}{20}\selectfont] at (27.7,17.9) {Suk\=uk\\[2pt] Outstanding\\[2pt] YoY Growth}; \node[anchor=north east, text=ifsiDark, font=\sffamily\bfseries\fontsize{17}{17}\selectfont] at (27.7,15.05) {>USD 1tn milestone}; % growth chart icon \begin{scope}[shift={(23.3,16.15)}, ifsiRule, line width=1.1pt] \draw (-0.55,-0.44) -- (-0.55,0.46) -- (0.55,0.46); \draw (-0.38,-0.44) rectangle (-0.2,-0.05); \draw (-0.09,-0.44) rectangle (0.09,0.11); \draw (0.2,-0.44) rectangle (0.38,0.27); \draw[->] (-0.46,0.0) -- (0.02,0.31) -- (0.38,0.44); \end{scope} % ============ BOTTOM-LEFT: Islamic Funds ============ \node[anchor=east, text=ifsiTeal, font=\sffamily\bfseries\fontsize{50}{50}\selectfont] at (5.6,3.85) {25.6\%}; \draw[ifsiRule, line width=0.7pt] (5.95,3.05) -- (5.95,4.65); \node[anchor=north west, text=ifsiDark, align=left, font=\sffamily\fontsize{18}{20}\selectfont] at (6.3,4.85) {Islamic Funds\\[2pt] YoY Growth}; \node[anchor=north west, text=ifsiDark, font=\sffamily\bfseries\fontsize{17}{17}\selectfont] at (6.3,3.15) {4.1\% of IFSI}; % hand + coin icon \begin{scope}[shift={(10.7,4.15)}, ifsiRule, line width=1.1pt] \draw (-0.55,-0.34) .. controls (-0.32,-0.54) and (0.17,-0.54) .. (0.34,-0.24); \draw (-0.55,-0.34) -- (-0.55,-0.06) -- (-0.05,-0.06); \draw (0.11,0.22) circle (0.22); \draw (0.02,0.22) -- (0.2,0.22); \end{scope} % ============ BOTTOM-RIGHT: Islamic Insurance ============ \node[anchor=west, text=ifsiOrange, font=\sffamily\bfseries\fontsize{50}{50}\selectfont] at (28.4,3.85) {13.9\%}; \draw[ifsiRule, line width=0.7pt] (28.05,3.05) -- (28.05,4.65); \node[anchor=north east, text=ifsiDark, align=right, font=\sffamily\fontsize{18}{20}\selectfont] at (27.7,5.6) {Islamic\\[2pt] Insurance\\[2pt] YoY Growth}; \node[anchor=north east, text=ifsiDark, font=\sffamily\bfseries\fontsize{17}{17}\selectfont] at (27.7,2.85) {1.6\% of IFSI}; % umbrella icon \begin{scope}[shift={(23.3,4.15)}, ifsiRule, line width=1.1pt] \draw (-0.54,0.06) .. controls (-0.54,0.46) and (0.54,0.46) .. (0.54,0.06); \draw (-0.54,0.06) .. controls (-0.35,0.24) .. (-0.18,0.06); \draw (-0.18,0.06) .. controls (0,0.24) .. (0.18,0.06); \draw (0.18,0.06) .. controls (0.35,0.24) .. (0.54,0.06); \draw (0,0.06) -- (0,-0.43); \draw (0,-0.43) .. controls (-0.18,-0.43) and (-0.18,-0.61) .. (0,-0.61); \draw (0.43,-0.1) circle (0.15); \node[font=\small] at (0.43,-0.1) {\$}; \end{scope} % ============ CENTRE BLOCK ============ \node[text=ifsiNavy, font=\sffamily\bfseries\fontsize{58}{58}\selectfont] at (17,10.9) {USD 4.40tn}; \node[text=ifsiNavy, font=\sffamily\fontsize{27}{27}\selectfont] at (17,9.35) {Total IFSI Assets Q3 2025}; \draw[fill=ifsiNavy, draw=none, rounded corners=17pt] (14.3,7.9) rectangle (19.7,8.75); \node[text=white, font=\sffamily\bfseries\fontsize{20}{20}\selectfont] at (17,8.325) {+13.4\% YoY}; \end{tikzpicture} \end{document} It gives the following: I would like to get the exact curves and ribbon effects on for each arrow. What I am missing and how I can create arrow curves and ribbon effects. Any advice or support would be greatly appreciated.

  • pgf-PeriodicTable: usage of 'cell width' / 'cell height' ruins the layout
    by cis on April 25, 2026 at 8:55 am

    I want a full-page periodic table - in height and width! (Because I want to add external graphics as an overlay to the cells. That means a simple/artificial enlargement using scalebox or something similar is not useful.) As a test, I tried: cell width=40pt, cell height=50pt, but it ruins the layout (icons and text overlap or shift). What do I have to do? \documentclass[]{article} \usepackage[ showframe=true, a4paper, landscape, margin=10mm, ]{geometry} \usepackage{pgf-PeriodicTable} \begin{document} \noindent\pgfPT[ cell width=40pt,% example from manual, p. 22 cell height=50pt,% example from manual, p. 22 name font=\normalfont, show title=false, show legend=false, ] \end{document}

  • Help with drawing stress tensor in cylindrical coordinates in tikz
    by noir on October 16, 2025 at 8:28 am

    I want to draw stress tensors in cylindrical coordinates like in the figure below. I have been able to draw stress components on the surfaces normal to the $z$ and $r$ directions, but I have not found a satisfying way to draw $\sigma_{\theta\theta}$ on the surfaces normal to the $\theta$ direction. Any suggestions on how to do it on the two surfaces? Thanks in advance. My code is \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc, arrows.meta, 3d, decorations.pathreplacing} \usepackage{tikz-3dplot} % tdplot \begin{document} % Cylindrical Coordinate \newcommand{\cylindricalcoordinate}[4]{% \coordinate (#4) at ({#1*cos(#2)}, {#1*sin(#2)}, {#3});% \coordinate (#4xy) at ({#1*cos(#2)}, {#1*sin(#2)}, 0);% } % Axis Angles \tdplotsetmaincoords{70}{110} % Macros \pgfmathsetmacro{\rvec}{5} \pgfmathsetmacro{\thetavec}{45} \pgfmathsetmacro{\zvec}{4} \pgfmathsetmacro{\drvec}{1.5} \pgfmathsetmacro{\dthetavec}{20} \pgfmathsetmacro{\dzvec}{1} % Layers \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background, main, foreground} \begin{tikzpicture}[tdplot_main_coords, >=Stealth] % Coordinates \coordinate (O) at (0, 0, 0); %% \cylindricalcoordinate{\rvec}{\thetavec}{\zvec}{A} \cylindricalcoordinate{\rvec}{\thetavec}{(\zvec+\dzvec)}{B} \cylindricalcoordinate{\rvec}{(\thetavec+\dthetavec)}{\zvec}{C} \cylindricalcoordinate{\rvec}{(\thetavec+\dthetavec)}{(\zvec+\dzvec)}{D} %% \cylindricalcoordinate{(\rvec+\drvec)}{\thetavec}{\zvec}{A'} \cylindricalcoordinate{(\rvec+\drvec)}{\thetavec}{(\zvec+\dzvec)}{B'} \cylindricalcoordinate{(\rvec+\drvec)}{(\thetavec+\dthetavec)}{\zvec}{C'} \cylindricalcoordinate{(\rvec+\drvec)}{(\thetavec+\dthetavec)}{(\zvec+\dzvec)}{D'} \cylindricalcoordinate{0}{0}{\zvec}{Z} \cylindricalcoordinate{0}{0}{(\zvec+\dzvec)}{Z'} \coordinate (E) at ($(A)!0.5!(D)$); \coordinate (E') at ($(A')!0.5!(D')$); \coordinate (F) at ($(A)!0.5!(B')$); \coordinate (F') at ($(C)!0.5!(D')$); \coordinate (ZZ) at ($(Z)!0.5!(Z')$); \coordinate (CT) at ($(B)!0.5!(D')$); % center top \coordinate (CD) at ($(A)!0.5!(C')$); % center down %%% Nodes (for debugging; remove if you want) % \node at (A) {A}; % \node at (B) {B}; % \node at (C) {C}; % \node at (D) {D}; % \node at (E) {E}; % \node at (A') {A'}; % \node at (B') {B'}; % \node at (C') {C'}; % \node at (D') {D'}; % \node at (E') {E'}; % \node at (Z) {Z}; % \node at (Z') {Z'}; % Axis \begin{pgfonlayer}{background} \draw[thick, -latex] (0, 0, 0) -- (6, 0, 0) node[pos=1.05]{$x$}; \draw[thick, -latex] (0, 0, 0) -- (0, 6, 0) node[pos=1.05]{$y$}; \draw[thick, -latex] (0, 0, 0) -- (0, 0, 7) node[pos=1.05]{$z$}; \end{pgfonlayer} % Vectors \begin{pgfonlayer}{main} \draw[blue, thick] (O) -- (A); \draw[thick] (O) -- (Axy) node [pos=0.6, below left] {$r$}; \draw (A) -- ($(A)-(Axy)$) node [left] {$z$}; \draw (B) -- ($(A)-(Axy)+(0, 0, \dzvec)$) node [left] {$z+\mathrm{d}z$}; \draw (D) -- ($(A)-(Axy)+(0, 0, \dzvec)$); \end{pgfonlayer} \begin{pgfonlayer}{background} \draw[dashed] (C) -- ($(A)-(Axy)$) node [left] {$z$}; \end{pgfonlayer} % Help Lines \begin{pgfonlayer}{background} \draw (A) -- (Axy); \draw (A') -- (A'xy); \draw[thick] (Axy) -- (A'xy) node [pos=0.6, below left] {$\mathrm{d}r$}; % \draw (O) -- (D'xy); \draw[dashed] (C) -- (Dxy); \draw (C') -- (C'xy); %% Arcs \tdplotdrawarc{(0, 0, 0)}{\rvec}{\thetavec}{\thetavec+\dthetavec}{}{} \tdplotdrawarc{(0, 0, 0)}{\rvec+\drvec}{\thetavec}{\thetavec+\dthetavec}{}{} \end{pgfonlayer} % Angles \begin{pgfonlayer}{foreground} % theta, dtheta \tdplotdrawarc[-stealth]{(O)}{0.9}{0}{\thetavec}{anchor=north}{$\theta$} \tdplotdrawarc[-stealth]{(O)}{1.5}{\thetavec}{\thetavec + \dthetavec}{}{} \node at (1.4, 1.9, 0) {$\mathrm{d}\theta$}; \end{pgfonlayer} % Differential Volume %% Lines \begin{pgfonlayer}{foreground} \draw[thick] (A) -- (B) -- (B') -- (A') -- cycle node [midway, below] {$\mathrm{d}r$}; \draw[thick] (D) -- (D') -- (C') node [midway, right] {$\mathrm{d}z$}; \end{pgfonlayer} \begin{pgfonlayer}{background} \draw[thick, dashed] (C') -- (C) -- (D); \end{pgfonlayer} %% Curved \begin{pgfonlayer}{background} \tdplotdrawarc[thick, dashed]{(0, 0, \zvec)}{\rvec} {\thetavec}{\thetavec+\dthetavec}{}{} \end{pgfonlayer} \begin{pgfonlayer}{foreground} \tdplotdrawarc[thick]{(0, 0, \zvec+\dzvec)}{\rvec} {\thetavec}{\thetavec+\dthetavec}{}{} \node at (2.5, 3.8, \zvec+\dzvec) {$r\mathrm{d}\theta$}; \tdplotdrawarc[thick]{(0, 0, \zvec+\dzvec)}{\rvec+\drvec} {\thetavec}{\thetavec+\dthetavec}{}{} \tdplotdrawarc[thick]{(0, 0, \zvec)}{\rvec+\drvec} {\thetavec}{\thetavec+\dthetavec}{}{} \end{pgfonlayer} %% Fill Color % \begin{pgfonlayer}{main} % % Front % \fill[yellow!50!red, opacity=0.15] (B) to (B') to[bend right=4] (D') to (D) to[bend left=4] cycle; % top % \fill[yellow!50!red, opacity=0.6] (B') to[bend right=4] (D') to (C') to[bend left=4] (A') to cycle; % outer % \fill[yellow!50!red, opacity=0.4] (B) to (B') to (A') to (A) to cycle; % front % \end{pgfonlayer} % \begin{pgfonlayer}{background} % % Back % \fill[yellow!50, opacity=0.5] (D) to (D') to (C') to (C) to cycle; % back % \fill[yellow!50, opacity=0.5] (B) to[bend right=4] (D) to (C) to[bend left=4] (A) to cycle; % inner % \fill[yellow!50, opacity=0.5] (A) to (A') to[bend right=4] (C') to (C) to[bend left=4] cycle; % bottom % \end{pgfonlayer} % ---------- Added: Stress arrows and labels ----------- % For visually 3D, first draw the arrows on the inner radial face and bottom face, and draw the two faces again \begin{pgfonlayer}{main} % radial face (inner) : σrr acting outward on inner face \draw[->, thick] (E) -- ($(E)!0.4!(ZZ)$) node[left] {$\sigma_{rr}$}; \draw[->, thick] ($(CD)$) --++ (0, 0, -1) node[below] {$\sigma_{zz}$}; \end{pgfonlayer} \begin{pgfonlayer}{main} \fill[yellow!50!red, opacity=0.5] (B) to (B') to[bend right=4] (D') to (D) to[bend left=4] cycle; % top \fill[yellow!50!red, opacity=0.6] (B') to[bend right=4] (D') to (C') to[bend left=4] (A') to cycle; % outer \fill[yellow!50!red, opacity=0.4] (B) to (B') to (A') to (A) to cycle; % front \end{pgfonlayer} \begin{pgfonlayer}{background} \fill[yellow!50, opacity=0.5] (D) to (D') to (C') to (C) to cycle; % back \fill[yellow!50, opacity=0.5] (B) to[bend right=4] (D) to (C) to[bend left=4] (A) to cycle; % inner \fill[yellow!50, opacity=0.5] (A) to (A') to[bend right=4] (C') to (C) to[bend left=4] cycle; % bottom \end{pgfonlayer} \begin{pgfonlayer}{foreground} % % radial face (outer) : σrr + d σrr / dr delta r (on outer face) \draw[->, thick] (E') -- ($(E)!-0.7!(ZZ)$) node[right] {$\sigma_{rr}$}; \draw[->, thick] (E') -- ($(E')!-1.1!($(D')!0.5!(C')$)$) node[left, above] {$\sigma_{r\theta}$}; \draw[->, thick] (E') -- ($(E')!1.8!($(A')!0.5!(C')$)$) node[below,right] {$\sigma_{rz}$}; % % top face (z-direction) : σzz upward on top face center \draw[->, thick] ($(CT)$) --++ (0, 0, 1) node[right] {$\sigma_{zz}$}; \draw[->, thick] (CT) -- ($(CT)!1.8!($(D)!0.5!(D')$)$) node[right] {$\sigma_{z\theta}$}; \draw[->, thick] (CT) -- ($(CT)!-0.3!(Z')$) node[right,below] {$\sigma_{zr}$}; \end{pgfonlayer} % Define midpoint parameters and circle radius % \pgfmathsetmacro{\rmid}{\rvec + 0.5*\drvec} \pgfmathsetmacro{\thetamid}{\thetavec + 0.5*\dthetavec} \pgfmathsetmacro{\circrad}{0.05} % Define coordinates for the center of each face % Draw the circles on the faces, placing them in the correct layers \begin{pgfonlayer}{main} % Top face (constant z, normal is z-axis) \begin{scope}[shift={(CT)}] \draw[canvas is xy plane at z=0, thin] (0,0,0) circle (\circrad); \end{scope} % Outer face (constant r, normal is r-hat) \begin{scope}[shift={(E')}, rotate around z={\thetamid}] \draw[canvas is yz plane at x=0, thin] (0,0,0) circle (\circrad); \end{scope} % Front face (constant theta, normal is theta-hat) \begin{scope}[shift={(F)}, rotate around z={\thetavec+\dthetavec}] \draw[canvas is xz plane at y=0, thin] (0,0,0) circle (\circrad); \end{scope} \end{pgfonlayer} \begin{pgfonlayer}{background} % Bottom face (constant z, normal is z-axis) \begin{scope}[shift={(CD)}] \draw[canvas is xy plane at z=0, thin] (0,0,0) circle (\circrad); \end{scope} % Inner face (constant r, normal is r-hat) \begin{scope}[shift={(E)}, rotate around z={\thetamid}] \draw[canvas is yz plane at x=0, thin] (0,0,0) circle (\circrad); \end{scope} % Back face (constant theta, normal is theta-hat) \begin{scope}[shift={(F')}, rotate around z={\thetavec}] \draw[canvas is xz plane at y=0, thin] (0,0,0) circle (\circrad); \end{scope} \end{pgfonlayer} \end{tikzpicture} \end{document}

  • Draw 3D triad in TikZ
    by user2501235 on July 12, 2025 at 11:38 pm

    I am attempting to mimic a 3D triad like the one shown below from a CAD system. So far I have been able to closely match the axes and the origin cube using TikZ but not sure exactly how to get the truncated 3D spheres. Here is a minimum working example. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{} \tikzstyle{isometric}=[x={(0.710cm,-0.410cm)},y={(0cm,0.820cm)},z={(-0.710cm,-0.410cm)}] \tikzstyle{dimetric} =[x={(0.935cm,-0.118cm)},y={(0cm,0.943cm)},z={(-0.354cm,-0.312cm)}] \tikzstyle{dimetric2}=[x={(0.935cm,-0.118cm)},z={(0cm,0.943cm)},y={(+0.354cm,+0.312cm)}] \tikzstyle{trimetric}=[x={(0.926cm,-0.207cm)},y={(0cm,0.837cm)},z={(-0.378cm,-0.507cm)}] \usepackage{xcolor} \definecolor{myblue}{HTML}{C7E9F1} \begin{document} \begin{tikzpicture} % Draw a triad \begin{scope}[trimetric] % Y-face \draw [fill=myblue!30!white] (-0.25,0.25,-0.25) --++(0.5,0,0) --++(0,0,0.5) --++(-0.5,0,0) -- cycle; % Z-face \draw [fill=myblue!50!white] (-0.25,0.25,0.25) --++(0.5,0,0) --++(0,-0.5,0) --++(-0.5,0,0) -- cycle; % x-face \draw [fill=myblue!80!white] (0.25,0.25,0.25) --++(0,0,-0.5) --++(0,-0.5,0) --++(0,0,0.5) -- cycle; % Axes \draw [ultra thick,-latex,red] (0.35,0,0) --(1.0,0,0); \draw [ultra thick,-latex,green!50!black] (0,0.35,0) --(0,1.0,0); \draw [ultra thick,-latex,blue] (0,0,0.35) --(0,0,1.0); \end{scope} \end{tikzpicture} \end{document} Here is the results from my TikZ attempt.

  • How to use `tkz-euclide` with `pgfplots`
    by Mr.Hedge on April 17, 2025 at 12:56 am

    Is there any way to make tkz-euclide compatible with pgfplots axis environment? Here is my code example where I want to add mark using \tkzMarkSegment but more often I want to find some line intersections or draw circles. Interestingly, simple \tkzLabelPoint works. \documentclass[tikz, margin=3mm]{standalone} \usetikzlibrary{ arrows.meta, positioning, } \usepackage{tkz-euclide} \usepackage{pgfplots} \usepackage[dvipsnames,table]{xcolor} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ xmin=-2.9, xmax=15.9, ymin=-3.9, ymax=15.9, xtick distance=1, ytick distance=1, xticklabels=\empty, yticklabels=\empty, extra y ticks={1}, extra y tick labels={$1$}, extra x ticks={1}, extra x tick labels={$1$}, axis lines=middle, axis line style={-Stealth}, xlabel={$X$}, ylabel={$Y$}, xlabel style={at={(ticklabel* cs:1)}, anchor=north east, font=\footnotesize}, ylabel style={at={(ticklabel* cs:1)}, anchor=north west, font=\footnotesize}, grid=both, grid style={dotted, gray!50}, set layers, clip mode=individual, axis equal image=true, % scale only axis, % unit vector ratio=2,1, ] \coordinate (A) at (axis cs:2,8); \coordinate (B) at (axis cs:10,2); \coordinate (S) at (axis cs:6,5); \draw[thick, black] (A)--(B); \draw[black, fill=black] (A) circle(1.5pt) (B) circle(1.5pt); \tkzLabelPoint[above left](A){$A$} \tkzLabelPoint[below right](B){$B$} \addplot [name path = A,domain=-2:15, samples=2, thick, color=Red] {4/3*x-3} node[pos=0.8, sloped, above, font=\footnotesize]{$y=\frac{4}{3}x-3$}; \draw[Green, fill=Green] (S) circle(1.5pt); \tkzMarkSegment[mark=|, pos=0.5](S,B) \end{axis} \end{tikzpicture} \end{document}

  • Graphs of 1/|x| and sin(1/x) does not look good
    by Timo Chang on December 15, 2024 at 5:16 am

    I draw the graph of 1/|x| with the code: \begin{tikzpicture}[>=latex, scale=0.3] \draw[->] (-5,0)--(5,0)node[right]{$x$}; \draw[->] (0,-1)--(0,9)node[right]{$y$}; \draw [domain=-5:-1/8, samples=500, thick] plot (\x, {-1/(\x)}); \draw [domain=1/8:5, samples=500, thick] plot (\x, {1/(\x)}); \fill[black] (0,3) circle (4pt); \end{tikzpicture} But the resulting picture looks like this: As you can see, it is not symmetric at the highest point. I wonder what causes this happen? And how can we fix this? A similar problem also happens when I draw the graph of sin(1/x): \begin{tikzpicture}[>=latex, scale=1.5] \draw[->] (-2,0)--(2,0)node[right]{$x$}; \draw[->] (0,-2)--(0,2)node[right]{$y$}; \draw [domain=-1:-0.03, samples=1000, thick] plot (\x, {sin(1/(\x) r)}); \draw [domain=0.03:1, samples=1000, thick] plot (\x, {sin(1/(\x) r)}); \end{tikzpicture} The resulting picture is: The problem is that it doesn't look "smooth" when getting close to x=0. Is there a way to fix this?

  • Using TikZ to draw a 3D plot with a surface u(x,y), a contour C on the xy-plane and a vertical surface between C and u(x,y)
    by Ramon Oliver on October 15, 2024 at 6:35 pm

    I want to have a 3D plot to explain integration of a complex function, f(z), along a contour on the complex plane, C. This 3D plot must contain these three ingredients: A surface plot of a function u(x,y) = Re(f(z)). To simplify matters, any u(x,y) > 0 will do. For example, exp(-(x * x + y * y)). The contour on the xy-plane, C. The vertical surface between C and u(x,y). It is a vertical "curtain" whose bottom is the contour C and whose top is at the intersection between u(x,y) and the curtain itself. I want to show this vertical surface because its area is the real part of the integral of f(z) along the contour C. My knowledge about TikZ is very very limited, but I am eager to learn. The problem is that I have not been able to find an example that could serve as a starting point. Thanks in advance for your help.

  • Draw Tubular surfaces
    by JulianDoyle on September 25, 2024 at 6:59 am

    I would like to find out a way to draw a tubular surface around a helix in LaTex without using the 3d-tikz. I'm seeking for a picture only made by tikzpicture. Also, I'm finding how I may draw in tikz a regular curve (not a circle) and a tube around it. Anyone could help me? For example, I made this tube around a circle, but I want to generalized for a smooth closed curve in $\mathbb{R}^2$. It is enough with an example. \begin{tikzpicture}[scale = 0.6] \fill[cyan!30] (0,0) circle (5cm); \draw[black, line width=1pt] (0,0) circle (5cm); \draw[black, line width=3pt] (0,0) circle (3cm); \fill[white] (0,0) circle (1cm); \draw[black, line width=1pt] (0,0) circle (1cm); \node at (3.5, 0) {$\mathbb{S}^1$}; \draw[<->, dashed, line width=1.5pt] (0,5) -- (0,3); \draw[<->, dashed, line width=1.5pt] (0,1) -- (0,3); \node at (0.5, 4) {$t$}; \node at (0.5, 2) {$t$}; \end{tikzpicture}

  • pgfplots: find the intersection point of two curves and determine the y value of the intersection point
    by BqBPdx on March 31, 2024 at 2:50 am

    Thank you for reading my question! Introduction Now I want to draw a picture, in which I need to calculate the intersection point of the two curves and determine whether the y value of the intersection point is zero. If it is not zero, I need to draw a straight line perpendicular to the x-axis through the point. I'm going to use a loop(foreach) to complete the operation, but now I have a problem when getting the total number of loops. The total number of loops should be the total number of intersections, but now it seems that the total number of intersections is not correctly copied to the macro\t. Here is my code: My environment is VSCode + TexLive + LaTeX Workshop \documentclass[tikz]{standalone} \usepackage{pgfplots,pgf,tikz} \usepackage{amsmath,amssymb,amsfonts,amsthm} \pgfplotsset{compat=1.18} \usetikzlibrary{intersections} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \def\sigmarayleigh{1} \def\gaussmean{4} \def\gaussvar{1.5} \def\xmin{0} \def\xmax{8} \def\ymin{0} \def\ymax{0.7} \begin{axis}[title = Fig1,xlabel = $Voltage$,ylabel = $Probability Density$,xmin = \xmin, xmax = \xmax, ymin = \ymin, ymax = \ymax, grid = both, legend pos = north east] \coordinate (O) at (\xmin,\ymin); \coordinate (X) at (\xmax,\ymin); \coordinate (Y) at (\xmin,\ymax); \addplot[name path = rayleigh, domain = 0:8, samples = 100, color = black, dashed, line width = 1pt]{x*exp(-x^2/(2*\sigmarayleigh^2))/(\sigmarayleigh^2)}; \addplot[name path = gauss, domain = 0:8, samples = 100, color = black, line width = 1pt]{1/(sqrt(2*pi*\gaussvar))*exp(-(x-\gaussmean)^2/(2*\gaussvar))}; \path [name intersections={of=rayleigh and gauss, name = ii, total=\t}]; \foreach \s in {1,...,\t}{ \typeout{Total intersections: \s}; }; \end{axis} \end{tikzpicture} \end{document} I'm going to test if my loop works but this code doesn't compile successfully. The following is the compile log: Then I made a simple modification to my code, replacing the \t with a fixed number 9, and then this code can run successfully. The modified code is as follows: \documentclass[tikz]{standalone} \usepackage{pgfplots,pgf,tikz} \usepackage{amsmath,amssymb,amsfonts,amsthm} \pgfplotsset{compat=1.18} \usetikzlibrary{intersections} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \def\sigmarayleigh{1} \def\gaussmean{4} \def\gaussvar{1.5} \def\xmin{0} \def\xmax{8} \def\ymin{0} \def\ymax{0.7} \begin{axis}[title = Fig1,xlabel = $Voltage$,ylabel = $Probability Density$,xmin = \xmin, xmax = \xmax, ymin = \ymin, ymax = \ymax, grid = both, legend pos = north east] \coordinate (O) at (\xmin,\ymin); \coordinate (X) at (\xmax,\ymin); \coordinate (Y) at (\xmin,\ymax); \addplot[name path = rayleigh, domain = 0:8, samples = 100, color = black, dashed, line width = 1pt]{x*exp(-x^2/(2*\sigmarayleigh^2))/(\sigmarayleigh^2)}; \addplot[name path = gauss, domain = 0:8, samples = 100, color = black, line width = 1pt]{1/(sqrt(2*pi*\gaussvar))*exp(-(x-\gaussmean)^2/(2*\gaussvar))}; \path [name intersections={of=rayleigh and gauss, name = ii, total=\t}]; \foreach \s in {1,...,9}{ \typeout{Total intersections: \s}; }; \end{axis} \end{tikzpicture} \end{document} The following is the compile log: It seems that \t is not assigned a value in my code. Is there something wrong with my usage of intersections?

  • TikZ 3d parametric plot on top of 2d plot
    by Benben on September 16, 2022 at 8:25 pm

    I am trying to add a 3d parametric plot of a function on top of 2d axes. \documentclass[10pt]{article} \usepackage{pgfplots} \usepackage{tikz-3dplot} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} % %% axes \draw[->] (-1, 0) -- (1,0); \draw[->] ( 0,-1) -- (0,1); %% lightcone \draw[->] (-1,-1,0) -- ( 3,3,0); \draw[->] ( 1,-1,0) -- (-3,3,0); % \begin{axis} [ axis lines=center, ticks=none, view = {15}{35} ] \addplot3 [no markers,domain = -1:0] ( {0}, {x}, {cos(cosh(11*x))} ); \end {axis} % \end {tikzpicture} \end {document} The function I want to plot is cos( a*exp(x) ) Also, when I try to add a pgf "Axis", it does not overlay the axis on top of my image, rather -- off to the side.

  • Shade between two cartesian lines and a polar curve
    by leogcam on August 23, 2021 at 12:56 pm

    I'm trying to shade the area between two cartesian lines (the two blue lines in the plot below) and a polar curve (the squiggly curve in the plot below). Using the fill command, I was only able to shade part of the area I wanted. I want to shade all the way to the origin, not just the section that is shaded now. Here is my current code: \documentclass[twocolumn, notitlepage, 11pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{titling} \usepackage{pgfplots} \usepgfplotslibrary{polar} \usepgfplotslibrary{fillbetween} \setlength{\droptitle}{-12em} \pagenumbering{gobble} \pgfplotsset{width=12cm,compat=1.9} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = left, xmin = 0, xmax = 1.25, ymin = 0, ymax = 1.25, yticklabels={,,}, xticklabels={,,} ] \addplot[color=red, domain=0:1,samples=100,smooth,ultra thick] {tan(20)*x} node[above,pos=1] {$\theta=\alpha$}; \addplot[name path = squiggle, color=black, data cs = polar, domain=0:90,smooth, ultra thick] {.15*sin(10*x-40) + .75} node[above, pos=0] {$r=f(\theta)$}; \addplot[name path = a, color=cyan, domain=0:1,samples=100,smooth,ultra thick] {tan(40)*x} node[above,pos=1] {$\theta=\theta_{i-1}$}; \addplot[name path = b, color=cyan, domain=0:.6,samples=100,smooth,ultra thick] {tan(60)*x} node[above,pos=1] {$\theta=\theta_i$}; \addplot[color=purple, domain=0:.2,samples=100,smooth,ultra thick] {tan(80)*x} node[above,pos=1] {$\theta=\beta$}; \addplot [domain=40:60, samples=30, smooth, black, ultra thick, fill=blue!40, data cs = polar] {.15*sin(10*x-40) + .75}; \end{axis} \end{tikzpicture} \end{document}

  • Special table - rounded borders
    by ez5653 on February 15, 2020 at 11:36 am

    Can you help me with creating this type of table in Latex ? Thank you

  • Tikz/pgfplots shade to origin (polar)
    by Donnie Nathan Chad on October 27, 2019 at 4:54 am

    I'm trying to shade in just one petal of a polar function. Specifically, I was wondering if there was a way to shade in the bounded region that lives between my two rays: I've tried searching for examples elsewhere but most of the ones I've seen involve either shading in a region bounded by two curves or shading in the area under a function y=f(x). \documentclass[border=5pt]{standalone} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ smooth, trig format plots=rad, axis lines=middle, axis equal] \addplot [domain=0:pi, samples=150, red] ({2*sin(5*x)*cos(x)}, {2*sin(5*x)*sin(x)}); \draw [-stealth, ultra thick, dashed, draw=blue] (axis cs: 0,0) -- ++(canvas polar cs: radius=3cm,angle=0); \draw [-stealth, ultra thick, dashed, draw=blue] (axis cs: 0,0) -- ++(canvas polar cs: radius=4cm,angle=deg{pi/5}); \end{axis} \end{tikzpicture}% \end{document} Any feedback would be greatly appreciated!

  • Rotate 3D plot to top down view
    by Philipp on May 26, 2018 at 1:01 pm

    I have a function with 2 parameters that, when plotted in 3D, is rotated in such a way that a part of the surface is hidden: \begin{tikzpicture}[ declare function={ func(\x, \y) = ((\x<10) * (\x/10) + (\x>=10)) * ((\y<=30) * (\y/30) + (\y>30) * (1- (\y-30)/((\y-30)+3))); } ] \begin{axis}[ colormap name=whitered, axis z line=middle, xmin=0, xmax=50, xlabel=$d$, ymin=0, ymax=30, ylabel=$v$, zmin=0, zmax=1.1, zlabel=$\overline{f}$ ] \addplot3[domain=0:50, y domain=0:30, samples=50, surf] {func(\x, \y)}; \end{axis} \end{tikzpicture} To prevent this I would like to plot it from a "top-down" view and then rely purely on colors to indicate the value of the function. How can this be done?

  • Add arrow to 3D pgfplot
    by s__C on December 3, 2013 at 3:30 pm

    How to add an arrow (cf red arrows below) in a 3D plot (or 2D plot should be similar) in pgfplots ? The arrow has not to be specifically aligned with the label but could be placed closer to the axis.

  • How to incorporate and scale matplotlib plots in latex using the PGF backend?
    by Nils_M on September 20, 2013 at 3:09 pm

    I am using the pgf backend of matplotlib to generate pgf files which I want to put into my latex document using tikzscale to be able to resize them easily. Example python code: #!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib as mpl mpl.use('pgf') import numpy as np import matplotlib.pyplot as mplp mpl.rcParams['text.latex.unicode']=True mpl.rcParams['text.usetex']=True mpl.rcParams['pgf.texsystem'] = 'pdflatex' fig = mplp.figure() ax = fig.add_subplot(111) x = np.arange(0,2 * np.pi, .1) data = np.sin(x) fmt = {"lw" : 3, "c" : "r", "ls" : '-'} ax.plot(x, data, label=r"sample data with greek $\mu$", **fmt) ax.set_ylabel(r"sample", rotation=0) ax.legend() fig.set_size_inches(1.41,1.) # fig.savefig('./sample.pgf', dpi=500, bbox_inches='tight') fig.savefig('./sample.pgf', dpi=500) Example latex code: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tikzscale} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \newcommand{\includepgf}[4] { \begin{figure} \centering \includegraphics{#1} \includegraphics[width=#2\textwidth, height=#2*0.7071428571428572\textwidth]{#1} \includegraphics[width=#2\textwidth, axisratio=0.7071428571428572]{#1} \caption[]{#4} \label{#3} \end{figure} } \begin{document} \includepgf{sample.pgf}{.9}{fig:sample}{Sample Figure} \end{document} Unfortunately the following happens for the three different \includegraphics commands: Works as expected, includes plot in original size Compiles with Package tikzscale Warning: Scaling of sample.pgf's width was only (tikzscale) accurate to 208.59694pt on input line 27. Package tikzscale Warning: Scaling of sample.pgf's height was only (tikzscale) accurate to 147.29488pt on input line 27. no resizing in final pdf file. Does not compile, gives ! Package tikzscale Error: Requested to scale unscalable graphic.

  • Table with rounded corners
    by Álvaro on August 17, 2013 at 4:33 pm

    I've taken an example of a very cool table from here and I've made some changes to suit my needs, the problem is that the table it's not correctly rounded: Unfortunately it doesn't seem to exist a rectagle element when you can only round some corners. Here's MWE: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[top=2.5cm, bottom=4cm, inner=2.5cm, outer=3.5cm]{geometry} \usepackage{times} \renewcommand{\rmdefault}{phv} % Arial \renewcommand{\sfdefault}{phv} % Arial \usepackage[T1]{fontenc} \usepackage{textcomp} % necesario para el símbolo € \usepackage[usenames,dvipsnames]{xcolor} \usepackage[pdftex]{graphicx} \usepackage{caption,subcaption} \setlength\textfloatsep{1.7\baselineskip plus 0.2\baselineskip minus 0.5\baselineskip} \setlength\intextsep{2\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip} \usepackage{environ} %lo usaré para crear el environ de tabla colorida \usepackage{tabularx} \usepackage{booktabs} % Contiene el comando \midrule \usepackage{colortbl} \usepackage{tikz} \usetikzlibrary{patterns} \usetikzlibrary{backgrounds,fit,calc} \usetikzlibrary{% decorations.fractals% ,decorations.pathmorphing% ,shadows% } \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.text} \usetikzlibrary{decorations.shapes} %para curvar texto \usetikzlibrary{shapes,positioning} %para los flow charts \usetikzlibrary{shapes,arrows,chains} \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \usetikzlibrary{intersections} \colorlet{TablaBordeSuperior}{BurntOrange} %\definecolor{TablaBordeSuperior}{cmyk}{0,0.51,1,0} % BurntOrange \colorlet{TablaBordeInferior}{Bittersweet} %\definecolor{TablaBordeInferior}{cmyk}{0,0.75,1,0.24} % Bittersweet \colorlet{TablaCentroSuperior}{blue!1} \colorlet{TablaCentroInferior}{blue!20} \colorlet{FuenteCabeceraTabla}{white} \newcommand{\fuentecabecera}[1]{\textcolor{FuenteCabeceraTabla}{\textbf{#1}}} \newcommand{\encabezadoUnaLineaSuperior}{0.8} \newcommand{\encabezadoUnaLineaInferior}{0.8} \newcommand{\espaciadoCabeceraCuerpoUnaLinea}{0.5em} \newcommand{\encabezadoDosLineasSuperior}{1.3} \newcommand{\encabezadoDosLineasInferior}{1.2} %\newcommand{\espaciadoCabeceraCuerpoDosLineas}{1.5em} %hay que aumentar el valor de 0.5 a 1.5 puesto que la cabecera ocupa dos líneas \newcommand{\espaciadoCabeceraCuerpoDosLineas}{2em} \newcommand{\encabezadoTresLineasSuperior}{1.8} \newcommand{\encabezadoTresLineasInferior}{1.8} \newcommand{\espaciadoCabeceraCuerpoTresLineas}{0.5em} \newcommand{\encabezadoSuperior}{\encabezadoUnaLineaSuperior} %por defecto una línea \newcommand{\encabezadoInferior}{\encabezadoUnaLineaInferior} %por defecto una línea \newcommand{\espaciadoCabeceraCuerpo}{\espaciadoCabeceraCuerpoUnaLinea} %por defecto el de una línea \newcommand{\encabezadoUnaLinea}{ \renewcommand{\encabezadoSuperior}{\encabezadoUnaLineaSuperior} \renewcommand{\encabezadoInferior}{\encabezadoUnaLineaInferior} \renewcommand{\espaciadoCabeceraCuerpo}{\espaciadoCabeceraCuerpoUnaLinea}} \newcommand{\encabezadoDosLineas}{ \renewcommand{\encabezadoSuperior}{\encabezadoDosLineasSuperior} \renewcommand{\encabezadoUnaLineaInferior}{\encabezadoDosLineasInferior} \renewcommand{\espaciadoCabeceraCuerpo}{\espaciadoCabeceraCuerpoDosLineas}} \newcommand{\encabezadoTresLineas}{ \renewcommand{\encabezadoSuperior}{\encabezadoTresLineasSuperior} \renewcommand{\encabezadoUnaLineaInferior}{\encabezadoTresLineasInferior} \renewcommand{\espaciadoCabeceraCuerpo}{\espaciadoCabeceraCuerpoTresLineas}} %estos tres últimos comandos gestionan si el encabezado será de una línea, de dos o de tres \newif\iflineaResaltado \lineaResaltadofalse \newcommand{\pieInferiorUno}{-5.2} \newcommand{\pieInferiorDos}{3.45} \newcommand{\resaltarPie}[2]{\lineaResaltadotrue\renewcommand{\pieInferiorUno}{#1}\renewcommand{\pieInferiorDos}{#2}} \NewEnviron{tablacolorida}[2]{% % \vspace*{-2em} \begin{center} \captionsetup{type=table} %para que no me de error el posterior comando \captionof \begin{tikzpicture} \node (tbl) { \BODY }; \begin{pgfonlayer}{background} \draw[rounded corners,top color=TablaBordeSuperior,bottom color=TablaBordeInferior, draw=white] ($(tbl.north west)+(0.14,0)$) rectangle ($(tbl.north east)-(0.13,\encabezadoSuperior)$); %el top color indica el color principal de la línea de cabecera %para tener encabezado de dos líneas (0.13,1.3) \draw[rounded corners,top color=white,bottom color=TablaBordeInferior, middle color=TablaBordeSuperior,draw=white!20] ($(tbl.south west) +(0.13,0.5)$) rectangle ($(tbl.south east)-(0.13,0)$); \draw[top color=TablaCentroSuperior,bottom color=TablaCentroInferior,draw=white] %el top color indica el color de inicio de las filas del medio, el "white" hace que el borde externo de las filas no se pinte ($(tbl.north east)-(0.13,\encabezadoInferior)$) %con el parámetro 0.8 controlamos la altura de la línea de cabecera %para tener encabezado de dos líneas (0.13,1.2) rectangle ($(tbl.south west)+(0.13,0.2)$); %el 0.2 controla el grosor de la línea decorativa inferior \iflineaResaltado \draw[top color=TablaBordeSuperior,bottom color=TablaBordeSuperior, draw=white] ($(0,\pieInferiorUno)+(7.5,2)$) rectangle ($(-0.5,1)-(7,\pieInferiorDos)$); % ($(0,-4.8)+(7.5,2)$) ($(-0.5,1)-(7,3.1)$) % ($(0,-5.2)+(7.5,2)$) ($(-0.5,1)-(7,3.45)$) %una fila más abajo \fi \end{pgfonlayer} \end{tikzpicture} \captionof{table}{#1} \label{tab:#2} \end{center} %\vspace*{-1em} } \begin{document} \begin{tablacolorida}{Hitos del proyecto}{hitosProyecto} \begin{tabularx}{1\textwidth}{m{0.10\linewidth} m{0.34\linewidth} m{0.48\linewidth}} \arrayrulecolor{purple} \centering\fuentecabecera{Hito} & \centering\fuentecabecera{Fecha} & \centering\arraybackslash\raisebox{-0.3em}{\fuentecabecera{Descripción}} \\[+\espaciadoCabeceraCuerpo] \centering\textbf{H1} & \centering Mes 0 & \centering\arraybackslash Comienzo del proyecto \\ \midrule \centering\textbf{H2} & \centering 2 meses y 3 semanas & \centering\arraybackslash Fin del estudio del arte \\ \midrule \centering\textbf{H3} & \centering 6 meses y 1 semana & \centering\arraybackslash Finalización de la plataforma de virtualización \\ \midrule \centering\textbf{H4} & \centering 9 meses & \centering\arraybackslash Finalización de lo concerniente a DTN \\ \midrule \centering\textbf{H5} & \centering 10 meses y 1 semana & \centering\arraybackslash Finalización de lo concerniente a CDN \\ \midrule \centering\textbf{H6} & \centering 12 meses & \centering\arraybackslash Fin del Proyecto Fin de Carrera (PFC) \\[0.5ex] \end{tabularx} \end{tablacolorida} \resaltarPie{-9.7}{7.95} \newcounter{paqueteTrabajo} \newcounter{tarea} \setcounter{paqueteTrabajo}{-1} \newcommand{\filaRHpt}[7]{\addtocounter{paqueteTrabajo}{1}\setcounter{tarea}{1}\centering \bfseries{PT.\arabic{paqueteTrabajo}.} & \centering \bfseries{#1} & \centering \bfseries{#2} € & \centering \bfseries{#3} & \centering \bfseries{#4 €} & \centering \bfseries{#5} & \centering \bfseries{#6 €} & \centering\arraybackslash \bfseries{#7 €} \\ \midrule} \newcommand{\filaRHt}[7]{\centering T.\arabic{paqueteTrabajo}\arabic{tarea}. & \centering #1 & \centering #2 € & \centering #3 & \centering #4 € & \centering #5 & \centering #6 € & \centering\arraybackslash #7 € \\ \midrule\addtocounter{tarea}{1}} \newcommand{\filaRHTOTAL}[7]{\centering \fuentecabecera{Total} & \centering \fuentecabecera{#1} & \centering \fuentecabecera{#2 €} & \centering \fuentecabecera{#3} & \centering \fuentecabecera{#4 €} & \centering \fuentecabecera{#5} & \centering \fuentecabecera{#6 €} & \centering\arraybackslash \raisebox{-0.15em}{\fuentecabecera{#7 €}} \\} \encabezadoTresLineas \begin{tablacolorida}{Presupuesto de recursos humanos}{presupuestoRH} \begin{tabularx}{1\textwidth}{m{0.08\linewidth} m{0.08\linewidth} m{0.11\linewidth} m{0.08\linewidth} m{0.11\linewidth} m{0.08\linewidth} m{0.11\linewidth} m{0.11\linewidth}} \arrayrulecolor{purple} \centering\fuentecabecera{\underline{Tarea}} & \multicolumn{7}{c}{\fuentecabecera{\underline{Recurso}}} \\ %[+\espaciadoCabeceraCuerpo] & \multicolumn{2}{c}{\fuentecabecera{FL}} & \multicolumn{2}{c}{\fuentecabecera{JMC}} & \multicolumn{2}{c}{\fuentecabecera{AM}} & \centering\arraybackslash\fuentecabecera{Coste} \\ & \centering\fuentecabecera{CT} & \centering\fuentecabecera{Coste} & \centering\fuentecabecera{CT} & \centering\fuentecabecera{Coste} & \centering\fuentecabecera{CT} & \centering\fuentecabecera{Coste} & \\ [+\espaciadoCabeceraCuerpo] %Para añadir un último elemento sería \centering\arraybackslash\raisebox{-0.25em}{\fuentecabecera{Total}} \filaRHpt{7}{0}{0}{0}{312}{0}{0} %PRIMER PAQUETE DE TRABAJO \filaRHt{2}{0}{0}{0}{120}{0}{0} \filaRHt{1}{0}{0}{0}{72}{0}{0} \filaRHt{2}{0}{0}{0}{88}{0}{0} \filaRHt{2}{0}{0}{0}{32}{0}{0} \filaRHpt{8}{480}{1}{60}{408}{14688}{15228} %SEGUNDO PAQUETE DE TRABAJO \filaRHt{1}{60}{0}{0}{88}{3168}{3228} \filaRHt{1}{60}{0}{0}{72}{2592}{2652} \filaRHt{3}{180}{0}{0}{88}{3168}{3348} \filaRHt{3}{180}{1}{60}{160}{5760}{6000} \filaRHpt{9}{540}{2}{120}{336}{12096}{12756} %TERCER PAQUETE DE TRABAJO \filaRHt{2}{120}{0}{0}{72}{2592}{2712} \filaRHt{2}{120}{0}{0}{88}{3168}{3288} \filaRHt{1}{60}{0}{0}{88}{3168}{3228} \filaRHt{4}{240}{2}{120}{88}{3168}{3528} \filaRHpt{26}{1560}{1}{60}{192}{6912}{8532} %CUARTO PAQUETE DE TRABAJO \filaRHt{24}{1440}{0}{0}{160}{5760}{7200} \filaRHt{2}{120}{1}{60}{32}{1152}{1332} \filaRHTOTAL{50}{2580}{4}{240}{1248}{33696}{36516}[0.5ex] \end{tabularx} \end{tablacolorida} \encabezadoUnaLinea \end{document}

  • How do you draw spheres and arcs on a sphere on latex?
    by user34807 on August 8, 2013 at 12:46 am

    So, I'm new to using latex and I need to draw some figures, specifically spheres and arcs and how to label endpoints.

  • How to draw spherical geometries with TeX?
    by Ingo on April 26, 2012 at 2:38 pm

    I am working in the field of Astrodynamics and have to do many computations using spherical geometry. To visualize some of the concepts I would like to prepare drawings of things like spherical triangles, planes around the earth, or circles projected onto the sphere. Here are some examples (1): How is this possible to do in TeX? I had a look whether this could be done with TikZ but could not find any comparable examples. I am convinced that in theory it should be possible to prepare a TikZ extension that does things like this rather simply, but at the moment I am looking for an already existing solution to accomplish such tasks. When I get more experienced with making such plots I might consider writing a basic package. The question is thus actually threefold: Is it possible to make such plots in LaTeX with current packages? If yes, with TikZ? Could you give me an example how to start? If not, what software would you recommend to prepare and include such kind of 3D graphics? Please note that this is not the kind of question you sometimes get here that asks "Please do this for me!" I honestly tried solving this problem but did not get far at all. It would be really great to get an answer, a lot of people in my field would benefit from this. (1) Wertz, James R. (2009). Orbit & Constellation Design & Management. New York: Springer.

  • Add text to absolute position in every slide automatically IN ADDITION to theme footer
    by bhilburn on December 14, 2011 at 8:03 pm

    I know this sounds like a repeat question, but I'm pretty sure it's not. I am trying to add text to an absolute position in every slide of the presentation, in addition to to content already provided by the theme I am using. Right now, I have defined this command: \usepackage{tikz} \newcommand{\addtext}{ \begin{tikzpicture}[remember picture,overlay] \node[yshift=1.5ex,anchor=south west] at (current page.south west) {\tiny My Added Text}; \end{tikzpicture} And then, in every slide I want to use it, I have to issue that command within the frame definition. The thing is, I want it in every slide, and requiring the user to remember to put it there is prone to forgetfulness. I have seen a ton of examples here on how to add text to the footer that replaces the theme, or how to create commands like the one I've shared above. My question is, how do I either do something like that in every slide, or make that command a part of every slide automatically? I've tried adding that command to the frametitle using \addtobeamertheme, but it doesn't go well. Ideas?

  • Different backgrounds for title and "normal" frames in beamer
    by Christoph on October 12, 2011 at 11:18 am

    I want to draw different backgrounds for the title frame and normal frames in beamer, using tikz. Doing this for the normal frames was straight forward, but that background now also shows up on the title frame (shifted to the bottom), which is not desired: \documentclass{beamer} \useoutertheme[subsection=true]{miniframes}%{miniframes} \defbeamertemplate*{background}{miniframes theme} {% \begin{beamercolorbox}{background} \begin{tikzpicture} \fill[red] (current page.north west) rectangle ++(0.5cm,-0.5cm); \end{tikzpicture} \end{beamercolorbox} } \usepackage{tikz} \usetikzlibrary{calc,positioning} \usepackage{blindtext} \title{new template} \author{Christoph} \setbeamertemplate{title page}{ \insertauthor \insertdate \insertinstitute \inserttitlegraphic } \setbeamertemplate{navigation symbols}{} \begin{document} \frame[plain]{\titlepage} \section{a section} \subsection{a subsection} \begin{frame} \frametitle{Frame 1} \blindtext \end{frame} \begin{frame} \frametitle{Frame 2} \end{frame} \subsection{another subsection} \begin{frame} \frametitle{Frame 1} \blindtext \end{frame} \begin{frame} \frametitle{Frame 2} \end{frame} \end{document} (my example just uses a red rectangle for simplicity) I have tried adding the tikzpicture to the header template, which resulted in a shifted navigation (without tikzpicture[overlay]), or the picture not showing up at all (with tikzpicture[overlay]). If this can be solved with the headline template, I'll use that. Text added to the frame should not be covered by the background picture.