Hot
- Conflict between "siunitx" package and TikZ library "math"by pejsek on April 26, 2026 at 8:46 am
I am using the code from this answer in my project. My project also uses the package siunitx. The code no longer works when siunitx is loaded. I am just a regular user with no knowledge of internals of siunitx or TikZ. What can I do to use the code and siunitx at the same time? In the code below, all I did was add \usepackage{siunitx}. % Source - https://tex.stackexchange.com/a/586432 % Posted by loved.by.Jesus, modified by community. See post 'Timeline' for change history % Retrieved 2026-04-26, License - CC BY-SA 4.0 \documentclass{article} \usepackage{siunitx} % if removed, the code works just fine \usepackage{tikz} \usetikzlibrary{math} \begin{document} \begin{tikzpicture} %Two points (A) and (B) \coordinate (A) at (0,0); \coordinate (B) at (2,2); %--Computing the distance between (A) and (B) %Creating a math coordinate \tikzmath{coordinate \C; %Storing coordinates difference \C = (B)-(A); %Computing the length of C = (Cx,Cy) from its components Cx and Cy %Note the length \distAB is in points (pt) \distAB = sqrt((\Cx)^2+(\Cy)^2); } %--Drawing %line A -- B \draw (A) node [above] {A} -- (B) node[above] {B} node[midway]{\distAB pt}; %Circle with center in (A) and radius \distAB points \draw (A) circle (\distAB pt); \end{tikzpicture} \end{document} Thank you for any help.
- Changing greeks (in math mode) with XeLaTeXby Ryan Kong on April 26, 2026 at 7:22 am
I want to change the greek font into STEP while keeping all other math font in TeX Gyre Termes Math and text font in Times New Roman. The following is my MWE: %! TEX program = xelatex \documentclass{article} \usepackage{amsmath,amssymb,amsthm} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{Times New Roman} \setmathfont{TeX Gyre Termes Math} \setmathfont{STEP}[ range={upgreek, uprightgreek, itgreek, italicgreek}, script=greek ] \begin{document} $\alpha \beta \Gamma \Delta$\\ $f(x) = x^2$ \end{document} It gives me some error messages: undefined Transcript written on test.log. Missing number, treated as zero. <to be read again> Use of \??? doesn't match its definition. <argument> \??? I don't know where went wrong. I downloaded all the fonts I need, and I can run the code if I remove the code: \setmathfont{STEP}[ range={upgreek, uprightgreek, itgreek, italicgreek}, script=greek ] but it gives me this instead. Any help would be much appreciated.
- why \begin{align*}..\end{align*} spacing is different inside tikz Matrix node than outside?by Nasser on April 26, 2026 at 4:33 am
I am learning how to use tikz Matrix to layout few things. Notice that inside tikz matrix node, the alignment is not the same as outside tikz using standard &= for align math environment. I had to to put align environment inside a minipage to make it work inside tikz matrix node. It will not let me just use align directly since not paragraph mode. But the issue is the spacing between left side of &= and right side is different than outside tikz. \documentclass[12pt,varwidth]{standalone} %need varwidth to use align inside standalon \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \fbox{\begin{minipage}{1.5in} \vspace{0pt} % Fixes top spacing issues \noindent % Ensures no paragraph indentation {\small All plots used the same initial conditions \begin{align*} x(0) &=1\\ x'(0) &=1\\ \end{align*} } \end{minipage} } \begin{tikzpicture} \matrix (m) [matrix of math nodes, nodes={anchor=center}, row sep=3.5em, column sep=2.5em, nodes in empty cells, draw] { 1& 2& \begin{minipage}{1.5in} \vspace{0pt} % Fixes top spacing issues \noindent % Ensures no paragraph indentation {\small All plots used the same initial conditions \begin{align*} x(0) &=1\\ x'(0) &=1\\ \end{align*} } \end{minipage} &4 \\ 5& 6 & 7 & 8 \\ }; \foreach \i in {1,2,3,4} \foreach \j in {1,2} \draw [help lines] (m-\j-\i.south west) rectangle (m-\j-\i.north east); \end{tikzpicture} \end{document} Compiled with lualatex gives lualatex, TL 2026
- How to fully center text inside tikz Matrix node, which spans multiple columns?by Nasser on April 26, 2026 at 3:02 am
I need to make a node in tikz matrix which spans multiple columns. After much struggle and trial and error, this is the result \documentclass[12pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning,arrows,chains,matrix,scopes,fit} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture} \matrix (m) [matrix of math nodes, nodes={anchor=center}, row sep=3.5em, column sep=2.5em, nodes in empty cells, draw] {1 & 2 & 3 & 4 \\ 5 & & & \\ 9 & 10 & 11 & 12\\ }; \node[fit=(m-2-2)(m-2-4),align=center,text centered,draw,fill=yellow]{spans cols 2 to 4}; \end{tikzpicture} \end{document} Compiled using lualatex gives Which is what I want, except I do not know how to make the text "spans cols 2 to 4" to be fully centered inside the node that spans the columns. I tried adding align=center and text centered as you see, but this had no effect on vertical centering inside the node. What is correct way to do this? Now the baseline as you see of the text inside, is not aligned with the baseline of the other nodes in the tikz matrix. TL 2026
- Linebreak: Strange word protrusion into the margin without hyphenating word "impedance" interacted with `microtype`?by Explorer on April 26, 2026 at 1:58 am
Claim: I believe that the code example could be simplified further. However, I don't find it easy to construct... : Here below is the original case: % lualatex \documentclass[zihao=-4,fontset=none]{ctexbook} \RequirePackage[ papersize={210mm,297mm}, margin=25mm,showframe, ]{geometry} \RequirePackage{enumitem} \usepackage{txfonts} \usepackage[T1]{fontenc} \begin{document} \begin{enumerate}[label={[}\arabic*{]}, labelindent=\parindent, leftmargin=*] \item Tao Y, \textbf{Liu H}, Wang X, et al. Probabilistically Informed Motion Primitives for Impedance Control in Contact-Rich Manipulation Tasks[J]. xxxx. \end{enumerate} \end{document} If we add microtype, with lualatex, it works: % lualatex \documentclass[zihao=-4,fontset=none]{ctexbook} \RequirePackage[ papersize={210mm,297mm}, margin=25mm,showframe ]{geometry} \RequirePackage{enumitem} %%%%%%%%% \usepackage{txfonts} \usepackage[T1]{fontenc} \usepackage{microtype} \begin{document} \begin{enumerate}[label={[}\arabic*{]}, labelindent=\parindent, leftmargin=*] \item Tao Y, \textbf{Liu H}, Wang X, et al. Probabilistically Informed Motion Primitives for Impedance Control in Contact-Rich Manipulation Tasks[J]. xxxx. \end{enumerate} \end{document} But with xelatex, it doesn't: I found it hard to remove the \documentclass[zihao=-4]{ctexbook} dependency to simplifiy the code, which change fontsize internally... Learning from this link, there are many better alternatives to txfonts: \usepackage{newtxtext} \usepackage{tgtermes} \usepackage[T1]{fontenc} \setmainfont{Times New Roman} \setmainfont{TeX Gyre Termes} But all confront with the word "Impedance" protrusion without microtype... My questions are: What caused the word "Impedance" protrusion here? Is this the expected bahavior? And is microtype the recommended package to tweak here (while failed with xelatex😔)?
- ClawXiv package on MikTeXby Sebastiano on April 25, 2026 at 12:08 pm
I can’t really understand how this package works. When I miss some .sty files related to a package on CTAN, MikTeX asks me and I authorise the installation. I have the following error. ! LaTeX Error: File `clawxiv.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: \documentclass[12pt]{article} \usepackage{clawxiv} \begin{document} \begin{seniorquote}{25 aprile 2026}{}[] My test \end{seniorquote} \end{document}
- Images plus spacer to fit exactly text widthby user1850133 on April 25, 2026 at 11:34 am
How can I fill horizontally the whole space with e.g. 2 images and a spacer in between? Here's my try using \textwidth, but it crosses the text area. \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage[showframe]{geometry} \setlength\parindent{0pt} \begin{document} \includegraphics[width=.45\textwidth]{example-image-9x16} \hspace{.1\textwidth} \includegraphics[width=.45\textwidth]{example-image-9x16} \end{document}
- How can I use Lua syntax inside a pgfkeys key, and load that from Lua so I can later print it's descendents to TeX?by Jasper on April 25, 2026 at 9:34 am
How can I use Lua syntax inside a pgfkeys key, and load that from Lua so I can later print it's descendents to TeX? This MWE looks ridiculous, but don't laugh! It's actually designed to show the type of behaviour I want to enable. That is, I want to have lua syntax highlighting in certain keys when I set them, and lua category codes too. I think it would be a really beautiful thing. \documentclass{article} \usepackage{jasper} \begin{document} \setobject[nice = { -- this is some lua syntax local with = "a \\par!" local wow = "!" -- I want to use the % operator too local test = 5 % 2 tex.sprint(test) -- blah return 7 }] \end{document} \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesExplPackage{jasper}{1994/04/05}{v1.0.0}{ LuaLaTeX package for a question about pgfkeys and Lua. } \RequirePackage{tikz} \tikzset{ /jasper/.is~family ,/jasper/.cd ,nice/.code = {\protected@edef\jasper@nice{#1}} } \lua_load_module:n { George } \NewDocumentCommand { \setobject } {o} { \group_begin: \tikzset{ /jasper/.search~also = {/tikz} ,/jasper/.cd ,#1 } \__jasper_setobject: \group_end: } local function register_tex_cmd(name, func, args, protected) name = "__jasper_" .. name .. ":" .. ("n"):rep(#args) local scanners = {} for _, arg in ipairs(args) do scanners[#scanners+1] = token['scan_' .. arg] end local scanning_func = function() local values = {} for _, scanner in ipairs(scanners) do values[#values+1] = scanner() end func(table.unpack(values)) end local index = luatexbase.new_luafunction(name) lua.get_functions_table()[index] = scanning_func if protected then token.set_lua(name, index, "protected") else token.set_lua(name, index) end end local function body_expression(str) return load(str, "expression", "t", _G)() end local function set_object(hash) local object = body_expression(hash.object) local name = hash.name lua_tikz3dtools.math[name] = object end register_tex_cmd("setobject", function() set_object{ nice = token.get_macro("jasper@nice"), } end, { })
- pgf-PeriodicTable: usage of 'cell width' / 'cell height' ruins the layoutby cis on April 25, 2026 at 8:55 am
I want a full-page periodic table - in height and width! (Because I want to add external graphics as an overlay to the cells. That means a simple/artificial enlargement using scalebox or something similar is not useful.) As a test, I tried: cell width=40pt, cell height=50pt, but it ruins the layout (icons and text overlap or shift). What do I have to do? \documentclass[]{article} \usepackage[ showframe=true, a4paper, landscape, margin=10mm, ]{geometry} \usepackage{pgf-PeriodicTable} \begin{document} \noindent\pgfPT[ cell width=40pt,% example from manual, p. 22 cell height=50pt,% example from manual, p. 22 name font=\normalfont, show title=false, show legend=false, ] \end{document}
- MakeGlossaries failure: how to investigate what causes the failure?by Evan Aad on April 25, 2026 at 4:57 am
Several years ago I wrote a very long LaTex document, named Detailed.tex, complete with a bibliography, and an index, and a glossary. The file starts with several arara commands: % arara: clean: { extensions: [aux, bbl, bcf, blg, glg, glo, gls, idx, ilg, ind, ist, log, out, run.xml, slnc, tex~, toc] } % arara: lualatex % arara: biber % arara: makeglossaries % arara: lualatex % arara: makeglossaries % arara: lualatex Back then, when I ran arara Detailed the document compiled successfully. However, when I run this command now, the compilation fails when processing the glossary: (LuaLaTeX) LuaLaTeX engine .............................. SUCCESS (Biber) The Biber reference management software ......... SUCCESS (MakeGlossaries) The MakeGlossaries software ............ FAILURE I don't see any error message inside Detailed.log. There is no file named Detailed.glg. I don't know how to proceed to resolve this issue. Help will be greatly appreciated.
- How to draw steographically projected Clifford parallels?by Jasper on April 25, 2026 at 2:11 am
I want to draw that cool diagram by Penrose in twistor theor; it's supposed to be composed of steographically projected Clifford parallels. credit: https://www.eurekalert.org/multimedia/928836 Not this Clifford: But rather this one: I attempted to try it myself, as I am fond of stereographic projection. However, I have never studied Clifford tori. I have no basis to check is my work is actually based on Clifford parallels. I only made tori using regular old stereographic projection. I don't know if this is right. This is the MWE I made. It uses my package, which can be downloaded from github. \documentclass[tikz,border=1cm]{standalone} \usepackage{lua-tikz3dtools} % https://github.com/Pseudonym321/TikZ-Animations/tree/master1/TikZ/lua-tikz3dtools \begin{document} \foreach \CCC in {5,10,...,25} { \begin{tikzpicture} \useasboundingbox (-5,-5) rectangle (5,5); \appendlight[v = {return Vector:new{1, 1, 1 , 1}}] \def\SSS{3} \foreach \AAA in {0,30,60} { \pgfmathsetmacro{\AAA}{\AAA+\CCC} \setobject[ name=a,object={\AAA*pi/180} ] \setobject[ name=R, object={1/cos(a)} ] \setobject[ name=r, object={sqrt(abs(1/cos(a)^2)-abs(cos(a)))} ] \setobject[ name=view, object = {Matrix.zyzrotation3(pi/2, pi/3, pi/6)} ] \pgfmathtruncatemacro{\BBB}{((\AAA-10)*10/7)} \appendsurface[ ustart={pi/2}, ustop={-pi}, usamples= 20, vstart=0, vstop=tau, vsamples= 50, transformation = {return view}, v = { return Vector.hsphere3(u, v, r) :hadd(Vector:new{R*cos(u), R*sin(u), 0, 1}) }, filter = { local M = A:hadd(B):hadd(C):hscale(1/3):multiply(view:inverse()) return abs(M[1]) < \SSS.001 and abs(M[2]) < \SSS.001 and abs(M[3]) < \SSS.001 }, fill options = {fill={gray!\BBB!black!50!ltdtbrightness},fill opacity = 1}, curve = { local segments = {} local domain_origin = pi/2 local branches = 7 local samples_per_branch = 40 local samples = branches*samples_per_branch local step = tau/samples local function append_segment(s0, s1) if s1 <= s0 then return end local wrap = floor(branches*s0/tau + 1e-9) local u0 = domain_origin - s0 local u1 = domain_origin - s1 local v0 = branches*s0 - wrap*tau local v1 = branches*s1 - wrap*tau table.insert(segments, { Vector:new{u0, v0}, Vector:new{u1, v1}, drawoptions = "draw = green!50!black, thick" }) end for i = 0, samples - 1 do local s0 = i*step local s1 = s0 + step local wrap0 = floor(branches*s0/tau + 1e-9) local wrap1 = floor(branches*s1/tau + 1e-9) if wrap0 == wrap1 then append_segment(s0, s1) else local seam = (wrap0 + 1)*tau/branches append_segment(s0, seam) append_segment(seam, s1) end end return segments } ] } % ends foreach \appendsolid[ ustart=-\SSS, ustop=\SSS, usamples= \SSS, vstart=-\SSS, vstop=\SSS, vsamples= \SSS, wstart=-\SSS, wstop=\SSS, wsamples= \SSS, transformation = {return view}, filter = {return false}, v = {return Vector:new{u, v, w, 1}} ] \displaysimplices \end{tikzpicture}} % ends \CCC \end{document}
- Is there a way to add a local environment variable to latex workshop? [closed]by abgup on April 25, 2026 at 12:14 am
Specifically add another $TEXINPUTS path. I tried adding it locally via terminal and in vscode, but seems to not connect to latex workshop build, but will work in terminal using latexmk cli.
- How to test a string value with tabularray and functional? (target: coloring table cells according to their text content)by quark67 on April 24, 2026 at 10:31 pm
The tabularray package provides in his manual an example of testing integers values of a table for coloring background according to the value, positive or negative. \documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{functional} \begin{document} \IgnoreSpacesOn \prgNewFunction \colorBack {} { \intStepOneInline {1} {\arabic{rowcount}} { \intStepOneInline {1} {\arabic{colcount}} { \intSet \lTmpaInt {\cellGetText {##1} {####1}} \intCompareTF {\lTmpaInt} > {0} {\cellSetStyle {##1} {####1} {bg=purple8}} {\cellSetStyle {##1} {####1} {bg=olive8}} } } } \IgnoreSpacesOff \begin{tblr}{hlines,vlines,cells={r,$},process=\colorBack} -1 & 2 & 3 \\ 4 & 5 & -6 \\ 7 & -8 & 9 \\ \end{tblr} \end{document} But how to do the same, when the table contains the words Yes (light green background) and No (light red background)? First step, replacing \intSet \lTmpaInt {\cellGetText {##1} {####1}} with \strSet \lTmpaStr {\cellGetText {##1} {####1}} Second step, replacing \intCompareTF with \strCase (\strCase and \intCompareTF are described in the functional manual). So, in theory, this is working: \documentclass{article} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{functional} \begin{document} \IgnoreSpacesOn \prgNewFunction \colorBack {} { \intStepOneInline {1} {\arabic{rowcount}} { \intStepOneInline {1} {\arabic{colcount}} { \strSet \lTmpaStr {\cellGetText {##1} {####1}} \strCase {\lTmpaStr} { {No} {\cellSetStyle {##1} {####1} {bg=red!20}} {Yes} {\cellSetStyle {##1} {####1} {bg=green!20}} } } } } \IgnoreSpacesOff \begin{tblr}{hlines,vlines,process=\colorBack} Yes & No & No \\ No & No & Yes \\ No & Yes & No \\ \end{tblr} \end{document} But the result is a table with a white background: If I replace: \strSet \lTmpaStr {\cellGetText {##1} {####1}} with the simplier: \strSet \lTmpaStr {No} in theory, all cells have a light red background. This gives this code: \strSet \lTmpaStr {No} \strCase {\lTmpaStr} { But no, they are all white. In the functional manual, I read: So, \lTmpaStr is a string no? And the manual also says: So why isn't the code: \strCase {\lTmpaStr} { {No} {\cellSetStyle {##1} {####1} {bg=red!20}} {Yes} {\cellSetStyle {##1} {####1} {bg=green!20}} correct? Where is the mistake? How coloring background cells according to the value of the cells (obtained with \cellGetText {##1} {####1}) This question is focused to the tabularray package. So I hope that coloring background according to the text content in the cells is possible with tabularray.
- Improved visualization of the domains of integration in ℝ³by Sebastiano on April 24, 2026 at 9:26 pm
Before of this question, I would like to thank the authors of the answers and everyone who appreciated my question. I had previously created these two figures related to two triple integrals. Is there a better way to improve their presentation and make them clearer and more visually appealing? T={(x, y, z) ∈ ℝ³: (x²+y²)¹/² ≤ z ≤ 1}. \documentclass[12pt]{article} \usepackage{tikz,tikz-3dplot} \begin{document} \begin{center} \tdplotsetmaincoords{60}{130} \begin{tikzpicture}[tdplot_main_coords,scale=3] \pgfmathsetmacro{\h}{0.6} \pgfmathsetmacro{\raggio}{\h} \draw[thick,->] (0,0,0) -- (1.5,0,0) node [below left] {\footnotesize$x$}; \draw[dashed] (0,0,0) -- (-1.5,0,0); \draw[thick,->] (0,0,0) -- (0,1.5,0) node [right] {\footnotesize$y$}; \draw[dashed] (0,0,0) -- (0,-1.5,0); \draw[thick,->] (0,0,1.0) -- (0,0,1.5) node [above] {\footnotesize$z$}; \draw[dashed] (0,0,0) -- (0,0,1.0); \foreach \altura in {0.01,0.02,...,1.0}{ \draw[cyan,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\altura*cos(\t r)},{\altura*sin(\t r)},{\altura}); } \draw[blue,thick,fill=brown!50,opacity=0.6] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{\h}); \draw[dashed,fill=yellow,opacity=0.4] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},0); \foreach \t in {0,10,30,60,90,120,150,250,280,310}{ \draw[black,dashed,thin,opacity=0.7] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}) -- ({\raggio*cos(\t)},{\raggio*sin(\t)},0); } \fill[gray,opacity=0.1] (-1.2,-1.2,\h) -- (1.2,-1.2,\h) -- (1.2,1.2,\h) -- (-1.2,1.2,\h) -- cycle; \draw[red,very thick] (0,0,\h) -- (0,\raggio,\h); \node at (0,1.5,\h) {\small $z=h$}; \node at (0,0.5,0.75) {\small $z$}; \node at (0,0.25,-0.35) {\small $T(z=0)$}; \node at (0,.75,1.3) {\small $T(z=h)=T(z)$}; \end{tikzpicture} \end{center} \end{document} C= {(x,y,z)∈ ℝ³: z∈ [0, 2], x²+ y²≤ z} \documentclass[12pt]{article} \usepackage{tikz,tikz-3dplot} \begin{document} \begin{center} \tdplotsetmaincoords{70}{130} \begin{tikzpicture}[tdplot_main_coords,scale=2.5] \pgfmathsetmacro{\h}{.6} \pgfmathsetmacro{\raggio}{sqrt(\h)} \draw[thick,->] (0,0,0) -- (1.5,0,0) node [below left] {$x$}; \draw[thick,->] (0,0,0) -- (0,1.5,0) node [right] {$y$}; \draw[thick,->] (0,0,0) -- (0,0,1.5) node [above] {$z$}; \draw[red,very thick] plot[domain=-1:1,smooth,variable=\t] (0,{\t},{\t*\t}); \draw[blue,fill=yellow,opacity=0.4] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{\h}); \draw[fill=yellow,dashed,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\raggio*cos(\t r)},{\raggio*sin(\t r)},{0}) node [above] {\tiny $C(z)$}; \foreach \t in {0,10,...,350}{ \draw[gray, dashed, thin,opacity=0.4] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}) -- ({\raggio*cos(\t)},{\raggio*sin(\t)},0); } \foreach \altura in {0.0125,0.025,...,1.0}{ \pgfmathsetmacro{\radio}{sqrt(\altura)} \draw[cyan,thick,opacity=0.5] plot[domain=0:2*pi,smooth,variable=\t] ({\radio*cos(\t r)},{\radio*sin(\t r)},{\altura}); } \fill[orange!30,opacity=0.4] (-1,-1,\h) -- (1,-1,\h) -- (1,1,\h) -- (-1,1,\h) -- cycle; \draw[blue,very thick] (0,0,\h) -- (0,{\raggio},\h); \node[black, above right] at (0,{\raggio/2},\h) {\tiny $\sqrt{z}$}; \draw[blue,fill=yellow,dotted,thick,opacity=0.4] plot[domain=0:360,smooth,variable=\t] ({\raggio*cos(\t)},{\raggio*sin(\t)},{\h}); \draw[blue!80,thick] plot[domain=0:2*pi,smooth,variable=\t] ({cos(\t r)},{sin(\t r)},{1.0}); \end{tikzpicture} \end{center} \end{document}
- How are tone letters defined internally in T3 and TIPA? [closed]by Grzegorz Brzęczyszczykiewicz on April 24, 2026 at 8:34 pm
There are component parts used to build them in the T3 encoding chart, but how are they exactly built when this encoding is used in the tipa package? There are 5 distinct heights, which should means 25 parts used to build tones (or 50 when short variants are included). But there are only 9 (18) parts. This must mean the program that generates the tone letters has to reposition them vertically. How does it calculate the exact value to reposition the tone letter components? A basic example: \documentclass{article} \usepackage[tone]{tipa} \begin{document} \tone{54} \end{document} An extreme example: \documentclass{article} \usepackage[tone]{tipa} \begin{document} \tone{13243435}a \end{document} Made with: \tone{13243435}a (this command is only accessible using \usepackage[tone]tipa) How does it know how to raise each component part of the complex "bumpy" shape so that their ends will meet in the right place? Here is the code that yields this result. After looking at the T3 encoding table (which appears to be what tipa uses, it appears that this complex shape is composed of many simple lines, all of which are separate glyphs/characters in T3. I'm asking the question: how does it know how much to raise each component to make this shape?
- Ungrouped alternatives to \foreach which are still canonical to use with tikzby Jasper on April 24, 2026 at 7:51 pm
Are there ungrouped alternatives to \foreach which are still canonical to use with tikz? I need to define a color in a loop and use it outside. Maybe expl3? \documentclass{article} \usepackage{pgffor,xcolor} \begin{document} \foreach \i in {1,2} {\colorlet{blah}{blue!\i}} \textcolor{blah}{blah} \end{document}
- Why does babel warn about missing small caps font for an inactive language?by niru on April 24, 2026 at 6:14 pm
With babel's onchar option, one can set fonts for multiple languages as can be seen in the following example: \documentclass{article} \usepackage{babel} \babelprovide[main,import,onchar=ids fonts]{english} \babelfont{rm}{NewCM10-Book.otf} \babelfont{sf}{NewCMSans10-Book.otf} \babelfont{tt}{NewCMMono10-Book.otf} \babelprovide[import,onchar=ids fonts]{malayalam} \babelfont[malayalam]{rm}{RIT-Rachana-Regular.ttf} \babelfont[malayalam]{sf}{RIT-MeeraNew.ttf} \babelfont[malayalam]{tt}{RIT-tnjoy-regular.ttf} \begin{document} \textsc{hii} മലയാളം \end{document} This code produces: LaTeX Font Warning: Font shape `TU/RIT-Rachana-Regular.ttf(0)/m/sc' undefined (Font) using `TU/RIT-Rachana-Regular.ttf(0)/m/n' instead on input line 13. I understand that this font doesn't have small caps which is why the warning is issued, but what I do not understand is that the main language of the document is english. As per the warning, \textsc, on line 13, is issued when there is no way Malayalam would be active; then why does the font warning for Malayalam's font appear? By the way, the warning goes if I add [SmallCapsFont=RIT-Rachana-Regular.ttf] to the font declaration. This warning is quite pointless as despite declaring the small caps font for Malayalam, the actual small caps text is (correctly) printed with English's font. Then... why?
- Tikz pie chart with unitsby Thomas on April 24, 2026 at 1:07 pm
I have a pie chart representing a distribution of hours, and I'm using the option sum=auto to display the chat by these values. But I'd like to add the unit of the values inside the plot. If I type 12~h/Maths it raises error because LaTeX tries to compute the percentages. How could I achieve it ? \documentclass{article} \usepackage{pgf-pie} \begin{document} \begin{tikzpicture} \pie[sum = auto]{ 12/Maths, 9/Physique-Chimie, 2/Informatique, 2/TIPE, 2/Français } \end{tikzpicture} \end{document}
- Songbook with chordsby Cupora on April 24, 2026 at 12:58 pm
I'm about to make a guitar song book with LaTeX, which means, song lyrics with chords written above the lines: Gm Remember when you were young, Gb Bb You shone like the sun. Eb Dm Cm Bb F Shine on you crazy diamond. I found several packages doing this, and also some other ideas for custom LaTeX commands (for example here). However, I do not like the way the chords are added to the lyrics, since one needs to integrate the chord commands into the song lyrics: \chord{Eb}Shine\chords{Dm} y\chord{Cm}ou cr\chord{Bb}azy di\chord{F}amond which is a hell lot of work to format the lyrics copied from some website. I would prefer to be able to format the lines similar to this: \textlinewithchords{Eb Dm Cm Bb F}{^Shine^ y^ou cr^azy di^amond} so that the lyrics just contain the placeholders for the chords, and the chords input is separated. I would be glad if somebody had an idea how I could implement this behaviour 🙂
- Correct accented characters in pdf with pdflatex/OT1?by Alain Stalder on April 24, 2026 at 12:17 pm
I think this deserves its dedicated question even though the answer might be that it is not possible except with changes to tex sources or postprocessing the pdf, which both would appear to be major projects (at least for me with little specific prior coding knowhow around that)… Example: \DocumentMetadata{lang=en, pdfstandard=ua-2, pdfstandard=a-4f, tagging=on} \documentclass{article} \usepackage[noTeX]{mmap} \usepackage[OT1]{fontenc} \renewcommand{\familydefault}{\sfdefault} \begin{document} The [Loránd] Eötvös experiment was a physics experiment that measured the correlation between inertial mass and gravitational mass, demonstrating that the two were one and the same, something that had long been suspected but never demonstrated with the same accuracy. (Wikipedia) \end{document} When I copy text from the resulting pdf I get a text that starts with this: The [Lora´nd] Eo¨tvo¨s Similarly when I do show-pdf-tags --xml test.pdf I get this in the text with additional linebreaks <br> added for visibility (the fusing of words at end and beginning would be a separate issue): <?MarkedContent page="1" ?>The [Lora´nd] Eo¨tvo¨s experiment was a physics experiment that<br> measured thecorrelation between inertial mass and gravitational mass, <br> demonstrating that thetwo were one and the same, something that had long<brd> been suspected but neverdemonstrated with the same accuracy. (Wikipedia) Since the output is based on the OT1 character encoding, it puts a ¨ above an a to write an ä. (And, yes, with T1 character encoding you don't have that problem, nor with XeLaTeX and LuaLaTeX (Unicode), but since I am also using modes.mf pdflatex/OT1 is the only way so far that gives me sufficiently great typographical results for my purposes and tastes, as far as I can see mainly because anything beyond that lacks the METAFONT mechanisms for giving existing fonts a bit more weight in a sophisticated way.) Is there a way to fix this maybe with existing tex packages? For example, the mmap package I used above in the example (or I could also have used cmap) resolved the issue with ligatures, for example fl would now end up as two letters fl in the resulting pdf. Other than what might already be possible within TeX/LaTeX, I see in principle two ways in which this might be addressed: Provide some mechanism that could be applied in the code that is used by pdflatex/OT1 for rendering a pdf such that in the resulting pdf the two characters would be combined into one, I guess something like wrap them into a /ActualText span in the “normal” pdf text and just replace in the tagged texts, but I suspect that would not be trivial due to the structure of the code, etc. Post-process the resulting pdf with some code in some language. I do not know much about that specifically, but I gather that especially with tagged pdfs and the standards they would have to implement this might not be easy. For now my approach is just to essentially use the above approach from the example, which has the effect (besides the fusing of words) that my articles especially in German will likely not be found so well via search engines (and are less accessible).
- How to control "Attributes" added by tagpdf?by niru on April 24, 2026 at 11:30 am
I am compiling a document with the following minimal setup: \DocumentMetadata{tagging=on,lang={en-GB}} \documentclass{article} \usepackage{lua-unicode-math} \begin{document} quack \end{document} When I check show-pdf-tags mwe.pdf, it generates: Document (http://iso.org/pdf2/ssn): └─text-unit (https://www.latex-project.org/ns/dflt) / Part (http://iso.org/pdf2/ssn): └─text (https://www.latex-project.org/ns/dflt) / P (http://iso.org/pdf2/ssn): ┝━━Attributes: │ └/Layout: │ └TextAlign: "Justify" └─Marked content on page 1: quack I want to know what Attributes:, Layout: and TextAlign: "Justify" are and how I can control them. Is there any way I can remove this from the output?
- Subscripts with capital lettersby Guran Semiotovic on April 24, 2026 at 9:46 am
I'm aware that similar questions are addressed elsewhere, but I have not found the answer that I am looking for. I am in a situation where: Even though this is not a choice I enjoy, I must use a capital J as a subscript. Expressions such as $u_J$, $P_J$, $\mu_{J+1}$, $\lambda_{J+1}$ are present in many parts of the paper I am writing, hence in most symbols J appears as a subscript of a lowercase letter. Other subscripts are with lower case letters, so I will also have $u_J(t_n)$, $K_m$, etc. I am looking for good practices to make the document look decent, and to do that consistently, possibly with one or more macros, if that is necessary. As I said, I would rather not take this path, but the compromises above are unavoidable. I have read in several posts about: using scriptsize changing default size for all subscripts keeping things as they are using a ghost superscript such as $u^{}_J$. Would you be up for going again through these choices with me, and expose pros and cons of them, and perhaps proposing alternatives? I can not cope well with how ugly $u_J$, $\mu_{J + 1}$ look. I know that some of these are a matter of taste, but I'm trying to find a decent solution that will make my subscripts look harmonious. You can use this minimal document if you want \documentclass{article} \begin{document} \[ u_J, u_{J+1} \qquad u_J(t_n), \qquad u_{J,M}(t_n) \qquad, P_J, \qquad P_{J, M} \] \end{document}
- European Computer Modern-like font that allows for bold italic smallcaps (textsc)?by canIchangethis on April 24, 2026 at 8:40 am
I would love to have bold, italicised small caps in my LaTeX document, using T1 encoding and, ideally, a font as close as possible to European Computer Modern. And I would like to only redefine \textbf{\textit{\textsc{}}} so that I can use smallcaps in italic and bold from another font. Related, I found this older question: https://tex.stackexchange.com/a/746482/114622 Thus, this is my MWE, which doesn't work, as in, it produces the warning: Font shape `T1/cmr/bx/scit' undefined \documentclass{article} \usepackage[T1]{fontenc} begin{document} \begin{center} \textbf{\textit{\textsc{my text}}} \end{center} \end{document}
- Why the note is wrongly placed?by iago on April 24, 2026 at 8:00 am
Why the F note is wrongly placed, taking into account as documentation specifies? My code (removing spaces after ovbkt and wh, or including 6 in {} does not changes the output): \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[left=2.5cm, right=2.5cm]{geometry} \usepackage[english]{babel} \usepackage{musixtex} \def\nnotes{\vnotes1.6\elemskip} \begin{document} \begin{music} \parindent10mm% \instrumentnumber{1}% \setstaffs1{1}% \setclef1{60}% \nobarnumbers% \startextract% \nnotes\ovbkt {{'E}}{1}6\cchar{-5}{$F2$}\wh {F}\en% \zendextract \end{music} \end{document} And the output: But, I would expect the note an octave below, the same as where F is placed in page 148 of https://mirrors.ctan.org/macros/generic/musixtex/doc/musixdoc.pdf, If I use L instead of 'E for the overline, it compiles as it is expected. But I understand both are interchangeable.
- coding a book cover color and titleby Nate on April 24, 2026 at 2:45 am
I am planning to write a book (using the book class) that has both a physical and digital version. In the physical version I am planning to use the bookcover package to create the following: while having the front cover as the first page of the pdf: What is the best way to code this flexibly so it can be adapted to both versions? (I used Word to create these examples.)
- pgf-PeriodicTable: produce a gap at La and Acby cis on April 24, 2026 at 1:36 am
How could I create a gap here (as seen sometimes)? \documentclass[landscape]{article} \usepackage[margin=11mm]{geometry} \usepackage{pgf-PeriodicTable} \tikzset{every picture/.append style={remember picture}} \begin{document} \pgfPT[ show title=false, show legend=false, IUPAC=false,% puts La and Ac above ] % Test \begin{tikzpicture}[remember picture, overlay] \node[fill, inner sep=0pt, minimum size=2mm, cyan, text=red] at (3.center) {UL}; \end{tikzpicture} \end{document}
- Is \textit now long, instead of short?by rallg on April 24, 2026 at 1:25 am
In the past, something such as \textit{this\par that} would throw an error, because the \textit command was "short" (it could not span paragraphs). But I now see (TeXlive 2026) that is is "long" (can span paragraphs). This is verified by inspecting code in file latex.ltx even though that file is not necessarily loaded. Even AI did not know that! Or did I hack something, and forgot about it? EDIT: When I first asked the question, it was with the assumption that something had changed in TeXlive 2026. No, as the answers and comments reveal. Rather, I had not noticed this before. That is, I knew that \textit could not span paragraphs, but had not seen its full definition. MWE: \documentclass{article} \show\textit \expandafter\show\csname textit \endcsname \begin{document} \textit{Hello \par World.} Goodbye, cruel world! \end{document} That produces the following console output (simplified): > \textit=macro: ->\protect \textit . > \textit =\long macro: #1->\ifmmode \nfss@text {\itshape #1}\else \hmode@bgroup \text@command {#1}\its hape \check@icl #1\check@icr \expandafter \egroup \fi . <recently read> \textit Runaway argument? {Hello ! Paragraph ended before \text@command was complete. <to be read again> \par l.5 \textit{Hello \par World.} Goodbye, cruel world! The \show\textit tells us that \textit is protected by a sneaky TeX trick. The following \show reveals the trick. Thus, since \textit is supposed to be a "long" macro, with one argument, I expect that it should be able to span paragraphs, and take one argument (rather than being a switch). But that is not the case, because internally, \textit contains \text@command, which has different behavior. This kind of situation is not unique to \textit.
- calculating tangent vectors with partial derivativesby Jasper on April 23, 2026 at 1:57 am
I wanted to try calculating some tangent vectors for a picture, just for fun. This requires taking partial derivatives. It will be some time before I can automate partial derivatives algebraically for illustrations, even though it is a long term goal of mine. In the meantime, I want to see how people would suggest I approximate them. \documentclass[tikz,border=3.14mm]{standalone} \usepackage[3d]{luadraw}%https://github.com/pfradin/luadraw \begin{document} \begin{luadraw}{name=tangent} local g = graph3d:new{viewdir={30,60}, window={-4,4,-3,7}, size={12,12}, bbox=false} local f = function(u, v) return M( 3*math.cos(u)+math.cos(u)*math.sin(v), 3*math.sin(u)+math.sin(u)*math.sin(v), u+math.cos(v)) end -- local dfdu = ??? -- local dfdv = ??? local S = surface(f, 0, 2*math.pi, 0, 2*math.pi) g:Dfacet(S, {mode=mShadedOnly,color="blue"}) g:Show() \end{luadraw} \end{document}
- Separate cases for real part and imaginary part [closed]by Tom Huntington on April 22, 2026 at 11:38 pm
I am trying to recreate I want it working in github markdown, but github markdown doesn't support this trick Missing or unrecognized delimiter for \right \left. aaaa \right\} Edit Github requires you to use \lbrace and \rbrace \left. aaaa \right\rbrace
- Plot a domain in 3D with TikZ for a triple integralby Sebastiano on April 20, 2026 at 9:59 pm
I have to solve this triple integral ∭ x y|z|³/(1+ (x²+y²)⁴) dx dy dz, with a domain T={(x, y, z) ∈ ℝ³: x ≤ 0, y ≥ 0, z² ≤ x²+y² ≤ 1}. Plotting with DESMOS 3D I see this: Actually I am not able to visualise this domain in my mind. It should be a cylinder enclosed by a double-sloped cone, but I can’t quite get the x ≤ 0, y ≥ 0 parameters right. I’ve created something but I would like my drawing (or a new one) to be intuitive with TikZ3D so that I can correctly draw this integral. My MWE: \documentclass[12pt]{article} \usepackage{tikz} \usepackage{tikz-3dplot} \tdplotsetmaincoords{60}{130} \begin{document} \begin{tikzpicture}[tdplot_main_coords, scale=3] % assi \draw[->] (0,0,0) -- (1.3,0,0) node[right]{$x$}; \draw[->] (0,0,0) -- (0,1.3,0) node[left]{$y$}; \draw[->] (0,0,0) -- (0,0,1.3) node[above]{$z$}; \foreach \t in {0,1,...,359}{ \pgfmathsetmacro{\ct}{cos(\t)} \pgfmathsetmacro{\st}{sin(\t)} \draw[blue!60, opacity=0.75] (0,0,0) -- plot[domain=0:1, samples=40] ({\x*\ct},{\x*\st},{\x}); \draw[red!60, opacity=0.75] (0,0,0) -- plot[domain=0:1, samples=40] ({\x*\ct},{\x*\st},{-\x}); } \draw[thick] plot[domain=0:360, samples=200] ({cos(\x)},{sin(\x)},1); \draw[thick] plot[domain=0:360, samples=200] ({cos(\x)},{sin(\x)},-1); \end{tikzpicture} \end{document}