Week
- Why are `{` and `}` printed as `-` and `"` instead of as themselves when their category codes are changed to normal letters?by H4XeO6 on May 18, 2026 at 2:22 am
Here is my minimal example (main.tex): \catcode`\{=11 \catcode`\}=11 hello}{ \bye I compiled it with tex main && dvipdfmx main.dvi and obtained main.pdf, which contains a single page printed as hello˝–. Actually, the issue could fixed up when I switch to a typewriter font: \catcode`\{=11 \catcode`\}=11 \tt hello}{ \bye Why does the default font produce this unexpected output? What is the underlying reason?
- Effects of "intertext" within "align"by Michael Hardy on May 17, 2026 at 9:48 pm
In the code below, the use of "intertext" with the words "and in general" has the effect that instances of ":=" above and below those words will be vertically aligned with each other. However, the last "intertext" near the end, was a (possibly misguided?) attempt to prevent that last phrase, beginning with the word "where", getting separated from what appears above it in case the house style of a publication to which I will submit this does not allow display breaks. But this causes extra vertical blank space to appear below that phrase: the space where something would appear on the next line if there were a next line. Is there a simple way to prevent a page break between the "where" phrase and the stuff above it without getting that extra which space below that? \begin{align} f_0\big( (\alpha)_{\alpha\in I} \big) : = {} & \sum_{\text{even } n\ge0} (-1)^{n/2} \sum_{A\in\binom In} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha, \\ \label{sine of sum} f_1\big( (\alpha)_{\alpha\in I} \big) : = % \sin \sum_{\alpha\in I} \alpha = {} & \sum_{\text{ odd } n\ge1} (-1)^{(n-1)/2} \sum_{_{A\in\binom In}} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha, \\ f_2\big( (\alpha)_{\alpha\in I} \big) : = {} & \sum_{\text{even } n\,\ge\,2} (-1)^{(n-2)/2} n \sum_{_{A\in\binom In}} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha, \\ f_3\big( (\alpha)_{\alpha\in I} \big) : = {} & \sum_{\text{ odd } n\,\ge\,3} (-1)^{(n-3)/2} (n-1) \sum_{_{A\in\binom In}} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha, \intertext{and in general,} f_i\big( (\alpha)_{\alpha\in I} \big) := {} & \!\!\!\! \sum_{\begin{smallmatrix} n \, \ge\,i \\ n\,\equiv\,i\bmod 2 \end{smallmatrix}} (-1)^{(n-i)/2} c_i(n) \sum_{A\in\binom In} \prod_{\alpha\,\in\,A} \sin\alpha \prod_{\alpha\,\in\,I\smallsetminus A} \cos\alpha \intertext{where $c_i(n)$ is the minimal polynomial of the set $\{\,n\in\{\,0,1,2,\ldots,i-1\,\} : n\equiv i\bmod2\,\}$.} \nonumber \end{align}
- Tangential curve labels with 1D force-based collision avoidance along paths in pgfplotsby cjorssen on May 17, 2026 at 8:44 pm
I am trying to implement a dynamic labeling system for multiple curves within a pgfplots axis environment. The goal is to have curve labels that are both tangential (sloped) to their respective paths and capable of avoiding collisions by utilizing a 1D force-based relaxation mechanism to repel each other along the curves' domains. My Understanding of pgfplots Internals From what I understand of pgfplots internals, and please correct me if my assumption is flawed, the package operates on a deferred drawing (or accumulation) model, conceptually quite similar to how matplotlib handles figures in Python. It seems to split its workflow into distinct steps: A Survey Phase where it reads \addplot data, accumulates coordinates in memory, and computes the global axis limits. A Visualization Phase triggered at \end{axis} where it maps data coordinates to physical dimensions and emits the actual TikZ paths and nodes. Based on this understanding, it feels like the ideal place to inject a label-relaxation algorithm would be right between these two phases (perhaps using hooks like before end axis), after the data is parsed but before the final typesetting occurs. The Technical Bottleneck: The Node Bounding Box Dilemma The core difficulty I am facing is a classic "chicken-and-egg" problem: To know the dimensions (width, height, depth) of a label's bounding box for collision detection, TeX must first typeset the text into a box. However, we cannot definitively position or rotate that node along the path until the force-based algorithm has computed the final, relaxed $t$ parameters for all curves. If a LuaLaTeX-based approach is required to handle the physics/loop, I am completely open to it. But I am unsure how to elegantly pass TeX box dimensions into Lua, or how to query the generated curve paths before the rendering phase. Minimal Working Example (Current State) Here is a basic MWE where the labels are sloped but completely overlap: \documentclass[border=5mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ domain=0:3.5, restrict y to domain = 0:10, samples=100, axis lines=left ] % Curve 1 \addplot[blue, thick] {x^2} node[pos = 0.2, sloped] {Function $f(x)$}; % Curve 2 \addplot[red, thick] {1/x} node[pos = 0.8, sloped] {Function $g(x)$}; \end{axis} \end{tikzpicture} \end{document} Tentative Logic / Pseudo-code (Force-Based Relaxation) Ideally, the macro or Lua script would perform a spring-embedder / force-directed approach constrained to 1D path coordinates: # Pre-computation phase for each label L_i: Typeset L_i into a temporary TeX box to get its dimensions (W_i, H_i) # Force-directed loop while system_not_in_equilibrium and max_iterations_not_reached: Initialize forces F_i = 0 for all labels for each curve i with label L_i: 1. Get baseline position P_i = curve_i(t_i) 2. Compute tangent angle theta_i at t_i 3. Construct Label Bounding Box B_i (using W_i, H_i) at P_i rotated by theta_i for each pair of labels (L_i, L_j): if Intersect(B_i, B_j): # Compute repulsive force based on overlap magnitude force_magnitude = calculate_repulsive_force(B_i, B_j) # Project force along the 1D direction of the respective curves F_i = F_i - force_magnitude F_j = F_j + force_magnitude # Update positions using a small step size (damping) for each label L_i: t_i = t_i + alpha * F_i ConstraintToValidDomain(t_i) Questions & Directions Is my mental model of the pgfplots accumulation process accurate enough to build upon, or am I missing a fundamental constraint of the package architecture? Is there an existing package or experimental snippet that already handles force-based label placement or relaxation algorithms along TikZ paths? If doing this via LuaLaTeX, what is the cleanest way to intercept the path coordinates generated by pgfplots and pass the TeX box dimensions to a Lua-based physics loop? Any pointers, conceptual corrections, or architectural advice would be highly appreciated. Real-World Use Case (Thermodynamic Diagrams) To provide some concrete context on why this automation is so critical for my workflow, here is a screenshot of the type of complex diagram I am currently generating (with luatex, FFI and the CoolProp shared library). It is a pressure-enthalpy (p-h) diagram widely used in refrigeration and chemical engineering, plotted in the (p, log h) plane for a pure substance. As you can see, the visual density is extremely high because it overlays several distinct families of isolines crossing each other: Isotherms (constant temperature) Isentropes (constant entropy) Isochores (constant specific volume) Vapor quality lines / isotitres (constant dryness fraction) Manually hardcoding and fine-tuning the pos parameter for dozens of labels across these intersecting families of curves is completely unmanageable—especially since the curves shift dramatically depending on the thermodynamic properties of the fluid being modeled. Having a generalized, tangential, force-directed algorithm to let these labels dynamically find their equilibrium along their respective paths would be an absolute game-changer for rendering complex engineering charts natively in pgfplots.
- How to convert a custom macro for marking angles with multiple arcs into a TikZ style?by Med Elhadi Kh on May 17, 2026 at 8:59 am
I have created a custom macro \MarkAngle that draws multiple arcs to mark an angle. It works well, but I want to convert it into a native TikZ style (e.g., using .style n args={4} or .code n args={4}) so I can use it cleanly within standard TikZ path options like this: \draw [red, thick, angle radius=1cm, mark angle={3}{A}{B}{C}]; Here is my Minimal Working Example (MWE), which includes my working \MarkAngle macro and my attempt at defining mark angle/.code n args={4}. However, using \pic inside a .code within a \draw path feels hacky and doesn't integrate perfectly. \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{decorations.markings, angles, quotes} % My working macro \newcommand{\MarkAngle}[5][]{% \begingroup \tikzset{angle radius=1cm, #1} \pgfkeysgetvalue{/tikz/angle radius}{\baseR} \foreach \i in {1,...,#2} { \pgfmathsetmacro{\currentR}{\baseR + (\i-1)*5} \ifnum\i=#2 \pic [draw, #1, angle radius=\currentR pt] {angle=#3--#4--#5}; \else \pic [draw, #1, fill=none, angle radius=\currentR pt] {angle=#3--#4--#5}; \fi } \endgroup } \begin{document} \begin{tikzpicture}[ mark segment/.style={ decoration={ markings, mark=at position 0.5 with { \foreach \i in {1,...,#1} { \pgfmathsetmacro{\xoffset}{(\i - (#1+1)/2) * 3} \draw (\xoffset pt, -4pt) -- (\xoffset pt, 4pt); }}}, postaction={decorate} }, % My attempt to convert it into a style mark angle/.code n args={4}{ \pgfmathsetmacro{\baseR}{scalar(\pgfkeysvalueof{/tikz/angle radius})} \foreach \i in {1,...,#1} { \pgfmathsetmacro{\currentR}{\baseR + (\i-1)*3} \ifnum\i=#1 \pic [draw, pic actions, angle radius=\currentR pt] {angle=#2--#3--#4}; \else \pic [draw, pic actions, fill=none, mark segment={}, angle radius=\currentR pt] {angle=#2--#3--#4}; \fi } } ] \coordinate (A) at (30:2); \coordinate (B) at (0,0); \coordinate (C) at (150:2); \draw (A) -- (B) -- (C); % Trying to use the style here \draw [red, thick, angle radius=1cm, mark angle={3}{A}{B}{C}]; \coordinate (D) at (0,2); \coordinate (E) at (0,0); \coordinate (F) at (2,0); \draw (D) -- (E) -- (F); \draw [blue, thick, angle radius=1cm, mark angle={2}{D}{E}{F}]; \end{tikzpicture} \end{document} My questions are: How can I properly define this as a TikZ style so that it respects path properties (like colors and line widths)? Is using .code the best approach here, or should this be defined entirely as a new custom pic type? Any advice on the most "TikZ-idiomatic" way to achieve this would be highly appreciated!
- Relabeling ticks on my number lineby cheeseboardqueen on May 17, 2026 at 1:54 am
I am trying to draw my own number line with variable ticks. I was able to generate the tick marks exactly where I want them and define the variable, however, they aren't spacing out the way I'd hope. Any suggestions? \documentclass[11pt]{amsart} \usepackage{tikz,tikz-cd} \begin{document} \begin{figure}[h] \centering \begin{tikzpicture} \draw[latex-latex] (-7.5,0) -- (7.5,0) ; %edit here for the axis \foreach \x in {-6.5, -6, -5.5, -4, -2.5, -2, -1.5, 0, 1.5, 2, 2.5, 4, 5.5, 6, 6.5} % edit here for the vertical lines \draw[shift={(\x,0)},color=black] (0pt,3pt) -- (0pt,-3pt); \foreach \x in {-z_b-T-h, -z_b-T, -z_b-T+h, -z_b, -z_b+T-h, -z_b+T, -z_b+T+h, 0, z_c-T-h, z_c-T, z_c-T+h, z_c, z_c+T-h, z_c+T, z_c+T+h} % edit here for the numbers \draw[shift={(\x,0)},color=black] (0pt,0pt) -- (0pt,-3pt) node[below] {$\x$}; \end{tikzpicture} \end{figure} \end{document} EDIT: I am looking to label the -6.5 position with $-z_b-T-h$ and so on. I'd be even okay if my defined labels don't fit horizontally and I have to label them vertically.
- Space before a vertical rule in an array got eaten in TeX Live 2023 but not in TeX Live 2024. What happened?by Mark McGregor on May 17, 2026 at 12:01 am
Feeding \documentclass{article} \pagestyle{empty} \usepackage{array} \begin{document} $\begin{array}{l||l} X \; & \; Y \end{array}$ \end{document} to pdflatex to latex in TeX Live 2023 yields As you see, before the double bar there is slightly less space than after it; probably, the space \; is eaten away. In TeX Live 2024 and 2025, the space before the double bar seems to be present: Due to italics math, it's a bit difficult to say which TeX-Live version produces a correct™ result. So I tried out \documentclass{article} \pagestyle{empty} \usepackage{array} \begin{document} $\begin{array}{l||l} \mathrm{X} \; & \; \mathrm{X} \end{array}$ \end{document} pdflatex in TL 2023 yields and pdflatex in TL 2024 yields The output in TeX Live 2024 seems to me more equalized, so probably corresponding to the author's intention, hence probably correct™. Still, before I adapt various arrays in my old code to match the behavior in the newer TeX Live, I need to know this: Was the TeX-Live-2023 behavior intentional? If so, for which reason? Was the change of behavior intentional? If so, for which reason?
- How to get \usebox to respect xrightmargin of \lstlisting...?by OppfinnarJocke on May 16, 2026 at 7:54 pm
I am trying to scale a lstlisting in a Beamer presentation, and for that I have to (?) put the listing into an lrbox. However, when I do that and later render it out as \usebox{\mybox} the xrightmargin of my listing is not respected. Is there any way to get this to work? MWE: \documentclass{beamer} \usepackage{listings} \usepackage{color} \lstset{ language=C, basicstyle=\footnotesize\ttfamily, numbers=left, numberstyle=\footnotesize, stepnumber=1, tabsize=2, numbersep=-2pt, showspaces=false, showstringspaces=false, showtabs=false, frame=single, framexleftmargin=-10pt, captionpos=b, breaklines=true, breakatwhitespace=false, } \begin{filecontents}{myfile.tex} \begin{lstlisting}[xrightmargin=3.5cm] void function (int r, int m, int *ptr, int *block, double value, double dest) { return block[r * m + *ptr] + value - dest; } \end{lstlisting}% \end{filecontents} \newsavebox{\mybox} \begin{document} \begin{lrbox}{\mybox}% \input{myfile.tex} \end{lrbox}% \begin{frame}[fragile]{usebox top, no usebox bottom} \usebox{\mybox}%% Ignores xrightmargin \vspace{0.5cm} \input{myfile.tex}%% Preserves xrightmargin \end{frame} \end{document} Result (frames are only for emphasis): What I want is to have \usebox preserve the xrightmargin so that I can then scale the narrower listing with \scalebox. Is this possible?
- Revealing blanks does not work well in numerator of a \fracby scottkosty on May 16, 2026 at 7:26 pm
I am using an implementation to first show an underline with a questionmark in the middle that takes up the same space as the revealed text, from this answer: An alt fill-in-the-blank with question in the middle and improved to handle nesting at Nested revealing of (correctly sized) blanks. But the underline is too long when I use it in a fraction. Presumably the code that calculates the length assumes the normal font size? Example below (see the last bullet point). % based on here: https://tex.stackexchange.com/a/757717 % Posted by jlab % Retrieved 2026-05-16, License - CC BY-SA 4.0 \documentclass{beamer} % needed to reproduce \beamerdefaultoverlayspecification{<alert@+|+->} \makeatletter \newlength{\gapwidth} \newcommand{\blankQ}[1]{% \begingroup% \edef\beamerpauses@backup{\arabic{beamerpauses}}% \ifmmode \if@display \settowidth{\gapwidth}{$\displaystyle #1$}% \else \settowidth{\gapwidth}{$#1$}% \fi \else \settowidth{\gapwidth}{#1}% \fi \setcounter{beamerpauses}{\beamerpauses@backup}% \alert<.(1)|handout:0>{% \alt<+->{% #1% }{% \vphantom{#1}\smash{\underline{\makebox[\gapwidth]{?}}}% }% }% \endgroup% } \makeatother \begin{document} \begin{frame} \begin{itemize} \item simple example showing usage of blankQ: $2+2=\blankQ{4.}$ \item $P(X + 1 < 4) = \blankQ{P(X < 3) = \blankQ{0.3.}}$ \item \blankQ{It works also \blankQ{for more \blankQ{nested levels\blankQ{~!~}}}} \item Now to show the problem: the underline is too long when in numerator: $V(X_i) = \frac{\blankQ{P_{H_{0}}(X_{i}=1)\left[1-P_{H_{0}}(X_i=1)\right]}}{n}$ \end{itemize} \end{frame} \end{document} Output from above example, showing the problem:
- PDF/UA-2 structure destination failures (LaTeX source)by Julian on May 15, 2026 at 10:48 am
Here is a MWE of LuaLaTeX source code: \nonstopmode \RequirePackage{pdfmanagement} \RequirePackage{tagpdf} \tagpdfsetup{activate/mc=true,activate/spaces=true} \documentclass[11pt,usegeometry]{article} \usepackage{hyperref} \hypersetup{ pdftitle={MyTitle}, pdfauthor={MyName}, pdfdisplaydoctitle=true} } \begin{document} \tableofcontents \section{First Section} A document with a single sentence linking to \hyperlink{My Ref}{My Ref}. \hypertarget{My Ref}{My Ref}. Details about my reference. \end{document} After I compile twice and then auto-tag the resulting PDF in Adobe Acrobat Pro, veraPDF includes the following PDF/UA-2 validation failures: I am looking for a way to resolve these failures, both for automated Table of Contents entries and also individual hyperlink/hypertarget internal links. Some background: I needed to meet a work deadline and I did not have enough time to recode my tabularray-based tables with tabular-based tables in my full document to enable full tagging using tagpdf, but I wanted to replace the interword glue with space glyphs to give screen readers some fluency as a stopgap while I create a fully accessible version of my PDF, which must be visually identical to the untagged version. Apart from this structure destination issue, I have found Adobe's auto-tag feature to be very useful. I simply set up a root Document tag, with Part tags inside them for my chapters, copy the relevant chunks into them, fix a few things here and there, and veraPDF is almost fully happy. Fixing "Each TOCI in the table of contents shall identify the target of the reference using the Ref entry" is fiddly but I know how to do it. The key stumbling block is this issue here: structure destinations. I feel tantalisingly close to being able to produce a nice PDF/UA-2 document, simply using Adobe Acrobat Pro to remediate. Any help would be greatly appreciated. Is it possible to fix this by editing tags in Adobe Acrobat Pro manually, with or without help from different LaTeX coding of the internal links? (Which presumably could be coded/automated?) Or is there an existing tool that would allow these to be fixed throughout my document? I have tried reading the ISO and PDF/UA-2 documentation but this is over my head. I have seen similar questions and answers here, and here, but I lack the technical knowledge to apply a solution. With a detailed description and/or screenshot of what to change (presumably inside the properties of Link - OBJR tags?), I would be good to go, and hugely grateful.
- The linebreak syntax bug with luacode?by Explorer on May 15, 2026 at 7:18 am
The highly related question is here and here and even early here: \documentclass{standalone}% compile with lualatex \usepackage{luacode} \begin{document} \begin{luacode} local f = function(x, y, opt) opt = opt or {} opt.sg = opt.sg or '+' if opt.sg == '+' then return x+y else return x-y end end local x = f(2, 2, {sg='+'} ) -- < this causes an error with luacode, but not luacode* tex.print("Result ="..x) \end{luacode} \end{document} The code above raise: (./mwe.aux)[\directlua]:13: ')' expected (to close '(' at line 11) near '='. \luacode@dbg@exec ...code@maybe@printdbg {#1} #1 } l.21 \end{luacode} ? I wonder is this really a bug which exists for past 14 years, and any suggestions or patch to correct this abnormal behaviour? Edited: Since nidarfp pointed out here: Two solutions: The ideal solution: that the author of luacode fixes the problem. Use the luadraw* environment (which uses luacode*), and your problem should disappear, but you won't be able to use TeX macros in the luadraw source code (which is the advantage of luacode) I wonder any further advice on luadraw' side?
- Is there a way to draw this parabola in plain tikz without getting a dimension error?by Jasper on May 15, 2026 at 5:52 am
Is there a way to draw this parabola in plain tikz without getting a dimension error? I don't want to drag out the big guns for what seems like it should be a simple diagram. \documentclass[tikz,border=1cm]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \pgfmathsetmacro\FOCUSX{2} \pgfmathsetmacro\FOCUSY{1} \pgfmathsetmacro\LINEPX{-1} \pgfmathsetmacro\LINEPY{0} \pgfmathsetmacro\LINEDX{-3} \pgfmathsetmacro\LINEDY{2} \pgfmathsetmacro\LINEDL{sqrt((\LINEDX)^2 + (\LINEDY)^2)} \pgfmathsetmacro\LINEDX{\LINEDX/\LINEDL} \pgfmathsetmacro\LINEDY{\LINEDY/\LINEDL} \pgfmathsetmacro\LINEPERPX{\LINEDY} \pgfmathsetmacro\LINEPERPY{-\LINEDX} % Focus \fill (\FOCUSX,\FOCUSY) node[right]{$F$} circle[radius=0.1]; % Directrix \draw[dashed] (\LINEPX,\LINEPY) -- +(7*\LINEDX,7*\LINEDY) -- +(-7*\LINEDX,-7*\LINEDY); \fill (\LINEPX,\LINEPY) node[below left]{$P$} circle[radius=0.1]; \draw[->] (\LINEPX,\LINEPY) -- ++(\LINEDX,\LINEDY) node[below left]{$D$}; % Directrix normal \draw[->] (\LINEPX,\LINEPY) -- ++(\LINEPERPX,\LINEPERPY) node[above left]{$N$}; \foreach \ALPHA in {-4,-3.5,...,4} { \pgfmathsetmacro\QUADA{1-(\LINEPERPX)^2-(\LINEPERPY)^2} \pgfmathsetmacro\QUADB{ \LINEPERPX*(\LINEPX+\ALPHA*\LINEDX-\FOCUSX) +\LINEPERPY*(\LINEPY+\ALPHA*\LINEDY-\FOCUSY) } \pgfmathsetmacro\QUADB{-2*\QUADB} \pgfmathsetmacro\QUADC{ (\LINEPX+\ALPHA*\LINEDX-\FOCUSX)^2 +(\LINEPY+\ALPHA*\LINEDY-\FOCUSY)^2 } \pgfmathsetmacro\QUADC{-\QUADC} \pgfmathsetmacro\BETA{ (-\QUADB+sqrt((\QUADB)^2-4*\QUADA*\QUADC)) /(2*\QUADA) } \fill[green] ($(\LINEPX,\LINEPY) + \ALPHA*(\LINEDX,\LINEDY) + \BETA*(\LINEPERPX,\LINEPERPY)$) circle[radius=0.1]; } \end{tikzpicture} \end{document}
- Is there a way to customize the definition of a tikzduck part? I am trying to draw a unicorn, but the horn is the same color as the bodyby Jasper on May 14, 2026 at 8:40 pm
Is there a way to customize the definition of a tikzduck part? I am trying to draw a unicorn, but the horn is the same color as the body. I want the horn to be a different color, and to also add some draw commands to it, so I can make a sort of swirl around it. Like this: \documentclass{article} \usepackage{tikz,tikzducks} \begin{document} \begin{tikzpicture} \duck[ body=brown!80!white, longhair=brown!50!black, horsetail, unicorn=brown!50!black ] \end{tikzpicture} \end{document}
- theorem-like-aware lists for cleverefby random name on May 14, 2026 at 2:53 pm
I use LaTeX for mathematics and am often in a situation where I want to write something like the following: I have a theorem with two conditions or sub-statements etc. which I later want to refer to in two different ways: Theorem 1.1. If X is ..., then X has the following properties (a) property a (b) property b proof. To prove (a) we ... ... "We see that Y satisfies Theorem 1.1.a so ...". For this, I would want the LaTeX code to look something like: \begin{theorem} If $X$ is ..., then $X$ has the following properties \begin{thmlist} \item\label{it:a} property a \item property b \end{thmlist} \end{theorem} \begin{proof} To prove \ref{it:a} we ... \end{proof} We see that $Y$ satisfies \cref{it:a} so ... The closest I have gotten to getting this to work is the following unsatisfactory way using thmtools and cleveref: \documentclass{amsart} \usepackage{enumitem} \usepackage{thmtools} \usepackage{cleveref} \newcounter{mythmlike} \numberwithin{mythmlike}{section} % setup lists \newlist{thmlist}{enumerate}{1} \setlist[thmlist]{label=\textnormal{\textbf{(\textit{\alph*})}},ref=\themythmlike.\alph*} % setup theorem-like environments with thmtools \declaretheoremstyle[sibling=mythmlike]{minsetning} \declaretheorem[style=minsetning,name=Theorem,postheadhook={\crefalias{thmlisti}{theorem}}]{theorem} \declaretheorem[style=minsetning,name=Corollary,postheadhook={\crefalias{thmlisti}{corollary}}]{corollary} \declaretheorem[style=minsetning,name=Lemma,postheadhook={\crefalias{thmlisti}{lemma}}]{lemma} \declaretheorem[style=minsetning,name=Proposition,postheadhook={\crefalias{thmlisti}{proposition}}]{proposition} \begin{document} \section{math} \begin{theorem} If $X$ is ..., then $X$ has the following properties \begin{thmlist} \item\label{it:a} property a \item property b \end{thmlist} \end{theorem} \begin{proof} To prove \ref{it:a} we ... \end{proof} We see that $Y$ satisfies \cref{it:a} so ... \end{document} Which produces The problems with this are two-fold: In the proof it writes "to prove 1.1.a we ..." instead of "to prove (a) we ...". It would be really great to have a command like \shortref{it:a} which would produce the latter. I have a lot of different theorem-like environments (even more than I gave in the example) and I would much prefer not having to add the postheadhook={\crefalias{thmlisti}{name}} to every single one. I tried adding postheadhook={\protect\crefalias{thmlisti}{\thmt@thmname}} when declaring the theorem-like minsetning style, but this does not work. I will add that it is important for me to have as much of the programming completely hidden away in my .sty/.cls file so that I can focus on just writing mathematics when I write -- This is also why I want to be able to use thmlist for all the theorem-like environments and not also something like a lemlist for lemmas etc. (also because I want the flexibility to easily change a lemma to a proposition etc. - which is the main benefit of using cleveref for me). Any help would be very much appreciated!
- How to shrink with a certain amount of offset?by D G on May 14, 2026 at 1:09 pm
I want a one cm offset between the blue path and the black one. \documentclass[tikz,margin=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[gray!50] (-8,0) grid (8,-8); \fill (0,0) node[above=12pt]{origin} circle (5pt); \draw[ultra thick] (-6,0) arc[x radius=12,y radius=8,start angle=90,end angle=0] -- (-6,-8) -- cycle; \draw[blue,ultra thick] (-5,-1) arc[x radius=10,y radius=6,start angle=90,end angle=0] -- (-5,-7) -- cycle; \end{tikzpicture} \end{document} Note: Both must be similar. Right now both are not similar.
- How do I make the gate branch in the JFET transistor symbol centralised rather than to the bottom or top of the gate?by Vector on May 14, 2026 at 10:58 am
I am trying to reproduce a specific transistor circuit image for an assignment. Using the stock circuitikz JFET symbol, I was able to reproduce the circuit fairly well. I am also quite satisfied with it. I am curious, however, if it is possible to make the gate closer to the center as it is in the image. I have looked through the documentation and the only plausible solution I can find is to create a new symbol however I am a bit stuck on how to go about that. The damper example in the documentation was not very clear. Here is the code, if it is needed. (I removed the voltmeter to keep the code copied compact.) \documentclass[border = 10pt]{standalone} \usepackage{amsmath} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[american, scale = 0.65] \ctikzset{ transistors/scale=1, capacitors/scale=0.7, resistors/scale=0.8 } % Transistor \draw (0,0) node[njfet, tr circle, anchor=S](Q){}; \draw(Q.G) to[short] ++(-2,0) to[short] ++(0, -2) node[ground] (G1) {}; \draw(Q.S) to[short] (Q.S |- G1) node[ground] {}; \coordinate (V_s) at ($(Q.D) + (1.5,0)$); \draw[-{Triangle[scale = 1.5]}](V_s) to[short] ++(-1.5,0) coordinate (Q.D); \draw (V_s)to [short](Q.S -| V_s); \draw[-{Triangle[scale = 1.5]}] (Q.S -| V_s) to[short] (Q.S); \draw(Q.D) to [short] ++ (0, 1.5) to[ammeter, v^<={\phantom{m}}] ++ (3.5,0) to[R, l_={$4.7\ \mathrm{k}\Omega$}, a^= {$R_D$}] ++(3.7,0) coordinate(C) to [battery, name = BDD, v_={\phantom{m}}, l^= {$V_\mathrm{DD}$}] (C |- G1) node[ground] {}; \ctikztunablearrow{1}{1}{135}{BDD} \end{circuitikz} \end{document} Here are the images;
- Tikz: perpendicular line to intersect the x-axisby Tldi You on May 14, 2026 at 10:11 am
I would like to draw a line starting from the point (200, 105.6), perpendicular to the failure envelope, and extending down to intersect the x-axis. I have implemented the following LaTeX/TikZ \documentclass[border=2pt]{standalone} \usepackage{pgfplots,siunitx} \pgfplotsset{compat=1.18} \usetikzlibrary{calc} \begin{document} \centering \begin{tikzpicture} \begin{axis}[ width=15cm, height=9.375cm, xmin=0, xmax=640, ymin=0, ymax=400, xtick={0,80,...,640}, ytick={0,80,...,400}, minor tick num=1, grid=both, grid style={black, thin}, minor grid style={black, thin}, xlabel={Contrainte normale ($\sigma_{nr}$), $kN/m^2$}, ylabel={Contrainte de cisaillement ($\tau_r$), $kN/m^2$}, axis line style={thick}, tick label style={font=\small}, label style={font=\small}, clip=false ] % Regression line: tau = 34 + sigma * tan(20) \addplot [domain=0:590, samples=2, thin, black] {34 + x*tan(20)}; % Data points on the line (open circles) \addplot [only marks, mark=o, mark size=3.5pt, fill=white, thin, black] coordinates { (100, 72.2) (200, 105.6) (300, 144.4) (400,177.7) }; % Solid dot and its label \node [circle, fill, inner sep=1.5pt] (dot) at (axis cs:320, 138) {}; \node [anchor=west, xshift=2pt] at (axis cs:320, 138) {\small (320, 138)}; % Perpendicular line from the 3rd circle (x=300) \coordinate (P) at (axis cs:200, {36 + 200*tan(20)}); \draw [very thick, black] (P) -- (axis cs:252.1, 0); % Right angle symbol \draw [very thick, black] ($(P) + ({-18*cos(20)}, {-18*sin(20)})$) -- ($(P) + ({-18*cos(20) + 18*sin(20)}, {-18*sin(20) - 18*cos(20)})$) -- ($(P) + ({18*sin(20)}, {-18*cos(20)})$); % Angle phi indicator \coordinate (phi_pt) at (axis cs:520, {34 + 520*tan(20)}); \draw [thin, black] (phi_pt) -- +(0.8cm, 0); \draw [thin, black] (phi_pt) +(0.5cm, 0) arc (0:20:0.5cm); % Box in top right \node [draw, thick, fill=white, align=center, inner sep=10pt] at (axis cs:520, 340) { $c = 34 \, kN/m^2$ \\ $\varphi = \ang{20}$ }; % Phi angle \coordinate (V) at (axis cs:520,223); \draw[thin] (V) -- ++(25pt,0); \draw[thin] ($(V)+(15pt,0)$) arc[start angle=0,end angle=20,radius=15pt]; \node[right] at ($(V)+(22pt,2pt)$) {$\varphi$}; \end{axis} \end{tikzpicture} \end{document} Do you have any suggestions or improvements? CURRENT RESULT:
- Break point inadequate in nested boxesby Erwann on May 14, 2026 at 4:18 am
In the code below, there are two \TitleBox environments inside a single \DocumentBox. I expected that when I add sufficient \lipsum text in the second \TitleBox, the page break would occur within that box at the overflow point. Instead, the entire second \TitleBox is moved to the next page, leaving extra whitespace on the first page. Is there a remedy for this behavior? \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[english]{babel} %\usepackage{csquotes} % disabled; use ``'' \usepackage[most]{tcolorbox} \usepackage[letterpaper]{geometry} \usepackage{lipsum} % ---------------------------------------------------------------- % Amendment commands % ---------------------------------------------------------------- \newcommand{\Delete}[1]{% {\sout{#1}}% } \newcommand{\Amend}[1]{% {\uline{#1}}% } % ---------------------------------------------------------------- % Global container % ---------------------------------------------------------------- \newtcolorbox{DocumentBox}{ enhanced, breakable, colback=white, boxrule=0.8pt, arc=1mm, left=4mm, right=4mm, top=4mm, bottom=4mm, } % ---------------------------------------------------------------- % Title box (FIXED: NOT breakable) % ---------------------------------------------------------------- \newtcolorbox{TitleBox}[1]{ enhanced, boxrule=0.6pt, arc=1mm, title={#1}, fonttitle=\sffamily, before skip=4mm, after skip=4mm, left=3mm, right=3mm, top=2mm, bottom=2mm, before upper=\parindent0pt, } % ---------------------------------------------------------------- \begin{document} \begin{DocumentBox} \begin{TitleBox}{\lipsum[1][1]} \lipsum[1][2] \end{TitleBox} \begin{TitleBox}{\lipsum[1][3]} \lipsum[2] \lipsum[3] \lipsum[4] \lipsum[5] \lipsum[6] \lipsum[7] \end{TitleBox} \end{DocumentBox} \end{document}
- renewcommand Gamma into itGamma in unicode-mathby Ryan Kong on May 14, 2026 at 2:26 am
I want to have a command \Gamma that does what \itGamma does, under unicode math. My Preambles: %! TEX program = xelatex \documentclass[]{article} \usepackage{amsmath} \usepackage[]{unicode-math} \setmathfont[]{TeX Gyre Termes Math} I only want \Gamma to be italic, so I will not consider using \usepackage[math-style=ISO]{unicode-math}. Here's what I tried and their respective error messages (or problem): \renewcommand{\Gamma}{\itGamma} \renewcommand{\Gamma}{\mitGamma} \AtBeginDocument{\renewcommand{\Gamma}{\mitGamma}} % They all compiles, but the result shows a upright \Gamma \AtBeginDocument{\renewcommand{\Gamma}{\itGamma}} % TeX capacity exceeded, sorry [input stack size=10000]. \tl_if_exist:NTF #1->\if_meaning:w #1 \unimathsetup{Gamma=italic} % The key 'unicode-math/Gamma' is unknown and is being ignored. I have no idea what I can do now, help would be much appreciated.
- Remember coordinate in nested tikzpicture with listingsby Jason Cho on May 13, 2026 at 2:10 pm
\documentclass{standalone} \usepackage{xcolor} \usepackage{tikz} \usepackage{listings} \begin{document} \begin{tikzpicture}[remember picture] \node[draw] {\begin{lstlisting}[language=c++, linewidth=140pt, basicstyle=\ttfamily\scriptsize] class Counter : public QObject { public: Counter() { value = 0; }!\tikz[remember picture]\node (l1){};! int getValue() { return value; }!\tikz[remember picture]\node (l2){};! }; \end{lstlisting}}; \draw[red, ->] (l1) -- (l2); \end{tikzpicture} \end{document} In this code snippet, I use listings to syntax highlight a piece of C++ code, where I mark two lines with name l1 and l2. Then I want to use the coordinates of l1 and l2. However, the output is off. How do I fix the location of the named coordinates? Requirements: I name these two points because there are a dozen of commands relying on these coordinates. Therefore I do not want to cram these commands between the escapechars of lstlisting. I want to measure the full size of the picture, including the main listing and adornments. For example, when I center the picture, the whole pic is centered, not only the main listing. I have checked: Remember coordinate in nested tikzpicture points to a weird place was solved by using a special command \subnode in tikz-qtree. access a coordinate in a nested \tikzpicture was solved by removing nesting.
- Apply command on each line of an environment automatically (luatex)by Salim Bou on May 13, 2026 at 1:12 pm
This code splits each line of an environment into two parts, places each part in a box of a specified width, and separates them with a small space. What I want is for this to happen automatically without writing the instruction at the beginning of each line, only specifying the split position and the end of the line. % lualatex \documentclass[12pt]{article} \usepackage[margin=1.8cm]{geometry} \def\<#1>{\makebox[7.8cm][s]{#1}\hspace{1cm}\makebox[7.8cm][s]{#2}} \newenvironment{mypoem}{\begin{center}\baselineskip=36pt\bfseries} {\end{center}} \begin{document} \begin{mypoem} \<first part of poem & second part of poem>\\ \end{mypoem} \end{document}
- I want to make a beamer presentation where I start with an animation, then animate that animation turning into the title pageby Jasper on May 13, 2026 at 6:13 am
I want to make a beamer presentation where I start with an animation, then animate that animation turning into the title page. I cannot figure out how to do this in beamer, and was barely able to get a prototype working in article. This is by no means an MWE, and it is by no means correct (I believe it is incorrect). But it is what I can muster right now. I want to minick this effect in beamer, where I start on a fullscreen animated slide, then animate the transition from that slide to the titlepage. I want the titlepage to be aligned as it normally would, with no vertical or horizontal separation. This is what I have so far, it needs to be viewed through adobe acrobat. \documentclass{article} \usepackage[paperwidth=160mm,paperheight=90mm,margin=0pt]{geometry} \usepackage{pgfplots,graphicx,tikz-3dplot,animate,tikzducks} \pgfplotsset{compat=1.18} \usetikzlibrary{calc} \newenvironment{jasperslide}{}{\newpage} \newsavebox{\titlebox} \sbox{\titlebox}{% \parbox{160mm}{% \centering {\Large\bfseries Overfull \textbackslash{}dbox}\par\vskip 1.5em {\normalsize Jasper Nice}\par\vskip 0.8em {\small Today}% }% } \begin{document} \begin{jasperslide} \begin{animateinline}[autoplay,loop]{10}% \pgfplotsforeachungrouped \FRAME in {1,...,60} {% \tdplotsetmaincoords{90}{-90}% \begin{tikzpicture}[x=\pagewidth,y=\pageheight] \coordinate (C) at (current page.center); \useasboundingbox (current page.south west) rectangle (current page.north east); \begin{scope}[tdplot_main_coords] \begin{scope}[canvas is yz plane at x=0,shift={($(current page.center)$)}] \duck \end{scope} \end{scope} \end{tikzpicture}% \pgfmathsetmacro{\III}{\FRAME != 60}% \ifnum\III=1\newframe\fi% }% \end{animateinline}% \end{jasperslide} \begin{jasperslide} \begin{animateinline}[autoplay]{10}% \pgfplotsforeachungrouped \FRAME in {1,...,60} {% \tdplotsetmaincoords{90-90*\FRAME/68}{-90+90*\FRAME/68}% \begin{tikzpicture}[x=\pagewidth,y=\pageheight] \coordinate (C) at (current page.center); \useasboundingbox (current page.south west) rectangle (current page.north east); \begin{scope}[tdplot_main_coords] \node[canvas is xy plane at z=0,transform shape] at (C) {\usebox{\titlebox}}; \begin{scope}[canvas is yz plane at x=0,shift={($(current page.center)$)}] \duck \end{scope} \end{scope} \end{tikzpicture}% \pgfmathsetmacro{\III}{\FRAME != 60}% \ifnum\III=1\newframe\else\newframe% \tdplotsetmaincoords{0}{0}% \begin{tikzpicture}[x=\pagewidth,y=\pageheight] \coordinate (C) at (current page.center); \useasboundingbox (current page.south west) rectangle (current page.north east); \begin{scope}[tdplot_main_coords] \node[canvas is xy plane at z=0,transform shape] at (C) {\usebox{\titlebox}}; \end{scope} \end{tikzpicture}% \fi% }% \end{animateinline}% \end{jasperslide} \end{document}
- Troubles with negative numbers on bar graph [duplicate]by Ismael Joaquim on May 12, 2026 at 9:00 am
everyone. I'm having troubles with the negative labels in the first graph.Can someone help me with this? \documentclass{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{tikz} \usetikzlibrary{pgfplots.groupplots, calc} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{groupplot}[ group style={ group size=2 by 1, horizontal sep=1.2cm }, ybar, width=7.2cm, height=6.2cm, ymode=log, log origin=infty, title style={font=\normal\bfseries}, symbolic x coords={NaCl (B1),TiC (B1),FeSi (B20)}, xtick=data, tick label style={font=\small}, x tick label style={font=\small}, visualization depends on={y \as \originalvalue}, nodes near coords={% \pgfmathprintnumber[fixed,precision=3]{\originalvalue}% }, nodes near coords style={ font=\small, rotate=90, anchor=west }, enlarge x limits=0.20, grid=major, major grid style={dashed, gray!35}, ] % ====================================================== % (a) Regime \pm 10% V0 — DADOS REAIS DOS FICHEIROS % ====================================================== \nextgroupplot[ bar width=6pt, title={(a) Regime $\pm 10\%\,V_0$}, ylabel={RMSE (meV/célula)}, ymin=1e-2, ymax=1e1, legend to name=gruppolegend, legend style={ legend columns=6, draw=black, fill=white, font=\small, column sep=6pt, }, ] % Murnaghan — NaCl: 0.061718, TiC: 0.216179, FeSi: 0.256858 \addplot+[fill=blue!75, draw=blue!75!black] coordinates { (NaCl (B1),0.061718) (TiC (B1),0.216179) (FeSi (B20),0.256858) }; \addlegendentry{Murnaghan} % BM3 — NaCl: 0.027460, TiC: 0.057278, FeSi: 0.072263 \addplot+[fill=red!80, draw=red!80!black] coordinates { (NaCl (B1),0.027460) (TiC (B1),0.057278) (FeSi (B20),0.072263) }; \addlegendentry{BM3} % Vinet — NaCl: 0.037637, TiC: 0.105771, FeSi: 0.125342 \addplot+[fill=purple!75, draw=purple!75!black] coordinates { (NaCl (B1),0.037637) (TiC (B1),0.105771) (FeSi (B20),0.125342) }; \addlegendentry{Vinet} % q-EoS (n=2) — NaCl: 0.027461, TiC: 0.057532, FeSi: 0.072068 \addplot+[fill=green!70!black, draw=green!50!black] coordinates { (NaCl (B1),0.027461) (TiC (B1),0.057532) (FeSi (B20),0.072068) }; \addlegendentry{q-EoS $(n=2)$} % q-EoS (n=3) — NaCl: 0.027537, TiC: 0.058481, FeSi: 0.073480 \addplot+[fill=orange!90, draw=orange!70!black] coordinates { (NaCl (B1),0.027537) (TiC (B1),0.058481) (FeSi (B20),0.073480) }; \addlegendentry{q-EoS $(n=3)$} % ====================================================== % (b) Regime \pm 50% V0 — DADOS REAIS DOS FICHEIROS % ====================================================== \nextgroupplot[ bar width=6pt, title={(b) Regime $\pm 50\%\,V_0$}, ymin=1e0, ymax=1e4, ] % Murnaghan — NaCl: 38.483922, TiC: 179.827163, FeSi: 209.918058 \addplot+[fill=blue!75, draw=blue!75!black] coordinates { (NaCl (B1),38.483922) (TiC (B1),179.827163) (FeSi (B20),209.918058) }; % BM3 — NaCl: 2.118186, TiC: 44.043547, FeSi: 63.469045 \addplot+[fill=red!80, draw=red!80!black] coordinates { (NaCl (B1),2.118186) (TiC (B1),44.043547) (FeSi (B20),63.469045) }; % Vinet — NaCl: 23.998934, TiC: 27.367181, FeSi: 38.077585 \addplot+[fill=purple!75, draw=purple!75!black] coordinates { (NaCl (B1),23.998934) (TiC (B1),27.367181) (FeSi (B20),38.077585) }; % q-EoS (n=2) — NaCl: 1.962260, TiC: 54.617663, FeSi: 61.961751 \addplot+[fill=green!70!black, draw=green!50!black] coordinates { (NaCl (B1),1.962260) (TiC (B1),54.617663) (FeSi (B20),61.961751) }; % q-EoS (n=3) — NaCl: 3.740124, TiC: 59.084828, FeSi: 68.649034 \addplot+[fill=orange!90, draw=orange!70!black] coordinates { (NaCl (B1),3.740124) (TiC (B1),59.084828) (FeSi (B20),68.649034) }; \end{groupplot} % Legenda centralizada acima dos dois painéis \node at ($(group c1r1.south east)!0.5!(group c2r1.south west)+(0,-1.1cm)$) {\pgfplotslegendfromname{gruppolegend}}; \end{tikzpicture} \end{document}
- Lstlisting copy paste code properly, without showing ␣by gioQ on May 12, 2026 at 8:51 am
I'm trying to improve the copy paste from a lstlisting code block. Firstly, I removed the possibility to copy the line numbers, but now I can't keep the spaces/tabs as I want. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{lmodern} % font \usepackage{accsupp} \usepackage{listings} \usepackage{xcolor} \newcommand{\noncopynumber}[1]{% \BeginAccSupp{ActualText={}}#1\EndAccSupp{}% } \makeatletter \def\lst@outputspace{{\ifx\lst@bkgcolor\empty\color{white}\else\lst@bkgcolor\fi\lst@visiblespace}} \makeatother \lstdefinestyle{BaseProgrammingStyle}{ keywordstyle=\color[HTML]{d8127e}\bfseries, % keyword: bf pink commentstyle=\color[HTML]{009900}, % comments: green backgroundcolor=\color[HTML]{f2f2eb}, % Background: beige numbers=left, numberstyle=\color{gray}\noncopynumber, % line numbers: gray stringstyle=\color[HTML]{9400d1}, % strings: purple aboveskip=1em, belowskip=1em, upquote=true, basicstyle=\ttfamily\small, frame=none, showstringspaces=false, breaklines=true, breakatwhitespace=true, lineskip=0pt, sensitive=false, literate={~} {$\sim$}{1}, % classic tilde keepspaces=true, columns=fullflexible, tabsize=2, } \lstdefinestyle{cstyle}{ style=BaseProgrammingStyle, language=C, morekeywords={system} } \begin{document} \begin{lstlisting}[style=cstyle] #include <stdio.h> int main(){ int s = 0; char buffer[10]; gets(buffer); // any lenght allowed, but adds \0 at the end printf("buffer: %s\n", buffer); printf("s: %d\n", s); } \end{lstlisting} \end{document} This is the solution I found, but when I copy the code, the spaces are shown as ␣.
- ConTeXt: "inbetween" math option is not working properlyby Georgian Ilie on May 12, 2026 at 8:49 am
Good morning everyone, I am encountering a problem while typing systems of equations. I would like to increase the space separating the equations, but I am not finding a sound way to do it. From the best that I have understood from the ConTeXt math documentation, this parameter should be set by the option inbetween, which should be appended to the \startcase...\stopcase environment. This approach was tried unsuccessfully in the simple example reported next: \setuphead[section] [style=\ss\bf, grid=line, method=m, % 'm' stands for 'max'—it forces the line height to the grid max before={\blank[force, 2*line]}, after={\blank[line]}] \setuphead[chapter] [page=right, style=\ss\tfc\bf, header=high, before=, after={\blank[line]\placecontent[criterium=local]\blank[line]}, grid=tolerant] \definecolumnset [example] [n=2] %\definecolumnsetspan[wide][n=2] \setuplayout[grid=yes] % \showgrid \starttext \startcolumnset[example] %\startcolumnsetspan[wide] %\startchapter[title=Introduction,grid=tolerant] %\stopcolumnsetspan \startsection[title=Happy] The quick, brown fox jumps \m{\varepsilon_p^*} over a lazy dog. DJs flock by when MTV ax quiz prog. Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs. Waltz, bad nymph, for quick jigs vex! Fox nymphs grab quick-jived waltz. Brick quiz whangs jumpy veldt fox. Bright vixens jump; dozy fowl quack. Quick wafting zephyrs vex bold Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged fop blew my junk TV quiz. How quickly daft jumping zebras vex. \startformula f(x) = \startcases \NC x \NC x \geq 0 \NR \NC -x \NC x < 0 \NR \stopcases \quad \breakhere f(x) = \startcases [spaceinbetween=1\lineheight] \NC x \NC x \geq 0 \NR \NC -x \NC x < 0 \NR \stopcases \stopformula Two driven jocks help fax my big quiz. Quick, Baz, get my woven flax jodhpurs! "Now fax quiz Jack!" my brave ghost pled. Five quacking zephyrs jolt my wax bed. Flummoxed by job, kvetching W. zaps Iraq. Cozy sphinx waves quart jug of bad milk. A very bad quack might jinx zippy fowls. Few quips galvanized the mock jury box. Quick brown dogs jump over the lazy fox. The jay, pig, fox, zebra, and my wolves quack! Blowzy red vixens fight for a quick jump. Joaquin Phoenix was gazed by MTV for luck. A wizard’s job is to vex chumps quickly in fog. Watch "Jeopardy!", Alex Trebek's fun TV quiz game. Woven silk pyjamas exchanged for blue quartz. Brawny gods just \stopsection \stopcolumnset \stoptext What am I mistaking? Thank you in advance for your help.
- Accent shift with `yhmath`'s nested `\widehat`/`\hat` command?by Explorer on May 12, 2026 at 3:55 am
I have the following code: \documentclass{article} \usepackage{amsmath} \usepackage{yhmath} \begin{document} $\widehat{AAABCCC}$ $\widehat{AAA\hat{B}CCC}$ $\widehat{AAA\widehat{B}CCC}$ \end{document} Here are some related information I have searched: How to make the \widehat wider? https://tex.stackexchange.com/a/320440 https://tex.stackexchange.com/a/101136 If I don't want mtpro2's style of \widehat(like this), any suggestions on the accent shift issues with nested \widehat/\hat commands? Edited: The symbol used here is common with statistic lession, for example the Asymptotic Standard Error:
- Why is the current page.center of a beamer page not making my image flush with the edges?by Jasper on May 12, 2026 at 2:29 am
Why is the current page.center of a beamer page not making my image flush with the edges? Compile with lualatex: Learning from samcarter's solution, the code below is okay to put the image: \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame}[plain] \begin{tikzpicture}[remember picture,overlay] \node[at=(current page.center)] { \includegraphics[width=\paperwidth, height=\paperheight]{example-image} }; \end{tikzpicture} \end{frame} \end{document} However, if put inside animateinline, as below: \documentclass{beamer} \usepackage{graphicx,tikz,animate} \begin{document} { \setbeamertemplate{navigation symbols}{} \begin{frame}[plain] \begin{animateinline}[autoplay,loop]{10}% % Credit to @Explorer's comment: \begin{tikzpicture}[remember picture,overlay] \node at (current page.center) {\includegraphics[ width=\pagewidth,height=\pageheight ]{example-image}}; \end{tikzpicture} \end{animateinline} \end{frame} } \end{document} The code complained that: ! Package animate Error: Content of first frame must not have zero width. See the animate package documentation for explanation. Type H <return> for immediate help. ... l.20 \end{frame} ? In regard to the comment about https://tex.stackexchange.com/a/656219/319072, the following MWE still is not flush. \documentclass{beamer} \usepackage{graphicx,tikz,animate} \begin{document} \AtBeginShipoutNext{% \AtBeginShipoutUpperLeft{% \unitlength=\paperheight% \put(0,-1){% \begin{animateinline}[autoplay,loop]{10}% \begin{tikzpicture} \node at (current page.center) {\includegraphics[ width=\pagewidth,height=\pageheight ]{example-image}}; \end{tikzpicture} \end{animateinline}% }% }% }% { \setbeamertemplate{navigation symbols}{} \begin{frame} \end{frame} } \end{document}
- Multilingual document: switch main language in order to switch layout within a documentby ncdipde on May 11, 2026 at 8:27 pm
I am writing a document whose main language is French. A whole section is in English \section{Abstract} And then other sections are in French \section{Résumé} \section{Méthodes} etc. I would like the English section to respect English typographic rules (note only punctuation or quotes) and other sections in French to respect French typographic rules. Writing \selectlanguage{english} or using otherlanguage environment only change the locale language which changes how quotes render for example, but it does not change first paragraph indentation nor the \labelitemi Is it possible to switch the main language for a whole section ? Thereafter a minimal example: \documentclass[paperletter, 12pt, english, french]{article} \usepackage{babel} \usepackage[inline]{enumitem} \usepackage{lipsum} \title{Plain Latex} \begin{document} \section{Français} Une liste en français \begin{itemize} \item La langue \og principale\fg{} est : \mainlocalename ! \item La langue \og courante\fg{} est : \localename ; \end{itemize} \lipsum[1][1-3]\par \lipsum[1][4-6] \selectlanguage{english} \section{English} A list in English \begin{itemize} \item The \og main\fg{} language is : \mainlocalename ! \item The \og current\fg{} language is : \localename ; \end{itemize} \lipsum[2][1-3]\par \lipsum[2][4-6]\par \subsection{poor patches} \noindent \lipsum[3][1-3]\par \lipsum[3][4-6]\par \begin{itemize}[label={\textbullet}] \item The \og main\fg{} language is : \mainlocalename ! \item The \og current\fg{} language is : \localename ; \end{itemize} \end{document}
- Creating a \hookrightnotleftarrows operatorby Alma Arjuna on May 11, 2026 at 3:21 pm
I wish to create a math operator, which I'm calling \hall, similar to \rightleftarrows, but the arrows should be hooked, as in \hookrightarrow and \hookleftarrow; the left arrow (which is below) should be crossed. I've tried to create the symbol with the following code, but it turned out quite ugly because of spacing. \documentclass{standalone} \usepackage{amssymb, amsmath} \usepackage{centernot} \newcommand{\hall}{{\hookrightarrow}\atop{\centernot\hookleftarrow}} \begin{document} $\rightleftarrows$ $\hall$ \end{document} It would also be nice if the hook in the left arrow would be pointed downwards instead of upwards. I tried fixing this with a \rotatebox, but this messed up with the arrow size.
- Minted–add a box around each tokenby Jean Dubois on May 11, 2026 at 3:00 pm
I have some minted code blocks in a beamer, such as: \documentclass[compress]{beamer} \usepackage{minted} \setminted[ocaml]{ frame=leftline, framesep=6pt, rulecolor=gray, linenos=true, numbersep=4pt, xleftmargin=20pt, breaklines=true, tabsize=2, } \begin{document} \begin{frame} \inputminted{ocaml}{some_file.ml} %% HERE \end{frame} \end{document} where some_file.ml is, say: let rec sum l = match l with | [] -> 0 | x::q -> x + sum q As expected, this is the output I get: I would like to box every token in the file, either automatically or manually (every snippet is as small as this example), approximately like this: I have absolutely no idea how to do this. I searched in the minted documentation for “token” but found nothing relevant. Is it possible to do this and if so, how can I achieve it? Thank you in advance 🙂
- How to draw two squares beside each other?by Intuition on May 11, 2026 at 11:23 am
Here is the picture I want to draw: I know how to draw just one colored square, for example here is a code to it: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[a4paper, margin=1.5in]{geometry} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{tikz-cd} \usepackage{amsmath,amsfonts,amssymb} \usepackage{amsthm} \usepackage{graphicx} \usepackage[all,cmtip]{xy} \usepackage[english]{babel} \usepackage{xurl} \usetikzlibrary{positioning, shapes.geometric} \begin{document} \begin{tikzpicture}[ every path/.style={thick}, every node/.style={circle,fill=black,draw,inner sep = 0pt, minimum size= 2pt} ] \draw[red] (0,0)--(2,0); \draw[cyan] (2,0)--(2,2); \draw[yellow] (2,2)--(0,2); \draw[red] (0,2)--(0,0); \draw[green] (0,0)--(2,2); %\draw[green] (0,2)--(2,0); \foreach \corner in {(0,0), (2,0), (2,2), (0,2)} \node at \corner {}; \end{tikzpicture} \end{document} Also, how to remove the common edge if I aligned the two squares beside each other? Any help will be greatly appreciated.