Month
- Is that possible to get symbol-family like `\ell` for "k" and "h"?by Explorer on September 11, 2025 at 1:29 pm
As the title mentioned, we know that \ell is provided by LaTeX kernal: latexdef \ell \ell: \mathchar"160 \the\ell: 352 In my senior high school, my mathematica teacher, use another two handwritten \ell-like symbols for k and h: Sorry for that I have no idea to draw them with tikz, and I didn't find some , so I can't provide my code. Is that possible to define another two similar symbols? Any thoughts are welcome and appreciated. Edited In texdoc unimath-symbols, there exists some letters with similar style, but not so "plain" as \ell, they are a bit too fancy. Edited Again: What I was actually after is the \ell-version of h and k which have the computer-modern-math style. What I said "computer-roman-math" style? In my opinion, that is harmonious with default computer-modern-math font. See the following figure(The h and k in purple are from "XITS Math" font): In my opinion, \ell is more matched with neighbored "og" in the example "log". But the k and h is not so matched with default "computer-modern-math" style. Thanks for @Sebastiano has provided methods to use cal fonts from mtpro2 and calligra. What I actually want to know is: Which font provide the similar \mathcal style of k and h, as l was converted to \ell by \mathcal with the same effect with "computer-modern-math"? I want to extend it to k and h with the similar style(without dramatic math-font style change when k and h was put together as normal computer-modern-math letters).
- Beamer: What else is possible besides blocks?by Gudrun on September 10, 2025 at 10:00 pm
for a beamer presentation I have 4 blocks with itemize env next to each other. I was wondering if there is a more interesting design for the blocks. I thought about 4 puzzle pieces connected. But I don't know how to connect the puzzle pieces automatically nor how to place an itemize env in one piece. Or how to have a better design? The pieces will stretch probably with more items/text, but that is fine for me. Some irregular puzzle. I prepared a MWE \documentclass{beamer} \usetheme{Madrid} \useoutertheme{shadow} \useoutertheme{infolines} \useoutertheme[subsection=false]{miniframes} \usepackage{jigsaw} \begin{document} \section{Section1} \begin{frame} \frametitle{Title1} \framesubtitle{Subtitle1} %Idea is to have 4 puzzle pieces connected to each other. %Each has a short title, maybe with a line break % All of them are connected %Suggested packages: https://github.com/samcarter/jigsaw %https://github.com/cpierquet/latex-packages/tree/main/thematicpuzzle \begin{columns}[T,onlytextwidth] \begin{column}{\textwidth} \begin{columns}[T,totalwidth=\textwidth] % Block 1 \begin{column}{0.23\textwidth} \begin{block}{Block 1 Block 1 extended} \scriptsize \begin{itemize} \item item1 \item item2 \item item3 \item A longer item. \item A very very very long item. \end{itemize} \end{block} \end{column} \hfill % Block 2 \begin{column}{0.23\textwidth} \begin{block}{Block 2} \scriptsize \begin{itemize} \item item1 \item item2 \item item3 \item A longer item. \item A very very very long item. \item item4 \end{itemize} \end{block} \end{column} \hfill % Block 3 \begin{column}{0.23\textwidth} \begin{block}{Block 3} \scriptsize \begin{itemize} \item item1 \item item2 \item item3 \item A longer item. \item A very very very long item. \end{itemize} \end{block} \end{column} \hfill % Block 4 \begin{column}{0.23\textwidth} \begin{block}{Block 4} \scriptsize \begin{itemize} \item item1 \item item2 \item item3 \item A longer item. \item A very very very long item. \end{itemize} \end{block} \end{column} \end{columns} \end{column} \end{columns} \begin{center} The take home message \end{center} \includegraphics[height=0.3\textheight]{example-image-duck} \end{frame} \begin{frame} \frametitle{Title2} Multiple items will stretch the jigsaw piece in vertical direction, but that is fine. \begin{tikzpicture} \path (2,-3) pic[ fill=lightgray, draw=teal, thick, scale=3, pic text={ Puzzle piece 1 Can it also have an itemize env inside with many items? }, pic text options={text=violet} ]{piece={1}{1}{0}{0}}; \path (5.5,-3) pic[ fill=lightgray, draw=teal, thick, scale=3, pic text={ Puzzle piece 2 Can it also have an itemize env inside with many items? }, pic text options={text=violet} ]{piece={-1}{-1}{0}{-1}}; %How to autoconnect the pieces? \path (9,-3) pic[ fill=lightgray, draw=teal, thick, scale=3, pic text={ Puzzle piece 3 Can it also have an itemize env inside with many items? }, pic text options={text=violet} ]{piece={-1}{-1}{0}{1}}; \path (12,-3) pic[ fill=lightgray, draw=teal, thick, scale=3, pic text={ Puzzle piece 3 Could one also have a tiny image inside? }, pic text options={text=violet} ]{piece={-1}{-1}{0}{1}}; \end{tikzpicture} \end{frame} \end{document}
- Can I print \ShowCommand's output to the document?by schtandard on September 10, 2025 at 3:18 pm
In classic TeX, there are two commands for inspecting the definition of a macro \show prints the macro name and definition to the .log file (and the interactive console). \meaning outputs the macro definition (but not the name, sadly) directly to the document. Now, for macros that do any preprocessing of their arguments, like detecting optional arguments, (or that do other fancy stuff) the actually interesting code is often obscured by several layers of helper macros. This is true for any command created using \NewDocumentCommand. LaTeX provides \ShowCommand for this reason, which bypasses all the noise and prints the command name and definition to the log file, i.e. it does \show on the relevant macro (along with info on the argument types). As far as I can tell, there is no similar equivalent to \meaning. While \show as advantages in some cases, \meaning often works better in my workflow for quick checks, as I have the .pdf output open in my editor while I do not usually have the .log file at hand. Can I (conveniently) typeset the output of \ShowCommand somehow? Not sure an MWE is helpful, but here is one. \documentclass{article} \usepackage[T1]{fontenc} \NewDocumentCommand\test{mm}{Testing #1 and #2 as a test.} \begin{document} \show\test \meaning\test \ShowCommand\test \end{document}
- How can I draw a simple three dimensional coil?by Desiree on September 10, 2025 at 10:46 am
I would like to draw something like this using tikz: So far, I only managed this: using the following code: \documentclass[tikz]{standalone} %\usetikzlibrary{decorations} \usetikzlibrary{decorations.pathmorphing} \begin{document} \begin{tikzpicture} \draw[thick,decoration={aspect=0.3, segment length=3mm,amplitude=1cm,coil},decorate] (0,3) -- (0,0.15); \draw[thick] plot[smooth , tension=2] coordinates {(0,3) (-2.5,1.5) (0,0.15)}; \end{tikzpicture} \end{document} Is there a simple way to add the white gaps so that the coil looks three dimensional? Thanks in advance for your help!
- Why does `\*` not show the multiplication sign "×" when using unicode-math with a math font?by Bastien on September 9, 2025 at 3:21 pm
I noticed that when I load the unicode-math package and select a math font (I tested several, and the issue occurs with all of them), the command \* no longer produces the expected multiplication sign "×" at a line break. According to The TeXbook (p. 173), \* should insert a "×" symbol in that context: For example, here is the default behavior without unicode-math: But when I load unicode-math and, say, NewComputerModernMath, the “×” sign disappears: Why does \* stop working with unicode-math, and how can I restore the correct behavior? Here is a MWE showing the issue with several fonts: \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath} % \setmathfont{LibertinusMath} % \setmathfont{euler-math} % \setmathfont{Asana Math} % \setmathfont{Erewhon Math} % \setmathfont{Fira Math} % \setmathfont{Garamond-Math} % \setmathfont{STIX Math} % \setmathfont{TeX Gyre Pagella Mat} % \setmathfont{XITS Math} \begin{document} Bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla $(x+y+z)\*(x-y+z)$ bla bla bla bla bla. \end{document}
- How can I align these lines better?by Davide Masi on September 8, 2025 at 4:01 pm
If I use {align*}, I can either write the symbols & or not. If I don't, everything gets aligned to the right. If I do, it all depends on where I put them. Is there a standard way to get my output centered without placing the symbol & everywhere and check the result until I find it reasonable? And what is preferable anyway? I am not so happy with my current outcome, but it might be better than what I am thinking. \begin{align*} &\left|\int_\gamma \frac{f(z)}{z-z_0}\mathrm dz - \sum_{j=1}^n\frac{f(w_j)}{w_j-z_0}(w_j-w_{j-1})\right| = \\ &\left|\int_a^b\frac{f(\gamma(t))}{\gamma(t)-z_0}\gamma'(t)\mathrm dt - \sum_{j=1}^n\frac{f(w_j)}{w_j-z_0}(w_j-w_{j-1})\right| = \\ &\left|\sum_{j=1}^n\int_{t_{j-1}}^{t_j}\Phi(t,z_0)\gamma'(t)\mathrm dt - \sum_{j=1}^n\Phi(t_j,z_0)(w_j-w_{j-1})\right| \le \\ & \sum_{j=1}^n\left|\int_{t_{j-1}}^{t_j}\Phi(t,z_0)\gamma'(t)\mathrm dt - \Phi(t_j,z_0)(w_j-w_{j-1})\right| =\\ & \sum_{j=1}^n\left|\int_{t_{j-1}}^{t_j} (\Phi(t,z_0)- \Phi(t_j,z_0))\gamma'(t)\mathrm dt \right|\le \\ & \sum_{j=1}^n \int_{t_{j-1}}^{t_j} |\Phi(t,z_0)- \Phi(t_j,z_0)||\gamma'(t)|\mathrm dt < \\ & \sum_{j=1}^n \frac{\varepsilon(t_j-t_{j-1})}{b-a} = \\ & \varepsilon. \end{align*} This is what I get at the moment:
- fontspec LetterSpace and microtype clashby David Purton on September 7, 2025 at 1:20 pm
I find it convenient to use the NFSS feature of fontspec to select the right font when there's a lot of series available. I can also use \selectfont to select everything else in one go. But when I try and add LetterSpace via fontspec, things go wrong when the microtype package is loaded. I'm open to switching to microtype for setting up the tracking if comparable functionality can be set up. But so far I haven't quite achieved this as it seems to work better if tracking is set up for specific fonts in the preamble. MWE Here's a MWE showing the kind of font selection I'd like to be able to do. It works without microtype loaded, but errors once microtype is loaded. %! TeX Program = lualatex \documentclass{article} \usepackage{microtype} \usepackage{fontspec} \newfontfamily\Raleway{Raleway}[ Ligatures=TeX, Extension=.otf, NFSSFamily=raleway, FontFace={ul}{n}{Font=*-Thin}, FontFace={ul}{it}{Font=*-ThinItalic}, FontFace={el}{n}{Font=*-ExtraLight}, FontFace={el}{it}{Font=*-ExtraLightItalic}, FontFace={l}{n}{Font=*-Light}, FontFace={l}{it}{Font=*-LightItalic}, FontFace={sl}{n}{Font=*-Regular}, FontFace={sl}{it}{Font=*-RegularItalic}, UprightFont=*-Medium, ItalicFont=*-MediumItalic, FontFace={sb}{n}{Font=*-SemiBold}, FontFace={sb}{it}{Font=*-SemiBoldItalic}, BoldFont=*-Bold, BoldItalicFont=*-BoldItalic, FontFace={eb}{n}{Font=*-ExtraBold}, FontFace={eb}{it}{Font=*-ExtraBoldItalic}, FontFace={ub}{n}{Font=*-Black}, FontFace={ub}{it}{Font=*-BlackItalic}] \DeclareKeys[dcp/font] { , family.store = \dcpfontfamily , leading.store = \dcpfontleading , series.store = \dcpfontseries , shape.store = \dcpfontshape , size.store = \dcpfontsize , tracking.store = \dcpfonttracking } \makeatletter \NewDocumentCommand{\DCPSelectFont}{m}{% \let\dcpfontfamily\f@family \let\dcpfontleading\f@baselineskip \let\dcpfontseries\f@series \let\dcpfontshape\f@shape \let\dcpfontsize\f@size \def\dcpfonttracking{0}% \SetKeys[dcp/font]{#1}% \fontfamily{\dcpfontfamily}% \fontsize{\dcpfontsize}{\dcpfontleading}% \fontseries{\dcpfontseries}% \fontshape{\dcpfontshape}% \addfontfeatures{LetterSpace=\dcpfonttracking}% \selectfont } \makeatother \begin{document} \DCPSelectFont{family=raleway,size=30,leading=36,series=ub,tracking=50} Test \DCPSelectFont{size=20,leading=24,series=l,tracking=0} Test \end{document}
- marginalia causes a blank line before theoremby Teepeemm on September 5, 2025 at 7:17 pm
The following code: \documentclass{article} \usepackage{marginalia,showframe} \newtheorem{theorem}{Theorem} \begin{document} \marginalia{margin} \begin{theorem} content \end{theorem} \end{document} results in Notably, the marginalia has caused a blank line in the output. This doesn't happen with non-theorem content. Is there a way to make the theorem start at the correct place (short of \vspace{-.8\baselineskip})?
- Replace decimal point with comma in luadraw (or globally in lua)by pascal974 on September 5, 2025 at 2:13 pm
In the luadraw documentation numericFormat={0,0}. Cette option précise le type d’affiche numérique (non encore implémenté). numericFormat={0,0}. This option specifies the type of numeric display (not yet implemented). (google traduction) In the meantime, I used siunitx to get the decimal point in the number display. Wouldn't there be a more efficient way by globally changing the point to comma in Lua? With siunitx and for k = 0, 2.8 , 0.4 do g:Dlabel("$\\num{"..k.."}$",k,{pos="S",dist=0.08}) end Code % !TeX TS-program = lualatex \documentclass{standalone} \usepackage{luadraw}%https://github.com/pfradin/luadraw/ \usepackage[locale=FR]{siunitx}% pour avoir la virgule \begin{document} \begin{luadraw}{name=virgule} local g = graph:new{ window={-1,4,-1,8,1,0.4}, size={10,10} } -- defaultlabelshift = 0 g:Labelsize("scriptsize") -- g:Daxes({0,0.4,1}, { arrows="->", limits={{0,3.2},{0,8}}, nbsubdiv={1,1}, legend={"Temps (en seconde)","Hauteur (en mètre)"}, legendpos={0.8,0.975}, legendsep={0.4,0.}, labelpos={"none","left"},-- pour ne pas mettre les graduations x grid=true, gridcolor="lightgray" }) -- -- bricolage pour avoir la virgule -- for k = 0, 2.8 , 0.4 do g:Dlabel("$\\num{"..k.."}$",k,{pos="S",dist=0.08}) end -- g:Show() \end{luadraw} \end{document}
- How to draw thousands of icons in a Tikz picture?. When you try drawing only 50 icons, the error is ! Dimension too largeby Mika Ike on September 3, 2025 at 6:07 am
The target is drawing 123000 over a pie chart (don´t worry about people over people). But the problem is that with only 50 people is obtained the error: ! Dimension too large. The 'mwe' runs well drawing 45 people (\newcommand{\imax}{45}), but fails when you type 50 or more instead. \documentclass[10pt,a5]{article} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{fontawesome7} \begin{document} \begin{tikzpicture} \newcommand{\PieRadius}{6} \newcommand{\imax}{45} % The target is drawing 123000 people over a pie. No worry about people over people. \foreach \i in {1,2,...,\imax}{ \draw (\i*360/\imax:\PieRadius) node{\faPerson}; %\draw (1,1) node{\faPerson}; % With this line the error occurs swhen you draw 50000 people. The error is ! TeX capacity exceeded, sorry [main memory size=5000000]. } \end{tikzpicture} \end{document} How can I draw 123000 people using TikZ?. End of the question. Note 1.- I think that TikZ may be not the ideal tool for the graphic, but nowadays I´m not using any kind of language program, so I try using TikZ. Note 2.- I tried changing main_memory.hugetex = ... in texmf.cnf as any other posts suggested. Curiosity (It´s not the question, it´s the final target in another phase).- The origin of this is the sensation of a not accurate of a graph when I read a few days ago: enter link description here What I finally will try, after solve the problem of ddrawing thounsands os people, is sketched on th next image
- How to draw the stereographic projection in mathematics?by Learner on September 1, 2025 at 9:42 am
I have tried the following tikz-pgf code to draw the stereographic projection: \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[scale=3] % Sphere (circle in 2D projection) \draw[thick] (0,0) circle (1); % Equator ellipse \draw[thick,dashed] (-1,0) arc[start angle=180,end angle=360,x radius=1,y radius=0.25]; \draw[thick] (1,0) arc[start angle=0,end angle=180,x radius=1,y radius=0.25]; % North pole N \fill (0,1) circle (0.02) node[above] {$N=(0,0,1)$}; % Center O \node at (0,-0.05) {$O$}; % Point P on the sphere \coordinate (Z) at (0.5,0.5); \fill (Z) circle (0.015) node[right] {$P=(\xi, \eta, \zeta)$}; % Horizontal plane \draw[thick] (-1.6,-0.35) -- (2.2,-0.35); \draw[thick] (-1.6,-0.9) -- (2.2,-0.9); \draw[thick] (-1.6,-0.35) -- (-1.6,-0.9); \draw[thick] (2.2,-0.35) -- (2.2,-0.9); %Horizontal line \draw[->] (0,1) -- (0.8,1); % line from N to P and P to z \draw[thick, dotted] (0,1) -- (0.5,0.5); \draw[thick] (0.5,0.5) -- (1.4,-0.5); % Intersection point on plane \coordinate (P) at (1.4,-0.5); \fill (P) circle (0.015); \node[below right] at (P) {$z=(x,y,0)$}; % Infinity symbol \node at (1,1) {$\infty$}; % Equation label \node at (2.1,0.6) {$x_1^2+x_2^2+x_3^2=1$}; \end{tikzpicture} \end{document} I got the following figure: I want to create a 3D animation or gif where I want to show that the straight line joining the point N=(0,0,1) and point z=(x,y,0) tends to become horizontal as as the point z(x,y,0) moves away to the right. Or I want to create a gif showing that if z=(x,y,0) in the plane moves away to the right towards infinity, the point P approaches to the north pole N(0,0,1). Remark: I put dotted line from N to P because this segment lies inside the sphere. And my graph is not quite perfect as the plane will lie along the equator, which is not in my case. Thanks
- Why does docstrip plus memoization insert a newline/paragraph between two items?by cfr on August 31, 2025 at 11:29 pm
Ref.: https://github.com/sasozivanovic/memoize/issues/50#issue-3370785926 Two MWEs ... First MWE: % \iffalse %<*driver> \documentclass[10pt,a4paper]{ltxdoc} \usepackage[extract=python]{memoize} \mmzset{% prefix={memos/}, include context in ccmemo, mkdir, } \usepackage{tikz} \begin{document} \DocInput{prawf-prooftrees-doc.dtx} \end{document} %</driver> % \fi % \thispagestyle{empty}% % {% % \centering % \begin{tikzpicture}\node{P};\end{tikzpicture} % \begin{tikzpicture}\node{Q};\end{tikzpicture} % % } % \clearpage % %\Finale After a single compilation, we obtain this exciting image: After a second compilation: That is, when externalised (memoized) images replace the original compiled pictures, the second picture is pushed to the next line. So, clearly this must be a memoize bug, right? Except that I cannot reproduce it without docstrip. Second MWE: \documentclass[10pt,a4paper]{ltxdoc} \usepackage[extract=python]{memoize} \mmzset{% prefix={memos/}, include context in ccmemo, mkdir, } \usepackage{tikz} \begin{document} \thispagestyle{empty}% {% \centering \begin{tikzpicture}\node{P};\end{tikzpicture} \begin{tikzpicture}\node{Q};\end{tikzpicture} } \clearpage \end{document} After a second (or first or, I suppose, fifty-third) compilation, we have: So is it a memoize bug which only shows up when docstrip is used or a docstrip bug which only shows up when memoize is used or am I just a brain-in-a-vat at the mercy of a mad scientist with a particularly twisted imagination? Why does the output differ? What am I missing here? Note that I can workaround this already, so I'm not looking for a 'fix' in terms of making-it-work. But I would like to know why it happens and, if applicable, where and how it should be fixed in docstrip/memoize/whatever.
- The forbidden nesting of matricesby Ted Black on August 31, 2025 at 12:52 pm
In tikz the nesting of matrices is strictly forbidden. One can write something like \[ \begin{tikzpicture} \matrix (m) [matrix of nodes,nodes={anchor=center}] { 1 & \tikz{\draw(0,0)--(1,1)(0,1)--(1,0); } \\ 2 & 3 \\ }; \end{tikzpicture} \] and it will produce but if this is replaced with \[ \begin{tikzpicture} \matrix (m) [matrix of nodes,nodes={anchor=center}] { 1 & \tikz{\matrix (n){1 & 2 \\ 3 & 4 \\}; } \\ 2 & 3 \\ }; \end{tikzpicture} \] LaTeX returns ! Package pgf Error: You cannot nest pgfmatrix environments, yet.See the pgf package documentation for explanation.Type H <return> for immediate help.... 1 & \tikz{\matrix (n){ This is a pity. Using \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{matrix,fit} \begin{document} \[ \begin{tikzpicture} \matrix (m) [matrix of nodes, ampersand replacement=\&,row sep=1.5ex,column sep=1.5ex,] { \mbox{\tiny $i=1$ \quad} \& $ \begin{bmatrix} 1 & 1 & \cdots & 1 & 1 \end{bmatrix} \begin{bmatrix} 0 \\ 1 \\ \vdots \\ 1 \\ 1 \\ \end{bmatrix} $ \\ \mbox{\tiny $i=2$ \quad} \& $ \begin{bmatrix} 1 & 1 & \cdots & 1 & 1 \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ \vdots \\ 1 \\ 1 \\ \end{bmatrix} $ \\ $\vdots$ \& $\vdots$\\ \mbox{\tiny $i=n-1$ \quad} \& $ \begin{bmatrix} 1 & 1 & \cdots & 1 & 1 \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ \vdots \\ 0 \\ 1 \\ \end{bmatrix} $ \\ \mbox{\tiny $i=n$ \quad} \& $ \begin{bmatrix} 1 & 1 & \cdots & 1 & 1 \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ \vdots \\ 0 \\ 0 \\ \end{bmatrix} $ \\ }; \node[fit= (m-1-2.north west) (m-5-2.south east), left delimiter={[}, right delimiter={]},inner sep=1ex] {}; \end{tikzpicture} \] \end{document} I get but ideally I would also like to use code like \[ \begin{tikzpicture} \matrix (m) [matrix of nodes, ampersand replacement=\&,row sep=1.5ex,nodes={shape=rectangle,anchor=center}] { \mbox{\tiny $j=1$} \& \mbox{\tiny $j=2$} \& $\cdots$ \& \mbox{\tiny $j=n-1$} \& \mbox{\tiny $j=n$} \\ $1$ \& $1$ \& $\cdots$ \& $1$ \& $1$ \\ }; \node[fit= (m-2-1.north west) (m-2-5.south east), left delimiter={[}, right delimiter={]},inner sep=0ex] {}; \end{tikzpicture} \] and \[ \begin{tikzpicture}[baseline={([yshift=-1.5ex]current bounding box.center)}] \matrix (m) [matrix of nodes, ampersand replacement=\&,row sep=1.5ex,column sep=1.5ex,nodes={shape=rectangle,anchor=center}] { \mbox{\tiny $j = 1$} \quad \& 0 \\ \mbox{\tiny $j = 2$} \quad \& 1 \\ $\vdots$\& $\vdots$ \\ \mbox{\tiny $j = n-1$} \quad \& 1 \\ \mbox{\tiny $j = n$} \quad \& 1\\ }; \node[fit= (m-1-2.north west) (m-5-2.south east), left delimiter={[}, right delimiter={]},inner sep=1ex] {}; \end{tikzpicture} \] to get little vectors like and that I can then put in the nodes of the big matrix. The final result should look like tikz is a powerful package so this is a minor inconvenience. Can anyone think of a workaround that allows nesting of pgfmatrices?
- How to properly fill the area under a hyperbola arc in TikZ without fillbetween?by Sebastiano on August 31, 2025 at 12:00 pm
I'm trying to color the area bounded by the hyperbola x²−y²=1 the x-axis, and the origin O in TikZ. My current code is: \documentclass[11pt]{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=1.2] \coordinate (O) at (0,0); \draw[->] (-2.5,0) -- (3,0) node[right] {$x$}; \draw[->] (0,-2) -- (0,2) node[above] {$y$}; \draw[domain=-2:2,smooth,variable=\y,blue,thick] plot ({sqrt(1+\y*\y)},\y); \draw[domain=-2:2,smooth,variable=\y,blue,thick] plot ({-sqrt(1+\y*\y)},\y); \coordinate (Q) at ({cosh(1)},{sinh(1)}); \fill (Q) circle (1.5pt) node[below right] {$Q(x_Q,y_Q)$}; \coordinate (A) at (1,0); \fill (A) circle (1.5pt) node[below left] {$\scriptstyle a$}; \fill (0,0) circle (1.5pt) node[below left] {$O$}; \draw[thick] (0,0) -- (Q); \coordinate (Qx) at ({cosh(1)},0); \coordinate (Qy) at (0,{sinh(1)}); \draw[dashed] (Q) -- (Qx) node[below] {$\scriptstyle x_Q$}; \draw[dashed] (Q) -- (Qy) node[left] {$\scriptstyle y_Q$}; \fill[orange, opacity=0.3] (A) \foreach \y in {0,0.01,...,1} { -- ({sqrt(1+\y*\y)},\y) } -- (O) -- cycle; \end{tikzpicture} \end{document} The problem is that filling with \foreach is ugly and not uniform. Yet, here, I haven't used \usetikzlibrary{backgrounds}. I would like to know if there is a clean and correct way to fill this area without using \usepgfplotslibrary{fillbetween} or appropriately \usetikzlibrary{backgrounds}.
- Is that extra empty space below the `\xRightarrow`?by Explorer on August 30, 2025 at 3:32 am
As I was browsing this excellent solution, it seemed that there exist extra empty space below the arrow: Is this a small bug or feature designed intentionally? Or is that elegant method to balance these two space's height? Here below is my test code: \documentclass{article} \usepackage{mathtools} \begin{document} case1: $\xRightarrow[aeiou]{aeiou}$ case2: $\xRightarrow[aeiou]{pqgqp}$ case3: $\xRightarrow[hbdlf]{aeiou}$ case4: $\xRightarrow[hbdlf]{pqgqp}$ case5: $\xRightarrow[ABCDE]{FGHIJ}$ \end{document} Edited according to egreg's answer: As egreg figured out that this issues is "font-specific", with fourier, the \xRightarrow would be vertically centered better(but still not exactly...) However, the = is still not centered. Now I still wonder what is the best practice to tune the "below" part's height(mainly focus on the default Computer Modern Math/ with unicode-math's Latin Modern Math)? \documentclass{article} \usepackage{mathtools} \usepackage{graphicx} \newcommand*\myxRightarrow[2][]{% \xRightarrow[\raisebox{4pt}{\scalebox{.65}{{$#1$}}}]{#2} }% \begin{document} case1: $\xRightarrow[aeiou]{aeiou}$ \quad $\myxRightarrow[aeiou]{aeiou}$ case2: $\xRightarrow[aeiou]{pqgqp}$ case3: $\xRightarrow[hbdlf]{aeiou}$ case4: $\xRightarrow[hbdlf]{pqgqp}$ case5: $\xRightarrow[ABCDE]{FGHIJ}$ \end{document}
- LuaLaTeX Accessible PDF not validated by accessibility checkerby layman on August 28, 2025 at 5:10 pm
I am having serious problems generating a PDF in TeX that passes my accessibility checker. Below is a minimal working example that should produce an accessible PDF, but the checker highlights that the resulting PDF is missing a title, that the image does not have alt text, and that there is an issue with the reading order. Minimal working example: \DocumentMetadata{ lang = en-US, pdfversion=1.7, pdfstandard = ua-2, pdfstandard = a-4f, tagging = on, tagging-setup = {table/header-rows=1} } \documentclass{article} \title{Document} \author{Your Name} \begin{document} \maketitle \section{Introduction} \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth, alt={Alt text here}] {sampleimage.png} \caption{Alt text.} \end{figure} \begin{table}[h] \centering \begin{tabular}{l r} \hline Name & Date (\$)\\ \hline M & 1 \\ T & -1 \\ \hline \end{tabular} \end{table} \end{document}
- Memorizing inconsistent key names in pgfplotsby Paul Paulsen on August 25, 2025 at 6:13 pm
I absolutely love tikz and pgfplots, and I am really thankful for what their authors have built. I regularly am surprised and in awe by what people can accomplish in them. Also, both of them have among the best documentation I have ever come across, and the online versions (tikz and pgfplots) are so smooth to use that I even find myself wanting to learn new functionalities for fun. However, I have one big frustration with pgfplots: I am seemingly unable to ever memorize any of the keys I can use. I always need to look up how to fine tune my plots, no matter how recently I did the same thing - either in the documentation or a file I made earlier. That most code editors can't come up with suggestions for tikz and pgfplots commands doesn't make things easier (I currently mostly use overleaf). And I think the inconsistent naming for keys plays a big role in my difficulties. For example: xtick distance but extra x ticks - why not extra xticks? extra x ticks but extra x tick labels - why not extra x ticks labels? Does anyone have any tips and tricks how to work around this and how to remember the most important of the many, many, many possible options? And out of curiosity, are there any technical reasons for these inconsistencies?
- Chapter title formatting with TikZ graphicby ncant on August 22, 2025 at 4:15 pm
I am trying to recreate the chapter titles from the 2010 print edition of Ogata's book, 'Modern Control Engineering'. Here's a sample of the pages in question: As you can see, the chapter number is enclosed between two squares, one of which is rotated 45 degrees relative to the other, while the actual chapter title is aligned to the right. Having a PDF file with some of these pages and opening it with Inkscape, I noticed that the chapter title is 18pt, while the chapter number is 58pt. With this information, I used the titlesec package with the following code in the preamble of my document: \usepackage{titlesec, titletoc} \titleformat{\chapter}[display]% {\headerfont\bfseries\Huge\raggedleft} % \Huge is not quite 18pt, but it'll do. {\thechapter} {20pt} % Space between chapter number and chapter title. To be adjusted accordingly. {\Huge} % FIXME: should be 58pt. I tried using the \fontsize command, but probably wrong. Now let's move on to the "fun part". I'm still pretty new to TikZ (until now I didn't have to use it much, relying instead on importing existing .svg files into my documents). However, I think it might be useful to draw the two squares that enclose the chapter number: As a proof of concept, I wrote the following MWE, which uses TikZ: \documentclass{standalone} \usepackage{tikz} \usepackage{anyfontsize} \begin{document} \begin{tikzpicture}[scale=2] \def\outer{1.25} \def\inner{1.05} \def\diamond{1} \def\thick{14pt} % Outer square \draw[thin] (-\outer,-\outer) rectangle (\outer,\outer); % Inner square \filldraw[fill=white, draw=black, thin] (-\inner,-\inner) rectangle (\inner,\inner); % Rotated square \draw[line width=\thick, rotate=45] (-\diamond,-\diamond) rectangle (\diamond,\diamond); % Central number \node at (0,0) {\fontsize{50}{60}\selectfont 3}; \end{tikzpicture} \end{document} which produces the following: As you can see, it's not an exact replica of what I want to achieve, and I kinda know this code it's not up to the task. Opening the PDF again, I approximately measured the bases of the squares: If you find these numbers weird, so do I: I tried switching measurement units in Inkscape, and yet I couldn't find a "perfectly sane" number. I am therefore asking for your help in combining (and, if possible, improving) these two code snippets, and perhaps getting a little closer to the reference images.
- Why adding `\usepackage{mathtools}` gives latex error in this example?by Nasser on August 21, 2025 at 11:21 pm
I am trying the solution given in How to get paragraph spacing within table to be same as outside when using parskip package? Which works fine except when I added \usepackage{mathtools} it gives error. I thought it will better to make new question on this. But if I should have made this comment instead, will delete this. Here is MWE. This is same exact code in the above link. All what I did is just add one line \usepackage{mathtools} and now lualatex gives error \documentclass[12pt]{book} \usepackage{mathtools} %uncomment this, error goes way \usepackage{longtable,array} \usepackage[skip=10pt plus1pt]{parskip} %see https://tex.stackexchange.com/questions/750023/how-to-get-paragraph-spacing-within-table-to-be-same-as-outside-when-using-parsk \newlength{\defaultparskip} \AtBeginDocument{\setlength{\defaultparskip}{\parskip}} \AddToHook{cmd/@arrayparboxrestore/after}{\setlength{\parskip}{\defaultparskip}} \begin{document} \begin{longtable}{|p{4in}|}\hline line 1 line 2 line 3 \\ \hline \end{longtable} line1 line2 line 3 \end{document} Now >lualatex index.tex This is LuaHBTeX, Version 1.23.3 (TeX Live 2026/dev) restricted system commands enabled. (./index.tex LaTeX2e <2025-06-01> patch level 1 L3 programming layer <2025-08-13> (/usr/local/texlive/2025/texmf-dist/tex/latex/base/book.cls Document Class: book 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/2025/texmf-dist/tex/latex/base/bk12.clo)) (/usr/local/texlive/2025/texmf-dist/tex/latex/mathtools/mathtools.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/tools/calc.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/mathtools/mhsetup.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/local/texlive/2025/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2025/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/amsmath/amsopn.sty))) (/usr/local/texlive/2025/texmf-dist/tex/latex/tools/longtable.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/tools/array.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/parskip/parskip.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/kvoptions/kvoptions.sty (/usr/local/texlive/2025/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty)) (/usr/local/texlive/2025/texmf-dist/tex/latex/etoolbox/etoolbox.sty)) (/usr/local/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-luatex.def) (./index.aux) (/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/local/texlive/2025/texmf-dist/tex/latex/graphics-def/luatex.def (/usr/local/texlive/2025/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ))) (/usr/local/texlive/2025/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))) ! Missing number, treated as zero. <to be read again> } l.32 \end{document} ? Note, I am using lualatex Version 1.23.3 on TL 2025 on Linux Is there a reason why adding \usepackage{mathtools} gives error on the above solution?
- Make a square tikzcd diagramby Liu Zhiyu on August 21, 2025 at 10:49 am
The following code gives a rectangle diagram. \documentclass{article} \usepackage{tikz} \usetikzlibrary{cd} \begin{document} \begin{center} \begin{tikzcd}[sep=large] \bullet \ar[r] \ar[d] \ar[rd] & \bullet \ar[d] \\ \bullet \ar[r] & \bullet \end{tikzcd} \end{center} \end{document} How to make it square shaped, like this:
- Spacing issues with big parenthesis in LuaTeXby PHL on August 21, 2025 at 6:29 am
When using New Computer Modern via fontsetup the spacing in T \bigl( is too small. MWE (to be compiled with LuaLaTeX): % !TEX TS-program = lualatex \documentclass{article} \usepackage{fontsetup}% no options = new computer modern \begin{document} $T( T \bigl( T \Bigl( T \biggl( T \Biggl($ $A( A \bigl( A \Bigl( A \biggl( A \Biggl($ \end{document} As the above example show, the problem does not arise with standard parenthesizes nor does it if we replace Tby A. The \Bigl(, \biggl( and \Biggl( command are also problematic, but less. The problem is specific to New Computer Modern (the default option) and not to fontsetup which works well with other options. Edit As pointed out, the problem is not with New Computer Modern, but with LuaTeX. See mickep's answer and the link within it.
- Issue with \integral command from intexgral package in math modeby Sebastiano on August 20, 2025 at 8:07 pm
I am using the intexgral package to format integrals with the upright "d" as the differential operator in my document. However, I am encountering an issue when I attempt to use many integrals in one equation. Specifically, in the following code: \documentclass[12pt]{article} \usepackage{amsmath,intexgral} \begin{document} \begin{align*} \integral{\sin^2x} &= \integral{\sin x \sin x}\\ &= -\sin x\cos x +\integral{\cos x\cos x} \\ &= -\sin x\cos x +\integral{(1-\sin^2x)} \\ &= -\sin x\cos x +\integral{1}+\integral{-\sin^2x} \end{align*} \end{document} The expression \integral{1}+\integral{-\sin^2x} is supposed to display two separate integrals: One for 1 and one for -\sin^2x. However, instead of rendering \integral{1}+\integral{-\sin^2x}, I get the following: The first integral displays correctly, but for \integral{-\sin^2x}, I get \integral{1} again (as though it is mistakenly taking -\sin^2x as 1).
- Is that possible to extend the \pic method to achieve tiling from my first thoughts?by Explorer on August 19, 2025 at 6:27 pm
Description I want to use tikz to achieve the following two images' tiling. This link maybe related, but seemedly not the same. For the First simpler one , I have the following code: \documentclass[border=5pt]{standalone} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture}[ myunit/.pic={ \tkzDefPoints{0/0/O,1/\tkzSqrTwo-1/x}% \tkzDefRegPolygon[center,sides=8,name=P](O,x) \tkzDrawPolygon[#1](P1,P...,P8) \tkzDefSquare(P3,P2)\tkzGetPoints{Q2}{Q3} \tkzDrawPolygon[#1](P2,P3,Q3,Q2) \tkzDefSquare(P1,P8)\tkzGetPoints{Q1}{Q8} \tkzDrawPolygon[#1](P1,P8,Q1,Q8) \tkzDefSquare(P7,P6)\tkzGetPoints{Q7}{Q6} \tkzDrawPolygon[#1](P6,P7,Q6,Q7) \tkzDefSquare(P5,P4)\tkzGetPoints{Q4}{Q5} \tkzDrawPolygon[#1](P4,P5,Q5,Q4) } ] \foreach \x in {0,...,4}{ \foreach \y in {0,...,4}{ \pic at (\fpeval{2*\x*\tkzSqrTwo},\fpeval{2*\y*\tkzSqrTwo}) {myunit={magenta,semithick}}; } } \end{tikzpicture} \end{document} which gives that: My very basic thought is to use pic act as the unit image, then use nested \foreach to tile all the image-units. Now taking into the Second Image , the for-loop angle and length is more difficult to calculate. And I have no idea from my current state. Question Starting from my current thoughts(and code), is there some solutions to extend to some more other-like tiltings patterns drawing. Appendix Here below are four another tilting patterns. Noted that they are no need to be plot in the answer, just to show what I want my pic thoughts to extend to a wider tilting patterns' example result. Edited: Thanks to MS-SPO's comment and I get inspired by that: Right, meeting a 1x1 size was my objective 😉 I have corrected my calculation error, and normalise the replicated unit symbol as "1×1" square as below: \documentclass[border=5pt]{standalone} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture}[ myunit/.pic={ \def\xx{0.25*sqrt(2)} \def\yy{\fpeval{0.5-0.25*sqrt(2)}} \tkzDefPoints{0/0/O,\xx/\yy/x}% \tkzDefRegPolygon[center,sides=8,name=P](O,x) \tkzDrawPolygon[#1](P1,P...,P8) \tkzDefSquare(P3,P2)\tkzGetPoints{Q2}{Q3} \tkzDrawPolygon[#1](P2,P3,Q3,Q2) \tkzDefSquare(P1,P8)\tkzGetPoints{Q1}{Q8} \tkzDrawPolygon[#1](P1,P8,Q1,Q8) \tkzDefSquare(P7,P6)\tkzGetPoints{Q7}{Q6} \tkzDrawPolygon[#1](P6,P7,Q6,Q7) \tkzDefSquare(P5,P4)\tkzGetPoints{Q4}{Q5} \tkzDrawPolygon[#1](P4,P5,Q5,Q4) } ] \draw[gray] (-1,-1) grid (6,6); \foreach \x in {0,...,5}{ \foreach \y in {0,...,5}{ \pic at (\x,\y) {myunit={magenta,semithick}}; } } \end{tikzpicture} \end{document} which gives:
- Why is there no expansion of a local let despite using xdef here?by INEEDANSWERS on August 19, 2025 at 1:32 pm
In this example: { \let\oldpar=\par \xdef\par{NEXT UP!\oldpar} } Par 1 Par 2 Par 3 \bye TeX complains that oldpar is not defined. I do not understand why it tries to look for a definition of oldpar in the first place. To my understanding, let assigns the meaning of par to oldpar in the first line; and, in the second line, TeX expands the xdef's replacement text so that it becomes "NEXT UP!" followed by whatever oldpar does (in this case, what par initially does), after which this new definition is linked to par. What causes the error? Is there a way to achieve what I want while keeping oldpar local?
- What are the exact rules about spaces surrounding macro parameters/arguments?by INEEDANSWERS on August 18, 2025 at 7:32 pm
To my surprise, the TeXbook (page 203) mentions that the first argument in \cs AB {\Look}C${And\$ }{look}\$ 5. where \cs is defined as \def\cs AB#1#2C$#3\$ {#3{ab#1}#1 c##\x #2} is \Look, and not [space], because in this case TeX ignores the blank space after B, and strips the braces off of {\Look} But it doesn't explain why, or in which other cases it would do so, or what the exact rules are. It is mentioned in an earlier paragraph that TeX doesn’t use single spaces as undelimited arguments. but I don't understand what Knuth means by that. What even are undelimited arguments (arguments, not parameters)? What does he mean with "single spaces".
- tagged pdf math book: best practicesby Jasper on August 17, 2025 at 9:41 pm
I want to learn the correct way of writing a tagged math book. Is my current structure sufficient? If not, how can I improve this skeleton? What packages must I sacrifice in the name of tagging? In my actual practise, I have a source file like this: \DocumentMetadata{ pdfstandard = UA-2 ,tagging = on ,lang = en } \documentclass[letterpaper]{book} \usepackage{preamble} \title{Jasper's Book} \author{Jasper} \date{\today} % \includeonly{chapter_4} \begin{document} \frontmatter \input{half-title} \maketitle \input{copyright} \input{dedication} \input{epigraph} \include{preface} \include{notation} \include{acknowledgements} \tableofcontents \listoftables \listoffigures \mainmatter \part{Blah} \include{chapter_1} \include{chapter_2} \include{chapter_4} \part{Blah blah} \include{chapter_5} \include{chapter_6} \include{chapter_7} \part{Blah blah, blah} \include{chapter_8} \include{chapter_9} \include{chapter_10} \include{chapter_11} \part{Blah blah, blah. Blah.} \include{chapter_12} \appendix \include{appendix_1} \include{appendix_2} \include{appendix_3} \backmatter \printbibliography \printindex \end{document} It expands to something like this: \DocumentMetadata{ pdfstandard = UA-2 ,tagging = on ,lang = en } \documentclass[letterpaper]{book} \makeatletter \PassOptionsToPackage{ backend=biber ,style=alphabetic ,sorting=nyt }{biblatex} \PassOptionsToPackage{colorlinks = true}{hyperref} \RequirePackage{ mathtools ,amsthm ,unicode-math ,siunitx ,microtype ,tikz ,booktabs ,tabularx ,enumext ,extarrows ,unicode-math ,subcaption ,nicematrix ,extarrows ,biblatex ,makeidx ,old-arrows ,xpatch ,hyperref } \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase} \setmainfont{Libertinus Serif} \setsansfont{Libertinus Sans} \setmonofont{Libertinus Mono} \setmathfont{Libertinus Math} \addbibresource{bibliography.bib} \makeindex \makeatother \title{Jasper's Book} \author{Jasper} \date{\today} % \includeonly{chapter_4} \begin{document} \frontmatter % half-title \clearpage \thispagestyle{empty} \par\vspace*{.35\textheight}{% \centering Jasper's Book \par } \clearpage \thispagestyle{empty} \maketitle % copyright \clearpage \thispagestyle{empty} \par\vspace*{.35\textheight}{% \copyright~2025 Jasper. This work may not be reproduced, distributed, or transmitted in any form or by any means without the prior written permission of the author. } % dedication \clearpage \thispagestyle{empty} \par\vspace*{.35\textheight}{% This book is deticated to the existence of peanut butter. } % epigraph \clearpage \thispagestyle{empty} \par\vspace*{.35\textheight}{% ``I hate Mondays'' ---Garfield } \chapter*{Preface} This book is meant for people who are interested in reading it. \chapter*{Notation} This book is full of notation, which we will not explain. \chapter*{Acknowledgements} \addcontentsline{toc}{chapter}{Acknowledgements} This work was typeset using \TeX{}, the typesetting system created by Donald~E.~Knuth, along with various extensions and packages developed by the \TeX{} community. I am grateful to the vibrant \TeX{} Stack Exchange community for their ongoing support and resources. \par \vspace{2em} \hfill\textit{Jasper} \tableofcontents \listoftables \listoffigures \mainmatter \part{Part 1} \chapter{Chapter 1} \chapter{Chapter 2} \chapter{Chapter 3} \part{Part 2} \chapter{Chapter 4} \chapter{Chapter 5} \chapter{Chapter 6} \appendix \chapter{Appendix 1} \chapter{Appendix 2} \chapter{Appendix 3} \backmatter \printbibliography \printindex \end{document}
- WARNING: mathml missing for hash 44BC9D542A92714CAC84E01CBBB7FD61 ====>grabbed math=macro:->aby Jasper on August 17, 2025 at 8:29 am
Credit to @Max C for simplifying the mwe: Compiled with latexmk -lualatex \DocumentMetadata{pdfstandard=ua-2, tagging=on, lang=en} \documentclass{book} \usepackage{mathtools, unicode-math} \begin{document} \begin{tabular}{l} \(a\) \end{tabular} \end{document} Package unicode-math Warning: Using \overbracket and \underbracket from (unicode-math) `mathtools' package. (unicode-math) (unicode-math) Use \Uoverbracket and \Uunderbracket for (unicode-math) original `unicode-math' definition. Package unicode-math Warning: I'm going to overwrite the following commands (unicode-math) from the `mathtools' package: (unicode-math) (unicode-math) \dblcolon, \coloneqq, \Coloneqq, \eqqcolon. (unicode-math) (unicode-math) (unicode-math) Note that since I won't overwrite the other (unicode-math) colon-like commands, using them will lead to (unicode-math) inconsistencies. \g__math_luamml_iow=\write3 \openout3 = mwe-luamml-mathml.html Package tagpdf Info: luamml has been enabled and will create an MathML file. WARNING: mathml missing for hash 44BC9D542A92714CAC84E01CBBB7FD61 ====>grabbed math=macro:->a
- \use:e and \expandedby User23456234 on August 17, 2025 at 6:55 am
Questions: What is the difference between \use:e and \expanded? I don't understand why \use:e has to absorb an argument first before passing it to \expanded. Why isn't \use:e defined to be a copy of \expanded? Wouldn't this be faster and simpler? For reference, source3.pdf defines \use:e as: \cs_gset:Npn \use:e #1 { \tex_expanded:D {#1} }
- How to put globes around semantic trees and connect them with arrows?by elmo on August 17, 2025 at 2:32 am
I am typesetting modal tableau proofs with the prooftrees package. Since prooftrees is not well suited for modal proofs with possible worlds and globes, I have split my proof into two separate tableau environments. Here is a minimal working example (MWE): \documentclass{article} \usepackage[tableaux]{prooftrees} \begin{document} \begin{center} \begin{tableau} { line no sep= .5cm, just sep= .5cm, %for tree={s sep'=10mm}, close with=\ensuremath{\ast}, % Star for closing branches } % [\parbox{1.75cm}{\centering \ensuremath{\Box(p \rightarrow q)}} , just={\parbox{3.25cm}{Premise 1}}, name=Prem1, % [\neg q, just={Premise 2}, name=Prem2, % [\neg \Box \neg q, just={Negated conclusion}, name=NegCon, % [(p \rightarrow q), just={($R$): Prem1}, name={PThenQR}, % [\neg p, just={($\rightarrow T$): PThenQR}, name={NegP1},] % [q, just={($\rightarrow T$): PThenQR}, name={Q1}, % close={:Prem2,Q1},] ]]]] \end{tableau} \begin{tableau} { line no shift=5, line no sep= .5cm, just sep= .5cm, %for tree={s sep'=10mm}, close with=\ensuremath{\ast}, % Star for closing branches, } % [\parbox{1.75cm}{\centering \ensuremath{\neg\neg q}} , just={\parbox{3.25cm}{3 ($\Box F$)}}, name={NegNegQ}, % [q, just={($\neg F$): NegNegQ}, name={Q}, % [(p \rightarrow q), just={1 ($\Box T$)}, name={PThenQ}, % [\neg p, just={($\rightarrow T$): PThenQ}, name={NegP}, % [\vdots, no line no ]] % [q, just={($\rightarrow T$): PThenQ}, % [\vdots, no line no ]] ]]] \end{tableau} \end{center} \end{document} What I would like to do: Place a globe/ellipse around the formulas only in the first tableau. Place a globe/ellipse around the formulas only in the second tableau. Draw arrows between the globes. Here is a picture of the kind of output I have in mind:
- Non-linear transformation of textby David Purton on August 16, 2025 at 2:20 pm
My end goal is to apply a specific wave warp to a short block of text in line with a style guide. Below is my attempt. I've applied the transform to a 4 by 4 grid and it behaves as I want with the sine wave having maximum height in the middle of the grid and reducing until the top and bottom of the grid remain horizontal. The second transform uses the text converted to a path in Inkscape and exported as TikZ code (sorry it's long). This also does what I want. The third example shows what I wish I could do in just putting the text in a node. I know that this is not possible to do this way as the TikZ documentation states: When /tikz/transform shape nonlinear is set to true, TikZ will try to apply any current nonlinear transformation also to nodes. Typically, for the text in nodes this is not possible in general, in such cases a linear approximation of the nonlinear transformation is used. But converting to curves in Inkscape and then applying the transform is a little too manual. I would like a more automated option, so that I can easily change the text and have a new wave output. Question: Is there a way I can do this? It does not have to be using TikZ (but I do want LaTeX). It can use l3draw or lua code. \documentclass{article} \usepackage{tikz} \usepgfmodule{nonlineartransformations} \pagestyle{empty} \makeatletter \def\wavewarp{% \pgf@ya=\pgf@y% \pgfmathsetmacro{\warped@y}{% \pgf@ya+% 0.01*\pgfkeysvalueof{/tikz/wave warp/bend}*% \pgfkeysvalueof{/tikz/wave warp/height}*% sin(\pgf@x/\pgfkeysvalueof{/tikz/wave warp/width}*360)*% sin(\pgf@ya/\pgfkeysvalueof{/tikz/wave warp/height}*180)% }% \pgf@y=\warped@y pt% } \makeatother \newsavebox{\warpbox} \newlength{\warpboxwd} \newlength{\warpboxht} \begin{document} \tikzset{ wave warp/width/.initial=\warpboxwd, wave warp/height/.initial=\warpboxht, wave warp/bend/.initial=10 } \newcommand*{\grid}{\draw (0,0) grid (4,4);} \sbox\warpbox{\tikz{\grid}} \setlength{\warpboxwd}{\wd\warpbox} \setlength{\warpboxht}{\ht\warpbox} \begin{tikzpicture} \begin{scope} \pgftransformnonlinear{\wavewarp} \grid \end{scope} \end{tikzpicture} \vspace{1cm} \tikzset{x=1pt,y=1pt} \newcommand*{\textaspath}{% \fill[shift={(6.6, 8.6)}] (11.8, -8.6) -- (6.0, -8.6) -- (6.0, 8.1) -- (0.8, 8.1) -- (0.8, 12.8) -- (17.0, 12.8) -- (17.0, 8.1) -- (11.8, 8.1) -- cycle(32.8, -8.6) -- (20.1, -8.6) -- (20.1, 12.8) -- (32.8, 12.8) -- (32.8, 8.2) -- (25.9, 8.2) -- (25.9, 4.8) -- (32.3, 4.8) -- (32.3, 0.2) -- (25.9, 0.2) -- (25.9, -3.9) -- (32.8, -3.9) -- cycle(55.9, -8.6) -- (49.2, -8.6) -- (45.0, -1.9) -- (40.9, -8.6) -- (34.3, -8.6) -- (41.4, 2.4) -- (34.7, 12.8) -- (41.2, 12.8) -- (45.0, 6.2) -- (48.7, 12.8) -- (55.3, 12.8) -- (48.6, 1.9) -- cycle(67.7, -8.6) -- (61.9, -8.6) -- (61.9, 8.1) -- (56.7, 8.1) -- (56.7, 12.8) -- (72.9, 12.8) -- (72.9, 8.1) -- (67.7, 8.1) -- cycle(23.7, 44.3) -- (18.4, 22.9) -- (11.5, 22.9) -- (9.5, 32.2) .. controls (9.5, 32.4) and (9.4, 32.7) .. (9.3, 33.1) .. controls (9.2, 33.5) and (9.1, 34.0) .. (9.0, 34.6) .. controls (8.9, 35.1) and (8.8, 35.6) .. (8.8, 36.1) .. controls (8.7, 36.7) and (8.6, 37.1) .. (8.6, 37.5) .. controls (8.5, 37.1) and (8.5, 36.7) .. (8.4, 36.1) .. controls (8.3, 35.6) and (8.2, 35.1) .. (8.1, 34.6) .. controls (8.0, 34.0) and (7.9, 33.5) .. (7.8, 33.1) .. controls (7.7, 32.7) and (7.7, 32.4) .. (7.6, 32.2) -- (5.5, 22.9) -- (-1.3, 22.9) -- (-6.6, 44.3) -- (-1.0, 44.3) -- (1.3, 33.6) .. controls (1.4, 33.3) and (1.5, 32.9) .. (1.6, 32.4) .. controls (1.7, 31.9) and (1.8, 31.4) .. (1.9, 30.9) .. controls (2.0, 30.3) and (2.1, 29.8) .. (2.2, 29.2) .. controls (2.3, 28.7) and (2.4, 28.3) .. (2.4, 27.9) .. controls (2.5, 28.5) and (2.6, 29.2) .. (2.7, 30.0) .. controls (2.8, 30.7) and (3.0, 31.5) .. (3.1, 32.3) .. controls (3.3, 33.1) and (3.5, 33.8) .. (3.6, 34.5) .. controls (3.8, 35.2) and (3.9, 35.8) .. (4.0, 36.2) -- (5.9, 44.3) -- (11.2, 44.3) -- (13.1, 36.2) .. controls (13.2, 35.8) and (13.3, 35.2) .. (13.4, 34.5) .. controls (13.6, 33.8) and (13.8, 33.1) .. (13.9, 32.3) .. controls (14.1, 31.5) and (14.2, 30.7) .. (14.4, 29.9) .. controls (14.5, 29.2) and (14.6, 28.5) .. (14.7, 27.9) .. controls (14.7, 28.4) and (14.8, 29.0) .. (15.0, 29.8) .. controls (15.1, 30.5) and (15.2, 31.2) .. (15.4, 31.9) .. controls (15.5, 32.6) and (15.6, 33.2) .. (15.7, 33.5) -- (18.1, 44.3) -- cycle(38.4, 22.9) -- (37.3, 26.9) -- (30.4, 26.9) -- (29.3, 22.9) -- (22.9, 22.9) -- (29.9, 44.4) -- (37.6, 44.4) -- (44.7, 22.9) -- cycle(35.2, 35.2) .. controls (35.1, 35.5) and (34.9, 36.1) .. (34.8, 36.8) .. controls (34.6, 37.5) and (34.4, 38.2) .. (34.2, 39.0) .. controls (34.0, 39.8) and (33.9, 40.4) .. (33.8, 40.9) .. controls (33.7, 40.4) and (33.6, 39.8) .. (33.4, 39.1) .. controls (33.3, 38.3) and (33.1, 37.6) .. (32.9, 36.9) .. controls (32.7, 36.2) and (32.6, 35.6) .. (32.5, 35.2) -- (31.6, 31.6) -- (36.1, 31.6) -- cycle(64.3, 44.3) -- (57.3, 22.9) -- (50.5, 22.9) -- (43.5, 44.3) -- (50.0, 44.3) -- (52.9, 33.4) .. controls (53.0, 33.0) and (53.1, 32.5) .. (53.3, 31.9) .. controls (53.4, 31.2) and (53.5, 30.6) .. (53.7, 30.0) .. controls (53.8, 29.3) and (53.9, 28.8) .. (53.9, 28.4) .. controls (53.9, 28.8) and (54.0, 29.3) .. (54.1, 29.9) .. controls (54.2, 30.6) and (54.4, 31.2) .. (54.5, 31.8) .. controls (54.6, 32.5) and (54.7, 33.0) .. (54.9, 33.4) -- (57.8, 44.3) -- cycle(79.3, 22.9) -- (66.6, 22.9) -- (66.6, 44.3) -- (79.3, 44.3) -- (79.3, 39.7) -- (72.4, 39.7) -- (72.4, 36.3) -- (78.8, 36.3) -- (78.8, 31.6) -- (72.4, 31.6) -- (72.4, 27.6) -- (79.3, 27.6) -- cycle(9.8, 60.8) .. controls (9.8, 59.7) and (9.5, 58.6) .. (8.9, 57.5) .. controls (8.4, 56.5) and (7.4, 55.7) .. (6.2, 55.0) .. controls (5.0, 54.4) and (3.4, 54.0) .. (1.4, 54.0) .. controls (0.5, 54.0) and (-0.4, 54.1) .. (-1.1, 54.2) .. controls (-1.9, 54.3) and (-2.5, 54.4) .. (-3.2, 54.6) .. controls (-3.8, 54.8) and (-4.5, 55.1) .. (-5.2, 55.4) -- (-5.2, 60.5) .. controls (-4.0, 60.0) and (-2.8, 59.5) .. (-1.7, 59.2) .. controls (-0.5, 58.9) and (0.6, 58.7) .. (1.6, 58.7) .. controls (2.4, 58.7) and (3.0, 58.9) .. (3.4, 59.2) .. controls (3.8, 59.5) and (4.0, 59.9) .. (4.0, 60.3) .. controls (4.0, 60.9) and (3.7, 61.3) .. (3.1, 61.7) .. controls (2.6, 62.0) and (1.6, 62.5) .. (0.2, 63.2) .. controls (-0.9, 63.7) and (-1.8, 64.2) .. (-2.6, 64.7) .. controls (-3.4, 65.3) and (-4.0, 66.0) .. (-4.4, 66.8) .. controls (-4.8, 67.6) and (-5.0, 68.6) .. (-5.0, 69.8) .. controls (-5.0, 71.2) and (-4.7, 72.3) .. (-4.0, 73.2) .. controls (-3.3, 74.2) and (-2.4, 74.9) .. (-1.2, 75.3) .. controls (0.0, 75.8) and (1.5, 76.1) .. (3.1, 76.1) .. controls (4.5, 76.1) and (5.7, 75.9) .. (6.8, 75.6) .. controls (8.0, 75.3) and (9.0, 74.9) .. (9.8, 74.5) -- (8.1, 70.1) .. controls (7.1, 70.5) and (6.2, 70.8) .. (5.3, 71.0) .. controls (4.5, 71.3) and (3.6, 71.4) .. (2.9, 71.4) .. controls (2.1, 71.4) and (1.6, 71.3) .. (1.2, 71.0) .. controls (0.9, 70.8) and (0.7, 70.5) .. (0.7, 70.1) .. controls (0.7, 69.7) and (0.8, 69.4) .. (1.1, 69.2) .. controls (1.4, 68.9) and (1.8, 68.6) .. (2.4, 68.3) .. controls (3.0, 68.0) and (3.9, 67.6) .. (4.9, 67.1) .. controls (6.0, 66.7) and (6.8, 66.1) .. (7.6, 65.6) .. controls (8.3, 65.0) and (8.9, 64.4) .. (9.2, 63.6) .. controls (9.6, 62.9) and (9.8, 62.0) .. (9.8, 60.8) -- cycle(33.2, 65.1) .. controls (33.2, 62.9) and (32.8, 60.9) .. (32.1, 59.3) .. controls (31.4, 57.6) and (30.3, 56.3) .. (28.7, 55.4) .. controls (27.2, 54.5) and (25.2, 54.0) .. (22.8, 54.0) .. controls (20.4, 54.0) and (18.4, 54.5) .. (16.9, 55.4) .. controls (15.3, 56.3) and (14.2, 57.6) .. (13.4, 59.3) .. controls (12.7, 60.9) and (12.4, 62.9) .. (12.4, 65.1) .. controls (12.4, 67.3) and (12.7, 69.3) .. (13.5, 70.9) .. controls (14.2, 72.6) and (15.3, 73.8) .. (16.9, 74.7) .. controls (18.4, 75.6) and (20.4, 76.1) .. (22.8, 76.1) .. controls (25.2, 76.1) and (27.2, 75.6) .. (28.7, 74.7) .. controls (30.3, 73.8) and (31.4, 72.5) .. (32.1, 70.9) .. controls (32.8, 69.2) and (33.2, 67.3) .. (33.2, 65.1) -- cycle(18.4, 65.1) .. controls (18.4, 63.1) and (18.8, 61.6) .. (19.4, 60.5) .. controls (20.1, 59.4) and (21.2, 58.9) .. (22.8, 58.9) .. controls (24.4, 58.9) and (25.5, 59.4) .. (26.1, 60.5) .. controls (26.8, 61.6) and (27.1, 63.1) .. (27.1, 65.1) .. controls (27.1, 67.0) and (26.8, 68.5) .. (26.1, 69.7) .. controls (25.5, 70.8) and (24.4, 71.3) .. (22.8, 71.3) .. controls (21.2, 71.3) and (20.1, 70.8) .. (19.4, 69.7) .. controls (18.8, 68.5) and (18.4, 67.0) .. (18.4, 65.1) -- cycle(46.4, 54.3) -- (42.0, 69.8) -- (41.9, 69.8) .. controls (41.9, 69.4) and (42.0, 68.8) .. (42.0, 68.1) .. controls (42.0, 67.5) and (42.1, 66.7) .. (42.1, 65.9) .. controls (42.2, 65.1) and (42.2, 64.4) .. (42.2, 63.6) -- (42.2, 54.3) -- (37.0, 54.3) -- (37.0, 75.8) -- (44.8, 75.8) -- (49.2, 60.5) -- (49.3, 60.5) -- (53.7, 75.8) -- (61.4, 75.8) -- (61.4, 54.3) -- (56.1, 54.3) -- (56.1, 63.7) .. controls (56.1, 64.4) and (56.1, 65.1) .. (56.2, 65.9) .. controls (56.2, 66.7) and (56.2, 67.4) .. (56.2, 68.1) .. controls (56.3, 68.8) and (56.3, 69.3) .. (56.3, 69.7) -- (56.2, 69.7) -- (51.9, 54.3) -- cycle(78.8, 54.3) -- (66.1, 54.3) -- (66.1, 75.8) -- (78.8, 75.8) -- (78.8, 71.1) -- (71.8, 71.1) -- (71.8, 67.7) -- (78.3, 67.7) -- (78.3, 63.1) -- (71.8, 63.1) -- (71.8, 59.0) -- (78.8, 59.0) -- cycle;} \sbox\warpbox{\tikz{\textaspath}} \setlength{\warpboxwd}{\wd\warpbox} \setlength{\warpboxht}{\ht\warpbox} \begin{tikzpicture} \begin{scope} \pgftransformnonlinear{\wavewarp} \textaspath \end{scope} \end{tikzpicture} \vspace{2cm} \newcommand*{\textastext}{% \node[transform shape, transform shape nonlinear, inner sep=0pt, outer sep=0pt, align=center, font=\sffamily\Huge\bfseries] {% SOME\\ WAVE\\ TEXT};} \sbox\warpbox{\tikz{\textastext}} \setlength{\warpboxwd}{\wd\warpbox} \setlength{\warpboxht}{\ht\warpbox} \begin{tikzpicture} \begin{scope} \pgftransformnonlinear{\wavewarp} \textastext \end{scope} \end{tikzpicture} \end{document}