Hot
- How can you draw more than three intersecting planes which are bounded by a cube, in a 2D software such as TikZ?by Jasper on November 27, 2025 at 6:13 am
In this old answer of mine, I used Asymptote to diagram numerous intersecting planes bound by a cube: https://tex.stackexchange.com/a/733960/319072. I want to be able to do this in TikZ or MetaPost. There are solutions for two or three intersecting planes, but I haven't found one which handles more than three. That is the goal of this question. How can you draw more than three intersecting planes which are bounded by a cube, in a 2D software? (The real goal of this question is to share this achievement, and to inspire others in the community to take a stab at this, possibly with different techniques, hence my self-answer.) MWE: unitsize(1cm); import three; import graph3; // Function to sort points based on the angle with the centroid triple[] sort_points(triple[] points) { triple centroid = (0, 0, 0); for (int i = 0; i < points.length; ++i) { centroid += points[i]; } centroid /= points.length; real[] angles; for (int i = 0; i < points.length; ++i) { angles.push(atan2(points[i].y - centroid.y, points[i].x - centroid.x)); } for (int i = 0; i < points.length; ++i) { for (int j = i + 1; j < points.length; ++j) { if (angles[i] > angles[j]) { real temp_angle = angles[i]; angles[i] = angles[j]; angles[j] = temp_angle; triple temp_point = points[i]; points[i] = points[j]; points[j] = temp_point; } } } return points; } void draw_plane( triple normal_vector ,triple point_on_plane ,real xmin = -5 ,real xmax = 5 ,real ymin = -5 ,real ymax = 5 ,real zmin = -5 ,real zmax = 5 ,pen thecolor = white ,real theopacity = 0.3 ,bool drawthebox = false ) { if (drawthebox) { draw(box((xmin,ymin,zmin), (xmax,ymax,zmax))); } real a = normal_vector.x; real b = normal_vector.y; real c = normal_vector.z; real d = dot(normal_vector, point_on_plane); real x(real y, real z) { return (((d)-((b)*(y))-((c)*(z)))/(a)); } real y(real x, real z) { return (((d)-((a)*(x))-((c)*(z)))/(b)); } real z(real x, real y) { return (((d)-((a)*(x))-((b)*(y)))/(c)); } if (a==0 && b==0 && c==0) { draw( surface( (xmin,ymin,zmin) -- (xmax,ymin,zmin) -- (xmax,ymax,zmin) -- (xmin,ymax,zmin) -- cycle ) ,thecolor+opacity(theopacity) ); draw( surface( (xmin,ymin,zmax) -- (xmax,ymin,zmax) -- (xmax,ymax,zmax) -- (xmin,ymax,zmax) -- cycle ) ,thecolor+opacity(theopacity) ); draw( surface( (xmin,ymin,zmin) -- (xmax,ymin,zmin) -- (xmax,ymin,zmax) -- (xmin,ymin,zmax) -- cycle ) ,thecolor+opacity(theopacity) ); draw( surface( (xmin,ymax,zmin) -- (xmax,ymax,zmin) -- (xmax,ymax,zmax) -- (xmin,ymax,zmax) -- cycle ) ,thecolor+opacity(theopacity) ); draw( surface( (xmin,ymin,zmin) -- (xmin,ymax,zmin) -- (xmin,ymax,zmax) -- (xmin,ymin,zmax) -- cycle ) ,thecolor+opacity(theopacity) ); draw( surface( (xmax,ymin,zmin) -- (xmax,ymax,zmin) -- (xmax,ymax,zmax) -- (xmax,ymin,zmax) -- cycle ) ,thecolor+opacity(theopacity) ); } // yz planes if (a!=0 && b==0 &&c==0) { if (xmin<=d/a && d/a<=xmax) { draw( surface( (x(ymin,zmin),ymin,zmin) -- (x(ymax,zmin),ymax,zmin) -- (x(ymax,zmax),ymax,zmax) -- (x(ymin,zmax),ymin,zmax) -- cycle ) ,thecolor+opacity(theopacity) ); } } // xz planes if (a==0 & b!=0 & c==0) { if (ymin<=d/b && d/b<=ymax) { draw( surface( (xmin,y(xmin,zmin),zmin) -- (xmax,y(xmax,zmin),zmin) -- (xmax,y(xmax,zmax),zmax) -- (xmin,y(xmin,zmax),zmax) -- cycle ) ,thecolor+opacity(theopacity) ); } } // xy planes if (a==0 && b==0 & c!=0) { if (zmin<=d/c && d/c<=zmax) { draw( surface( (xmin,ymin,z(xmin,ymin)) -- (xmax,ymin,z(xmax,ymin)) -- (xmax,ymax,z(xmax,ymax)) -- (xmin,ymax,z(xmin,ymax)) -- cycle ) ,thecolor+opacity(theopacity) ); } } // y of x planes (invariant over z) if (a!=0 && b!=0 && c==0) { real xylower = xmin; if (ymax < y(xmin,0)) { xylower = x(ymax,0); } if (y(xmin,0) < ymin) { xylower = x(ymin,0); } real xyupper = xmax; if (ymax < y(xmax,0)) { xyupper = x(ymax,0); } if (y(xmax,0) < ymin) { xylower = x(ymin,0); } if (!(xylower<xmin || xmax<xylower) && !(xyupper<xmin || xmax<xyupper)) { draw( surface( (xylower,y(xylower,0),zmin) -- (xyupper,y(xyupper,0),zmin) -- (xyupper,y(xyupper,0),zmax) -- (xylower,y(xylower,0),zmax) -- cycle ) ,thecolor+opacity(theopacity) ); } } // z of x planes (invariant over y) if (a!=0 && b==0 && c!=0) { real xzlower = xmin; if (z(xmin,0)<zmin) { xzlower = x(0,zmin); } if (zmax<z(xmin,0)) { xzlower = x(0,zmax); } real xzupper = xmax; if (z(xmax,0)<zmin) { xzupper = x(0,zmin); } if (zmax<z(xmax,0)) { xzupper = x(0,zmax); } if (!(xzlower<xmin || xzlower>xmax) && !(xzupper<xmin || xzupper>xmax)) { draw( surface( (xzlower,ymin,z(xzlower,0)) -- (xzupper,ymin,z(xzupper,0)) -- (xzupper,ymax,z(xzupper,0)) -- (xzlower,ymax,z(xzlower,0)) -- cycle ) ,thecolor+opacity(theopacity) ); } } // z of y planes (invariant over x) if (a==0 && b!=0 && c!=0) { real yzlower = ymin; if (z(0,ymin)<zmin) { yzlower = y(0,zmin); } if (zmax<z(0,ymin)) { yzlower = y(0,zmax); } real yzupper = ymax; if (z(0,ymax)<zmin) { yzupper = y(0,zmin); } if (zmax<z(0,ymax)) { yzupper = y(0,zmax); } if (!(yzlower<ymin || yzlower>ymax) && !(yzupper<ymin || yzupper>ymax)) { draw( surface( (xmin,yzlower,z(0,yzlower)) -- (xmin,yzupper,z(0,yzupper)) -- (xmax,yzupper,z(0,yzupper)) -- (xmax,yzlower,z(0,yzlower)) -- cycle ) ,thecolor+opacity(theopacity) ); } } // Intersection points array triple[] intersections; // Calculate intersections with x, y, z bounds void add_intersection(real x, real y, real z) { if (xmin <= x && x <= xmax && ymin <= y && y <= ymax && zmin <= z && z <= zmax) { intersections.push((x, y, z)); } } // Add intersections with the six planes of the rectangular prism for (real y = ymin; y <= ymax; y += ymax - ymin) { for (real z = zmin; z <= zmax; z += zmax - zmin) { add_intersection(x(y, z), y, z); } } for (real x = xmin; x <= xmax; x += xmax - xmin) { for (real z = zmin; z <= zmax; z += zmax - zmin) { add_intersection(x, y(x, z), z); } } for (real x = xmin; x <= xmax; x += xmax - xmin) { for (real y = ymin; y <= ymax; y += ymax - ymin) { add_intersection(x, y, z(x, y)); } } // Sort intersections intersections = sort_points(intersections); // Initialize plane_outline with the first intersection point path3 plane_outline; if (intersections.length > 0) { plane_outline = (intersections[0]); } // Convert intersections to a path for (int i = 1; i < intersections.length; ++i) { plane_outline = plane_outline -- intersections[i]; } // Close the path if we have enough points if (intersections.length >= 3) { plane_outline = plane_outline -- cycle; } // Draw the outline of the clipped plane if (intersections.length >= 3) { draw(surface(plane_outline), thecolor + opacity(theopacity)); } } void draw_plane_test() { // (a==0 && b==0 && c==0) // draw_plane( // (0,0,0) // ,(0,0,0) // ,thecolor=blue // ,theopacity=0.1 // ,drawthebox=true // ); // (a!=0 && b==0 && c==0) // draw_plane( // (-2,0,0) // ,(-1,-1,-1) // ,thecolor=red // ); // draw_plane( // (3,0,0) // ,(3,2,1) // ,thecolor=red // ); // (a==0 && b!=0 && c==0) // draw_plane( // (0,2,0) // ,(2,-2,2) // ,thecolor=blue // ); // draw_plane( // (0,-3,0) // ,(1,5,2) // ,thecolor=blue // ); // (a==0 && b==0 && c!=0) // draw_plane( // (0,0,1) // ,(2,-2,2) // ,thecolor=green // ); // draw_plane( // (0,0,-2) // ,(1,5,1) // ,thecolor=green // ); // (a!=0 && b!=0 && c==0) // draw_plane( // (1,2,0) // ,(3,3,3) // ,thecolor=red // ,drawthebox=true // ); // draw_plane( // (-1,2,0) // ,(3,3,3) // ,thecolor=red // ); // draw_plane( // (20,-3,0) // ,(-3,-2,-4) // ,thecolor=red // ); // (a!=0 && b==0 && c!=0) // draw_plane( // (-2,0,3) // ,(0,0,0) // ,thecolor=green // ,drawthebox=true // ); // draw_plane( // (-4,0,-3) // ,(2,2,2) // ,thecolor=green // ,drawthebox=true // ); // draw_plane( // (4,0,30) // ,(-2,3,-2) // ,thecolor=green // ,drawthebox=true // ); // (a==0 && b!=0 && c!=0) // draw_plane( // (0,-2,3) // ,(0,0,0) // ,thecolor=blue // ,drawthebox=true // ); // draw_plane( // (0,-4,-3) // ,(2,2,2) // ,thecolor=blue // ,drawthebox=true // ); // draw_plane( // (0,4,30) // ,(3,-2,-2) // ,thecolor=blue // ,drawthebox=true // ); // (a!=0 && b!=0 && c!=0) draw_plane( (2,2,2) ,(-3,4,1) ,thecolor=red ,drawthebox=true ); draw_plane( (-2,-3,1) ,(-3,4,1) ,thecolor=green ); draw_plane( (-2,-3,1) ,(3,3,-1) ,thecolor=blue ); } draw_plane_test();
- reformattting a Chicago-style biblatex podcast footnote citation?by Paul on November 27, 2025 at 12:07 am
I've tried different ways to get podcast citations to appear properly in Chicago style, as in Rand, Paul. ``Do Animals Dream? with David M. Peña-Guzmán." Produced by the University of Chicago Podcast Network. Big Brains, podcast, 33:26, July 21, 2022. https://news.uchicago.edu/do-animals-dream-david-m-pena-guzman. I've tried various types: @online, @audio, @misc in various permutations. @audio comes closest, but omits the url, and does not put the producer where desired. I've tried to figure out how to rewrite the cbx style file but am getting hopelessly lost. Help? MWE: \documentclass{article} \usepackage[notes,isbn=false,doi=false,url=false,backend=biber]{biblatex-chicago} \begin{filecontents}[overwrite]{\jobname.bib} @audio{randAnimalsDreamDavid2022a, entrysubtype = {podcastepisode}, title = {Do {{Animals Dream}}? With {{David M}}. {{Peña-Guzmán}}}, shorttitle = {Do {{Animals Dream}}?}, maintitle = {Big Brains}, namea = {Rand, Paul}, nameatype = {host}, eventdate = {2022-07-21}, publisher = {University of Chicago Podcast Network}, note = {Podcast, 33:26,}, format = {podcast}, length = {33:26}, url = {https://news.uchicago.edu/do-animals-dream-david-m-pena-guzman}, urldate = {2025-09-05}, abstract = {Scholar explores the science behind animal consciousness}, langid = {english} } \end{filecontents} \addbibresource{\jobname.bib} \begin{document} Foo\autocite{randAnimalsDreamDavid2022a} \end{document}
- TikZ word search diagramby yannis on November 26, 2025 at 11:50 pm
How can I draw such a "word-search" diagram in TikZ? I need to place the letters on a grid and then to add red horizontal, vertical, diagonal or antidiagonal highlighting boxes as in the picture.
- How to customize CircuiTikz ac - dc symbolsby Anisio Braga on November 26, 2025 at 8:12 pm
The ac & dc symbols in Circuitikz are a much welcomed addition. However, I could not find a proper way customize it to a typical application in a multimeter dial with the ac or dc symbol positioned above the letter, besides changing the thickness of the lines. How can this be done with the new ac and dc symbols used in the didactic multimeter in the following code. \documentclass[10pt]{article} \usepackage[usenames]{color} %used for font color \usepackage[utf8]{inputenc} %useful to type directly diacritic characters \usepackage[siunitx,american, RPvoltages]{circuitikz} \usetikzlibrary{positioning,fit} \usepackage{physics} \usepackage{ifthen} \usepackage{xcolor} \usepackage{xargs} % for using extra optional arguments % Defining Matlab default colors with portuguese names to avoid conflicts \definecolor{lara}{rgb}{0.8500 0.3250 0.0980} \definecolor{azul}{rgb}{0.0000 0.4470 0.7410} \definecolor{verm}{rgb}{1.0000 0.3100 0.3900} \definecolor{amar}{rgb}{0.9290 0.6940 0.1250} \definecolor{roxo}{rgb}{0.4940 0.1840 0.5560} \definecolor{verd}{rgb}{0.4660 0.6740 0.1880} \definecolor{azcl}{rgb}{0.3010 0.7450 0.9330} \definecolor{marr}{rgb}{0.6350 0.0780 0.1840} \definecolor{ouro}{rgb}{0.9961 0.6667 0.2275} %-------------------- % Definitions to help locate nodes. Comment out the second definition when done! \def\coord(#1){coordinate(#1)} %\def\coord(#1){node[circle, inner sep=1pt,pin={[teal, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.3cm, pin edge={teal, line width=0.5pt, shorten <=-2pt, {Kite[length=1.5mm]}-{Circle[open,line width=0.5pt,length=0.75mm]}}]45:#1}](#1){}coordinate(#1)} \newcommandx{\probe}[7][1=red, 3=45:0.5, 5=$+$, 6=0.25pt, 7=5pt] %[color]{x,y}[angle:radius]{name}[label][line width][-Kite length] {\draw[#1, line width = #6,-{Kite[length=#7]}] ($(#2)+(#3)$) node[circle, very thin, inner sep=0pt, minimum size=5pt, draw=#1, fill=#1!10,font=\tiny](#4){#5} to (#2); } % DC and AC symbols \newcommand{\mathdirectcurrent}{\mathrel{\mathpalette\mathdirectcurrentinner\relax}} \newcommand{\mathdirectcurrentinner}[1]{% \settowidth{\dimen0}{$#1=$}% \vbox to .75ex {\offinterlineskip \hbox to \dimen0{\leaders\hrule height 0.65pt \hfill} \vskip.25ex \hbox to \dimen0{% \leaders\hrule height 0.35pt \hskip.25\dimen0\hfill \leaders\hrule height 0.35pt \hskip.25\dimen0\hfill \leaders\hrule height 0.35pt \hskip.25\dimen0 } \vfill }% } \newcommand{\textdirectcurrent}{\mathdirectcurrentinner{\textstyle}{}} %----------------------------------------- \newcommand{\DCACsup}[1]{$\widetilde{\stackrel{\mathdirectcurrentinner{}}{\rm #1}}$} \newcommand{\DCsup}[1]{$\stackrel{\mathdirectcurrentinner{}}{\rm #1}$} \begin{document} %->/Multimeters \scalebox{1}{% % ---- Multimeter ------------- \tikzset{pics/Multimeter/.style={code={ \tikzset{Multimeter/.cd,#1} \def\pv##1{\pgfkeysvalueof{/tikz/Multimeter/##1}}% local object variable %------------------------------ \def\mmw{1*2} % width \def\mmh{1.6*2} % height %---------- \path (0,0) \coord(-MM0); \draw[\pv{body border}, thin, fill=\pv{body border}, rounded corners=1mm] (0,0) rectangle (\mmw,\mmh); \draw[\pv{body border}, thin, fill=\pv{body},opacity=0.75, rounded corners=1mm] ($(-MM0)+(0.05*\mmw,0.05*\mmw)$) rectangle (0.95*\mmw,\mmh-0.05*\mmw); % --- nodes for tag positioning %--- display \draw[gray,fill=gray!10,rounded corners=0.5mm] ($(-MM0)+(0.1*\mmw,0.7*\mmh)$)\coord(MMdisplay0) rectangle (0.9*\mmw,0.925*\mmh) \coord(MMdisplay1); %--- Displayed value \node[left, align=right,rotate=0] at ($(MMdisplay1)+(0.05*\mmw,-0.11*\mmh)$) {\large \pv{value}}; %--- center dial \draw[gray!80!\pv{body},thick,very thin, fill=white] ($(-MM0)+(0.5*\mmw,0.45*\mmh)$)\coord(-MM0center) circle[radius=0.25*\mmw]; \node at (-MM0center) {}; \foreach \x/\y in {-45/mA,0/$\widetilde{\mathrm{A}}$,45/$\stackrel{\mathdirectcurrentinner{}{}}{\mathrm{A}}$,90/$\Omega$,135/ $\stackrel{\mathdirectcurrentinner{}{}}{\mathrm{V}}$,180/ $\widetilde{\mathrm{V}}$,-135/{\textsf{OFF} \qquad}} { \draw (-MM0center) ++ (\x:0.325*\mmw) node[blue] {\tiny \y};} \foreach \x in {-45,0,45,90,135,180,-135} \draw (-MM0center) ++ (\x:0.25*\mmw) -- ++(\x:0.025); % \draw[line width = 1.5mm, black!50,->,-{Kite[length=3mm,width=2mm]}] (-MM0center) -- ++ (225-\pv{dial}*45:0.24*\mmw); \draw[line width = 1.5mm, black!50,->,-{Triangle Cap[length=1.75mm]}] (-MM0center) -- ++ (225-\pv{dial}*45:0.24*\mmw); \draw[line width = 1.5mm, black!50, -Round Cap] (-MM0center) -- ++ (225-\pv{dial}*45:-0.24*\mmw); \draw[gray!70!black,thick, fill=gray] (-MM0center) circle[radius=1mm]; %--- tag \node at ($(-MM0center)+(\pv{tag pos})$){\pv{tag}}; %--- bornes % \draw[black,very thin, fill=gray] ($(-MM0)+(0.5*\mmw,0.25*\mmw)$)\coord(-COM) circle[radius=0.1]; \node [bnc,thick, color=black, anchor=zero, rotate=\pv{COMout}, scale=1](COMbnc) at ($(-MM0)+(0.5*\mmw,0.2*\mmw)$){}; \path (COMbnc.center) \coord(-COM); \ifthenelse{\equal{\pv{ampere}}{on}}{ % amperimeter probe on % \draw[red!30!black,very thin, fill=red] ($(-MM0)+(0.2*\mmw,0.25*\mmw)$) \coord(-Aprobe) circle[radius=0.1]; \node [bnc, color=red,thick, anchor=zero, rotate=\pv{Aout}, scale=1](Abnc) at ($(-MM0)+(0.2*\mmw,0.2*\mmw)$){}; \path (Abnc.center) \coord(-A); % \draw[thick,-{Triangle[width=1.5mm,length=1.75mm, sep=1*\mmw mm]Circle[length=0.1mm]},gray] (Abnc.zero) -- (COMbnc.zero); \draw[thick,-{Triangle[width=1.5mm,length=1.75mm]},gray!50!black, opacity = \pv{current} ] (Abnc.zero) -- ($ (Abnc.zero) !0.65!(COMbnc.zero)$); \draw[thick,gray!50!black, opacity = \pv{current} ] ($ (Abnc.zero) !0.6!(COMbnc.zero)$) -- (COMbnc.zero); \node[above=0.1, align=center,font=\tiny] at (Abnc.zero){\textbf{A}}; }{} \ifthenelse{\equal{\pv{volt}}{on}}{%voltmeter or ohmeter % \draw[red!30!black,very thin, fill=red] ($(-MM0)+(0.8*\mmw,0.25*\mmw)$)\coord(-Vprobe) circle[radius=0.1]; \node [bnc, color=red,thick, anchor=zero, rotate=\pv{Vout}, scale=1](Vbnc) at ($(-MM0)+(0.8*\mmw,0.2*\mmw)$){}; \path (Vbnc.center) \coord(-V); }{} \ifthenelse{\equal{\pv{ohm}}{on}}{%ohmmeter \node [bnc, color=red,thick, anchor=zero, rotate=\pv{Vout}, scale=1](Vbnc) at ($(-MM0)+(0.8*\mmw,0.2*\mmw)$){}; \path (Vbnc.center) \coord(-V); \draw[thick,-{Bar[width=1mm]},gray!50!black, opacity = \pv{battery}] (COMbnc.zero) -- ($ (COMbnc.zero) !0.5!(Vbnc.zero)$); \draw[thick,{Bar[width=3mm]}-,gray!50!black, opacity = \pv{battery}]($ (COMbnc.zero) !0.6!(Vbnc.zero)$) -- (Vbnc.zero); }{} \node[above=0.1, align=center,font=\tiny] at (Vbnc.zero){\textbf{V$\Omega$}}; \node[above=0.1, align=center,font=\tiny] at (COMbnc.zero){\textsf{\textbf{COM}}}; %--------------------- } % end of code }, % end of style Multimeter/.cd, tag/.initial= $V_{AB}$, tag pos/.initial= 90:2, % distancing vector from center value/.initial= $1.0^{\mathrm{mA}}$, body/.initial=yellow, body border/.initial=orange, Vout/.initial= -90, % volt bnc angle Aout/.initial = -90, % ampere bnc angle COMout/.initial= -90, % COM bnc angle text width/.initial = 1.5cm, dial/.initial = 6,% 0=OFF, 1=V~, ..., 6=mA ampere/.initial= on, % To connect an ammeter set the volt=off volt/.initial= on, ohm/.initial= off, current/.initial= 1, % current arrow opacity: 0 < current < 1 battery/.initial= 0, % ohmmeter battery opacity: 0 < battery < 1 } % End of multimeter %=======================================% \begin{circuitikz}[scale=1, transform shape,transform canvas={scale=1} ] \ctikzset{resistors/scale=0.7} \ctikzset{open voltage position=legacy} \def\dx{3} \def\dy{3} % --- circuit \draw (0,0)\coord(gnd) to[battery,v_=\SI{1}{\volt},*-] ++(0,1.25*\dy)\coord(A) to[short, f<=\color{azul}$I_1$, color=azul] ++(1.5*\dx,0)\coord(B) to[R,l=\SI{1}{\kilo\ohm},-] ++(0,-1.25*\dy) \coord(C) to[open,*-*] (gnd)node[ground]{}; % ---- Positioning probes ---- \probe[gray!50!black]{C}[180:0.75]{An}[$-$][2pt][10pt] \node [above right, font=\footnotesize] at (An){$0$V}; \probe[verm]{gnd}[0:0.75]{Ap}[$+$][2pt][10pt] % ---- voltmeter ---- \pic[scale=1,transform shape, rotate=0] (M1) at ($(gnd)+(-3.5,0)$) {Multimeter={tag=$V_{AC}$,dial=2,ampere=off, value= $1.00^{\mathrm{V}}$, Vout=0,body=red!10,body border=red!50!black}}; \probe[verm]{A}[180:0.75]{Av}[$+$][2pt][10pt] \probe[gray!50!black]{gnd}[180:0.75]{Cv}[$-$][2pt][10pt] \draw[line width = 1.5pt, red] (M1-V) to[out=0, in=180] (Av); \draw[line width = 1.5pt, black] (M1-COM) to[out=-90, in=180] (Cv); \pic[scale=1,transform shape, rotate=0] (M1) at ($(gnd)+(1.5,0)$) {Multimeter={value=$-1.0^{\mathrm{mA}}$, tag=$I_{1}$, dial=6, ampere=on, ohm=on,Aout=-90, Vout=-90,COMout=-90}}; \draw[line width = 1.5pt, red] (M1-A) to[out=-90, in=0] (Ap); \draw[line width = 1.5pt, black] (M1-COM) to[out=-90, in=180] (An); %\node at (0,-3)[dc symbol,dc symbol/height=2},dc symbol segments=3]{V}; \end{circuitikz} %---------------- }% --- End Scalebox --- \end{document}
- macTeX suddenly installs a lot of updates and takes huge disk spaceby F'x on November 26, 2025 at 7:10 pm
I've been using macTeX for many years, installing the new version each year, and updating (with tlmgr update --all) about every two weeks. Every time, it updates a few dozen packages. But about two weeks ago, the update command decided to update several hundred packages. I was in a hurry, so I said yes, and though maybe I had forgotten to update for a long time. But today I run another update, and it updated 459 packages. I wondered what happened, and I looked at my /usr/local/texlive/2025/texmf-dist, and now it's whooping 8.6 GB. I don't have a number for before, but all info I find online says it should be a few GB, not that much. So, in that context: how can I check the logs of past updates, see how many packages were updated each time? has something changed in the last few months about texlive updates?
- LaTeX not properly tagging links that appear in headersby Kit Scriven on November 26, 2025 at 6:59 pm
I am producing a tagged pdf, and I'm trying to put a hyperlink in the header using fancyhdr. \DocumentMetadata{pdfstandard = ua-2, pdfversion = 2.0, tagging = on} \tagpdfsetup{table-header-rows=1} \documentclass[10pt]{article} \usepackage{hyperref,fancyhdr} \pagestyle{fancy} \lhead{\href{https://www.wikipedia.org}{Wikipedia}} \begin{document} Foo bar. \end{document} This produces an error when checking with VeraPDF: "A link annotation and its associated content shall be enclosed in either a Link or Reference structure element". This error does not occur when the reference appears in the main body. Is there a way to fix this? Thanks.
- Adjust Vertical Spacing in Forest / Prooftreesby pgregory on November 26, 2025 at 5:31 pm
I am struggling with the vertical spacing in these truth trees. In the attached image, grouped formulas are closer together than a formula and the space created by a branch. This is particularly evident comparing lines 2 and 3 to 3 and the space between it and 4. Or the space between 12 and 13 vs. 13 and 14. The second image gives a simplified view of what I am talking about: the red distance is slightly greater than the green distance. I provide the code for the simpler tree. Is there a way to slightly increase the space between grouped formulas and/or decrease the vertical space of the branches? It would be nice if the height of a line with a formula were equal to the height of the unnumbered space where a branch sits. Thanks, PG \documentclass{article} \usepackage{prooftrees} \begin{document} \begin{prooftree} { single branches, for tree={draw}, } [B [B [B, grouped [B [B, grouped [B, grouped [B, grouped [B, grouped [B ] ] ] ] ] ] ] ] ] \end{prooftree} \end{document}
- How to make \left and \right strictly increase the size of the delimiter (as opposed to finding minimal size)by math2001 on November 26, 2025 at 4:52 pm
In this code, \begin{align*} \left[\left(foo\right)\right] \end{align*} I would like to make the [ and ] strictly larger than ( and ). Right now, latex finds the minimal size, which means they are the same size. My problem is that I am writing process algebra like this: (C || (A || B) \ a) \ bc \ has higher precedence than || (ie. (C || ((A || B) \ a)) \ bc). I would like the second || to be the smallest, then the first \ slightly larger, then the first || slightly larger, then the second \ largest. Here is an exaggerated drawing. The goal is that I can should be able to remove the brackets, and based on the size of the operators, the reader can tell where the brackets should go. \middle should not increase the size. Eg. in (A || B || C) \ e, the || should all have the same size.
- TeX Live 2025 shows \ac / \cref warnings but TeX Live 2024 doesn'tby jonnybolton16 on November 26, 2025 at 4:07 pm
Combining the acronym package with tableofcontents and other lists can cause unexpected behaviour if acronyms are used in headings (and captions etc). The compiler sees the list as the first time the acronym is used and expands it there, instead of in the text. To overcome this problem I've used \acs in headings. Now, adding hyperref and cleveref causes the acronyms to become hyperlinks, as desired. Then, switching from the 2024 to 2025 TexLive compiler causes a warning: Label 'acro:BBC@cref' multiply defined. The warning is removed if \tableofcontents is removed. Is there a better approach to avoid these warnings in TexLive 2025? \documentclass{article} \usepackage[parfill]{parskip} \usepackage{acronym} \usepackage{hyperref,cleveref} \begin{document} \tableofcontents \section*{List of Abbreviations} \begin{acronym} \acro{BBC}{British Broadcasting Corporation} \end{acronym} \addcontentsline{toc}{section}{List of Abbreviations} \section{Intro} This MWE calls the \ac{BBC} acronym for the first time here. However, when compiling, the acronym is first seen in the table of contents, and is expanded there instead, which is not desired. To fix this, I use `acs' in the section header instead. \newpage \section{The \acs{BBC}} This section is about the \ac{BBC}. \end{document}
- how to use key-value? [duplicate]by xcn on November 26, 2025 at 3:16 pm
How to replace \spreadbeam{400}{900}{500}{1000}{0} with \spreadbeam{bx=400, lx=900, bb=500, bc=1000, x=0} ? \documentclass{article} \usepackage{xcolor} \usepackage{enumitem} \ExplSyntaxOn \fp_new:N \l_bxlx_fp \fp_new:N \l_bxbb_fp \fp_new:N \l_bbxx_fp \cs_new:Nn \__display_condition_simple:Nn { \bool_if:NTF #1 { \item ~ #2 } { \color{red}\item ~ #2 } } % Define mathematical expression commands \cs_new:Nn \__condition_one_math: { $b\sb x / l\sb x = \fp_use:N \l_tmpa_fp / \fp_use:N \l_tmpb_fp = \fp_eval:n { round( \l_bxlx_fp, 3 ) } < 1/2$ } \cs_new:Nn \__condition_two_math: { $b\sb x / b\sb b = \fp_use:N \l_tmpa_fp / \fp_use:N \l_tmpc_fp = \fp_eval:n { round( \l_bxbb_fp, 3 ) } < 2/3$ } \cs_new:Nn \__condition_three_math: { $b\sb b + b\sb x + x = \fp_use:N \l_tmpc_fp + \fp_use:N \l_tmpa_fp + \fp_use:N \l_tmpe_fp = \fp_use:N \l_bbxx_fp > \fp_use:N \l_tmpd_fp / 2$ } % Define function: \check_conditions:nnnnn {bx} {lx} {bb} {bc} {x} \cs_new:Nn \check_conditions:nnnnn { % Set variables \fp_set:Nn \l_tmpa_fp { #1 } % bx \fp_set:Nn \l_tmpb_fp { #2 } % lx \fp_set:Nn \l_tmpc_fp { #3 } % bb \fp_set:Nn \l_tmpd_fp { #4 } % bc \fp_set:Nn \l_tmpe_fp { #5 } % x % Calculate intermediate variables \fp_set:Nn \l_bxlx_fp { \l_tmpa_fp / \l_tmpb_fp } \fp_set:Nn \l_bxbb_fp { \l_tmpa_fp / \l_tmpc_fp } \fp_set:Nn \l_bbxx_fp { \l_tmpc_fp + \l_tmpa_fp + \l_tmpe_fp } % Set boolean conditions \bool_set:Nn \l_tmpa_bool { \fp_compare_p:nNn { \l_bxlx_fp } < { 0.5 } } \bool_set:Nn \l_tmpb_bool { \fp_compare_p:nNn { \l_bxbb_fp } < { 0.6666667 } } \bool_set:Nn \l_tmpc_bool { \fp_compare_p:nNn { \l_bbxx_fp } > { \l_tmpd_fp / 2 } } % Display variable values $ b\sb x = \fp_use:N \l_tmpa_fp , \, l\sb x = \fp_use:N \l_tmpb_fp , \, b\sb b = \fp_use:N \l_tmpc_fp , \, b\sb c = \fp_use:N \l_tmpd_fp , \, x = \fp_use:N \l_tmpe_fp $\par \noindent \begin{itemize} \__display_condition_simple:Nn \l_tmpa_bool { \__condition_one_math: } \__display_condition_simple:Nn \l_tmpb_bool { \__condition_two_math: } \__display_condition_simple:Nn \l_tmpc_bool { \__condition_three_math: } \end{itemize} } % Create user command \NewDocumentCommand{\spreadbeam}{ m m m m m } { \check_conditions:nnnnn { #1 } { #2 } { #3 } { #4 } { #5 } } \ExplSyntaxOff \begin{document} % Call function with parameters: bx, lx, bb, bc, x \spreadbeam{400}{900}{500}{1000}{0} \end{document}
- How to avoid etex warning with leaflet class?by user2609605 on November 26, 2025 at 3:06 pm
I have some latex document starting \documentclass[a4paper,notumble,10pt,english]{leaflet} ... Compilation with lualatex yields This is LuaHBTeX, Version 1.22.0 (TeX Live 2025) restricted system commands enabled. (./productLeaflet.tex LaTeX2e <2025-11-01> L3 programming layer <2025-11-14> (/usr/local/texlive/2025/texmf-dist/tex/latex/nag/nag.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/nag/nag-l2tabu.cfg) (/usr/local/texlive/2025/texmf-dist/tex/latex/nag/nag-orthodox.cfg)) (/usr/local/texlive/2025/texmf-dist/tex/latex/leaflet/leaflet.cls Document Class: leaflet 2024/03/12 v2.1c LaTeX document class (JS,WaS,RN,HjG) (/usr/local/texlive/2025/texmf-dist/tex/latex/etex-pkg/etex.sty Package etex Warning: Extended allocation already in use. (etex) etex.sty code will not be used. (etex) To force etex package to load, add (etex) \RequirePackage{etex} (etex) at the start of the document. ) (/usr/local/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class So it does not matter what comes next in the document. I tried to comment out loading of etex in leaflet.cls because naively I interpreted the message that etex is just not needed, but the solution is not as simple as that. I use texlive 2025, latest update. Please, if you downvote, let me know the reason. I think this would be fair.
- Vertical separators in pchstack in cryptocodeby Michael Hammer on November 26, 2025 at 3:02 pm
I work with Cryptocode package in $\LaTeX$ and want to generate discription of games with oracles. My goal is to generate something like: (Source: https://eprint.iacr.org/2023/275) If my understanding is correct, this is generate via a pcvstack/pchstack-combination (p. 32 in documentation: https://ftp.rrzn.uni-hannover.de/pub/mirror/tex-archive/macros/latex/contrib/cryptocode/cryptocode.pdf). There is to my knowledge no intended parameter to separate horizontal stacks with a vertical line as on the picture. Is there any elegant solution to this problem? My current best attempt is to introduce dummy procedure inbetween filled with vertical rule: \documentclass{report} \usepackage{cryptocode} \begin{document} \begin{pchstack}[space=1em,center, boxed] \procedure{$\mathsf{Left}$}{ \text{Hello,} } \procedure{}{ \rule{0.4pt}{1.5cm} } \procedure{$\mathsf{Right}$}{ \text{Tex StackExchange} } \end{pchstack} \end{document} But that is not ideal because of the awkward spacing: Any well-known workaround?
- Confusing Recursive Macro definition with LaTeXby Explorer on November 26, 2025 at 2:22 pm
I came up with a resursive macro method to achieve my previous plot question: \documentclass[tikz,border=10pt]{standalone} \def\totalwidth{8} \def\totalheight{2} \def\mysep{0.5} \newcommand\mynode[3]{% % #1: width, #2:height, #3: coordinate(x,y) \node[% draw, thick, font=\Huge\bfseries, minimum width=#1 cm, minimum height=#2 cm, inner sep=0pt, outer sep=0pt, ] at (#3) {}; % \node[rectangle,fill=magenta,align=center,inner sep=1pt,scale=.5] at (#3) {(#3)\\width=#1, height=#2}; } \newcommand\recursivenodes[5]{% % #1: Depth % #2: Width % #3: Height % #4: X coordinate % #5: Y coordinate \begingroup \mynode{#2}{#3}{#4,#5} \ifnum#1>1\relax \pgfmathtruncatemacro{\nextdepth}{#1-1} \pgfmathsetmacro{\xoffset}{0.275*#2} \pgfmathsetmacro{\nextwidth}{0.45*#2} \pgfmathsetmacro{\nextheight}{0.65*#3} \pgfmathsetmacro{\nexty}{#5 - 0.5 * #3 - \mysep - 0.5 * \nextheight} \pgfmathsetmacro{\leftx}{#4 - \xoffset} \pgfmathsetmacro{\rightx}{#4 + \xoffset} % Left subtree \recursivenodes{\nextdepth}{\nextwidth}{\nextheight}{\leftx}{\nexty} % Right subtree \recursivenodes{\nextdepth}{\nextwidth}{\nextheight}{\rightx}{\nexty} \fi \endgroup } \begin{document} \begin{tikzpicture} \recursivenodes{4}{\totalwidth}{\totalheight}{0}{0} \end{tikzpicture} \end{document} It gives extremely confusing result: However, it behaves not as I expected, looks like a group question.... What causes the recursion to break and how should I fix this?
- verbatim - Indic languages not getting displayedby vrgovinda on November 26, 2025 at 12:54 pm
\documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage{polyglossia} \usepackage{fontspec} \setmainlanguage{english} \setotherlanguage{kannada} \newfontfamily{\kan}[Script=Kannada]{Noto Serif Kannada Bold} \begin{document} This is a MWE. \begin{verbatim} {\kan \hspace*{5em} {\uvaca ಧೃತರಾಷ್ಟ್ರ ಉವಾಚ} ಧರ್ಮಕ್ಷೇತ್ರೇ ಕುರುಕ್ಷೇತ್ರೇ ಸಮವೇತಾ ಯುಯುತ್ಸವಃ । ಮಾಮಕಾಃ ಪಾಂಡವಾಶ್ಚೈವ ಕಿಮಕುರ್ವತ ಸಂಜಯ ॥%1॥ } \end{verbatim} \end{document} Inside the verbatim environment, I cannot get the Kannada font to display. I have searched the internet for sometime. Not able to resolve this issue. Requesting help from knowledgeable friends in this forum. In my understanding, I think I don't know how to make the \newfontfamily to work within the verbatim environment.
- Locally disallow ordinary typeset content within an environment (like it’s disallowed before `\begin{document}`)by Peter LeFanu Lumsdaine on November 26, 2025 at 12:32 pm
I’d like to write an environment within which ordinary content for typesetting is not accepted. Within this environment, content is expected to be given just via a few specific commands (e.g. \printthis in the MWE below); any other raw ordinary content should throw an error, much like it does in a preamble before \begin{document}. Is there any way to achieve this? (The use-case is that I’m writing a multilingual parallel text. In the main text source, each chunk has its versions given together as, say, \engswe{This is English.}{Det här är svenska.} \engswe{Another sentence.}{Ännu en mening.}. This is then input within an environment which might typeset it in any of several ways — the two versions in parallel columns, or on parallel pages, or just one version… I have the setup working well in most respects, but I’d like to ensure that within these environments, only correctly-structured content is accepted.) \documentclass{article} \newenvironment{restrictinput}{\newcommand{\printthis}[1]{##1}}{} \begin{document} \begin{restrictinput} \printthis{XYZ} % this should get typeset as normal ABC % this should throw an error \end{restrictinput} \end{document}
- Thicker axis in PGFplotby mf67 on November 26, 2025 at 11:46 am
Is there a better method to have the x=0 and y=0 axes thicker? I made a basic approach by adding lines, but is there a better method? \documentclass{book} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=0.8] \begin{axis}[ xmin=-2, xmax=6, ymin=-1.5, ymax=10, xtick={0,2,4}, ytick={0,2,4,6,8}, xmajorgrids=true, ymajorgrids=true, ytick style={draw=none}, xtick style={draw=none}, xlabel=$x$, ylabel=$y$, height=5cm, axis equal image ] \addplot [domain=-2:6, samples=100, color=blue!50, line width=1pt]{pow(x-2,2)}; \addplot [domain=-2:6, color=red!50, line width=1pt]{4}; \draw[line width=.5pt] ({axis cs:0,-2}) -- ({axis cs:0,10}); \draw[line width=.5pt] ({axis cs:-10,0}) -- ({axis cs:10,0}); \draw[line width=.5pt, green] (-2,0)--(0,0); \draw[green,fill=white] (0,0) circle(2pt); \draw[line width=.5pt, green] (4,0)--(6,0); \draw[green,fill=white] (4,0) circle(2pt); \end{axis} \end{tikzpicture} \end{document} This is not the same as pgfplots: how to make the axis thick? as that 'thicker' command results in thicker frame, not axes. N.B. I don't want thicker arrow axes, I want thicker 'axes lines' in a framed plot. They do not seem to want to 'co-exist'.
- how to make it so my document uses OT1 by default but I want to mix in a T1 characterby Grzegorz Brzczyszczykiewicz on November 26, 2025 at 11:30 am
How to make it so my document uses OT1 by default but I want to mix in a T1 character? I want to mix in a character from T1, but still use OT1 by default. This is different from having a normal T1-encoded document.
- What is the name of the \prime symbol?by Grzegorz Brzczyszczykiewicz on November 26, 2025 at 9:44 am
The common prime symbol is: this symbol was made using the code ^\prime but there is another variant that is typed with \prime without a superscript What is the name of this "non-superscript prime" symbol?
- How do I debug what is causing tagging related warnings and how do I fix them?by MeljahU on November 26, 2025 at 6:08 am
I have a sty file which defines my institution's dissertation format. I have for the most part been able to get it to work with tagging (via TexLive 2025, LuaLaTeX and tweaking code) for accessibility. Likewise, I have gone from TaggedPDF reporting errors, to the document compiling with just some warnings. Accessibility checking (via Foxit) gives "Lbl and LBody - Failed" which I narrowed down to \chapter and \section macros. For posterity, I had to tweak the \tableofcontents macro from: \newlength\singlespacelength \newlength\doublespacelength \newlength\triplespacelength \setlength\singlespacelength{15\p@} \setlength\doublespacelength{26\p@} \setlength\triplespacelength{40\p@} \newcommand\startsinglespace{\setlength\baselineskip{\singlespacelength}} \newcommand\startdoublespace{\setlength\baselineskip{\doublespacelength}} \def\typesetHeading#1{{\normalfont\large{#1}}} \def\intro{\clearpage \thispagestyle{intropage} \global\@topnum\z@ \@afterindenttrue \secdef\@chapter\@schapter } \renewcommand\contentsname{TABLE OF CONTENTS} \newcommand\contentsnameLC{Table of Contents} \renewcommand\tableofcontents{% \intro*{\typesetHeading\bf\contentsnameLC \@mkboth{{\contentsnameLC}}{{\contentsnameLC}}}% \startsinglespace \@starttoc{toc} \startdoublespace } to % ... other definitions left alone \renewcommand\tableofcontents{% \if@openright\cleardoublepage\else\clearpage\fi \begingroup \startsinglespace \centering {\normalfont\large\bfseries \contentsnameLC}% \@mkboth{{\contentsnameLC}}{{\contentsnameLC}}% \par\vskip\medskipamount \@starttoc{toc}% \endgroup } Which fixed the errors. Now I am facing a tougher problem, the chapter macros. Unlike the other commands which I was able to get working, the chapter macros are a lot more coupled/complex, and I cannot tell where exactly are things breaking. I would appreciate instruction on how to begin to debug this, or working chapter macros that achieve the same thing (visually). \def\chapter{\clearpage \thispagestyle{chappage} \global\@topnum\z@ \@afterindenttrue \secdef\@chapter\@schapter }%\pagestyle{plain} \def\@chapter[#1]#2{ %% Chapters are necessary, so checking secnumdepth is immaterial. \refstepcounter{chapter}% \ifapp \ifnum\value{chapter}=1 \addtocontents{toc}{\vskip 1.0em %plus 1pt \hskip -\parindent \appendicesname\hfill% \vskip 0.25em \rm} \else {} \fi \else \ifnum\value{chapter}=1 % Moving away from roman numerals % \pagenumbering{arabic} \pagestyle{plain} \addtocontents{toc}{\vskip 0.25em \rm} \fi \fi \ifnum \c@secnumdepth >\m@ne \typeout{\@chapapp\space\thechapter.} \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter.}#1}% \else \addcontentsline{toc}{chapter}{#1} \fi \chaptermark{#1}% \@makechapterhead{#2}% % \pagestyle{reset} } % Chapter # is 2in from top, followed by 2 lines, followed by % the title, 4 lines, and then the text. \def\@makechapterhead#1{ { % Change Chapter headings from 2in. to 1in. %\vspace*{0.25in} \vspace*{-0.75in} \parindent \z@ \raggedright \reset@font \ifnum \c@secnumdepth >\m@ne% \center\typesetHeading{\bf\@chapapp{} \bf\thechapter}% %\par %\vskip 30pt \fi \begin{center} % Remove Bold from Chapter Headings %\large\boldcmd\typesetChapterTitle{#1} \vskip -20pt \typesetChapterTitle{#1} %\par \end{center} \nobreak %\vskip 15\p@ % Too much space between chapter title and body } } \def\@schapter#1{% \@makeschapterhead{#1}% } % Placement of the Chapter headings \def\@makeschapterhead#1{ % Change heading in TOC, LOF, LOT, and Aknowledgements from 2in. to 1in. \vspace*{-0.5in} { \parindent \z@ \raggedright \reset@font \begin{center} \large\boldcmd\typesetChapterTitle{#1} \par \end{center} \nobreak % Reduce the spacing between the chapter heading and title \vskip 15\p@ } }
- TikZ forest: how to add vertical dots to the 'top' or bottom of a directory tree? (continuation)by Grass on November 26, 2025 at 5:37 am
A while back, cfr kindly answered my question here. But I have some issues. 1) I want to be able to insert vertical dots at any ‘level’ of the forest tree (Ref: cfr’s first comment) I want something like this: I tried \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system,extensible edge [config ] [lib, extend [file.txt, file, extend ] [file, file] ] ] \end{forest} with cfr’s MWE but it gave 2) How to adapt the code so that it works with rounded corners (Ref: cfr’s second comment) When we use for tree={edge=rounded corners}, as in the following MWE, we have extraneous white space, which the removal of |- !u.child anchor seems to solve: \documentclass[border=10pt,multi,tikz]{standalone} % ateb: https://tex.stackexchange.com/a/754955/ \usepackage[edges]{forest} \definecolor{folderbg}{RGB}{124,166,198} \definecolor{folderborder}{RGB}{110,144,169} \newlength\Size \setlength\Size{4pt} \tikzset{% folder/.pic={% \filldraw [draw=folderborder, top color=folderbg!50, bottom color=folderbg, sharp corners] (-1.05*\Size,0.2\Size+5pt) rectangle ++(.75*\Size,-0.2\Size-5pt); \filldraw [draw=folderborder, top color=folderbg!50, bottom color=folderbg, sharp corners] (-1.15*\Size,-\Size) rectangle (1.15*\Size,\Size); }, file/.pic={% \filldraw [draw=folderborder, top color=folderbg!5, bottom color=folderbg!10, sharp corners] (-\Size,.4*\Size+5pt) coordinate (a) |- (\Size,-1.2*\Size) coordinate (b) -- ++(0,1.6*\Size) coordinate (c) -- ++(-5pt,5pt) coordinate (d) -- cycle (d) |- (c) ; }, } \forestset{% declare autowrapped toks={pic me}{}, declare boolean register={pic root}, pic root=0, pic dir tree/.style={% for tree={% folder, font=\ttfamily, grow'=0, }, before typesetting nodes={% for tree={% edge label+/.option={pic me}, edge=rounded corners, }, if pic root={ tikz+={ \pic at ([xshift=\Size].west) {folder}; }, align={l} }{}, }, }, pic me set/.code n args=2{% \forestset{% #1/.style={% inner xsep=2\Size, pic me={pic {#2}}, } } }, pic me set={directory}{folder}, pic me set={file}{file}, declare toks={real siblings}{}, extensible edge/.style={% delay={% prepend={[\strut, delay={% do dynamics, temptoksa=, for following siblings={% if temptoksa={}{}{% temptoksa+={,}, }, temptoksa+/.option=name, }, real siblings/.register=temptoksa, folder, grow'=0, before computing xy={% l'=0pt, s'=-15pt, }, delay n=2{% split option={real siblings}{,}{append}, }, }, edge path'={% (!u.parent anchor) ++(\foresteregister{folder indent},0pt) -- ++(0pt,-5pt) edge [dotted] ([xshift=\foresteregister{folder indent}].parent anchor) }, ]}, }, }, extend/.style={% delay={% append={[\strut, folder, grow'=0, before computing xy={% l'=0pt, s'=-15pt, }, if n children=0{% before drawing tree={% delay={% y/.min={>O{y}}{parent,descendants}, }, }, }{}, edge path'={% (!uu.parent anchor |- !u.child anchor) ++(\foresteregister{folder indent},0pt) coordinate (a) -- ([yshift=15pt].parent anchor -| a) edge [dotted] (.parent anchor -| a) }, ]}, }, }, } \begin{document} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system [config ] [lib [Access ] [Plugin ] [file.txt, file ] ] ] \end{forest} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system, extensible edge, [config ] [lib [Access ] [Plugin ] [file.txt, file ] ] ] \end{forest} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system [config ] [lib, extend [Access ] [Plugin ] [file.txt, file,extend ] ] ] \end{forest} \begin{forest} pic dir tree, pic root, for tree={% folder icons by default; override using file for file icons directory, }, [system,extensible edge [config ] [lib, extend [Access ] [Plugin ] [file.txt, file, extend ] ] ] \end{forest} \end{document} Edit I also want some lines to be of equal length, for aesthetic reasons:
- Changeable parameter in equation tagby Jinwen on November 26, 2025 at 3:43 am
Is it possible to have a changeable parameter in the Tag of an equation? Consider the following example: \documentclass{article} \usepackage{hyperref} \usepackage{mathtools} \begin{document} \def\EqCParameter{\mu} \[\tag{C${_{\EqCParameter}}$}\label{eq:C} x_{\mu} y_{\mu} z_{\mu} = 1 \] \( (x^{(0)},y^{(0)},z^{(0)}) \) satisfies {\def\EqCParameter{1}\eqref{eq:C}}. % <- want to show (C_1) \end{document} I am using \eqref to refer to the equation since this will make the reference clickable. However, I would like this parameter \mu in the equation tag to be changeable, so that one could directly say "... satisfies (C_1)", and when reader clicks on (C_1) it will jump to the original definition (C_\mu). Is this possible to achieve this? It seems that \tag will expand its argument so even if I define it as a macro (here \EqCParameter), the tag will still stay the same while referencing even when the content of this macro changes.
- Two columns of text for quotes written in two languagesby ncant on November 25, 2025 at 10:08 pm
This is a screenshot from the Italian Wikipedia page on Richard Feynman: At the top of the page there is one of Feynman's quotes, repeated twice: first in English and then translated into Italian. These two versions are arranged in an “invisible” structure (without lines marking the boundaries) similar to a table. I would like to replicate this structure, but without having to manually wrap the text, which discouraged me from using a table. I am open to any suggestions on how to achieve this result. I would also like this structure, when typeset in the final document, not to occupy the entire text area of the page; instead, it should leave some space on the left and right margins, as in the following modified screenshot: Can you please help me with this? Thank you.
- Is there a good way to define common code between LaTeX projects?by Dov on November 25, 2025 at 9:59 pm
I have multiple courses, each containing similar LaTeX code. There are tests built on exam, slides built on beamer. I often include a file with the common files if there are multiple files for example: \input{slides_preamble.tex} or \input{test_preamble.tex} I find myself repeating these files though, and they get out of sync. I would like to have one standard slides and test file in a common place. Defining a common directory in LaTeX seems bad. For one thing, that is embedding the directory structure in the code. I would prefer to do it in a makefile external to the documents: COMMON=/my/path and then some way to refer to that variable in LaTeX, so the code is not linux or windows dependent, and certainly not so I have to change it if I change directory structures. I have started giving my code to fellow professors as well, so this affects that as well. I don't know much about styles. Is that a way out of this? All I really need at this point is to be able to specify external variables. I can definitely see a use for having a common folder for graphics (for the Logo of the University, department, etc), a common directory for the course (for information that doesn't change with the semester, the exercise/test/etc. I use pdflatex to generate output if that affects the answer. Last, when sharing all this, it would be nice if I can export it to overleaf.com. It may not be the fastest environment, and I prefer to work locally, but it does have the huge benefit that we edit collaboratively together when editing papers. On overleaf I don't know how to control the environment at all. Chatgpt suggested using TEXINPUTS for code but to generate a custom script from environment variables if I want to do this for graphics and code. #!/usr/bin/env bash COURSE="${COURSE:-/path/to/course}" BASE="${BASE:-/path/to/shared}" cat > localpaths.tex <<EOF \makeatletter \def\input@path{{./code/}{${COURSE}/code/}{${BASE}/code/}} \makeatother \usepackage{graphicx} \graphicspath{{./figs/}{${COURSE}/figs/}{${BASE}/figs/}} EOF This at least gave me some options, and hopefully let me ask the question better, but for this kind of question I want human advice, preferably from someone who has encountered this problem before.
- My caption doesn't appear in a wide tableby hager moharram on November 25, 2025 at 7:18 pm
I was preparing a table in LaTeX (Springer Nature template) and the table ended up too wide for the page. I used many tricks to put it still on the page with some codes like \setlength{\tabcolsep}{3.5pt} and \resizebox{1\textwidth}{!}{}. While this worked, the problem is that my caption doesn't appear anymore, and it is just allowing it to be inserted as a \textbf{}. I need to arrange my labels, and the template allows either the caption or the modified table. Are there any other ways to put the caption? This is the code of the table: \newpage \begin{table} \centering \addtocounter{table}{1} \begin{flushleft}\textbf{Table 2} Comparison between anthropometric and clinical data within each group at baseline and post-treatment, and between the two groups \end{flushleft} \vspace{2mm} \setlength{\tabcolsep}{3.5pt} \resizebox{1\textwidth}{!}{ \begin{tabular}{cccccccc} \cmidrule(r){1-8} \multirow{2}{*}{Variable} & \multicolumn{2}{c}{\textbf{Group I (n=35)}} & \multirow{2}{*}{$P$1} & \multicolumn{2}{c}{\textbf{Group 2}} & \multirow{2}{*}{$P$2} & \multirow{2}{*}{$P$3} \\\addlinespace[0.5ex] \cmidrule(r){2-3}\cmidrule(r){5-6} \addlinespace[0.5ex] & bbbbbbbb & tttttttttttttt & & bbbbbbbb & tttttttttttttt & & \\\cmidrule(r){1-8} kkkkkk (kk)& 00.00 ± 00.00 & 00.00 ± 00.00& 0.000* & 00.00 ± 00.00 & 00.00 ± 00.00 & 0.000 & 0.000 \\ mmm (mm/mm)& 00.00 ± 0.00 & 00.00 ± 0.00 & 0.000* & 00.00 0.00 & 00.00 ± 0.00 & 0.000 & 0.000 \\ mmmmmmmm & 0.00 (0.00 – 0.00) & 0.00 (0.00 – 0.00) &$<$0.000* & 0.00 (0.00 – 0.00) &0.00 (0.00 – 0.00) &$<$0.000* & 0.000 \\ jjj (mg/dL)& 000.0 (000.0 – 000.0) &149.0 (000.0 – 000.0) & $<$0.000* & 000.0 (000 – 000.0) & 000.0 (0.000 – 000.5) & $<$0.000* & 0.000 \\ kkk (kkk/kk)& 0.00(0.00 – 00.00) & 0.0 0(0.00 – 00.00) & 0.000 & 0.00 (0.00 – 0.00) & 0.00 (0.00 – 00.0)0 & 0.000 & 0.099 \\ jjjj-jj& 0.00 (0.00 – 0.0)0 &0.0 0(0.00 – 0.00) &0.000* & 0.00 (0.00– 0.00) & 0.0 0(0.00 – 0.0)0& $<$0.000*& 0.000 \\ jjjjjjjj (jj/jj) &0.00 (0.00 – 0.00) &0.00 (0.00 – 0.00) &0.000 & 0.00 (0.00 –0.00) & 0.00 (0.00 – 0.00) &0.000* & 0.000 \\ ggggggggg (jj/j)& 000.0 (000.0 – 000.0) & 000.0 (000.0 – 000.0) &0.000* & 000.0 (000.0 – 0.0) & 0.0 (0.0 – 000.0) & 0.000 & 0.000* \\ \bottomrule \end{tabular}} \begin{flushleft}\footnotetext{\footnotesize \raggedright }\end{flushleft} \end{table}
- How to get a structure of this nodes tower with proper coordinates?by Explorer on November 25, 2025 at 5:54 pm
What I want to achieve is something as below(sorry for drawing in a hurry): The only requirements is vertical alignment(shown as the red dashed lines), the spacing of each nodes could be design, given that would not ruin the figure is okay. What I have tried is as below: \documentclass[tikz,border=5pt]{standalone} \newcommand\mynode[2][1]{% \node[draw,thick,minimum width=8cm,minimum height=2cm,font=\Huge\bfseries,scale=#1] at (#2) {AAAA}; } \begin{document} \begin{tikzpicture} % \mynode[1]{0,0} % \mynode[.45]{-2.25,-2} % \mynode[.45]{2.25,-2} % \mynode[.225]{-3.25,-3} % \mynode[.225]{1.25,-3} % \mynode[.225]{-1.25,-3} % \mynode[.225]{3.25,-3} %... \foreach \x[ evaluate=\x as \y using {int(2^(\x-1))} ] in {1,...,6}{ \foreach \t in {1,...,\y}{ \def\xx{\fpeval{-4 + (8/(\y+1))*\t*1.25}} \def\yy{\fpeval{(8/(\x+1))*1.25}} \mynode[\fpeval{1/\y}]{\xx,\yy} } } \end{tikzpicture} \end{document} It gives: I found that dilemma to determine the proper spacing, and exact coordinates calculation to guarentee vertical alignment at the same time. Is that any powerful tikz tools or something other (box, coffin?) to achieve this? Or I maybe just to make more effort to solve the better numerical relationship or working with the recursive structure?
- Graph of a relationby Dimitrios ANAGNOSTOU on November 25, 2025 at 4:24 pm
First attempt to create a graph with TikZ. More precisely, I want to be able to create figures like the following one. After much trial and error, I was able to get something close with the code below: \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{arrows.meta,positioning} \begin{document} \begin{tikzpicture}[ >=Stealth, node/.style={circle, fill=black, inner sep=2pt}, every loop/.style={min distance=15mm, looseness=8} ] % Define nodes \node[node, label=left:4] (4) at (0, 3) {}; \node[node, label=left:1] (1) at (0, 1) {}; \node[node, label=below left:2] (2) at (-2, 0) {}; \node[node, label=below right:3] (3) at (2, 0) {}; % Draw edges \draw[->] (1) -- (4); \draw[->] (1) -- (2); \draw[->] (1) -- (3); \draw[->] (2) to[bend left=30] (4); \draw[->] (3) to[bend right=30] (4); \draw[->] (2) to[bend right=30] (3); % % Self-loops \draw[->] (4) edge[loop above] (4); \draw[->] (1) edge[loop right] (1); \draw[->] (2) edge[loop left] (2); \draw[->] (3) edge[loop right] (3); \end{tikzpicture} \end{document} How can I get something closer to the book picture? Also, is there any TikZ library/extension that automates such staff? Thank you very much for your time.
- Wild Turkeys in TikZby karlh on November 25, 2025 at 4:20 pm
I have an annual scavenger hunt at Thanksgiving in which the TikZlings and TikZ ducks (and related fauna) guide my nieces and nephew through the course. Given that it is Thanksgiving, I wanted to include a turkey munching on pie and sipping wine, but the closest I can come is \documentclass{article} \usepackage{tikzlings} \begin{document} \begin{tikzpicture} \chicken[cake=orange!50!brown,wine] \end{tikzpicture} \end{document} and that just doesn't have the same ring to it. I found a good wild turkey drawn in MetaPost (Draw a turkey, a pumpkin pie, or any other object traditionally associated with Thanksgiving), but since the holiday is only two days away, I thought I'd see whether anyone was interested in making a picture of Meleagris gallopavo.
- How can I draw grid of cylinders?by minthao_2011 on November 25, 2025 at 9:02 am
I used Mathematica and tried grid of cylinder I don’t know how to draw with other tools. How can I draw it?
- How to create two bottom-aligned side-by-side figures in llncs?by user20478285 on November 25, 2025 at 2:13 am
I want to create two side-by-side subfigures that are bottom aligned. With subcaption, I would do it this way: \documentclass{llncs} \usepackage{graphicx} \usepackage{subcaption} \begin{document} \begin{figure} \centering \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=4cm, angle=90, origin=c]{example-image-a}% \caption{Foo.} \label{fig:foo} \end{subfigure}% \hfil \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=4cm]{example-image-b}% \caption{Bar.} \label{fig:bar} \end{subfigure} \caption{Foo (\ref{fig:foo}) and Bar (\ref{fig:bar}) using \texttt{subcaption}.} \label{fig:foobar} \end{figure} \end{document} And obtain this result: The figures are properly aligned, but by loading subcaption it reset llncs's default caption setup. It seems the subcaption package cannot be used with llncs (Package caption Warning: Unknown document class (or package), standard defaults will be used. See the caption package documentation for explanation.) and changes the default caption format. As an alternative I tried subfig, and what I have now is \documentclass{llncs} \usepackage{graphicx} \usepackage[caption=false]{subfig} \begin{document} \begin{figure} \centering \subfloat[% Foo.% \label{fig:foo}% ]{% \centering \includegraphics[width=4cm, angle=90, origin=c]{example-image-a}% } \hfil \subfloat[% Bar.% \label{fig:bar}% ]{% \centering \includegraphics[width=4cm]{example-image-b}% } \caption{Foo (\ref{fig:foo}) and Bar (\ref{fig:bar}) using \texttt{subfig}.} \label{fig:foobar} \end{figure} \end{document} where the captions look fine (style-wise) but the result looks unpleasing as the two figures are not bottom-aligned: I am not limited to the subfig package; if there are other packages that allow me to create side-by-side figures with individual labels and captions I'd happily give them a try, as long as they can be used with llncs (i.e. do not modify its default caption setup). Any help is much appreciated!
- pdfLaTeX puts invalid characters into generated PDF filesby blackcat on November 24, 2025 at 11:15 pm
I have found that pdfLaTeX replaces two input Cyrillic letters with their Latin counterparts breaking full text search. I'm talking about і and І (U+0456 and U+0406), they are replaced with i and I (U+0069 and U+0049). I tested two projects: one old with cp1251 as an input encoding and a font encoding (T2A) set by babel, and another one with utf-8 as input and OT2,TA2 as fontenc. It doesn't matter whether cmap package is used. My question is what package is to blame and report a bug against: babel, fontenc or something else? Just in case: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[belarusian]{babel} \begin{document} Latin: iI Cyrillic: іІ \end{document} LuaLaTeX generates correct PDF, it only needs \usepackage{fontspec}\setmainfont{Noto Serif} added to use a font with Cyrillic glyphs.