Month
- Decimals and Fractions on a Number lineby SandyM on July 11, 2025 at 7:08 am
Question: See the attached figure. I also provided MWE. Can anyone help me to achieve the desirable figure? MWE \documentclass[a4paper,landscape]{article} \usepackage[margin=1in]{geometry} \usepackage{tikz} \begin{document} \large \begin{center} \begin{tikzpicture}[scale=2,>=stealth, every node/.style={align=center,scale=.8}] \draw[black,line width=1pt] (-5,0)--(5,0); \foreach \i in {-5,...,5} \draw[teal] (\i,.1)--(\i,-.1) node[below]{\i}; \end{tikzpicture} \end{center} \end{document}
- Decoding the mystery calligraphic “I” in Pugh’s Real Mathematical Analysisby Sebastiano on July 10, 2025 at 9:22 pm
Regarding this link with the user's question and comments, I have not understood how to find the way the calligraphic letter I appearing in the text is represented. Other calligraphic fonts are eulervm (or affine). Could someone explain how it is possible to find it? In the PDF "Charles C. Pugh Real Mathematical Analysis Second Edition", the actually used fonts are the following (extracted from the .pdf file on page 443 of Appendix C Borel versus Lebesgue): RmqyxtBqtllcCMTI10 KcdtssWcpjxjCMBX12 RfwtcxGcnxkbMSBM10 JhgbpyShymrhCMMI10 PsknyfYsbdsyCMBX10 BstmcdKkrxmyCMR8 QystycRrkcwkCMSY10 QmxxlkDrkxjrCMSY8 MxrqrnWxqxycCsc PpvjqsGxxmhdCMMI8 NwrxcxSfqsqgCMEX10 XdlxbkFclrycCMR10 should be: CMR = Computer Modern Roman CMBX = Computer Modern Bold Extended CMMI = Computer Modern Math Italic CMSY = Computer Modern Symbol CMTI = Computer Modern Text Italic CMEX = Computer Modern Extension (large math symbols) MSBM = AMS Math Symbol B CMR8 = Computer Modern Roman (8pt size). I have researched all possible sites to identify the font, even pasting the character into a Word document. It doesn’t appear in the PDF metadata, but from the unknown source, it seems that the font might be MxrqrnWxqxycCsc. I think that an XeLaTeX/LuaLaTeX engine is used for this special "I".
- How to vertically glue two tcolorboxes?by Colas on July 10, 2025 at 8:12 pm
I would like to have two tcolorboxes exactly one above the other, without any vertical space between them. How can I achieve that? Here is a MWE. \documentclass{article} \usepackage[most]{tcolorbox} \newtcolorbox{box1}{colback = red, center} \newtcolorbox{box2}{colback = blue, center} \begin{document} \begin{box1} First box \end{box1} \begin{box2} Second box \end{box2} \end{document}
- How to vertically center a rotated cell across two rows in a LaTeX table?by Andy R on July 10, 2025 at 1:19 pm
I’m trying to format a table in LaTeX where one of the headers, "Header B", spans two rows and is rotated vertically using \rotatebox. I’d like this label to be centered vertically across the two rows, but I can’t get it to align properly. Here’s a minimal example of my table: \documentclass{article} \usepackage{multirow} \usepackage{tcolorbox} \begin{document} \begin{table}[h] \caption{Some caption\label{tab:sample}} \scalebox{1}{\centering \begin{tabular}{|l|l|l|l|l|} \cline{3-5} \multicolumn{2}{c|}{} & \multicolumn{3}{c|}{Header A} \\ \cline{3-5} \multicolumn{2}{c|}{} & Type A & Type B & Type C \\ \hline \multirow{2}{*}{\rotatebox[origin=c]{90}{Header B}} & \rotatebox[origin=c]{90}{Option 1} & \begin{tabular}[c]{@{}l@{}}\vspace{2mm}\\- Item 1 \\ - Item 2 \\ - Item 3 \\\vspace{2mm}\end{tabular} & \begin{tabular}[c]{@{}l@{}}\vspace{2mm}\\- Item 4 \\ - Item 5 \\ - Item 6 \\\vspace{2mm}\end{tabular} & \begin{tabular}[c]{@{}l@{}}\vspace{2mm}\\- Item 7 \\ - Item 8 \\ - Item 9 \\\vspace{2mm}\end{tabular} \\ \cline{2-5} & \rotatebox[origin=c]{90}{Option 2} & \begin{tabular}[c]{@{}l@{}}\vspace{2mm}\\- Item 10 \\ - Item 11 \\\vspace{2mm}\end{tabular} & \begin{tabular}[c]{@{}l@{}}\vspace{2mm}\\- Item 12 \\\vspace{2mm}\end{tabular} & \begin{tabular}[c]{@{}l@{}}\vspace{2mm}\\- Item 13 \\ - Item 14 \\ - Item 15 \\\vspace{2mm} \end{tabular} \\ \hline \end{tabular}} \end{table} \end{document} Does anyone know how I can properly center the rotated "Header B" text across the two rows? Thanks in advance!
- Draw illustration (cylindric)by Alex on July 10, 2025 at 1:08 pm
I have a such image And I try to draw this in Tikz, and have some troubles: how to set the correct viewing angle (as in the picture) for set the correct position of the plane at an angle of $2pi/3$? \documentclass[tikz,border=3.14mm]{standalone} \usepackage{amssymb} \usepackage{amsmath,amsthm} %\pdfpkresolution=2400 %\pdfpkmode={supre} %\usepackage[exscale]{ccfonts} \usepackage{tempora} \usepackage{newtxmath} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikz} \usepackage{tikz-cd} \usetikzlibrary{ arrows, matrix, arrows.meta, backgrounds, fit, matrix, positioning, calc, patterns, arrows.meta, graphs, shapes.misc, shadows.blur, shapes.geometric, decorations.pathmorphing } \newcommand{\myunit}{1 cm} \tikzset{ node style sp/.style={draw,circle,minimum size=\myunit}, node style ge/.style={circle,minimum size=\myunit}, arrow style mul/.style={draw,sloped,midway,fill=white}, arrow style plus/.style={midway,sloped,fill=white}, } \pgfplotsset{compat=1.18} \usepackage{tikz,tikz-3dplot} \begin{document} \tdplotsetmaincoords{70}{110} \begin{tikzpicture}[tdplot_main_coords,scale=0.8] \tikzstyle{every node}=[font=\small] % Define parameters \def\R{2.5} \def\zheight{4} \def\zbottom{-2.5} \def\phiangle{60} % Draw the complete cylinder (from bottom to top) % Bottom circle (hidden, at z = zbottom) \draw[thick,dashed] (0,0,\zbottom) circle (\R); % Circle at z = 0 \draw[thick] (0,0,0) circle (\R); % Top circle at z = z₀ \draw[thick] (0,0,\zheight) circle (\R); % Cylinder sides (visible parts) \draw[thick] (\R,0,\zbottom) -- (\R,0,\zheight); \draw[thick] (-\R,0,\zbottom) -- (-\R,0,\zheight); % Dashed lines for hidden parts \draw[thick,dashed] (0,\R,\zbottom) -- (0,\R,\zheight); \draw[thick,dashed] (0,-\R,\zbottom) -- (0,-\R,\zheight); % Draw coordinate planes % z = 0 plane (gray, transparent) \filldraw[fill=gray!20, draw=gray, opacity=0.3] (-4,-4,0) -- (4,-4,0) -- (4,4,0) -- (-4,4,0) -- cycle; % z = z₀ plane (gray, transparent) \filldraw[fill=gray!20, draw=gray, opacity=0.3] (-4,-4,\zheight) -- (4,-4,\zheight) -- (4,4,\zheight) -- (-4,4,\zheight) -- cycle; % φ = 2π/3 plane \tdplotsetrotatedcoords{0}{0}{\phiangle} \begin{scope}[tdplot_rotated_coords] \filldraw[fill=gray!10, draw=gray, opacity=0.4] (0,0,0) -- (4,0,0) -- (4,0,\zheight) -- (0,0,\zheight) -- cycle; \end{scope} % Mark important points and labels \node at (0,0,0) [below left] {$O$}; \node at (3.5,0,0) [below] {$\varphi_0$}; \node at (0,0,\zheight) [left] {$z = z_0$}; \node at (0,0,-0.3) [below] {$z = 0$}; \node at (\R,0,2) [right] {$r = R$}; % Draw angle arc for φ₀ = 2π/3 \tdplotdrawarc[thick,->]{(0,0,0)}{1.5}{0}{\phiangle}{anchor=north}{$\varphi_0 = \varphi = \frac{2\pi}{3}$} % Draw radial line \draw[thick] (0,0,0) -- ({\R*cos(\phiangle)},{\R*sin(\phiangle)},0); % Add "2" label inside cylinder \node at (0,0,2) [font=\large] {$2$}; % Add dimensional indicators \draw[<->] (\R+0.5,0,0) -- (\R+0.5,0,\zheight) node[midway,right] {$z_0$}; \draw[<->] (0,0,-0.7) -- (\R,0,-0.7) node[midway,below] {$R$}; % Mark the cylinder boundary at z = z₀ \draw[thick] (0,0,\zheight) circle (\R); % Draw dashed construction lines \draw[dashed] (0,0,\zbottom) -- ({\R*cos(\phiangle)},{\R*sin(\phiangle)},\zbottom); \draw[dashed] (0,0,0) -- ({\R*cos(\phiangle)},{\R*sin(\phiangle)},0); \draw[dashed] (0,0,\zheight) -- ({\R*cos(\phiangle)},{\R*sin(\phiangle)},\zheight); \draw[dashed] ({\R*cos(\phiangle)},{\R*sin(\phiangle)},\zbottom) -- ({\R*cos(\phiangle)},{\R*sin(\phiangle)},\zheight); % Draw coordinate axes (on top, black) \draw[thick,-latex] (0,0,0) -- (5,0,0) node[anchor=north east]{$x$}; \draw[thick,-latex] (0,0,0) -- (0,5,0) node[anchor=north west]{$y$}; \draw[thick,-latex] (0,0,\zbottom-0.5) -- (0,0,5) node[anchor=south]{$z$}; \end{tikzpicture} \end{document} Current result:
- I can't find this symbol (looks like a T)by user314271 on July 10, 2025 at 3:13 am
I wanted to write the following equation: However, I wasn't able to find the symbol just after the = sign (shown inside the red rectangle in the figure below). I've searched through Detexify and the Comprehensive LaTeX symbols list.
- Create string expansion in a single commandby Æzor Æhai -him- on July 7, 2025 at 7:20 pm
I am uncertain of what terms to search for to ask this question, but my goal is something along these lines: \documentclass{article} [\mycommand definition] \begin{document} 1: \mycommand{a,b} 2: \mycommand{b} 3: \mycommand{c,a} \end{document} produces: 1: Alpha, beta 2: Beta 3: Alpha, gamma Preferably, the expanded strings are generated in a defined order, e.g. a always precedes b, etc., as in #3, but not a strict requirement if the complexity trade-offs are too high. (Also, the would be nice if the first character was capitalized.)
- Tcolorbox with boundary box with shadedby Rajesh TeXnicians on July 7, 2025 at 3:55 pm
I'm looking to create a specific box structure in LaTeX using tcolorbox: I need an inner boundary box to be enclosed by an outer, shaded box. I have attached images (or can attach them) that illustrate the desired nested box structure. Any help with the LaTeX code would be greatly appreciated! Please find MWE file: \documentclass{article} \usepackage{blindtext} \usepackage[most]{tcolorbox} \usetikzlibrary{shapes.geometric,calc,backgrounds} \newlength{\internalshift} \setlength{\internalshift}{10pt} \pgfdeclarelayer{background rounded rect} \pgfsetlayers{background rounded rect,main} \tcbset{% innerboxcolback/.colorlet=tcbcol@innerback, outerboxcolback/.colorlet=tcbcol@outerback, outerboxcolframe/.colorlet=tcbcol@outerboxframe, innerboxcolback=gray!40, outerboxcolback=gray!20, outerboxcolframe=blue, } \makeatletter \newtcolorbox{curvedbox}[1][]{% enhanced, breakable, colback=black!20, colframe=green, innerboxcolback=gray!90, arc=\internalshift, auto outer arc, interior hidden, frame hidden, attach boxed title to top center, boxed title style={colback=tcbcol@outerback,enhanced,frame hidden}, coltitle=black, title={Title}, underlay={% Drawing the blue \begin{pgfonlayer}{background rounded rect} \draw[tcbcol@outerboxfrmame, line width=0.5pt, fill=tcbcol@outerback,rounded corners=1.5\internalshift] ($(frame.north west) + (0pt,1\internalshift)$) rectangle ($(frame.south east) - (0pt,\internalshift)$); \draw[tcbcol@outerboxframe, line width=0.5pt,fill=tcbcol@outerback,rounded corners=1.5\internalshift] ($(frame.north west) - (0.5\internalshift,0.5\internalshift)$) rectangle ($(frame.south east) + (0.5\internalshift,0.5\internalshift)$); \end{pgfonlayer} },% End of underlay % Now the yellow box underlay if the box is unbroken underlay unbroken={\draw[line width=1.5pt, fill=tcbcol@innerback,rounded corners=\kvtcb@arc] (frame.north west) rectangle (frame.south east);}, % Now the yellow box underlay if the box is broken, provide rounded rectangles for the first at the bottom and for the middle and last on the top. underlay first={\draw[line width=1.5pt, fill=tcbcol@innerback,rounded corners=\kvtcb@arc] (frame.north west) rectangle (frame.south east);}, underlay middle and last={\draw[line width=1.5pt, fill=tcbcol@innerback,rounded corners=\kvtcb@arc] (frame.north west) rectangle (frame.south east);}, #1 } \makeatother \begin{document} \begin{curvedbox} \blindtext[10] \end{curvedbox} \end{document}
- Was there ever a ConTeXt Mark III or Context Mark V?by John on July 7, 2025 at 12:31 am
According to the Wikipedia article on ConTeXt, there are ConTeXt Marks I, II, IV, and LMTX. Occasionally, I also see LMTX referred to as MkXL, as in the filename cont-new.mkxl. According to the ConTeXtGarden Wiki page, Mark VI is just Mark IV with named parameters, all of which leaves me the question: Have there ever been ConTeXt marks 3 (III), 5 (V), or any of 7--39 (VII -- XXXIX)? EDIT if not, why are those versions skipped?
- Kerning error around "l" in purchased font ("Better Sans")by Keks Dose on July 4, 2025 at 5:45 pm
I bought a font called "Better Sans" here: Better Sans at MyFonts . Used with LaTeX and LibreOffice, there is a kerning error, but used with Textmaker, Word and InDesign, no error occurs. Is there a way to get rid of the bad kerning around the "l"? I've only got the *.otf files. The seller refuses to concede the bug in the *.otf files. Any help appreciated! MWE: \documentclass[fontsize=24pt, DIV=30]{scrartcl} \usepackage{fontspec} %\defaultfontfeatures{Ligatures=TeX} \setmainfont{Better Sans Regular}[BoldFont=Better Sans Semibold,ItalicFont=Better Sans Italic] \setmainfont{Better Sans Regular}[BoldFont=Better Sans Semibold,ItalicFont=Better Sans Italic] \newfontfamily{\fettig}{Better Sans Black}[ItalicFont=Better Sans Black italic] \newfontfamily{\extraheavy}{Better Sans Heavy}[ItalicFont=Better Sans Heavy italic] \newfontfamily{\leicht}{Better Sans Light}[ItalicFont=Better Sans Light italic] \addtokomafont{title}{\fettig} \title{Bestellung\\ Helles Spüllicht} \date{} \begin{document} \maketitle \vspace*{-4cm} Südlicht Bestellung (Regular) \emph{Südlicht Bestellung} (Regular Italic) \extraheavy Spüllicht Bestellung (Heavy) \emph{Bestellung} (Heavy Italic) \leicht Spüllicht Bestellung (Light) \emph{Spüllicht Bestellung} (Light Italic) \fettig Spüllicht Bestellung (Black) \emph{Spüllicht Bestellung} (Black Italic) \end{document} % Local Variables: % TeX-engine: luatex % End: Result: But if I use TextMaker, no error. With LibreOffice, error there. Libre-Office, Writer: But with Textmaker (and apparently Word and InDesigner, as reported by the Seller of the fonts, MyFont):
- Old PSTricks drawing not working as it previously didby Svend Tveskæg on July 2, 2025 at 7:52 pm
Consider the following drawing: \DocumentMetadata{} \documentclass{article} \usepackage{pstricks-add} \def\laengdeD{216} \def\bredde{120} \def\sti[#1]{% \pscustom[#1]{% \psarc(\fpeval{\laengdeD-\bredde/4},\fpeval{\bredde/4}){\fpeval{\bredde/4}}{-90}{90} \psarc(\fpeval{\laengdeD-\bredde/4},\fpeval{\bredde/4*3}){\fpeval{\bredde/4}}{-90}{90} \psframe(\laengdeD,\bredde)% }% }% \begin{document} \begin{figure} \centering \psset{ unit = 0.05 } \begin{pspicture}(224,128) \psclip{ \sti[ linestyle = none ] } \psframe[ fillstyle = vlines, % Fyldstil til området, der ikke må vandes. hatchcolor = black, % Farve til området, der ikke må vandes. hatchsep = 1pt, linestyle = none ](\fpeval{\laengdeD-\bredde/4},0)(\laengdeD,\bredde) \endpsclip \sti[] \psdots(\fpeval{\laengdeD-\bredde/4},\fpeval{\bredde/4}) (\fpeval{\laengdeD-\bredde/4},\fpeval{\bredde/4*3}) \psset{ arrows = |<*->|*, linestyle = dotted, offset = 12pt, nrot = :U } \pcline(0,\bredde)(\laengdeD,\bredde) \ncput*{\qty{\laengdeD}{\m}} \pcline(\laengdeD,\bredde)(\laengdeD,0) \ncput*{\qty{\bredde}{\m}} \end{pspicture} \end{figure} \end{document} Question As far as I remember, when I first had this drawing made (probably with the help of Herbert Voß), the two semicircles were not filled; only the two corners and the middle part of left side were filled. How do I change the drawing to achieve this once more?
- Explode a group of slices in pgf pieby Papagon on July 1, 2025 at 6:39 pm
on this tikzpicture, there are two exploded slices, but I would like them to be exploded "together", as a group. How may I do that? \documentclass[tikz, border=5pt]{standalone} \usepackage{amsmath} \usepackage{tikz,pgf-pie} \begin{document} \begin{tikzpicture}[scale=0.36] \pie[color={gray,white,white,gray,white},explode={0.2,0.2,0,0,0},hide number]{10,25,15,15,35}; \end{tikzpicture} \end{document} Thank you!
- How to plot curve given implicitlyby Apollonius on July 1, 2025 at 3:21 pm
How do I use pgfplots to plot something like this? as you can see, this is the locus of the curve $x^2y+xy^2-x^4-y^4=0$. Here is an example which did work, where my work-around was to use a parametrisation of the curve. However, ideally I'm looking for a more direct solution. \documentclass[tikz, border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines=none, ] \addplot[ domain=-1.20:1.20, samples=100, smooth, black, variable=t, ] ({t^2 - 1}, {t^3 - t}); \end{axis} \end{tikzpicture} \end{document}
- How to *locally* expose lua code in a .sty fileby Jasper on June 30, 2025 at 9:07 am
I want to make latex commands which run lua code. In particular, I want to know how to properly expose this lua code locally to a .sty file, so I don't have to require it in every newcommand. My big underlying goal here is to learn how to properly use lua and latex together. Reference: https://tex.stackexchange.com/a/742410/319072 % test.tex % arara: lualatex \documentclass[border = 1cm]{standalone} \usepackage{test} \begin{document} \begin{tikzpicture} \appendpoint{-1}{0} \appendpoint{1}{0} \appendpoint{0}{-1} \appendpoint{0}{1} \rotatepoints{math.pi/4} \renderpoints \end{tikzpicture} \end{document} % test.sty \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesPackage{test} [ 2025/06/30 v0.01 LaTeX package for an inquiry on TeX.SE. ] \RequirePackage{tikz} \newcommand{\appendpoint}[2]{ \directlua{ local test = require("test") test.append_point(#1,#2) } } \newcommand{\renderpoints}{ \directlua{ local test = require("test") test.render_points() } } \newcommand{\rotatepoints}[1]{ \directlua{ local test = require("test") test.list_of_points = test.mult( test.list_of_points ,test.rotate(#1) ) } } -- test.lua local test = {} test.list_of_points = {} function test.append_point(x,y) table.insert(test.list_of_points,{x,y,1}) end function test.render_points() for i = 1, #test.list_of_points do tex.print( string.format( [[ \fill (%f,%f) circle[radius = 0.1]; ]] ,test.list_of_points[i][1] ,test.list_of_points[i][2] ) ) end end function test.mult(A,B) local rows_A = #A local columns_A = #A[1] local rows_B = #B local columns_B = #B[1] assert( columns_A == rows_B ,string.format( [[ Wrong size matrices for multiplication. Size A: %f,%f Size B: %f,%f ]] ,rows_A,columns_A ,rows_B,columns_B ) ) local product = {} for row = 1, rows_A, 1 do product[row] = {} for column = 1, columns_B, 1 do product[row][column] = 0 for dot_product_step = 1, columns_A, 1 do product[row][column] = ( product[row][column] + A[row][dot_product_step] * B[dot_product_step][column] ) end end end return product end function test.rotate(angle) return { {math.cos(angle),math.sin(angle),0} ,{math.cos(angle+math.pi/2),math.sin(angle+math.pi/2),0} ,{0,0,1} } end return test
- Is there a TECkit equivalent in LuaTeX?by yannis on June 29, 2025 at 6:33 pm
XeTeX uses TECkit map files as a regular grammar to derive output character words from input character words. For example: U+0021 U+0060 <> U+00A1 ; produces a Spanish inverted exclamation mark from an exclamation mark followed by an ASCII grave accent. Is there, or can there be, something equivalent in LuaTeX?
- Where and why does LuaLaTeX imports the lualibs libraries?by yannisl on June 29, 2025 at 8:28 am
Consider the following MWE demonstrating that when compiling with LuaLaTeX there is no need to require("lualibs"). Where in the sources are these libraries loaded and why? \documentclass{article} \begin{document} testing \directlua{ for key,v in pairs(lualibs.module_info) do tex.print(-2,key .." = " .. v, " ") end } \end{document}
- Expanding macros to stringby LemeRus on June 28, 2025 at 1:37 pm
I have macros for output first char of string. \makeatletter \def\firstchar#1{\expandafter\checkfirst#1\@nil} \def\checkfirst#1{% \ifx\UTFviii@two@octets#1% \expandafter\gettwooctets \else \expandafter\@car\expandafter#1% \fi } \def\gettwooctets#1#2#3\@nil{\UTFviii@two@octets#1#2} \makeatother It works if I pass a string directly like \firstchar{Иванович} If I pass macros with english string it also works correctly. But if I try \firstchar{\developerPatron} where \newcommand{\developerPatron}{Иванович} I see error ! LaTeX Error: Invalid UTF-8 byte sequence (�\nexttoken). \nexttoken is any token following \firstchar{…} call. I tried some variants with \expandafter. Below are variants of code and mathing errors. C: \expandafter\firstchar{\developerPatron} E: ! Missing \endcsname inserted. <to be read again> \protect E: ! LaTeX Error: Invalid UTF-8 byte sequence (�\endcsname\nexttoken). C: \expandafter\firstchar{\expandafter\developerPatron} E: ! Undefined control sequence. \firstchar #1->\expandafter \checkfirst #1\@nil E:! Argument of \@car has an extra }. <inserted text> \par E: Runaway argument? {}.\,\fi \developerSurName \color@endgroup ! Paragraph ended before \@car was complete. <to be read again> \par E: ! Extra }, or forgotten \endgroup. <recently read> } C: \expandafter\firstchar\expandafter\developerPatron E: ! Missing \endcsname inserted. <to be read again> \protect E: ! LaTeX Error: Invalid UTF-8 byte sequence (�\endcsname\nexttoken). How can I expand \developerPatron to \firstchar work correctly with cyrillic strings?
- Use foreach loop variable in path coordinatesby Franz on June 27, 2025 at 12:36 pm
I have the following code: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture} \begin{axis}[% axis x line=center, axis y line=center, xmax=2., xmin=-1., ymax=2., ymin=-1., ] \foreach \eps in { 1.0, 0.39810717, 0.15848932, 0.06309573, 0.01 }{ \addplot[ domain=\eps/\pgfkeysvalueof{/pgfplots/xmax}:\pgfkeysvalueof{/pgfplots/xmax}, samples=100, mark=none, name path=reg, ] {\eps/x}; % \path [name path=xaxis] % (\eps/\pgfkeysvalueof{/pgfplots/xmax}, 0.0) -- % (\pgfkeysvalueof{/pgfplots/xmax}, 0.0); % \addplot[ % gray, % opacity=0.5 % ] fill between [of=reg and xaxis]; } \end{axis} \end{tikzpicture} \end{document} Adding the commented lines I get an Undefined control sequence \eps error. Using \eps in the definition of the function and domain works. But apparently I cannot use it in the coordinates of a node. Could someone give me a brief explanation why this is the case? How can I make use of the value of \eps? EDIT: Using \closedcycle as suggested by samcarter_is_at_topanswers.xyz does not work for me as I need to use \eps also in other places. This is what I want the plot to look like (loop unrolled for two cases): \path [name path=yaxis] (0.0, 0.0) -- (0.0, \pgfkeysvalueof{/pgfplots/ymax}); \addplot[ domain=1/\pgfkeysvalueof{/pgfplots/xmax}:\pgfkeysvalueof{/pgfplots/xmax}, samples=100, mark=none, name path=reg, ] {1/x}; \path [name path=xaxis] (1/\pgfkeysvalueof{/pgfplots/xmax}, 0.0) -- (\pgfkeysvalueof{/pgfplots/xmax}, 0.0); \addplot[ gray, opacity=0.5 ] fill between [of=reg and xaxis]; \path [name path=toinf] (1/\pgfkeysvalueof{/pgfplots/xmax}, 0.0) -- (1/\pgfkeysvalueof{/pgfplots/xmax}, \pgfkeysvalueof{/pgfplots/ymax}); \addplot[ gray, opacity=0.5 ] fill between [of=yaxis and toinf]; \addplot[ domain=0.1/\pgfkeysvalueof{/pgfplots/xmax}:\pgfkeysvalueof{/pgfplots/xmax}, samples=100, mark=none, name path=reg, ] {0.1/x}; \path [name path=xaxis] (0.1/\pgfkeysvalueof{/pgfplots/xmax}, 0.0) -- (\pgfkeysvalueof{/pgfplots/xmax}, 0.0); \addplot[ gray, opacity=0.5 ] fill between [of=reg and xaxis]; \path [name path=toinf] (0.1/\pgfkeysvalueof{/pgfplots/xmax}, 0.0) -- (0.1/\pgfkeysvalueof{/pgfplots/xmax}, \pgfkeysvalueof{/pgfplots/ymax}); \addplot[ gray, opacity=0.5 ] fill between [of=yaxis and toinf]; Also using \closedcycle results in the axis lines been drawn multiple times as seen here:
- Reference a TikZ coordinate from later in the pictureby schtandard on June 26, 2025 at 8:19 am
I want to clip a tikzpicture to a shape that is derived from a node in the tikzpicture (which should also be clipped). In order to do this, I need to know the node coordinates (for clipping) before the node is defined. How can I do this? Here's an MWE. The red box marks the desired clipping path. If I uncomment the \clip path at the start of the picture, I get the error No shape `testnode' is known., of course. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} % \clip % (testnode.north west) % -- (testnode.south west) % -- (testnode.east) % -- (testnode.north east) % -- cycle; \draw [blue, very thick] (-1,0) sin (-.5,.5) cos (0,0) sin (.5,-.5) cos (1,0); \node (testnode) {This is a test}; \draw [red] (testnode.north west) -- (testnode.south west) -- (testnode.east) -- (testnode.north east) -- cycle; \end{tikzpicture} \end{document}
- Save old command with \let which was redefined in an environmentby one too many on June 25, 2025 at 5:50 pm
I am writing some notes, where for brevity, I want to have a shorthand for arrows: \def\->{\ensuremath{\rightarrow}} \def\=>{\ensuremath{\Rightarrow}} which also improves the readability of code. Due to how (la)tex handles commands (no idea), \=> also overrides \= (similar for \-> and \-) The tabbing environment redefines the command \= as a tab placing marker. Thus \begin{tabbing} Some text \= with \tabs \\ in a \> new \> line \end{tabbing} is not working anymore. I can save the old command with \let\macron\=. However, this only saves the \= (macron) outside the tabbing environment. Question: How to use \let for a command redefined inside an environment? BTW: I solved the problem by using the tabular environment, which I actually prefer. I am asking out of curiosity.
- Differences between \int_compare:nNnTF and \int_compare:nTFby chrispi_cookie on June 25, 2025 at 3:43 pm
I'm writing a personal package where I compare some integer variables. Because \int_compare:nNnTF is around 5 times faster than \int_compare:nTF according to expl3 interfaces I tried the comparisons with the first one and noticed some differences in the evaluation of the integer expressions between both functions. What I've done: \documentclass{article} \begin{document} \ExplSyntaxOn \int_compare:nNnTF { 0 } = { 0test } { TRUE } { FALSE } % prints: testTURE \int_compare:nNnTF { 1 } = { 0test } { TRUE } { FALSE } % prints: testFALSE \int_compare:nTF { 0 = 0test } { TRUE } { FALSE } % error (LaTeX Error: Relation 't' not among =,<,>,==,!=,<=,>=) \int_compare:nTF { 1 = 0test } { TRUE } { FALSE } % error (LaTeX Error: Relation 't' not among =,<,>,==,!=,<=,>=) \ExplSyntaxOff \end{document} I expected the errors in the last two cases, but I thought all cases should result in errors. After some research the integer expressions in \int_compare:nNnTF are evaluated basically as \the\numexpr<integer-expression>\relax and \the\numexpr0test\relax gives indeed 0test. In contrast the definition for \int_compare:nTF is more complicated to support more relational symbols. According to the documentation, the integer expressions are evaluated in the same way for both functions (quotes from the documentation): \int_compare:nNnTF: "This function first evaluates each of the ⟨int expr⟩s as described for \int_eval:n". \int_compare:nTF: "This function evaluates the ⟨int expr⟩s as described for \int_eval:n". In fact, \int_eval:n { 0test } doesn't lead to an error either and prints 0test. Of course the t from test is interpreted as a relational operator because it is not an integer expression. But is it intended that \int_compare:nTF leads to errors while \int_compare:nNnTF evaluates something that is obviously not an integer expression, even though the evaluation should work identically?
- Luatex version and formatby LeO on June 23, 2025 at 1:45 pm
With the usage of the PDF-Tagging we currently try to keep up to date with the versions of lualatex - especially with new and changed capabilities. If I look in the log file I see as first line something like This is LuaHBTeX, Version 1.22.0 (TeX Live 2025) (format=lualatex 2025.6.23) ... LaTeX2e <2025-06-01> patch level 1 L3 programming layer <2025-05-26> To my understanding the format is the important thing which is updated and defines the capability. Perhaps I'm wrong with the wording format - if so please correct me. When I use the following MWE \documentclass{article} \begin{document} \luatexbanner \end{document} I just get as printout the first part, namely This is LuaHBTeX, Version 1.22.0 (TeX Live 2025) Q: is there a way to include the format (or whatever is relevant for the PDF-Tagging) as well? Background: With the additional information I could easily spot with which version the PDF was compiled. UPDATE: The possible duplicate answer won't help since first of all the format is not printed on the command line with parameter --version. Next the commands there are for pdftex and won't apply to lualatex. Plus to my understanding the version of the format is not (directly) related to the TeX-version.
- Interaction between \ifcat, \noexpand, and active charactersby plante on June 20, 2025 at 7:24 pm
I have come across the following oddity. Consider this example: \catcode`!=\active \let~=\empty \ifcat\noexpand~\noexpand! yes\else no\fi \let~=\relax \ifcat\noexpand~\noexpand! yes\else no\fi Why does the first \ifcat return yes while the second returns no? It seems that \empty can be any expandable token, and \relax can be any non-expandable token. I am unable to find any information in the TeXbook or TeX by Topic pertaining to this. But perhaps I am overlooking something simple. Many thanks!
- Drawing two slices of bread framing a sausage or a slice of tomatoby projetmbc on June 18, 2025 at 4:25 pm
This is not a serious question. Here is a culinary variation of this post Drawing "two police officers" (squeeze theorem) metaphor with stylized uniforms for sequences. The squeeze theorem is also called the ‘sandwich theorem’, it would also be great fun to draw two slices of bread framing a sausage or a slice of tomato. PS: you can draw either wholemeal, semi-complete or white bread, or any other kind of bread.
- Drawing "two police officers" (squeeze theorem) metaphor with stylized uniforms for sequencesby Sebastiano on June 17, 2025 at 11:01 pm
I'm working on a TikZ illustration to visually represent the squeeze theorem (also known as the sandwich theorem or two police officers theorem (in Italy "dei due carabinieri") in the context of sequences, with a playful metaphor: imagining the bounding sequences aₙ and bₙ as two "carabinieri" (police officers) guiding or squeezing the sequence cₙ. My idea is to visually depict the two sequences aₙ and bₙ as two human-like figures (the "carabinieri"), possibly wearing slightly modified uniforms that distinguish them from real police officers (for appropriateness), here a photo (the link is put looking the edit from this question): but still conveying the idea of symmetric bounding or convergence. I'd like to adapt their appearance to suggest authority or structure (maybe uniforms in different colors or styles). I would like to have, using tikzpeople package, a uniform that looks like that of a "carabiniere" by using the clothing of other people (e.g. uniform elements, hats, colors, etc.) adapting it to my case. My MWE: \documentclass[tikz]{standalone} \usepackage{tikz} \usepackage{tikzpeople} \begin{document} \begin{tikzpicture}[] \node[police,label=$a_n$, minimum size=1.5cm] (T) at (-1.5,0) {}; \node[criminal, label=$c_n$, minimum size=1.5cm] (S) at (0,0) {}; \node[police, label=$b_n$, mirrored,minimum size=1.5cm] (N) at (1.5,0) {}; \end{tikzpicture} \end{document}
- Why doesn't `enlargelimits` appear to do anything in this graph?by Matthew Bourque on June 17, 2025 at 8:07 pm
In the following MWE, I expected that the use of enlargelimits=true would enlarge the axis limits beyond the values which are computed from the function domain, and from the maximum and minimum function values computed for the graph. \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat = newest} \begin{document} \begin{tikzpicture} \begin{axis}[ width = 5in, height = 3in, enlargelimits = true, axis x line = center, axis y line = center, xtick distance = 1, ytick distance = 0.5, grid = major, clip = false, domain = -6.28:6.28 ] \addplot[ <->, smooth, thick, blue, samples=101 ] {sin(deg(2*x+pi/4))}; \end{axis} \end{tikzpicture} \end{document} When I compile with pdfTeX (by way of latexmk, by way of VimTex), I get the following: The axes end exactly at the ends of my given domain, and at the max/min values computed for the function. I have also tried using enlargelimits = 0.2 with the same result. Why is that? How can I get the axes to enlarge a little bit in this plot?
- What is the way to use vector arrow notation inline without interfering with descenders?by Jasper on June 14, 2025 at 8:04 pm
What is the way to use vector arrow notation inline without interfering with descenders, and without making the linespacing less aesthetically pleasing? I am using the package overarrows for extensible arrows, for reference. \documentclass{article} \usepackage{overarrows} \begin{document} This text precedes the definition---in display math---of a vector, \[\overrightarrow{0}=\begin{bmatrix}0\\0\end{bmatrix}.\] Now I would like to refer to that vector inline. However, t{g}his takes up too much vertical space. If there were descenders above, then \(\overrightarrow{0}\) would interfere with them. \end{document}
- How to tag a tikzpicture with a bounding box?by Teepeemm on June 14, 2025 at 3:16 pm
In a previous question, I learned how to add alt text to a TikZ image. This validates as UA-1 according to VeraPDF. On the other hand, PDF Accessibility Checker says this is not UA-1 because the TikZ figure doesn't have a bounding box. How do I provide the bounding box to this figure? (Among other issues, we can get the size of the bounding box, but can't know the location until the page is shipped out.) I've come tantalizingly close with the following: % !TEX program = LuaLaTeX \DocumentMetadata{tagging=on,lang=en,pdfversion=1.7,pdfstandard=ua-1} \title{My Title} \documentclass{article} \usepackage{graphicx, tikz} \ExplSyntaxOn \dim_new:N \g_tpmm_dx_dim \dim_new:N \g_tpmm_dy_dim \cs_new:Nn \tpmm_setupBBox: { \node(current~bounding~box.south~west){\savepos}; \pgfextractx{\g_tpmm_dx_dim}{\pgfpointdiff{\pgfpointanchor{current~bounding~box}{west }}{\pgfpointanchor{current~bounding~box}{east }}} \pgfextractx{\g_tpmm_dy_dim}{\pgfpointdiff{\pgfpointanchor{current~bounding~box}{south}}{\pgfpointanchor{current~bounding~box}{north}}} \dim_gset_eq:NN \g_tpmm_dx_dim \g_tpmm_dx_dim \dim_gset_eq:NN \g_tpmm_dy_dim \g_tpmm_dy_dim \hook_gput_next_code:nn { shipout/after } { \tpmm_addBBox:ennee {\tag_get:n{struct_num}} {\lastxpos} {\lastypos} {\g_tpmm_dx_dim} {\g_tpmm_dy_dim} } } \cs_new:Npn \tpmm_addBBox:ennee #1#2#3#4#5 { \dim_set:Nn \g_tpmm_dx_dim { #4 } \dim_set:Nn \g_tpmm_dy_dim { #5 } \dim_add:Nn \g_tpmm_dx_dim { #2 sp } \dim_add:Nn \g_tpmm_dy_dim { #3 sp } % see latex-lab-testphase-graphic.sty \tag_struct_gput:ene{#1}{attribute} { /O /Layout /BBox~ [ \dim_to_decimal:n { #2 sp } \c_space_tl \dim_to_decimal:n { #3 sp } \c_space_tl \dim_to_decimal:n { \g_tpmm_dx_dim } \c_space_tl \dim_to_decimal:n { \g_tpmm_dy_dim } ] } } \hook_gput_code:nnn{env/tikzpicture/end}{tikz}{\tpmm_setupBBox:} \ExplSyntaxOff \begin{document} \tagstructbegin{tag=Figure,alt=a circle}\tagmcbegin{}% \SuspendTagging{tikz}% \begin{tikzpicture} \draw (0,0) circle (1cm); \end{tikzpicture}% \par \ResumeTagging{tikz}% \tagmcend\tagstructend \tagstructbegin{tag=Figure,alt=a circle}\tagmcbegin{}% \SuspendTagging{tikz}% \begin{tikzpicture} \draw (0,0) circle (1cm); \end{tikzpicture}% \par \ResumeTagging{tikz}% \tagmcend\tagstructend \tagstructbegin{tag=Figure,alt=a circle}\tagmcbegin{}% \SuspendTagging{tikz}% \begin{tikzpicture} \draw (0,0) circle (1cm); \end{tikzpicture}% \par \ResumeTagging{tikz}% \tagmcend\tagstructend \end{document} Unfortunately, it appears that multiple figures interfere with each other: their bounding boxes use entries 0 and 1 of the last figure, and entries 2 and 3 accumulate. How can I determine the bounding box of a TikZ picture?
- In \tt, why do \char92 and \char'134 output the backlash '\', while \char"5c outputs 'Πc'?by ezequiel-garzon on June 14, 2025 at 2:16 pm
\tt \char`\\ \char92 \char'134 \char "5c \bye outputs \\\Πc Why does it change using hexadecimal notation? Thanks in advance.
- Is there better method to declare tikz picture with proper baseline and fontsize?by Explorer on June 13, 2025 at 11:52 am
I want to use tikz to custom construct the following "steel" symbols: With my poor tikz practice, I get the following MWE: \documentclass{article} \usepackage{tikz} \newcommand*\steelA{\tikz[baseline=(char.south),yshift=.8ex]{% \draw[thick] node (char) {} ellipse[x radius=.25em,y radius=.45ex]; \draw (0,-.85ex) -- (0,.85ex); }}% \newcommand*\steelB{\tikz[baseline=(char.south),yshift=.8ex]{% \draw[thick] node (char) {} ellipse[x radius=.25em,y radius=.45ex]; \draw (0,-.85ex) -- (0,.85ex) (-.3em,-.85ex) -- (.3em,-.85ex); }}% \newcommand*\steelC{\tikz[baseline=(char.south),yshift=.8ex]{% \draw[thick] node (char) {} ellipse[x radius=.25em,y radius=.45ex]; \draw[xshift=-.1em] (0,-.85ex) -- (0,.85ex); \draw[xshift=.1em] (0,-.85ex) -- (0,.85ex); \draw (-.3em,-.85ex) -- (.3em,-.85ex); }}% \newcommand*\steelD{\tikz[baseline=(char.south),yshift=.8ex]{% \draw[thick] node (char) {} ellipse[x radius=.25em,y radius=.45ex]; \draw[xshift=-.1em] (0,-.85ex) -- (0,.85ex); \draw[xshift=.1em] (0,-.85ex) -- (0,.85ex); \draw (-.3em,-.85ex) -- (.3em,-.85ex) (-.3em,.85ex) -- (.3em,.85ex); }}% \begin{document} A\steelA B A\steelB B A\steelC B A\steelD B { \Huge% A\steelA B A\steelB B A\steelC B A\steelD B }% \end{document} But there are some drawbacks: poor method to handle the absolute distance(with some hard-encoded parameters(eg. .85ex)) the handle of baseline is not eleagnt, and not perfectly align: I want the top of the symbol EXACTLY the same height as A and B; and the bottom of the symbol the same depth as A and B When I test the different fontsize, it seemed that the symbol's thickness is too thin, is that possible to automaticallly change the thickness? Or in other word, how to better turn a tikzpicture into a "text symbol"? Sorry for (a little) mix three requirements together, but sepreate it into three questions seemed a bit inefficient. Thanks in advance! Edited with the symbol's information: but I don't know anything about these symbols, so maybe this style does not really make sense It comes from a standard file "GB 50010-2010"(I'm sorry for I can't provide the link here) at Page.22. The steel is graded into FOUR levels: