• How can I improve the appearance of a 3D parametric curve with projections in PGFPlots?
    by Marco Moldenhauer on July 15, 2025 at 5:53 am

    I'd like to recreate the appearance of a 3D parametric curve with vertical projection lines, as shown in the image below (you can ignore the text labels): Below is my code and the output it produces. Unfortunately, I'm not very happy with the result — it doesn't quite match the the target image. Any ideas for improving the visual appearance of this parametric plot would be greatly appreciated! my code \documentclass{article} \usepackage{geometry} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{tikzmark} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \pagenumbering{gobble} \usepackage{xcolor} \geometry{ %showframe, paperwidth=34.40cm, paperheight=14.40cm, margin=1cm } \begin{document} \begin{tikzpicture} [ % Define a paremtric curve declare function = { fx(\t) = 1+\t^3; fy(\t) = 1+1.6*\t; fz(\t) = 1.5-\t^2; SamplesLow = 5; SamplesHigh = 50; DomLowerBound = 0; DomUpperBound = 1; stepsize = (DomUpperBound-DomLowerBound)/SamplesLow; AxisXmin = -.5; AxisXmax = 4; AxisYmin = -.5; AxisYmax = 4; AxisZmin = 0; AxisZmax = 2; }, ] \begin{axis} [%% view={120}{45}, plot box ratio=1 1 1, width=22cm, height=12cm, xmin=AxisXmin, xmax=AxisXmax, ymin=AxisYmin, ymax=AxisYmax, zmin=AxisZmin, zmax=AxisZmax, grid, grid style={very thin, gray}, trig format plots=rad, enlargelimits=false, xlabel=$x$, ylabel=$y$, zlabel=$z$, xtick={0,1,...,AxisXmax-1}, ytick={0,1,...,AxisYmax-1}, ztick={0,1,...,AxisZmax} %axis x line=middle, %axis y line=middle, %axis z line=middle, ]%% % Plot the parametric surface using the defined functions \addplot3 [ variable=t, mesh, domain=DomLowerBound:DomUpperBound, samples=SamplesLow+1 ] ( { fx(t) }, { fy(t) }, { fz(t) } ); \addplot3 [ variable=t, mesh, domain=DomLowerBound:DomUpperBound, samples=SamplesLow+1, gray ] ( { fx(t) }, { fy(t) }, { AxisZmin } ); \pgfplotsinvokeforeach {0,stepsize,...,DomUpperBound} { \draw[gray, dotted] ({fx(#1)},{fy(#1)},AxisZmin) -- ({fx(#1)},{fy(#1)},{fz(#1)}); } \end{axis} \end{tikzpicture} \end{document} my output

  • Is that possible to automatically add the non-empty border in tabularray?
    by Explorer on July 15, 2025 at 3:58 am

    I want to get the following result: which is generated by: \documentclass{article} \usepackage{libertinus} \usepackage{tabularray} \setlength\lTblrDefaultHruleWidthDim{2pt}% \setlength\lTblrDefaultVruleWidthDim{2pt}% \begin{document} \begin{tblr}{ colspec = *{4}{Q[c,.75cm]}, stretch=0, rows = {ht=1cm,font=\bfseries\Large}, hline{1} = {1-2}{}, hline{2} = {1-2,4}{}, hline{3-4}, vline{1} = {1,3}{}, vline{2-3}, vline{4-5} = {2-3}{}, } A & B & & \\ & C & & D \\ E & F & G & H \\ \end{tblr} \end{document} However, the following controled mannally is not so clever: hline{1} = {1-2}{}, hline{2} = {1-2,4}{}, hline{3-4}, vline{1} = {1,3}{}, vline{2-3}, vline{4-5} = {2-3}{}, Provided that the rows and columns are large, and it's cumbersome to determine the "border" of "non-empty" content. I have consulted for the cmd key, however it's used for "execute command for the cell text", which is not so proper. Is that better method to draw the "non-empty"'s border automnatically in this case with tabularrray?

  • Package answers: access to answers counters?
    by Garulfo on July 14, 2025 at 8:22 am

    With the package answers, is it possible to have access to the answer counter? Here is a minimal example, where I would like to write something like "Ans. 1.1 (continued)" or "Sol. 1.1 (continued)" (using a command that could be something like \theans or \thesol to get the right answer or solution number) at the top of each new page (see in code). Anyone have an idea? \documentclass[french,12pt,a4paper]{book} \usepackage[T1]{fontenc} \usepackage{babel} \usepackage{answers} %%%%%%%%%%%%%%%%%%%%%%% %% commands relative to package answers %%%%%%%%%%%%%%%%%%%%%%% \newtheorem{Exc}{Exercice}[chapter] \Newassociation{sol}{Solution}{solutions} \Newassociation{ans}{Answer}{answers} \renewcommand{\Answerlabel}[1]{\textbf{Ans. #1}} \renewcommand{\Solutionlabel}[1]{\textbf{\fbox{Sol. #1}}} %%%%%%%%%%%%%%%%%%%%%%% %% Begin document %%%%%%%%%%%%%%%%%%%%%%% \begin{document} \chapter{My first chapter} \section{Theory} Theory chapter 1 %%%%%%%%%%%%%%%%%%%%%%% %% Begin exercices %%%%%%%%%%%%%%%%%%%%%%% \Opensolutionfile{solutions}[solutions\thechapter] \Opensolutionfile{answers}[answers\thechapter] \section{Exercices} %%%%%%%%%%%%%%%%%%%%%%% Ex. 1.1 \begin{Exc} Calculate. \begin{enumerate} \item Item (1) \item Item (2) \item Item (3) \end{enumerate} \begin{ans} ~ \begin{enumerate} \item Answer (1) \item Answer (2) \item Answer (3) \end{enumerate} \end{ans} \begin{sol} ~ \begin{enumerate} \item Detailed solution (1) \item Detailed solution (2) \newpage Here at the top of the new page, I would like to have something like:\\ \fbox{\textbf{Sol. 1.1 (continued)}} \item Detailed solution (3) \end{enumerate} \end{sol} \end{Exc} %%%%%%%%%%%%%%%%%%%%%%% \Closesolutionfile{answers} \Closesolutionfile{solutions} \section{Answers} \input{answers\thechapter} \section{Detailed solutions} \input{solutions\thechapter} \end{document}

  • Is the main advantage of sockets that they are TeX's version of enum?
    by Teepeemm on July 13, 2025 at 10:28 pm

    I'm wanting to understand sockets better. The following is adapted from texdoc ltsockets: \documentclass{article} \NewSocket{fooSocket}{2} \NewSocketPlug{fooSocket}{fooSocketPlugA}{foo-A: #1!#2} \NewSocketPlug{fooSocket}{fooSocketPlugB}{foo-B: #2 x 2} \begin{document} \begin{enumerate} \item \UseSocket{fooSocket}{hello}{world} % no output; default plug is noop \AssignSocketPlug{fooSocket}{fooSocketPlugA} \item \UseSocket{fooSocket}{hello}{world} % output: foo-A: hello!world \AssignSocketPlug{fooSocket}{fooSocketPlugB} \item \UseSocket{fooSocket}{hello}{world} % output: foo-B: world x 2 \AssignSocketPlug{fooSocket}{noop} \item \UseSocket{fooSocket}{hello}{world} % no output \end{enumerate} \end{document} and has output 1. 2. foo-A: hello!world 3. foo-B: world x 2 4. From my reading of ltsockets and ltsockets-code, this seems to be the exact same as: \documentclass{article} \newcommand{\fooSocket}[2]{} \newcommand{\fooSocketPlugA}[2]{foo-A: #1!#2} \newcommand{\fooSocketPlugB}[2]{foo-B: #2 x 2} \begin{document} \begin{enumerate} \item \fooSocket{hello}{world} % no output \let\fooSocket=\fooSocketPlugA \item \fooSocket{hello}{world} % output: foo-A: hello!world \let\fooSocket=\fooSocketPlugB \item \fooSocket{hello}{world} % output: foo-B: world x 2 \makeatletter\let\fooSocket=\@gobbletwo\makeatother \item \fooSocket{hello}{world} % no output \end{enumerate} \end{document} Both have the same output. The main advantage of sockets seems to be that they are like enums in other programming languages: only a fixed set of predefined elements can be used, making them less error prone. For example, \let\fooSocket=\textbf works, but \AssignSocketPlug{fooSocket}{textbf} is a compilation error. Other (less important) differences seem to be that sockets must be defined at the top level, and sockets have error messages and debugging support. Am I understanding sockets correctly? Is there an aspect to sockets that I've missed?

  • How Can I Define Macros Using Name Suffixes Based on Counter Values?
    by HOO on July 13, 2025 at 3:27 pm

    I am trying to define a set of macros whose names are derived from the values of a counter. In the MWE given below, I am trying to define the macros \itemOne, \itemTwo, ... \itemSeven. I get the following error messages when I try to compile the code: Missing \endcsname inserted.} Extra \endcsname. } Undefined control sequence. Item one: \itemOne Undefined control sequence. Item two: \itemTwo Undefined control sequence. Item seven: \itemSeven The problem is with the code line that uses the \expandafter, \csname and \endcsname constructs. I would be very grateful if someone could analyze the MWE, point out the mistake that I have made and let me know how I should modify the code to eliminate the problem. Thanks, in advance, to all those who will have had a look at the MWE. MWE: \documentclass[a4paper,10pt]{article} \usepackage[T1]{fontenc} \usepackage{etoolbox} \usepackage{numname} \usepackage{pgffor} % \setlength{\parindent}{0pt} % \newcounter{itemcount} \setcounter{itemcount}{0} % \begin{document} \foreach \i in {a,b,c,d,e,f,g}{ \addtocounter{itemcount}{1} \def\name{item\numtoName{\theitemcount}} \expandafter\xdef\csname\name\endcsname{\i} } Item one: \itemOne\\ Item two: \itemTwo\\ ...\\ Item seven: \itemSeven \end{document}

  • Use Libertinus serif italic J from stylistic alternative
    by schtandard on July 12, 2025 at 6:36 am

    The capital J in the serif italic font from Libertinus (i.e. Libertine) is a bit out of place. There is a stylistic alternative in the font (cf. for example this PR) that contains a glyph that's more consistent with the other letters. In the libertinus-otf documentation, a font option salt is mentioned, but I cannot figure out how to select it, let alone for just one letter. How can I select the alternative glyph for the serif italic J? % !TeX program = lualatex \documentclass{article} \usepackage{libertinus} \usepackage{xcolor} \begin{document} ABCDEFGHI\textcolor{green!70!black}{J}KLMNOPQRSTUVWXYZ \textit{ABCDEFGHI\textcolor{red}{J}KLMNOPQRSTUVWXYZ} \end{document}

  • Draw parabole and secant plane in perspective
    by graograman on July 11, 2025 at 7:36 pm

    I'd like to reproduce the following parabola in TeX but my approach is not working as I'd like it to. Because TeX doesn't have a 3D engine I drew the whole thing in Geogebra and then tried to reproduce it in code thus: \documentclass[12pt]{standalone} \usepackage{tikz} \usetikzlibrary{matrix, positioning, angles, decorations.pathreplacing, 3d, arrows.meta} \begin{document} \begin{tikzpicture}[parabola/.style={red}, scale=2] \draw [blue, dashed] (0,-1.5,0) -- (0,1.5,0); \draw (0.8,-1,0) arc (-10:-170:0.8cm and 0.3cm); \draw [dashed] (0.8,-1,0) arc (10:170:0.8cm and 0.3cm); \draw (0.8,1,0) arc (-10:-170:0.8cm and 0.3cm); \draw (0.8,1,0) arc (10:170:0.8cm and 0.3cm); \draw (0.8,1,0) -- (-0.78,-1,0); \draw (-0.78,1,0) -- (0.8,-1,0); \draw [fill, blue] (0,0,0) circle (0.5pt) node [left] {$S$}; \coordinate (a) at (-0.4,-0.8,0); \def\b{2} \def\h{1} \def\p{0.5} \pgfmathsetmacro{\rx}{\b/2} \pgfmathsetmacro{\ry}{\rx*\p} \pgfmathsetmacro{\ta}{90-atan2(\h,\ry)} \coordinate (parabend) at (-1*\ta:0.2*\rx-0 and \ry); \path (a) +(50+50*\p:\rx+0 and \ry) coordinate (tmp) +(-90+25*\p:\rx+0 and 0.9*\ry) coordinate (tmp2); \end{tikzpicture} \end{document} which renders the parabola bent like this: and I can't get the plane's edges straight or looking so at least. Maybe there's an easier way to draw the lines? I've looked at some examples but I can't make sense of them.

  • 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 command
    by Æ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 shaded
    by 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 did
    by 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 pie
    by 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 implicitly
    by 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 file
    by 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 string
    by 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 coordinates
    by 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 picture
    by 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 environment
    by 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:nTF
    by 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 format
    by 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 characters
    by 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 tomato
    by 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 sequences
    by 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?