• How to get a structure of this nodes tower with proper coordinates?
    by Explorer on November 25, 2025 at 5:54 pm

    What I want to achieve is something as below(sorry for drawing in a hurry): The only requirements is vertical alignment(shown as the red dashed lines), the spacing of each nodes could be design, given that would not ruin the figure is okay. What I have tried is as below: \documentclass[tikz,border=5pt]{standalone} \newcommand\mynode[2][1]{% \node[draw,thick,minimum width=8cm,minimum height=2cm,font=\Huge\bfseries,scale=#1] at (#2) {AAAA}; } \begin{document} \begin{tikzpicture} % \mynode[1]{0,0} % \mynode[.45]{-2.25,-2} % \mynode[.45]{2.25,-2} % \mynode[.225]{-3.25,-3} % \mynode[.225]{1.25,-3} % \mynode[.225]{-1.25,-3} % \mynode[.225]{3.25,-3} %... \foreach \x[ evaluate=\x as \y using {int(2^(\x-1))} ] in {1,...,6}{ \foreach \t in {1,...,\y}{ \def\xx{\fpeval{-4 + (8/(\y+1))*\t*1.25}} \def\yy{\fpeval{(8/(\x+1))*1.25}} \mynode[\fpeval{1/\y}]{\xx,\yy} } } \end{tikzpicture} \end{document} It gives: I found that dilemma to determine the proper spacing, and exact coordinates calculation to guarentee vertical alignment at the same time. Is that any powerful tikz tools to achieve this? Or I just to make more effort to solve the better numerical relationship?

  • Graph of a relation
    by Dimitrios ANAGNOSTOU on November 25, 2025 at 4:24 pm

    First attempt to create a graph with TikZ. More precisely, I want to be able to create figures like the following one. After much trial and error, I was able to get something close with the code below: \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{arrows.meta,positioning} \begin{document} \begin{tikzpicture}[ >=Stealth, node/.style={circle, fill=black, inner sep=2pt}, every loop/.style={min distance=15mm, looseness=8} ] % Define nodes \node[node, label=left:4] (4) at (0, 3) {}; \node[node, label=left:1] (1) at (0, 1) {}; \node[node, label=below left:2] (2) at (-2, 0) {}; \node[node, label=below right:3] (3) at (2, 0) {}; % Draw edges \draw[->] (1) -- (4); \draw[->] (1) -- (2); \draw[->] (1) -- (3); \draw[->] (2) to[bend left=30] (4); \draw[->] (3) to[bend right=30] (4); \draw[->] (2) to[bend right=30] (3); % % Self-loops \draw[->] (4) edge[loop above] (4); \draw[->] (1) edge[loop right] (1); \draw[->] (2) edge[loop left] (2); \draw[->] (3) edge[loop right] (3); \end{tikzpicture} \end{document} How can I get something closer to the book picture? Also, is there any TikZ library/extension that automates such staff? Thank you very much for your time.

  • Wild Turkeys in TikZ
    by karlh on November 25, 2025 at 4:20 pm

    I have an annual scavenger hunt at Thanksgiving in which the TikZlings and TikZ ducks (and related fauna) guide my nieces and nephew through the course. Given that it is Thanksgiving, I wanted to include a turkey munching on pie and sipping wine, but the closest I can come is \documentclass{article} \usepackage{tikzlings} \begin{document} \begin{tikzpicture} \chicken[cake=orange!50!brown,wine] \end{tikzpicture} \end{document} and that just doesn't have the same ring to it. I found a good wild turkey drawn in MetaPost (Draw a turkey, a pumpkin pie, or any other object traditionally associated with Thanksgiving), but since the holiday is only two days away, I thought I'd see whether anyone was interested in making a picture of Meleagris gallopavo.

  • Using TikZ with a command only defined on second pass
    by Jason on November 25, 2025 at 3:39 pm

    I have a number of commands that work a lot like the \ref command in that its true typeset value is only defined after an initial pass is performed. In the first pass they typeset ? - like the \ref command, and in the second pass that ? is instead a number or some string. It would be nice if I could use these commands inside a tikzpicture environment as a parameter. Obviously, tikz errors out when it gets the LaTeX command, and even if I can get the command to expand, it still errors due to tikz trying to understand the ? on the first pass - thus breaking the compile before it can build the correct value for a second pass. Is there a way to generically redefine a command (or tikz elements I guess?) so such commands still executes as normal on the first pass (a \ref command waits for a corresponding label to get defined so it has a value, but a generic command may execute some TeX like writing to an external file or change some settings/variables in the compile which it would still need to do on the first pass before it was defined in a way to be used in the tikzpicture env on the second pass), but it doesn't generate an error in tikz in the first pass (or the error is ignored/doesn't stop compile) so that the command gets a chance to be defined for the second pass - then have tikz actually use the command output on the second pass once it is correctly defined? Below is a MWE for what I am looking for, using a \label and \ref combo as a simple version of what I am after, but it would be ideal if it could work on generic commands that expand into arbitrary tikz code. \documentclass{article} \usepackage{tikz} \begin{document} \setcounter{section}{6} \section{Introduction}\label{temp} \ref{temp}% Should display 7 \begin{tikz}% Should display a 7 radius circle \draw circle(\ref{temp}pt); \end{tikz} \setcounter{section}{13} \section{Intro2}\label{temp2} \ref{temp2}% Should display 14 \begin{tikz}% Should display a 14 radius circle \draw circle(\ref{temp}pt); \end{tikz} \end{document} EDIT FOR MORE INFO The primary use case I want to apply this to is the \sage{arg} command, which on the first pass outputs a ? and writes out to an external file. That file is then processed before a second LaTeX pass. On the second pass, the \sage{arg} command grabs the definition of arg from the external file, and then the \sage{arg} command expands as the definition given by the external file. The actual particulars of sage itself aren't really important (I think), it's more that I want to have a normal LaTeX command get run inside a tikz environment, but without stopping the compile because its initial output is just a ?. But the first pass generates something so that on the second pass the command expands into tikZ parseable code, so that in the second pass it will then actually be used in tikzpicture correctly. In particular, I would actually expect any solution for this, to also work for \label and \ref, assuming that \ref is a number or somehow a string that tikz should be able to parse normally.

  • Check for and report excessively large dimensions in \tkzGetNodes
    by Alain Matthes on November 25, 2025 at 1:46 pm

    This is a refinement I would like to add to the following macro: \def\tkzGetNodes{\directlua{% for K,V in pairs(z) do local n,sd,ft n = string.len(K) if n > 1 then _,_,ft, sd = string.find(K, "(.+)(.)" ) if sd == "p" then K=ft.."'" end _,_,xft, xsd = string.find(ft, "(.+)(.)" ) if xsd == "p" then K=xft.."'".."'" end end tex.sprint("\\coordinate ("..K..") at ("..V.re..","..V.im..") ; \string\r") end }} This macro allows you to switch between points created with lua and TikZ nodes. K is a key, or more simply the name of the point and then the node, while V.re and V.im are the future coordinates of this node. The issue is not so much controlling the value of the coordinates, although it is interesting to know the largest possible value, as it is the ability to inform the user that coordinates have been rejected. Is this possible, and how can it be done?

  • Difficulties in using string.find with directlua
    by Alain Matthes on November 25, 2025 at 1:36 pm

    The main macro in tkz-elements is \tkzGetNodes. This macro retrieves the elements from the z table in order to create nodes. The elements in the table provide the node name and its coordinates. The code for this macro is as follows: \def\tkzGetNodes{\directlua{% for K,V in pairs(z) do local n,sd,ft n = string.len(K) if n > 1 then _,_,ft, sd = string.find(K, "(.+)(.)" ) if sd == "p" then K=ft.."'" end _,_,xft, xsd = string.find(ft, "(.+)(.)" ) if xsd == "p" then K=xft.."'".."'" end end tex.sprint("\\coordinate ("..K..") at ("..V.re..","..V.im..") ; \string\r") end }} There is no problem with the contact details, but I am having difficulty processing the names. Of course, whether it is on the lua or TeX side, certain characters are not accepted. As the use is primarily mathematical, I need certain characters. _ poses no difficulty, but in order to use prime (') and double prime (''), I had to find a workaround. This involves reserving the letter p or the pair pp, replacing them with ' and '' if they appear at the end of a name. Thus, z.Ap = point(1, 2) becomes node A' with coordinates (1, 2). z.Bpp becomes B'' and z.p becomes p. Example: \documentclass{standalone} \usepackage[mini]{tkz-euclide} \usepackage{tkz-elements} \begin{document} \directlua{ z.Ap = point(0, 0) z.Bpp = point(5, 1) z.p = point(2, 3) % z.apo = point(1, 1) } \begin{tikzpicture} \tkzGetNodes \tkzDrawPolygon(A',B'',p) \tkzDrawPoints(A',B'',p) \tkzLabelPoints(A',B'') \tkzLabelPoints[above](p) \end{tikzpicture} \end{document} Question: How can I modify my macro so that point names that do not have a p at the end are accepted, but one or more letters p in their bodies? The following case appears to be the only one ... With z.apo, I obtain ./name.tex:18: Package pgf Error: No shape named `apo' is known. Ultimately, I am not filtering the names correctly, and with z.xpy, xpy is transformed into x''?

  • Error based on interaction of thmtools and an implemantation of a refable delayed proof environment
    by Klimace on November 25, 2025 at 12:39 pm

    I added the solution by @egreg to the question Reference to proof prints section instead to my document and it did not work throwing the error: Undefined control sequence. \@hyper@@anchor ...r@spot {#2#3}\let \put@me@back The culprit as it turns out is thmtools: \documentclass{article} \usepackage{amsthm} \usepackage[colorlinks]{hyperref} \usepackage{cleveref} \usepackage{thmtools} %Only addition compared to the used solution \newtheorem{theorem}{Theorem} \newenvironment{delayedproof}[1] {\begin{proof}[\raisedtarget{#1}Proof of \Cref{#1}]} {\end{proof}} \newcommand{\raisedtarget}[1]{% \raisebox{\fontcharht\font`P}[0pt][0pt]{\hypertarget{#1}{}}% } \newcommand{\proofref}[1]{\hyperlink{#1}{proof}} \begin{document} \section{Theorems} \begin{theorem}\label{thm:some-theorem} This is a theorem. \end{theorem} For an intuition, see the \proofref{thm:some-theorem}. \appendix \section{Proofs} \begin{delayedproof}{thm:some-theorem} This is a proof. \end{delayedproof} \end{document} I am now interested in answering what exactly breaks and if there is a better, i.e. the hyperlink does the right thing, fix that what I have come up with: \newenvironment{delayedproof}[1] {\raisedtarget{#1}\begin{proof}[Proof of \Cref{#1}]} {\end{proof}} \newcommand{\raisedtarget}[1]{% \raisebox{\fontcharht\font`P}[0pt][0pt]{\hypertarget{#1}{}}% }

  • How to ensure a text starts exactly at the left margin of the text area?
    by Denis Bitouzé on November 25, 2025 at 11:28 am

    In the following MCE, there is a small space between the left margin of the text area and the “F” of “Foo”. Hence, the “F” and the red horizontal rule below this text aren't vertically aligned. How to make them vertically aligned? \documentclass{article} \usepackage{xcolor} \usepackage[showframe,paperwidth=5cm,paperheight=3cm,noheadfoot,nomarginpar]{geometry} \setlength{\parindent}{0cm} \pagestyle{empty} \begin{document} \sffamily% Foo\par \color{red}\hrulefill \end{document}

  • How can I draw grid of cylinders?
    by minthao_2011 on November 25, 2025 at 9:02 am

    I used Mathematica and tried grid of cylinder I don’t know how to draw with other tools. How can I draw it?

  • Implementing certain unicode-math symbols
    by userא0 on November 25, 2025 at 8:31 am

    I came across the following extensive list of symbols defined by unicode-math and am struggling to implement them in my document. Attempting to to use certain commands mentioned in the linked list I rad to the following problem; I am interested in implementing the \mup commands. Trying to use any of the \mup... commands (mentioned in section 13.1.1 in the linked document) does not change anything. I mean that \alpha and \mupalpha looks the same after compiling the file (and the same is true for all other greek letters). Another thing might be worth mentioning is that, writing any individual \mup command literally compiles as text mupalpha and not \alpha. here is a minimal working example; % Preview source code %% LyX 2.4.1 created this file. For more info, see https://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[english,hebrew,no-math]{extarticle} \usepackage{amsmath} \usepackage{amsthm} \usepackage{fontspec} \setmainfont[Mapping=tex-text]{Hadasim CLM} \setsansfont[Mapping=tex-text]{Palatino} \setmonofont{Palatino} \usepackage[a4paper]{geometry} \geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=2cm,rmargin=2cm,headheight=2cm,headsep=2cm} \usepackage{setspace} \doublespacing \usepackage[pdfusetitle, bookmarks=true,bookmarksnumbered=false,bookmarksopen=false, breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false] {hyperref} \makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. \numberwithin{equation}{section} \newlength{\lyxlabelwidth} % auxiliary length \@ifundefined{date}{}{\date{}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \usepackage{faktor} \usepackage{graphicx, nicefrac} \usepackage[all]{xy} \usepackage{fancyhdr} \usepackage{xcolor} \pagestyle{fancy} \usepackage{bbm} \usepackage{xfrac} \usepackage[dvipsnames]{xcolor} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{unicode-math} \setmathfont{texgyrepagella-math.otf}[math-style=french, Scale=1] \setmathfont{STIXTwoMath-Regular.otf}[range={cal, bfcal}, StylisticSet=0] \usepackage[scr=rsfs]{mathalfa} \makeatother \usepackage{polyglossia} \setdefaultlanguage{hebrew} \setotherlanguage{english} \begin{document} $\mupalpha$ \end{document} Thanks a lot!

  • Does LaTeX support abstract class like Java and C sharp?
    by YCH817 on November 25, 2025 at 6:16 am

    I find out that Till Tantau's pgf supports OOP programming . But does it support abstract classes ? Here is a small example : \pgfooclass{mathobj}{ \attribute form LaTeX ; \attribute form Verb ; \method mathobj(#1) {% \pgfooset{form LaTeX}{\ensuremath{#1}}% } \method print LaTeX() {% \pgfoovalueof{form LaTeX}% } } \pgfoonew\mymathobj=new mathobj(x^2) \mymathobj.print LaTeX() I wish the mathobj class can be the abstract class or interface in Java , and other classes can inherit / implement it .

  • How to create two bottom-aligned side-by-side figures in llncs?
    by user20478285 on November 25, 2025 at 2:13 am

    I want to create two side-by-side subfigures that are bottom aligned. With subcaption, I would do it this way: \documentclass{llncs} \usepackage{graphicx} \usepackage{subcaption} \begin{document} \begin{figure} \centering \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=4cm, angle=90, origin=c]{example-image-a}% \caption{Foo.} \label{fig:foo} \end{subfigure}% \hfil \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=4cm]{example-image-b}% \caption{Bar.} \label{fig:bar} \end{subfigure} \caption{Foo (\ref{fig:foo}) and Bar (\ref{fig:bar}) using \texttt{subcaption}.} \label{fig:foobar} \end{figure} \end{document} And obtain this result: The figures are properly aligned, but by loading subcaption it reset llncs's default caption setup. It seems the subcaption package cannot be used with llncs (Package caption Warning: Unknown document class (or package), standard defaults will be used. See the caption package documentation for explanation.) and changes the default caption format. As an alternative I tried subfig, and what I have now is \documentclass{llncs} \usepackage{graphicx} \usepackage[caption=false]{subfig} \begin{document} \begin{figure} \centering \subfloat[% Foo.% \label{fig:foo}% ]{% \centering \includegraphics[width=4cm, angle=90, origin=c]{example-image-a}% } \hfil \subfloat[% Bar.% \label{fig:bar}% ]{% \centering \includegraphics[width=4cm]{example-image-b}% } \caption{Foo (\ref{fig:foo}) and Bar (\ref{fig:bar}) using \texttt{subfig}.} \label{fig:foobar} \end{figure} \end{document} where the captions look fine (style-wise) but the result looks unpleasing as the two figures are not bottom-aligned: I am not limited to the subfig package; if there are other packages that allow me to create side-by-side figures with individual labels and captions I'd happily give them a try, as long as they can be used with llncs (i.e. do not modify its default caption setup). Any help is much appreciated!

  • Why does putting the alignment tab after relation operators in the align environment cause the spacing after the operator to be too thin?
    by palapapa on November 25, 2025 at 12:53 am

    For example: \begin{align} a =& b \end{align} causes there to be too little space after the equal sign, but if I put the alignment tab before the equal sign, this doesn't happen. Why? Does the align environment magically put an empty atom after alignment tabs so that the equal sign gets spaced correctly?

  • Length adjusted mapsfrom with text above it
    by Rabeeb Ibrat on November 25, 2025 at 12:25 am

    How do I get a length adjusted \mapsfrom arrow with text over it similar to \xmapsto? I have tried the following: \overset{fghij}{\mapsfrom}, and \overset{fghij}{\longmapsfrom} but these don't adjust the length of the arrow flexibly. Instead I get the following: Is there a way to do this from the existing packages?

  • pdfLaTeX puts invalid characters into generated PDF files
    by blackcat on November 24, 2025 at 11:15 pm

    I have found that pdfLaTeX replaces two input Cyrillic letters with their Latin counterparts breaking full text search. I'm talking about і and І (U+0456 and U+0406), they are replaced with i and I (U+0069 and U+0049). I tested two projects: one old with cp1251 as an input encoding and a font encoding (T2A) set by babel, and another one with utf-8 as input and OT2,TA2 as fontenc. It doesn't matter whether cmap package is used. My question is what package is to blame and report a bug against: babel, fontenc or something else? Just in case: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[belarusian]{babel} \begin{document} Latin: iI Cyrillic: іІ \end{document} LuaLaTeX generates correct PDF, it only needs \usepackage{fontspec}\setmainfont{Noto Serif} added to use a font with Cyrillic glyphs.

  • How can I make an align equation look neater
    by George Dewhirst on November 24, 2025 at 10:40 pm

    I know a bit of LaTeX but struggle with making large multi-line equations look professional. Apologies if this is the wrong way/place to ask. Literally any help would be grand. Specifically I would like the formatting to be on the left. (Here is some LaTeX for reference...) \begin{proof} First we prove \eqref{E-alpha-1}. \begin{align} \left|\mathbf{E}_{\alpha,1}^{(\beta)}( t) v\right|_{\mu} = \sum_{j=1}^{\infty}\lambda_j^{\mu}\langle(E_{\alpha,1}^{(\beta)}(t)v,e_j\rangle^2 \end{align} Note that $\langle(\mathbf{E}_{\alpha,1}^{(\beta)}t)v,e_j\rangle = \sum_{k=0}^{\infty}\frac{\langle (-A)^{\beta k}t^{\alpha k}v,e_j\rangle}{\Gamma(\alpha k+1)} = \sum_{k=0}^{\infty}\frac{\langle (-\lambda_j)^{\beta k}t^{\alpha k}v,e_j\rangle}{\Gamma(\alpha k+1)} = E_{\alpha,1}(-\lambda_j^{\beta} t^{\alpha})\langle v, e_j \rangle$. Using that $A^{\beta k}e_j = \lambda_j^{\beta k} e_j$ whenever $e_j$ are the eigenvectors of $A$. Next we use the result that $|E_{\alpha,1}(z)|^2\leq \frac{C}{(1+|z|)^2}$ Thus \begin{align} |\mathbf{E}_{\alpha,1}^{(\beta)}( t) v|_{\mu}^2 = \sum_{j=1}^{\infty}\lambda_j^{\mu}\langle(E_{\alpha,1}^{(\beta)}(t)v,e_j\rangle^2 = \sum_{j=1}^{\infty}\lambda_j^{\mu}\langle v, e_j \rangle^2 |E_{\alpha,1}(-\lambda_j^{\beta} t^{\alpha})|^2 \\ \leq \sum_{j=1}^{\infty}\lambda_j^{\mu}\langle v, e_j \rangle^2 \frac{1}{(1+\lambda_j^{\beta}t^{\alpha})^2}\\ \leq C t^{-\frac{\alpha}{\beta}(\mu - \nu)} \sum_{j=1}^{\infty}\frac{(\lambda_j^\beta t^{\alpha})^{\frac{\mu-\nu}{\beta}}}{(1+\lambda_j^{\beta}t^{\alpha})^2}\lambda^{\nu}_j\langle v, e_j \rangle^2 \\ \leq Ct^{-\frac{\alpha(\mu-\nu)}{\beta}}\sum_{j=1}^{\infty}\lambda_j^{\nu}\langle v, e_j\rangle^2 \leq Ct^{-\frac{\alpha(\mu-\nu)}{\beta}}|v|_{\nu}^2 \end{align} \end{proof} )

  • Make Ipe use local LaTeX document formatting
    by yms on November 24, 2025 at 9:36 pm

    I'm trying to export an Ipe figure so that whatever math in the figure will use the font in my document. Here is my preamble: \documentclass{amsart} \usepackage{comment} \usepackage{tgtermes} \usepackage{newtxmath} \usepackage[usenames,dvipsnames]{color} \usepackage[normalem]{ulem} \usepackage{url} \usepackage{graphicx} \usepackage{float, caption} \usepackage{enumerate} \usepackage{hyperref} and here is how I'm attaching a figure: \begin{figure} \centering \includegraphics[width=0.7\linewidth]{graphics/figure1.eps} \end{figure} On the IPE figure I'm using the math mode to attach text, should I be putting raw LaTeX code instead? Thanks in advance for the help.

  • Problem finding texlive in TeXworks
    by Greg Bennett on November 24, 2025 at 8:51 pm

    I have a new install of texlive 2025 and a new install of TeXworks 0.6.8("Debian") No complaints in the log of either. They cannot find one another (yet). I made a small file in my home directory, opened it in TeXworks, hit the green arrow and received only Console output: This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian) (preloaded format=pdflatex) {This suggests that the TeXlive installation has been found} kpathsea: Running mktexfmt pdflatex.fmt mktexfmt: No such file or directory I can't find the format file `pdflatex.fmt'! Why, I wonder, is mktexfmt being called .. texlive made the formats during installation as fat as I can see: Looking in TeXworks.conf the binary paths are: binaryPaths=/usr/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /sbin, /bin, /usr/games, /usr/local/games, /usr/local/texlive/2025/bin/x86_64-linux, /usr/local/texlive/2025/texmf-var/web2c/pdftex In the last element is the file pdflatex.fmt ! How do I make sure that TeXworks does find things in what seems to be its own search paths ? Thanks for advice/assistance Greg Bennett

  • cleveref cannot deal with figures under tufte classes and amsmath
    by Máté Wierdl on November 24, 2025 at 6:56 pm

    In a document where I reference a figure using cleveref, incorrect name and counter are used, namely the name used is section and the counter is the surrounding section's counter. This happens when I use either of the tufte classes and load amsmath. If I load the article class instead, the problem disappears. If I use a tufte class but not amsmath, again the problem disappears. I am using texlive 2025. I add that the same error is present when I reference a table. In the example below, I inserted a \newpage so that clicking on the figure reference, we can see that we jump to the section starting on the previous page. % \documentclass{article} \documentclass{tufte-handout} \usepackage{amsmath} \usepackage[nameinlink]{cleveref} \setcounter{secnumdepth}{2} \begin{document} \section{Cleveref test} \label{sec:cleveref-test} \subsection{The line} \label{sec:line} \newpage \Cref{fig:try} shows a line. \begin{figure} \caption{The line} \hbox to 5cm{\hrulefill} \label{fig:try} \end{figure} \end{document}

  • Inaccurate TikZ/PGF plot
    by Dominique on November 24, 2025 at 6:31 pm

    I'm using the following code to produce a plot: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width = 15cm, xtick = {0, 1, 2, 3, 4, 5}, ] \addplot[black, thick, smooth, domain=0:5] {exp(-100 * \x) + sin(\x)}; \addplot[blue, thick, smooth] table {stiff.dat}; \end{axis} \end{tikzpicture} \end{document} It produces the following plot: Here, the blue curve plots data points generated with Matlab for the same function. The blue curve is correct, but the black one is not. It seems TikZ is not able to plot the function accurately. I've read on this forum about this issue and I tried a few things: \ustikzlibrary{fpu}: did not help; that may be because the PFU is limited to 4-5 digits \usepackage{xfp}: I could not get this to work and kept getting an error with \fpeval \usepackage{expl3}: same. I must be doing something wrong. What is the correct incantation here? I would rather not resort to compiling with Lua because my document is part of series that all compile fine with PDFLaTeX. Thank you in advance!

  • circuitikz: Rename self-drawn 'bipole symbol'
    by cis on November 24, 2025 at 4:46 pm

    I drew a new bipol-symbol (which is similar to a capacitor from pgfcircbipoles.tex) and I want to be able to say \draw[] (0,0) to[newname] (2,0) to[vC] (4,0); instead of \draw[] (0,0) to[capacitor] (2,0) to[vC] (4,0); I thought I could do the same trick as here. Simply "search and replace" doesn't work. What do I have to do? %\documentclass[a4paper]{article} \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \makeatletter %% Normaly-Open-Contact Dipol Symbol ============ \ctikzset{bipoles/capacitor/height/.initial=0.35}% default 0.6 \ctikzset{bipoles/capacitor/width/.initial=0.3}% default 0.2 \pgfcircdeclarebipolescaled{capacitors} {} {\ctikzvalof{bipoles/capacitor/height}} {capacitor} {\ctikzvalof{bipoles/capacitor/height}} {\ctikzvalof{bipoles/capacitor/width}} { \pgfcirc@maybe@fill@straight@capacitor \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{2\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{2\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{2\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{2\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} } \pgfcirc@activate@bipole@simple{l}{capacitor} %% ============================= \makeatother \begin{document} \begin{circuitikz}[] \draw[] (0,0) to[capacitor] (2,0) to[vC] (4,0); \end{circuitikz} \end{document}

  • Add a DPDT switch
    by Nicolas on November 24, 2025 at 1:55 pm

    I've diagrammed the charging and discharging of a capacitor. \documentclass[border = 1mm]{standalone} \usepackage[utf8]{inputenc} \usepackage{siunitx} \usepackage[european, straightvoltages, RPvoltages]{circuitikz} \usetikzlibrary{babel} \begin{document} \begin{circuitikz} \draw (0,0) node[spdt,rotate=90,anchor=in] (Sw) {} (Sw.in)--++(0,-1) coordinate(RC) --++(1,0) to[R] ++(0,-1.5) to [leDo]++(0,-1.5) --++(-1,0) (RC)--++(-1,0) to[capacitor]++(0,-3)--++(1,0) (RC)--++(1,0) to[R] ++(0,-1.5) to [leDo]++(0,-1.5) coordinate (basRC) ($(basRC)+(-1,0)$) --++(0,-1) node[ground](GND){} (Sw.out 1) to[R] ++(-2,0) to[leDo, invert, mirror] ++(-2,0) coordinate(posSource) to [vsource] (posSource|-GND) --(GND) (Sw.out 2) --++(3,0) coordinate (posMoteur) to [Telmech=M,n=motor] (posMoteur|-GND)--(GND); \end{circuitikz} \end{document} For the discharge, I'd like to add a DPDT switch (and an LED + protection resistor in the corresponding loop) to be able to change the motor's direction of rotation: I haven't found anything about this in the documentation.

  • LaTeX "minted" is not working with MikTeX, Win10
    by J AK on November 24, 2025 at 11:29 am

    I want to submit a paper in e-informatica, so I am using their file, which is available here. But without any change, their file is not working. It generates the error Error message: minted v3+ executable is not installed or is not added to PATH with two other errors. I have uninstalled and reinstalled the package, and I have also already tried pdflatex --shell-escape your_document.tex pip install minted Please guide how I can fix this.

  • \setmainfont (missing characters) vs \babelfont (not all settings available)
    by Denis Bitouzé on November 24, 2025 at 11:15 am

    (Disclaimer: if I am not mistaken, this question incidentally concerns transliteration of Sanskrit, but I know nothing about that language.) The following MCE: \documentclass{article} \usepackage{fontspec} \usepackage{babel} \setmainfont{texgyrepagella}[ Extension =.otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-boldItalic, Numbers = OldStyle, ] % \babelfont{rm}[Language=Default]{texgyrepagella} \begin{document} \foreignlanguage{sanskrit}{haṁsamukhī} \end{document} (run with lualatex) doesn't work well: Missing character: There is no ṁ (U+1E41) in font [texgyrepagella-regular.otf ]:mode=node;script=latn;language=dflt;+tlig;+onum;! If the line: % \babelfont{rm}[Language=Default]{texgyrepagella} is uncommented, it works nicely and still works nicely if in addition the \setmainfont command is commented. Hence I would be inclined to just rely on: \babelfont{rm}[Language=Default]{texgyrepagella} but, AFAICS, I would then be unable to adjust the settings precisely (e.g. Numbers = OldStyle). So what would be the right way to both: not have missing characters, be able to adjust the settings of the font precisely? Is it safe to keep both \setmainfont and \babelfont?

  • Why do expl3 setting commands use \edef?
    by jlab on November 24, 2025 at 9:21 am

    Looking at the definition of \tl_set:Nn (for example, with latexdef \tl_set:Nn), we find \tl_set:Nn: \protected\long macro:#1#2->\__kernel_tl_set:Nx #1{\__kernel_exp_not:w {#2}} where \__kernel_tl_set:Nx is simply \edef; and \__kernel_exp_not:w is \unexpanded. So, \tl_set:Nn \l_my_tl {...} means \edef \l_my_tl {\unexpanded {...}} that is to say: \edef requests for the expansion of the macro definition, but this expansion is prevented by \unexpanded. I'm curious, why not using instead \def \l_my_tl {...} ?

  • LaTeX and tabluarray theme
    by Aaron on November 24, 2025 at 7:26 am

    The table with the local settings works perfectly. But if I want to have a theme = compact, it no longer works. I want to write lines 25 and 26 into a global theme and only customize the specific changes locally, see line 25. \documentclass{scrbook} \usepackage{fontspec} \usepackage[sfdefault]{noto} \setmonofont{Noto Sans Mono}[UprightFont = * SemiBold] \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewTblrTheme{compact}{% \DefTblrTemplate{contfoot-text}{default}{}% \DefTblrTemplate{conthead-text}{default}{}% % Style for the first line (header) \SetTblrStyle{row}{1}{font={\sffamily\bfseries\small},abovesep=3pt,belowsep=3pt}% % Style for all data rows \SetTblrStyle{row}{2-Z}{font={\sffamily\small},abovesep=1pt,belowsep=1pt}% } \begin{longtblr}[ theme = compact, caption = {Test}, label = {tab:test} ]{ colspec = {cX[l]}, rowhead = 1, % row{1} = {font={\small\sffamily\bfseries}, abovesep=3pt, belowsep=3pt}, % row{2-Z} = {font={\small\sffamily}, abovesep=1pt, belowsep=1pt}, cell{2-Z}{1} = {font=\ttfamily\small} } \toprule Spalte 1 & Spalte \\ \midrule 123 - 456 & Zeile 1 \\ 123 - 456 & Zeile 2 \\ 123 - 456 & Zeile 3 \\ 123 - 456 & Zeile 4 \\ \bottomrule \end{longtblr} \end{document}

  • floating point arithmetic and boolean operations with \ifthenelse
    by underflow on November 24, 2025 at 6:50 am

    This is a follow up to my previous post about arithmetic operations and tikz I would like to performance floating point arithmetic & boolean operations in conjunction with \ifthenelse. Here is a minimal example: \usepackage{tikz, ifthen} \begin{document} \begin{tikzpicture} \foreach \a in {-6,...,6} { \foreach \b in {-6,...,6} { \ifthenelse{ (\a+1.4*b < 4) \and (\a - 1.4*b)> 1 } { \node at ( (\a, \b ) {(\a, \b)}; } {} } } \end{tikzpicture} \end{document} Many thanks for your help!

  • How to align the visual bottom of a large quotation mark with the cap height of the text?
    by Mihai on November 23, 2025 at 10:03 pm

    I am trying to figure how to correctly place a symbol (e.g., a quotation mark) as illustrated below. So, far I have the following: % Document class. \documentclass[12pt]{article} % Dependencies. \usepackage{lipsum} % Start. \ExplSyntaxOn % Define a box for the quote symbol. \box_new:N \l_quote_box % Define the `\pquote` command. \NewDocumentCommand{\pquote}{ m }{% % Start the quote environment. \begin{quote} % Enter horizontal mode. \leavevmode % Set the quote box to its content. \hbox_set:Nn \l_quote_box {% % Define the quote symbol. \rule{1em}{1em}% } % Place the quote symbol to the left. \llap{% % Smash to avoid affecting line spacing. \smash{% % Raise to align with the top of the first line. \raisebox{ \dim_eval:n { \fontcharht\font`H } }{% % Render the box containing the quote symbol. \box_use:N \l_quote_box }% }% }% % Render the quote content. #1 \end{quote} } % Stop. \ExplSyntaxOff \begin{document} \lipsum[1][1-3] \pquote{\lipsum[1][1-3]} \end{document} Which produces as output: However, the moment I redefine \l_quote_box as % Set the quote box to its content. \hbox_set:Nn \l_quote_box {% % Define the quote symbol. \fontsize{46}{0}\selectfont``% } the positioning of the symbol along the y-axis offset seems off, and the output obtained is: I can correctly reposition the symbol by tweaking the \raisebox, e.g. by setting \dim_eval:n { \fontcharht\font`H - 0.8em } but this feels arbitrary and perhaps dependent on the size used in \fontsize, which is not what I want. I would ideally like to: Determine (i.e., or scale) the size of quotation mark without compromising its "touch" point with the cap height, and thus not have to adjust the y-shift manually. Be mindful that large quotation marks do not overlap the text above, but rather push the entire quote environment down. Is there a robust way of achieving this, preferably without tikZ? I'd appreciate any ideas!

  • How to Make TikZ Overlay Arrows Smoother and Better Arranged in Table?
    by mingabua on November 23, 2025 at 6:33 pm

    I'm creating a table with TikZ overlay arrows to illustrate the data flow between cells. The arrows currently work, but they look somewhat crude and could be improved. I'm looking for suggestions on: How to make the curved arrows look more fluid and natural Better positioning strategies for the labeled nodes (A, B, C, D) so they don't overlap with arrows How to avoid awkward arrow angles and improve the overall visual flow Here's my MWE: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath} \usepackage{booktabs} \usepackage{xcolor} \usepackage{lipsum} \usepackage{caption} \usepackage{tikz} \usetikzlibrary{tikzmark} \usepackage[most]{tcolorbox} % Color \definecolor{boxBack}{RGB}{245, 247, 250} \definecolor{darkgrey}{HTML}{464e51} \definecolor{customGray}{HTML}{DDDDDD} \definecolor{customRed}{HTML}{FDE7A9} \definecolor{customOrange}{HTML}{FC8E64} \definecolor{customBlue}{HTML}{B83779} % tcolorbox settings \tcbset{ enhanced, colback=boxBack, colframe=gray!40, boxrule=0.5pt, fonttitle=\bfseries\sffamily, coltitle=black, attach boxed title to top left={xshift=0.5cm, yshift=-3mm}, boxed title style={colback=white, colframe=gray!40, arc=3pt}, top=1em, bottom=1em, left=1em, right=1em } \begin{document} \lipsum[1-3] \begin{tcolorbox}[title=Test] \footnotesize $\quad$ \lipsum[1] \renewcommand{\arraystretch}{1.2} \begin{center} \captionsetup{font=footnotesize,labelfont={color=darkgrey,bf}} \captionof{table}{\textcolor{darkgray}{Example}} \label{tab:shifte} \vspace{-0.5cm} \[ \begin{array}{@{\hspace{1em}}c@{\hspace{2em}}c@{\hspace{3.5em}}c@{\hspace{3.5em}}c@{\hspace{3.5em}}c@{\hspace{2em}}c@{\hspace{1.0em}}} \toprule \text{Day} & \text{$1$} & \text{$2$} & \text{$3$} & \text{$4$} & \text{$\ldots$} \\ \midrule \text{{\fontsize{9}{10}\selectfont ...}} & \text{{E}} & \text{{L}} & \text{{O}} & \text{{E}} & \text{$\ldots$} \\[6pt] \text{$a_{ds}$} & \tikzmarknode{A2}{\text{$(1,0)$}} & \tikzmarknode{A3}{\text{$(0,1)$}} & \tikzmarknode{A4}{\text{$(0,0)$}} & \tikzmarknode{A5}{\text{$(1,0)$}} & \tikzmarknode{A6}{$\ldots$} \\[6pt] \text{$b_{ds}$} & \tikzmarknode{B2}{\text{$(1,0)$}} & \tikzmarknode{B3}{\text{$(1,0)$}} & \tikzmarknode{B4}{\text{$(0,1)$}} & \tikzmarknode{B5}{\text{$(0,1)$}} & \tikzmarknode{B6}{$\ldots$} \\[6pt] \text{$c_{ds}$} & \text{$(0,0)$} & \text{$(0,0)$} & \tikzmarknode{Z1}{\text{$(0,1)$}} & \text{$(0,0)$} & \text{$\ldots$} \\[6pt] \text{$v_{ds}$} & \tikzmarknode{E3}{\text{$(0,0)$}} & \tikzmarknode{E4}{\text{$(0,1)$}} & \text{$(0,0)$} & \tikzmarknode{E5}{\text{$(1,0)$}} & \tikzmarknode{E6}{$\ldots$ } \\ [6pt] \text{$d_{d}$} & \text{$0$} & \text{$1$} & \tikzmarknode{Z12}{\text{$0$}} & \text{$1$} & \text{$\ldots$} \\ \bottomrule \end{array} \] \begin{tikzpicture}[remember picture,overlay] % Fixed the typo here \draw[thick, ->] (-1.94,0.98) -- (-1.32,0.98); \draw[thick, -<] (-1.94,2.02) -- (-1.32,2.02); \draw[thick, -<] (-1.94,2.58) -- (-1.32,2.58); \draw[thick, ->] (-2.44,2.8) -- (-1.32,2.26); \draw[thick, customGray, -] (1.48,1.6) -- (2.56,2.22); \draw[thick, ->] (-0.44,2.8) -- (0.6,1.60); \draw[thick, ->] (1.48,1.6) -- (2.56,2.22); \draw[thick, -] (-1.94,2.58) -- (-1.94,0.98); \fill[customGray] (-2.21,2.65) circle (0.19); \fill[customGray] (2.02,1.91) circle (0.19); \fill[customGray] (0.08,2.16) circle (0.19); \fill[customGray] (-1.94,1.5) circle (0.19); \node[circle,draw,inner sep=1pt,font=\tiny] at (-2.21,2.65) {A}; \node[circle,draw,inner sep=1pt,font=\tiny] at (-1.94,1.5) {B}; \node[circle,draw,inner sep=1pt,font=\tiny] at (0.08,2.16) {C}; \node[circle,draw,inner sep=1pt,font=\tiny] at (2.02,1.91) {D}; \end{tikzpicture} \end{center} \noindent \lipsum[1] \end{tcolorbox} \normalsize \lipsum[2] \end{document} I want the arrows to look something like this:

  • How to recreate a DuPont scheme
    by Dorian on November 22, 2025 at 1:30 pm

    I'd like to recreate a DuPont scheme as the image below. I’m not necessarily asking for the exact code used to recreate the graphic, but rather for the packages and commands that would allow me to do it myself. Is there anything more “accessible” than TikZ? Thank you in advance 😉