TikZ
- Why does combining TikZ `patterns` and `fadings` cause rendering problems in some PDF viewers? [closed]by kabenyuk on September 27, 2026 at 3:47 pm
I have come across an interesting difference in how a PDF produced by TikZ is rendered by different PDF viewers. The following MWE isolates the issue: \documentclass{article} \usepackage{tikz} \usetikzlibrary{patterns,fadings} \begin{document} \begin{tikzpicture} % Pattern only \fill[draw,pattern=north west lines] (0,0) rectangle (3,.4); % Fading only \fill[draw,path fading=east] (0,-1) rectangle (3,-.6); % Pattern + fading \fill[draw,pattern=north west lines,path fading=east] (0,-2) rectangle (3,-1.6); \end{tikzpicture} \end{document} Left: Adobe Acrobat. Right: WinEdtPDF. The same PDF file is shown in both viewers. In WinEdtPDF the first two rectangles are rendered correctly. The problem appears only in the third one, where pattern=north west lines and path fading=east are used together: the hatching is not rendered correctly. Thus, pattern=north west lines works by itself, and path fading=east works by itself. The rendering difference appears only when the two TikZ mechanisms are combined. The same PDF is rendered correctly in Adobe Acrobat, Microsoft Edge, and Firefox. The same defect as in WinEdtPDF is also visible in Google Drive's PDF preview. I initially reported this to the WinEdt developer. Alex Simonic explained that WinEdtPDF uses PDFium for rendering and that the behavior observed there is a limitation of PDFium rather than of WinEdtPDF itself: https://github.com/WinEdt-Team/WinEdt-Support/discussions/131#discussioncomment-18627725 So my question is about the TikZ/PDF side of this behavior: what does TikZ write into the PDF when a pattern and path fading are combined, and what is special about this construction that makes different PDF rendering engines handle it differently?
- Override a PGF key .initial value for a new shapeby 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 TikZby 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 pathby 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 tikzby 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 infographicsby 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 layoutby 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}
- Draw 3D triad in TikZby 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 goodby 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 surfacesby 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 pointby 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 plotby 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 curveby 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 bordersby 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!
- Tabular with rounded corners made with tikzpicture with overlay is not properly positioned inside table environmentby Eelco van Vliet on July 31, 2019 at 10:14 pm
My quest is to make a table which looks like this: To good thing so far: I have succeeded in making this table. The bad thing: I cannot include this in a normal \begin{table}\end{table} environment as the boundingbox of the tabular is not seen. All text is running over the table Hopefully somebody can solve this. Either by giving my an alternative way to create this table, or by fixing the error in my code The code below is using stuff from other answers I have found here: rounded corners shows how to make rounded corners around a table. The problem is: I want my first row with the column heading ABOVE line with rounded corners. My idea to solve was easy: just adjust the clipping of the tabular such that I make a rounded corner of the first column, immediately go up, and then go to the other side: ------------------------------ R-| heading cols | |first grey col value cols | | | R--------------------------------- At the locations of the R's I want to add the rounded corners. The code I came up with is quite long, I will add it here. It is stand alone. This clipping idea comes from the first link. Also, I am adding a tikzmark A because I want the clipping path to automatically connect to the bottom of the first row. That idea was inspired by this exampleadd tikznode at corner. In order to get the y coordinates of this point A, I used this idea extract y coordinate Here is the code, which should run stand alone \documentclass{article} \usepackage[dvipsnames,table]{xcolor} \usepackage{array} \usepackage{environ} \usepackage{blindtext} \usepackage{tikz} \usepackage{etex} \usetikzlibrary{calc, tikzmark} \definecolor{lichtgrijs}{RGB}{236,236,236} \newcolumntype{L}{>{\columncolor{lichtgrijs}}l} \newsavebox{\tablebox} \NewEnviron{rndtable}[1]{% \addtolength{\extrarowheight}{1ex}% \savebox{\tablebox}{% \begin{tabular}{#1}% \BODY% \end{tabular}}% \begin{tikzpicture} [overlay, remember picture] \ExtractCoordinate{$(pic cs:A)$} \begin{scope} \useasboundingbox; \clip[rounded corners=1ex] (0,-\dp\tablebox) -- (\wd\tablebox,-\dp\tablebox) -- (\wd\tablebox,\ht\tablebox) { [rounded corners=0ex]-- (1ex,\ht\tablebox) -- (1ex,\YCoord-\RowDepth)}-- %(1ex,\ht\tablebox-3ex)}-- (0,\YCoord-\RowDepth) -- cycle; \node at (0,-\dp\tablebox) [anchor=south west,inner sep=0pt]{\usebox{\tablebox}}; \end{scope} \end{tikzpicture} } \begin{document} \setlength\arrayrulewidth{1.2pt} \edef\RowDepth{\the\dimexpr\arraystretch\dimexpr.3\baselineskip\relax\relax} \newdimen\XCoord \newdimen\YCoord \newcommand*{\ExtractCoordinate}[1]{\path (#1); \pgfgetlastxy{\XCoord}{\YCoord};}% %\blindtext[10] %\begin{table}[tbp] % \caption{bla} \begin{rndtable}{Llr} \rowcolor{white} \tikzmark{A} \textbf{Label} & \textbf{Naam} & \textbf{Leeftijd}\\ \arrayrulecolor{lichtgrijs} \hline GK & Paul Robinson & 45\\ LB & Lucus Radebe & 23\\ DC & Michael Duberry & 84\\ DC & Dominic Matteo & 22\\ RB & Didier Domi & 34\\ MC & David Batty & 5\\ MC & Eirik Bakke & 58\\ MC & Jody Morris & 75\\ FW & Jamie McMaster & 13\\ ST & Alan Smith & 70\\ ST & Mark Viduka & 30\\ \arrayrulecolor{lichtgrijs}\hline \end{rndtable} %\end{table} %\blindtext[10] \end{document} This code works and generates the tabular I have just show. HOWEVER, apparently when I include the \begin{table} the size of the table is not recognized at all. If I would put text around the table (by uncommenting blindtext and begin{table}) it is running over the table. My suspicion is that it has to to with either the overlay option or that I use the savebox. Unfortunately I am not able to solve this. It looks like this: Who knows how I can fix this script such that I can use it properly within a table environment ? Any hints appreciated! Regards Eelco EDIT: The suggestion by Marmot about removing the overlay and useasboundingbox works. Now at least a tabular is nicely put into the table environment. however: a new problem arises; when I want to include two or more tables, somehow every time I run the code the tables get another position. For instance, you can do \blindtext[1] \begin{table}[tbp] \caption{First table} \begin{rndtable}{Llr} \rowcolor{white} \tikzmark{A} \textbf{Label} & \textbf{Naam} & \textbf{Leeftijd}\\ \arrayrulecolor{lichtgrijs} \hline GK & Paul Robinson & 45\\ MC & Jody Morris & 75\\ FW & Jamie McMaster & 13\\ ST & Alan Smith & 70\\ ST & Mark Viduka & 30\\ \arrayrulecolor{lichtgrijs}\hline \end{rndtable} \end{table} \blindtext[1] \begin{table}[tbp] \caption{Another table} \begin{rndtable}{Llr} \rowcolor{white} \tikzmark{A} \textbf{Label} & \textbf{Naam} & \textbf{Leeftijd}\\ \arrayrulecolor{lichtgrijs} \hline GK & Paul Robinson & 45\\ LB & Lucus Radebe & 23\\ DC & Michael Duberry & 84\\ MC & Jody Morris & 75\\ FW & Jamie McMaster & 13\\ ST & Alan Smith & 70\\ ST & Mark Viduka & 30\\ \arrayrulecolor{lichtgrijs}\hline \end{rndtable} \end{table} \blindtext[1] \begin{table}[tbp] \caption{Last table} \begin{rndtable}{Llr} \rowcolor{white} \tikzmark{A} \textbf{Label} & \textbf{Naam} & \textbf{Leeftijd}\\ \arrayrulecolor{lichtgrijs} \hline GK & Paul Robinson & 45\\ LB & Lucus Radebe & 23\\ DC & Michael Duberry & 84\\ MC & Jody Morris & 75\\ FW & Jamie McMaster & 13\\ ST & Alan Smith & 70\\ ST & Mark Viduka & 30\\ \arrayrulecolor{lichtgrijs}\hline \end{rndtable} \end{table} This will indeed make three tables, each in its own environment, but they get another location every time I run the code. Also the aux file changes with every run. Probably this has to do with those global vars XCoord and YCoord I use, combined with the savebox trick. But I need those to be able to find the location of the upper row and clip it properly. So this solution I came up with is still not usable. Anybody knows how to solve this? EDIT2: The suggestion by Marmot to leave out the ExtractCoordinate line does not work as I need it to get the location of the bottom of the first row. I found this example here add tikznode at corner and here extract y coordinate If I leave out ExtractCoordinate (as suggested by Marmot), the table looks like this: As you can see, the upper rounded corners now always is exactly half way the table. It should be at the bottom of the first row (with the title columns). Indeed, if I leave out this line with ExtractCoordinate, it fixes the problem of the jumping tables. But then I would need an alternative way to extract the ycoordinate from my tikzmark A. Any idea? EDIT3: At this point I almost got the example above working: the only thing it requires is to find an alternative way to extract the y coordinate of the tikzmark, since the trick with ExtractCoordinate is messing up the tables. But just to be complete, I have also an alternative approach for making tables like this which is based on this idea tabular with rounded corners My code looks like this: \documentclass{article} \usepackage[dvipsnames,table]{xcolor} \usepackage{array} \usepackage{blindtext} \usepackage{tikz} \usepackage{etex} \usepackage[most]{tcolorbox} \usepackage{tabularx} \usetikzlibrary{calc, tikzmark} \definecolor{lichtgrijs}{RGB}{236,236,236} \newcolumntype{L}{>{\columncolor{lichtgrijs}}l} \newcolumntype{Y}{>{\raggedleft\arraybackslash}X} \newtcolorbox{twocoltable}[4][]{% tabularx*={\renewcommand{\arraystretch}{1.2}}% {>{\columncolor{lichtgrijs}\hsize=#3\linewidth}X>{\hsize=#4\linewidth}Y}, enlarge top initially by=1.5em, enlarge bottom finally by=0em, enhanced, fontupper=\footnotesize, breakable, colframe=lichtgrijs, colback=white, arc=1mm, outer arc=1mm, clip upper, rightrule=0pt, sharp corners=east, width=1\linewidth, overlay=% { \node[anchor=south east] (ycoltit) at % ([xshift=-0cm, yshift=0.0\baselineskip]frame.north east)% {{\footnotesize\textbf{#2}}}; }, #1 } \begin{document} \blindtext \begin{table}[tbp] \caption{Last table} \begin{twocoltable}% {\textbf{Leeftijd}}{0.8}{0.2} Paul Robinson & 45\\ Lucus Radebe & 23\\ Michael Duberry & 84\\ Jody Morris & 75\\ Jamie McMaster & 13\\ Alan Smith & 70\\ Mark Viduka & 30\\ \end{twocoltable} \end{table} \blindtext \end{document} and the result looks like this The only problem is that I need to add the column titles explicitly using the overlay inside newtcolorbox, which I don't like since I fix the number of columns in the definition (in this case two columns only). But this was the only way to get the column title above the line with the rounded corners. I case somebody knows a better way of doing this, it would be great as well EDIT4: Ignasis answer is the best so far. Still I was trying to vary some formats of the table which I know I am going to need, such as fixing the width of the column. The example I tried look like this \begin{table} \centering \begin{tikzpicture} \matrix[mymatrix, column 3/.style={nodes={anchor=center}}, column 4/.style={nodes={anchor=east}, text width=2cm}] (A) { Label & Naam & Leeftijd & Length in centimeters\\ MC & Jody Morris & 75 & 174\\ FW & Jamie McMaster & 13 & 184\\ ST & Alan Smith & 70 & 150\\ ST & Mark Viduka & 30 & 190\\ }; \tableback{A}{5}{4} \end{tikzpicture} \caption{Shorter on} \end{table} The result looks like this As you can see, the column at the east is not aligned to the right anymore, and also to first row with the title should align with the bottom of the row. Any idea how to fix this? EDIT 5: In parallel with the solution of Ignasis with the matrix environment I have tried to fix my first attempt using the savebox. As Marmot pointed out I need to get rid of the ExtractCoord. This is what I did. My solution now looks like this \documentclass{article} \usepackage[dvipsnames,table]{xcolor} \usepackage{array} \usepackage{environ} \usepackage{blindtext} \usepackage{tikz} \usepackage{etex} % required for savebox %\usetikzlibrary{calc, tikzmark} \usetikzlibrary{tikzmark} \definecolor{lichtgrijs}{RGB}{236,236,236} \newcolumntype{L}{>{\columncolor{lichtgrijs}}l} %\renewcommand{\tikzmark}[2][]{% % \tikz[remember picture,overlay]\coordinate[#1](#2);% %} % \NewEnviron{rndtable}[2][\tablebox]{% \addtolength{\extrarowheight}{1ex}% \def\locbox{#1} \savebox{\locbox}{% \begin{tabular}{#2}% \BODY% \end{tabular}}% \begin{tikzpicture} [remember picture] \def\radius{1mm}; \edef\RowDepth{\the\dimexpr\arraystretch\dimexpr.3\baselineskip\relax\relax} \coordinate (southwest) at (0,-\dp\locbox); \coordinate (southeast) at (\wd\locbox,-\dp\locbox); \coordinate (northeast) at (\wd\locbox,\ht\locbox); \coordinate (northwest) at (0,\ht\locbox); \coordinate (Pt) at ([xshift=\radius]northwest); \coordinate (A) at (pic cs:A); \coordinate (cellborder) at ([yshift=-\RowDepth]A); \coordinate (Pb) at (cellborder -| Pt); \coordinate (west) at (Pb -| northwest); \begin{scope} \clip[rounded corners=\radius] (southwest) -- (southeast) -- (northeast) { % make straight corners for the cutout [rounded corners=0ex]-- (Pt) -- (Pb) }-- (west) -- cycle; \node at (0,-\dp\locbox) [anchor=south west,inner sep=0pt]{\usebox{\locbox}}; % debugging circels %\draw[red, fill] (Pt) circle[radius=2pt]; %\draw[green, fill] (A) circle[radius=2pt]; %\draw[blue, fill] (cellborder) circle[radius=2pt]; %\draw[yellow, fill] (Pb) circle[radius=2pt]; %\draw[orange, fill] (west) circle[radius=2pt]; \end{scope} \end{tikzpicture} } \begin{document} \setlength\arrayrulewidth{1.2pt} \blindtext[1] \newsavebox{\tablebox} \begin{table}[tbp] \caption{First table} \begin{rndtable}[\tablebox]{Llr} \rowcolor{white} \tikzmark{A} \textbf{Label} & \textbf{Naam} & \textbf{Leeftijd}\\ \arrayrulecolor{lichtgrijs} \hline GK & Paul Robinson & 45\\ MC & Jody Morris & 75\\ FW & Jamie McMaster & 13\\ ST & Alan Smith & 70\\ ST & Mark Viduka & 30\\ \arrayrulecolor{lichtgrijs}\hline \end{rndtable} \end{table} \blindtext[1] \newsavebox{\otherbox} \begin{table}[tbp] \caption{Second table} \begin{rndtable}[\otherbox]{Llr} \rowcolor{white} \tikzmark{A} \textbf{Label} & \textbf{Naam} & \textbf{Leeftijd}\\ \arrayrulecolor{lichtgrijs} \hline GK & Paul Robinson & 45\\ MC & Jody Morris & 75\\ FW & Jamie McMaster & 13\\ ST & Alan Smith & 70\\ ST & Mark Viduka & 30\\ \arrayrulecolor{lichtgrijs}\hline \end{rndtable} \end{table} \blindtext[1] \end{document} For one table this works fine again. For two tables LaTeX keeps getting two alternating solutions for the table positions: one with the two tables at one page, one with the two tables as separate pages. I think it has to do with the savebox, that why I tried to add an extra parameter such that I can define a savebox for every table. Unfortunately this does not work. If I compare the aux files of two subsequent runs of xelatex, a diff on both files will show the following output: 9,13c9,13 < \@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Second table}}{1}} < \savepicturepage{pgfid3}{1} < \pgfsyspdfmark {pgfid3}{9192734}{33349459} < \savepicturepage{pgfid4}{1} < \pgfsyspdfmark {pgfid4}{8799518}{30733844} --- > \@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Second table}}{2}} > \savepicturepage{pgfid3}{2} > \pgfsyspdfmark {pgfid3}{9192734}{41880784} > \savepicturepage{pgfid4}{2} > \pgfsyspdfmark {pgfid4}{8799518}{39265169} The third run will have an aux file equal to the first run again. If this can be solved I prefer this solution above all since it makes use of a original tabular environment. If it cannot be solved I will fall back on the matrix solution, which is a great alternative
- Rotate 3D plot to top down viewby 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 pgfplotby 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 cornersby Á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 footerby 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 beamerby 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.