Week
- Make perfect circular diagramsby Fran on February 5, 2026 at 12:23 pm
I know that I can make circular diagrams with the nice smartdiagram package, but arrows do not fit perfectly in a imaginary circle. In fact, the diagram is far from a circle when there are only two or three nodes: \documentclass{standalone} \usepackage{smartdiagram} \begin{document} \smartdiagramset{ connection color=red, module shape= circle, circular distance=2cm, uniform color list=white for 6 items, uniform arrow color=true, arrow color=black} \smartdiagram[circular diagram:clockwise]{foo, bar} \end{document} I know also that there are several examples in this site about making circular diagrams without this package, but translating these examples to diagrams with a different numbers of nodes is complex, so I tried an automated solution with tikz (without really knowing what I was doing, I have to admit) so that I only have to modify a list of nodes in \mylist and little more to obtain the result: \documentclass[border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[ > = Stealth, every node/.style = {circle, draw, thick, minimum width=1cm, align=center} ] \def\mylist{foo, bar, baz} % play with this \foreach \x [count=\i from 1] in \mylist {\xdef\n{\i}} \def\radio{2cm} % and this if needed \foreach \texto [count=\i from 0] in \mylist{ \pgfmathsetmacro\ang{-\i*360/\n} \node (n\i) at (\ang:\radio) {\texto}; } \foreach \dummy [count=\i from 0] in \mylist{ \pgfmathsetmacro\j{int(mod(\i+1,\n))} \pgfmathsetmacro\angini{-\i*360/\n} \pgfmathsetmacro\angfin{-\j*360/\n} \pgfmathsetmacro\outang{mod(\angini - 90 + 720, 360)} \pgfmathsetmacro\inang {mod(\angfin + 90 + 720, 360)} \draw[->, thick, line width=1.4pt] (n\i) to[out=\outang, in=\inang, looseness=.9] (n\j); % and with the looseness } \end{tikzpicture} \end{document} Mainly it works. The problem is that like in smartdiagram, the arrows don't perfectly follow an imaginary circle, that was the idea behind getting involved in this business. Playing with looseness is possible to correct a bit the curvature of the arrows, but it's tedious and the result is never perfect. So, the result should be ideally near to the image below (that I modified manually in Inkscape) and still require minimal settings to adapt the code to diagrams of n nodes. Fixes of the MWE as well as alternative approaches are welcome.
- Can there be multiple floats in a single paragraph that do not "break" the text flow around them?by Gary on February 5, 2026 at 4:30 am
I don't know what this is called to ask the question better. I'm trying to match an old book's structure as close as possible and it has multiple small labels within the same paragraph that are floated left and that also serve as sections in the right-hand page headers only but not in the TOC. An example is provided below; however, in the book, the text is not split/broken before a block item, it just runs continuous around each. I tried using \placefigure but either that is the wrong approach or I did it wrong. I'd like the second line,immediately before Block 1, to be justified and the line before Block 2 to not break at "around" but continue with the next line's "multiple". Is it possible and, if so, what's it called so I can look it up? Thank you. \setuplayout[width=5in] \starttext An example of a fairly old handset document that includes justified text wrapped around mulitple blocks of text that are set to the left. \placefigure[none,left,paragraph][]{}{\framed{Block 1}}And each one of these blocks that are sort of floats is also a section in the sense that which ever block is on the right-hand page appears in that page's header. To repeat that, this is an example of a fairly old handset document that includes justified text wrapped around \placefigure[none,left,paragraph][]{}{\framed{Block 2}}mulitple blocks of text that are set to the left. And each on of these blocks that are sort or floats is also a section in the sense that which ever block is on the right-hand page appears in that page's header. \stoptext
- Left-aligning lines of text to left edge of right-aligned line?by Dan Li on February 5, 2026 at 1:36 am
What I’m trying to accomplish is best illustrated as follows: The first line (“Monday, December 22, 2025, 16:00 EST”) is right-aligned to the text width (possibly by \hfill, but not a hard requirement). The second line (“New York City, New York”) needs to be left-aligned to the left edge of that first line. In other words, the start of the M in “Monday” and N in “New York” are vertically aligned. How can this be done?
- Problem with the position of a graph (pgfplots)by Octavius on February 5, 2026 at 12:36 am
in the following code and in the attached image, the graph becomes misaligned. Could you please give me an idea on how to fix it? \documentclass{article} \usepackage{graphicx} % Required for inserting images \newcommand{\ocultar}[1]{} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{pdfpages} \usepackage{hyperref} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage[utf8]{inputenc} \usepackage[spanish]{babel} \usetikzlibrary{angles, quotes} \usepackage{fancyhdr} \usepackage{graphicx} \usepackage{array} \begin{document} \begin{center} \begin{tabular}{>{\centering}m{5cm} >{\centering}m{5cm} >{\centering}m{5cm}} % CRECIENTE \begin{tikzpicture} \begin{axis}[ axis lines=middle, xmin=-3,xmax=6, ymin=-3,ymax=6, grid=both, width=5cm, height=5cm, ticks=none ] \addplot[red, thick] {x+1}; \end{axis} \end{tikzpicture} & % DECRECIENTE \begin{tikzpicture} \begin{axis}[ axis lines=middle, xmin=-3,xmax=6, ymin=-3,ymax=6, grid=both, width=5cm, height=5cm, ticks=none ] \addplot[blue, thick] {-x+3}; \end{axis} \end{tikzpicture} & % CONSTANTE \begin{tikzpicture} \begin{axis}[ axis lines=middle, xmin=-3,xmax=6, ymin=-3,ymax=6, grid=both, width=5cm, height=5cm, ticks=none ] \addplot[black, thick] {3}; \end{axis} \end{tikzpicture} \\[2mm] \fbox{\begin{minipage}{4.5cm} \centering \textbf{Creciente.}\\ En este caso su pendiente\\ es \textcolor{red}{\textbf{POSITIVA}.} \end{minipage}} & \fbox{\begin{minipage}{4.5cm} \centering \textbf{Decreciente.}\\ En este caso su pendiente\\ es \textcolor{blue}{\textbf{NEGATIVA}.} \end{minipage}} & \fbox{\begin{minipage}{4.5cm} \centering \textbf{Constante.}\\ En este caso su pendiente\\ es \textbf{CERO}. \end{minipage}} \end{tabular} \end{center} \end{document}
- How to produce "Ȟ" by mimicking the caron accent, in math mode?by Jinwen on February 4, 2026 at 9:21 am
I would like to produce a Ȟ ("H" with caron accent) in math mode, specifically, for \mathsf. (This is an uncommon notation used for Čech cohomology in a book.) Perhaps this would be easy for pdfLaTeX. However, when using LuaLaTeX, and when this character is not already provided in the font, I can only get very strange output: Is there some way to mimic this caron accent in this situation? More generally, how can one apply this accent to general math symbols? (In the same book, this accent seems to be used to represent the dual objects, e.g., V with caron accent instead of V^{\vee}, possibly to save some space...) (I tried \check, but it looks different and cannot be properly aligned...) \documentclass{article} \usepackage{kpfonts-otf} \usepackage{unicode-math} \begin{document} Ȟ % \v{H} \( \mathsf{Ȟ} \) \( \mathsf{\v{H}} \) \( \check{\mathsf{H}} \) \end{document}
- improve of solid effect of stack of unit cube legos: solid draw with hole, protruding elementsby Epa on February 4, 2026 at 8:06 am
How to make the solid effect view better, as shown in the photo attached? \documentclass[]{standalone} \usepackage{amsmath, amssymb, latexsym, amscd, amsthm} \usepackage{tikz} \newcommand{\drawboxa}[4]{ \pgfmathsetmacro \angle {30} \pgfmathsetmacro \xd {{2/3*cos(\angle)}} \pgfmathsetmacro \yd {{2/3*sin(\angle)}} \pgfmathsetmacro \x {{#1-1+(#2-1)*(\xd)}} \pgfmathsetmacro \y {{#3-1+(#2-1)*(\yd)}} \draw[fill=#4] (\x,\y) -- (\x+1,\y) -- (\x+1,\y+1) -- (\x,\y+1) -- cycle; \draw[fill=#4] (\x,\y+1) -- (\x+\xd,\y+1+\yd)coordinate[pos=.5](M) -- (\x+1+\xd,\y+1+\yd) -- (\x+1,\y+1) -- cycle; \draw[fill=#4] (\x+1,\y+1) -- (\x+1+\xd,\y+1+\yd) -- (\x+1+\xd,\y+\yd)coordinate[pos=.5](M2) -- (\x+1,\y)-- (\x+1,\y+1)coordinate[pos=.5](M3); \path(M2)--(M3)coordinate[pos=.5](M4); \draw[fill=#4] (M)++(.5,0)coordinate(T1)++(.15,0)arc(0:-180:.15cm and .06cm)--++(0,.1)arc(-180:0:.15cm and .06cm)coordinate(T2)--++(0,-.1) (T2)arc(0:180:.15cm and .06cm); \draw[fill=black,opacity=.1](M4)circle(.12cm and .15cm) (\x,\y)++(.5,.5)circle(.15); \draw(M4)circle(.12cm and .15cm) (\x,\y)++(.5,.5)circle(.15); } \newcommand{\drawboxb}[3]{ \pgfmathsetmacro \angle {30} \pgfmathsetmacro \xd {{2/3*cos(\angle)}} \pgfmathsetmacro \yd {{2/3*sin(\angle)}} \pgfmathsetmacro \x {{#1-1+(#2-1)*(\xd)}} \pgfmathsetmacro \y {{#3-1+(#2-1)*(\yd)}} \draw[fill=white] (\x,\y) -- (\x+1,\y) -- (\x+1,\y+1) -- (\x,\y+1) -- cycle; \draw[fill=white] (\x,\y+1) -- (\x+\xd,\y+1+\yd)coordinate[pos=.5](M) -- (\x+1+\xd,\y+1+\yd) -- (\x+1,\y+1) -- cycle; \draw[fill=white] (\x+1,\y+1) -- (\x+1+\xd,\y+1+\yd) -- (\x+1+\xd,\y+\yd)coordinate[pos=.5](M2) -- (\x+1,\y)-- (\x+1,\y+1)coordinate[pos=.5](M3); \path(M2)--(M3)coordinate[pos=.5](M4); \draw[fill=white] (M)++(.55,0)coordinate(T1)++(.15,0)arc(0:-180:.2cm and .07cm)--++(0,.1)arc(-180:0:.2cm and .07cm)coordinate(T2)--++(0,-.1) (T2)arc(0:180:.2cm and .07cm) (T2)++(-.2,0)circle(.16cm and .04cm); \draw(M4)circle(.15cm and .2cm)circle(.11cm and .16cm) (\x,\y)++(.5,.5)circle(.2)circle(.15); } \usepackage{tikzbricks} %\printanswers \newcommand{\drawboxc}[4]{ \pgfmathsetmacro \angle {30} \pgfmathsetmacro \xd {{2/3*cos(\angle)}} \pgfmathsetmacro \yd {{2/3*sin(\angle)}} \pgfmathsetmacro \x {{#1-1+(#2-1)*(\xd)}} \pgfmathsetmacro \y {{#3-1+(#2-1)*(\yd)}} \draw[fill=#4] (\x,\y) -- (\x+1,\y) -- (\x+1,\y+1) -- (\x,\y+1) -- cycle; \draw[fill=#4] (\x,\y+1) -- (\x+\xd,\y+1+\yd)coordinate[pos=.5](M) -- (\x+1+\xd,\y+1+\yd) -- (\x+1,\y+1) -- cycle; \draw[fill=#4] (\x+1,\y+1) -- (\x+1+\xd,\y+1+\yd) -- (\x+1+\xd,\y+\yd)coordinate[pos=.5](M2) -- (\x+1,\y)-- (\x+1,\y+1)coordinate[pos=.5](M3); \path(M2)--(M3)coordinate[pos=.5](M4)coordinate[pos=.4](M5); \draw[fill=#4](M4)circle(.12cm and .15cm)++(0,.15)coordinate(Y1)++(0,-.15)coordinate(Y2); \draw[fill=#4](M5)++(0,-.025)circle(.12cm and .15cm)++(0,.15)coordinate(Y3)++(0,-.3)coordinate(Y4) (Y3)--(Y1)arc(90:270:.12cm and .15cm)--(Y4)arc(270:90:.12cm and .15cm); \draw[fill=black,opacity=.1](\x,\y)++(.5,.5)circle(.15) (M)++(.5,0)coordinate(T1)circle(.15cm and .06cm); \draw(\x,\y)++(.5,.5)circle(.15) (T1)circle(.15cm and .06cm); } \begin{document} \begin{tikzpicture} \def\x{3} %so luong block \foreach\h in{1,...,\x}{ \drawboxa{1}{1}{\h}{blue!25} } \def\d{.3} \draw(1,-\d) node[scale=1.3]{3}; \draw(.8,\x+1.2*\d) node[scale=1.2, above]{three}; \begin{scope}[xshift=100] \def\x{2} %so luong block \foreach\h in{1,...,\x}{ \drawboxa{1}{1}{\h}{blue!25} } \draw(1,-\d) node[scale=1.3]{2}; \draw(.8,\x+1.2*\d) node[scale=1.2, above]{two}; \end{scope} \begin{scope}[xshift=200] \def\x{5} %so luong block \foreach\h in{1,...,\x}{ \drawboxa{1}{1}{\h}{blue!25} } \draw(1,-\d) node[scale=1.3]{5}; \draw(.8,\x+1.2*\d) node[scale=1.2, above]{five}; \end{scope} \end{tikzpicture} \vspace{1cm} \begin{tikzpicture} \def\x{5} %so luong block %drawbox{x}{z}{y} %x la toa do x %z la toa do lop tinh theo goc xien %y la toa do y \drawboxb{1}{0}{0} \end{tikzpicture} \begin{tikzpicture} \def\x{5} % so luong block xanh \def\v{2} % so luong block vang \def\b{1} % so luong block xanh duong \pgfmathtruncatemacro{\xx}{\x+1} \pgfmathtruncatemacro{\vv}{\x+\v} \pgfmathtruncatemacro{\vvv}{\vv+1} \pgfmathtruncatemacro{\bb}{\vv+\b} \ifnum\x>0 \foreach \h in {1,...,\x}{ \drawboxc{\h}{1}{1}{brown!35} } \fi \ifnum\v>0 \foreach \h in {\xx,...,\vv}{ \drawboxc{\h}{1}{1}{yellow!55} } \fi \ifnum\b>0 \foreach \h in {\vvv,...,\bb}{ \drawboxc{\h}{1}{1}{blue!25} } \fi \end{tikzpicture} \end{document} The code was from user 11232 How to draw stacked cubes of different sizes and colors?
- How to add fermata symbol to metre package?by rensemil on February 3, 2026 at 11:10 am
I am using the package metre. It has the environment \metra{} used for typesetting latin (and greek) metre notation. This environment has almost all the special characters I need, except one: I need a character that looks somewhat like a fermata 𝄐 but preferrably in the same style as the other metrical symbols. This could, I believe, be achieved by simply taking the character breve that is produced by \documentclass{article} \usepackage[en]{metre} \begin{document} \metra{\a\m\b\bm} \end{document} and have it flipped upside down and a dot put underneath. In a book, this is what it looks like: It's the last symbol of each of the lines in the box. Does anyone know how this could be achieved? I even tried contacting the package's creator but his email address does not seem to exist anymore. My MWE produces the symbols in this picture (the ones inside the brackets): Thanks in advance!
- How to make nested tabularx workby user2609605 on February 3, 2026 at 10:00 am
Example: \documentclass[a4paper]{article} \overfullrule=10mm \usepackage{tabularx} \begin{document} This document is for experimenting around \texttt{tabularx}. \begin{tabularx}{\linewidth}{|XX}%p{5cm} \begin{minipage}{\linewidth} \begin{tabularx}{\linewidth}{|X}% long text to be \newline long text to be \newline long text to be \newline long text to be \newline long text to be \newline % \the\hsize % \the\linewidth % \the\textwidth long text to be \end{tabularx} \end{minipage} & %\begin{tabularx}{0.25\linewidth}{|X}% 2nd %\end{tabularx} \end{tabularx} \end{document} results in: ! Extra }, or forgotten \endgroup. \TX@trial ...er \tabular \the \toks@ \endtabular } \TX@ckpt \TX@typeout@ {\@s... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \TX@endtabularx ...\csname endtabular*\endcsname } \global \TX@ftn \expandaft... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \TX@endtabularx ... }\the \TX@ftn \ifnum 0=`{\fi } \expandafter \expandafter ... l.80 \end{tabularx} ! Extra }, or forgotten \endgroup. \@endpbox ...trutbox \par \color@endgroup \egroup \hfil l.80 \end{tabularx} ! Missing \endgroup inserted. <inserted text> \endgroup l.80 \end{tabularx} ... If I replace the inner tabularx by tabular (dropping \linewidth and changing X) it works. I would even like to use without minipage, but that it does not work with minipage, it means that minipage encapsulation is not very strict. I will have a look I think I remember an example where nested tabularx worked.
- Scoping the value of a l3keys option to the place it is used (part 2)by Denis Bitouzé on February 3, 2026 at 8:32 am
(Sorry again for the vague title of this question (which is a follow-up of another question of mine), I can't think of a more appropriate one.) Suppose I'd like to augment the key set of keytheorems with a Title key which isn't exactly an alias of its title (or its alias name) key but which makes uppercase the first character of its value before passing it to keytheorems' title (or name). In the following MCE, I rely for this on an auxiliary token list which, unfortunately, is not limited to the definition of each defined theorem: only the last value it took is used each time one of the defined theorems is used, so instead of: Abc 1. Foo. Xyz 1. Baz. I get: Xyz 1. Foo. Xyz 1. Baz. How can I work around this problem? \documentclass{article} \usepackage{keytheorems} \ExplSyntaxOn \keys_define:nn { keytheorems/thm } { Title .code:n = { \tl_set:Nn \l_tmpa_tl {\text_titlecase_first:n{#1}} \keys_set:nn { keytheorems/thm } { name=\l_tmpa_tl} } } \NewDocumentCommand{\mynewtheorem}{O{} m} { \newkeytheorem{#2}[#1] } \ExplSyntaxOff \mynewtheorem[Title=abc]{foo} \mynewtheorem[Title=xyz]{baz} \begin{document} \begin{foo} Foo. \end{foo} \begin{baz} Baz. \end{baz} \end{document}
- Drawing a crystal latice with tikzby Nicolas on February 2, 2026 at 9:27 pm
I'd like to draw crystal structures using TikZ-3Dplot'''. I saw that solutions exist with Asymptote, but for some reason, I can't install it (and I admit I had trouble understanding how the package works). I started with TikZ 3D Plot, which seems to work. I just have one question: I can't keep some lines horizontal, which I find unsightly (I've tried several angle values in the command \tdplotsetmaincoords, but without success). \documentclass{standalone} \usepackage{tikz,tikz-3dplot} \usepackage{xcolor} \begin{document} \tdplotsetmaincoords{75}{10} \begin{tikzpicture}[tdplot_main_coords, scale = 5] % ---- Tracé des traits du réseau ---- \draw[thin] (0,0,0) -- (1,0,0) -- (1,1,0) -- (0,1,0) -- (0,0,0); \draw[thin] (0,0,1) -- (1,0,1) -- (1,1,1) -- (0,1,1) -- (0,0,1); \draw[thin] (0,0,0) -- (0,0,1); \draw[thin] (1,0,0) -- (1,0,1); \draw[thin] (1,1,0) -- (1,1,1); \draw[thin] (0,1,0) -- (0,1,1); \tdplottransformmainscreen{0}{0}{0} \shadedraw[tdplot_screen_coords, ball color = blue] (\tdplotresx,\tdplotresy) circle (0.10); \end{tikzpicture} \end{document}
- How to fade the background image with multiple opacity?by Explorer on February 2, 2026 at 5:58 pm
I have the following code to add background for the document: \documentclass{article} \usepackage{lipsum} \usepackage{geometry} \usepackage{graphicx} \usepackage{tikz,tikzpagenodes} \usetikzlibrary{calc,fadings} \AddToHook{shipout/background}{ \begin{tikzpicture}[remember picture,overlay] \node[ % path fading=north, inner sep=0pt,outer sep=0pt, anchor=south,opacity=.3, ] at (current page.south) {\includegraphics[width=\paperwidth]{bg.png}}; % \path[path picture={ % \node[inner sep=0pt,outer sep=0pt,anchor=south,scope fading=south] at (current page.south) {\includegraphics[width=\paperwidth]{bg.png}}; % }]; \coordinate (L) at ($(current page.north west)!.5! (current page text area.north west)$); \coordinate (R) at ($(current page.south east)!.5! (current page text area.south east)$); \fill[white,opacity=.5] (L) rectangle (R); \end{tikzpicture} } \begin{document} \lipsum[1-6] \end{document} It produced: However, the intersection border's color transformation is too sharp! I want the image could smoothly fade to white, with multiple opacity, I have consulted this link, but it doesn't work. The bg.png could be accessed as below(maybe example-image is okay, but its background is pure gray, I would prefer to show that on bg.png):
- How to resume an enumitem list at lower levelby mm96 on February 2, 2026 at 4:52 pm
Similar to this question: similar question I don't know, why the 'resume*=series' approach does not work here. \documentclass{scrartcl} \usepackage{enumitem} \begin{document} text text text texttext text text text\\ text text text texttext text text text \begin{enumerate}[leftmargin=*] \item asdfg \item afhaf \begin{enumerate}[series=_test] \item adslfa \item adsfadsf \end{enumerate} \end{enumerate} text text text texttext text text text\\ text text text texttext text text text \begin{enumerate}[resume*=_test] \item adfa \end{enumerate} \end{document}
- Bug or feature: unexpected behavior of \bar with subscript first and superscript secondby user470904 on February 2, 2026 at 1:28 pm
As a physicist, I often need to typeset tensor indices where it matters whether the subscript is to the left or to the right of the superscript. My usual solution is to use {t_A}^B, which puts the superscript B to the right of the subscript A, compared to t_A^B which puts the superscript B vertically aligned with the subscript A. However, I recently noticed that if I use \bar{t} or \tilde{t} instead of t above, the output no longer differs whether I enclose the (xxx)_A part with braces or not. But, \overline{t} still behaves as I expect. Then I tried \widetilde{t}, which still ignores the braces. Is this a bug or a feature? If it's a feature, how should I classify which commands ignore the braces and which do not? In particular, is there a "tilde" command that behaves like \overline that can put the superscript to the right of the subscript? Minimal working example: \documentclass{article} \begin{document} \begin{equation} \begin{array}{lllll} t_A^B & \tilde{t}_A^B & \widetilde{t}_A^B & \bar{t}_A^B & \overline{t}_A^B \\ {t_A}^B & {\tilde{t}_A}^B & {\widetilde{t}_A}^B & {\bar{t}_A}^B & {\overline{t}_A}^B \end{array} \end{equation} \end{document} Output:
- Spacing with mathematical symbols in braketsby Danya Zh on February 1, 2026 at 9:38 pm
In the braket package I have noticed a spacing issue with mathematical operators; plus and minus symbols after | will be treated as binary operators, even if they represent an ordinary operator. For example $\braket{+45|+45}$ will have no spacing for the first + symbol (treated as class 0), but will have the operator spacing for the second + symbol (treated as class 2). \documentclass{article} \usepackage{braket} \begin{document} How can we fix spacing in $\braket{+45|+45}$ without invoking \verb+\!+ \end{document} I would like to have a solution that does not involve inline spacing fixes. I am confident that the command can be redefined in a way that would resolve this issue.
- How to transform canvas with `grid` and not to affect the `node`'s content at the same time?by Explorer on February 1, 2026 at 5:24 pm
Description As the successor of my prevoius not-supported l3draw attempt, I try with plain-tikz: \documentclass[tikz,border=5pt]{standalone} \usepackage{mathpazo} \usepackage{amsmath} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[ x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}, ] \fill[orange!10] (-2,-2) rectangle (5,5); \draw[orange] (-2,-2) grid (5,5); \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}] \fill[orange!10] (-2,-2) rectangle (5,5); % \draw[orange] (-2,-2) grid (5,5); \foreach \i in {-2,-1,...,5} {\draw[orange] (\i,-2) -- ++(0,7) (-2,\i) -- ++(7,0);} \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[ transform canvas={cm={1.5, 0.5, 0.5, 2, (0,0)}} ] \fill[orange!10] (-2,-2) rectangle (5,5); \draw[orange] (-2,-2) grid (5,5); \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \end{document} Here, I have three proposals: FIRST: the grid doesn't transform by x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}. SECOND: the manual \foreach gives what I want, but I don't think manually mimic what feature grid do is the best practice. THIRD: with transform canvas, it affected the grid, but all on the canvas, the text and arrow are both sheared, that is not I want. Question: Is there better approach without manually plot the grid? I would make good use of feature grid in my case as possible.
- In 2026, what kind of plot requirement is suitable with `l3draw`(such as "arrow")?by Explorer on February 1, 2026 at 3:38 pm
I want to mimic the following figure with l3draw, the \draw_transform_matrix:nnnn feature to apply transformation matrix. Here below is my attempt: \documentclass[border=5pt]{standalone} \usepackage{l3draw} \usepackage{amsmath} \begin{document} \ExplSyntaxOn \draw_begin: \color_set:nnn { orange } {RGB} {255, 128, 0} \draw_scope_begin: \draw_transform_matrix:nnnn { 2.5 } { 0.5 } { 0.5 } { 3 } \draw_set_cap_round: \draw_path_rectangle_corners:nn { -5mm , -5mm } { 35mm , 35mm } \color_fill:n { orange!15 } \draw_path_use_clear:n { fill } \draw_path_grid:nnnn { 1cm } { 1cm } { -5mm , -5mm } { 35mm , 35mm } \color_stroke:n { orange } \draw_path_use_clear:n { stroke, fill } \draw_set_linewidth:n { .1cm } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 0cm, 1cm } \draw_path_use_clear:n { stroke } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 1cm, 0cm } \draw_path_use_clear:n { stroke } \color_stroke:n { black } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 2cm, 2cm } \draw_path_use_clear:n { stroke } \draw_scope_end: \draw_end: \ExplSyntaxOff \end{document} My question is: Is that possible to plot the image of "arrow" in l3draw's code framework? In 2026, when to choose l3draw? (I found that there are only 17 posts on this site was tagged l3draw since now) By reading the post on this site, l3draw is more used to constuct symbols(without arrow), or apply some transformations with l3box.... (Notes: I don't think my second question is a quite different one, in my state now, it's quite natural to ask if some features didn't provide by l3draw, while I have written the code shown above) Edited: Since Joseph has commented that: Currently arrows are not implemented, partly as I've not had a need to do it - the priority is really to get the code stable ATM I still wonder what kind of plotting requirement is suitable to play with l3draw in the current state(2026.02)?
- Write the "gradings" under a mapby Jinwen on February 1, 2026 at 11:43 am
How should one write the term-by-term "grading" under the equation, as in the following pictures? There should be various ways to achieve this. But at least, I would like to know how to do this in the usual situation, and with tikz-cd. Here is an example code of the above two equations: \documentclass{article} \usepackage{mathtools,amssymb,tikz-cd} \def\A{\mathbb{A}} \begin{document} Situation 1 (2 places): \[ H_X \colon [X \times \A^1] \to [X] \] Situation 2 (3 places): \[ [U \cap V] \xrightarrow{[j']-[i']} [U] \oplus [V] \xrightarrow{[i]+[j]} [X] \] Situation 2' (with \texttt{tikz-cd}): \[ \begin{tikzcd}[column sep=large] {[U \cap V]} & {[U] \oplus [V]} & {[X]} \arrow["{[j']-[i']}", from=1-1, to=1-2] \arrow["{[i]+[j]}", from=1-2, to=1-3] \end{tikzcd} \] \end{document}
- Drawing a pulley systemby Fatai Bakare on February 1, 2026 at 8:32 am
I need to draw a pulley system as in the figure. How can I do that? Specific information about the figure: A block of mass Mo is on a horizontal surface and attached by a string to a hanging block, also of mass Mo , as shown in the figure. Friction between the block and the horizontal surface is negligible. The masses of the string and pulley are negligible, and the pulley can rotate with negligible friction around its axle.
- Redefine `\item` so its first "argument" is a full wordby mathbekunkus on February 1, 2026 at 5:37 am
I defined a Tikz macro and I want to use it so the item of an inline itemize is passed as its argument. So far, my solution is this: \documentclass{article} \usepackage[inline]{enumitem} \usepackage{tikz} \newcommand\itemvalue[1]{ \tikz[baseline=(o.base)] { \node[ inner xsep=0pt, inner ysep = 1pt, outer xsep=2pt, outer ysep=2pt ] (o) at (0,0) {\textcolor{blue!80!black}{\fontsize{10}{16}\textbf{#1}}}; \draw[color=gray!50, thick] ([xshift=(-1.3)]o.south west) -- ([xshift=(1.3)]o.south east); } } \begin{document} \let\olditem\item \renewcommand\item[1]{\olditem\itemvalue{#1}} \begin{itemize*}[label={}, labelsep=2em, parsep=2ex] \item {First} \item {Second} \item {Third} \end{itemize*} \end{document} The output looks like this: This is what I want but I was wondering if there was a way of redefining \item so it reads the full word (not only its first letter). If I remove the braces on each item, the output looks like this: This makes sense as far as I can tell how \item works, but I'd like a workaround that doesn't use braces on each item. Thanks!
- Wrapping a circle on a torusby M. Al Jumaily on February 1, 2026 at 4:19 am
I have used the sample code from latexdraw that draws a torus. I am trying to draw a filled circle and a dashed circle where they should be wrap around the torus instead of being drawn uniformly at z=0. I am looking for a TikZ solution. The closest I have seen is this solution but it is too difficult for me to decipher. Any help would be appreciated! \documentclass[margin=4pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikz-3dplot} \usepgfplotslibrary{colormaps} \pgfplotsset{ compat=newest, colormap={manifoldmap}{color=(lightgray) color=(white) color=(lightgray)} } \begin{document} \begin{tikzpicture} \def\R{2.75} % Major radius (distance from torus centre to tube centre) \def\offset{0.5} % Radial displacement from the torus centre circle \def\thetaB{2.5} % Angular position (in radians) for highlighted point \begin{axis}[ width=12cm, axis equal image, hide axis, z buffer=sort, view={125}{35}, clip=false ] % Parametric torus equations: % x = (R + cos(x)) cos(y) % y = (R + cos(x)) sin(y) % z = sin(x) \addplot3[ surf, shader = faceted interp, samples = 30, samples y = 40, domain = 0:2*pi, domain y = 0:2*pi, colormap name = manifoldmap, thin, opacity=0.75 ] ( {(\R + cos(deg(x))) * cos(deg(y))}, {(\R + cos(deg(x))) * sin(deg(y))}, {sin(deg(x))} ); \begin{scope}[canvas is xy plane at z=0, transform shape] \coordinate (p) at ({(\R + \offset) * cos(deg(\thetaB))}, {(\R + \offset) * sin(deg(\thetaB))}); \draw[fill=red, draw=none] (p) circle (4pt); \draw[blue, dashed, thick] (p) circle (16pt); \end{scope} \end{axis} \end{tikzpicture} \end{document}
- The choice between pdflatex and xelatex, and the use of newcomputermodernby Ho Man-Ho on January 31, 2026 at 9:07 am
Let me provide some background for my question: I am compiling a latex project, which involves a main tex file and more than 100 other tex files with no figures (except for a few simple diagrams) or pictures. The resulting pdf file has more than 600 pages. Initially, I was using pdflatex and newtxtext for font. However, recently I am more inclined to use NewComputerModern, in particular I like the slightly thicker font. As we know, to use NewComputerModern, we must either use xelatex or luatex. I chose xelatex because it seems to be slightly faster than using luatex, but it is slower than pdflatex. So I ended up spending more time for compilation, especially when I am editing the tex files for the pages of the end of the pdf file. The packages I am using are: amsfonts, amsmath, amscd, amssymb, euscript, amsthm, fancyhdr, pgf, tikz, pgfplots, caption, subcaption, enumitem, thmtools, color, centernot, mathtools, afterpage, amsbsy, systeme, sectsty, multirow, float, tikz-cd, etoolbox, microtype, mathrsfs, fontspec, fncychap, xy, appendix My question is: is there any way to use NewComputerModern and get faster compilation? I want to minimize the time for compilation while keep looking at NewComputerModern rather than newtxtext. I considered using pdflatex and newtxtext during editing, and xelatex and NewComputerModern right before finish editing. But I think we should be able to do better than this.
- How to tweak this inline chemical equation in a uniform framework?by Explorer on January 30, 2026 at 2:52 pm
What I want to typeset is something as below inline: Here below is my (ugly) attempt: \documentclass{article} \usepackage{lipsum} \usepackage{chemfig} \usepackage[version=4]{mhchem} \usepackage{extarrows} % https://tex.stackexchange.com/a/267541/322482 \makeatletter \DeclareRobustCommand{\textsupsub}[2]{{% \m@th\ensuremath{% ^{\mbox{\fontsize\sf@size\z@#1}}% _{\mbox{\fontsize\sf@size\z@#2}}% }% }} \makeatother \begin{document} \lipsum[2][1-6] HCHO + SO\textsupsub{2--}{3} + H\textsuperscript{+} $\xlongequal{\phantom{xxx}}$ \chemfig[atom sep=2em]{HO-[:30]-[:-30]S(=[:-120]O)(=[:60]O)-[:-30]O\rlap{${}^-$}} \lipsum[3][1-5] \ce{HCHO + SO_3^2- + H^+} $\xlongequal{\phantom{xxx}}$ \chemfig[atom sep=2em]{HO-[:30]-[:-30]S(=[:-120]O)(=[:60]O)-[:-30]O\rlap{${}^-$}} \lipsum[2] \end{document} which combined with: text mode's formula abruptly \xlongequal with abrupt \phantom chemfig which is not properly coordinated in length I wonder is that mechem or chemfig that could typeset this chemical equation in a uniform package framework, instead of composed of multiple isolated parts.
- Too much space after primeby bubba on January 30, 2026 at 10:38 am
When I write M'(t) or H''(t) to denote derivatives, I get an unpleasantly large space between the "prime" symbol and the parenthesis. I'm wondering if I perhaps have a corrupted font. Or do people think the output is good and as expected, and my tastes are weird? Second question: what's the best way to fix this? \documentclass{article} \begin{document} $$ \mathbf{M}'(t) = \mathbf{H}''(t) $$ \end{document}
- Make certain item "titles" of enumerate bold textby Roberto Rastapopoulos on January 30, 2026 at 10:06 am
For my homework I would like to make the hand in exercises in bold text, and the practice exercises in normal text. Currently, I have: \documentclass[12pt]{exam} \usepackage{enumitem} \begin{document} \begin{enumerate}[label=Exercise \arabic*.] \item \item \end{enumerate} \end{document} Which results in . But I would like to be able to say something like this: \begin{enumerate}[label=Exercise \arabic*.] \item* \item \end{enumerate} to give . Is there a way to edit the enumerate environment to achieve this in this simple manner?
- Calculate values of standard normal distribution table as macroby cis on January 30, 2026 at 9:18 am
I calc values of the Standard normal table (with 5-digit accuracy). So I wrote a calculation with numerica.sty (using approximate values of the error function). This works so far; if I put in a concrete value like ... [..., x=0.61]. But I would like to have this as a macro, say \sn{<#1>}, for example \sn{0.61} → 0.72907. I tried to put the whole thing into a newcommand, but this seems to be not that easy. I'd like to implement this inside pdflatex, using a package (not Lua, Mathematica, etc.). I've implemented it here using the numerica package because it worked without problems (including the use of the help-variable h, see MWE). However, I'm not sure if numerica is the best choice. The xintexpr package seems promising, but I'm currently unclear on its syntax. In any case: if anyone knows of a better implementation using a different package (e.g., xint.sty), it would be nice too. \documentclass[margin=10mm, varwidth]{standalone} \usepackage{numerica} \begin{document} \section{Test with \texttt{numerica}} \xdef\x{0.61} sn(\x) = \eval*{% 0.5 (2-h \exp( -0.5 x^2 -1.26551223 +1.00002368 h +0.37409196 h^2 +0.09678418 h^3 -0.18628806 h^4 +0.27886807 h^5 -1.13520398 h^6 +1.48851587* h^7 -0.82215223 h^8 +0.17087277 h^9)) }[h=1/(1+0.25*\sqrt{2}*x), x=0.61% cannot use \x here 🙁 ][5] \section{Test with \texttt{xint}} ... ? .... \end{document}
- Diagbox in a table: how to align elements to the right or belowby cis on January 30, 2026 at 6:11 am
Is it possible to configure \diagbox[*]{*}{*} so that the elements to the right or below are aligned? \documentclass[margin=5pt, varwidth]{standalone} \usepackage{diagbox} \begin{document} \begin{tabular}{c | c | *{3}{c}} \hline a & \diagbox{$b$}{$c$} & 0.1 & 0.2 & 0.3 \\ \hline 2 & 0 & 0.1 & 0.2 & 0.3 \\ 2 & 1 & 2.1 & 2.2 & 2.3 \\ 2 & 2 & 4.1 & 4.2 & 4.3 \\ \end{tabular} \end{document}
- Fail to construct spiral gradually with beamer framesby D G on January 30, 2026 at 2:40 am
Objective: The spiral construction is shown gradually. Each iteration is on a separate frame. \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{frame}{step by step spiral construction} \begin{tikzpicture} \draw (0,0) foreach \a in {1,...,120} { \only<\a->{ -- ++({10*\a}:{pow(0.99,\a)}) } }; \end{tikzpicture} \end{frame} \end{document} Error: No file test.nav. ! Package tikz Error: Giving up on this path. Did you forget a semicolon?. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.16 \end{frame} ?
- Fill plot area with rainbow colorsby Brasil on January 29, 2026 at 11:53 pm
I would like to fill the plot area with the rainbow colors. The wavelength of the colors corresponds to the wavelength of the x-axis. I have the MWE example below. It works fine uless for the line \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); How can I fix it, please? \documentclass[tikz, border=1mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5} \usepackage{color} \begin{document} \begin{tikzpicture} \small \begin{axis}[% width = 70mm, height = 50mm, % grid = both, xmin = 0.41, xmax = 0.73, % xtick = \empty, % xtick distance = 100, ymin = 1.4, ymax = 2.0, ytick distance = 0.2, xlabel = Wavelength ($\mu$m), ylabel = Refractive index, ] %--> FILL PLOT AREA \foreach \wl in {410,...,729}{ \definecolor{tmpcol}{wave}{\wl} \colorlet{mycol}[rgb]{tmpcol} \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); } %--> Borosilicate glass BK7 \addplot[thick, domain=0.41:0.73] {1.5046 + 0.00420/x^2}; \node at (axis cs: 0.7, 1.57) [above]{BK7}; %--> Barium crown glass BaK4 \addplot[thick, domain=0.41:0.73] {1.5690 + 0.00531/x^2}; \node at (axis cs: 0.7, 1.52) [below]{BaK4}; %--> Dense flint glass SF10 \addplot[thick, domain=0.41:0.73] {1.7280 + 0.01342/x^2}; \node at (axis cs: 0.7, 1.745) [above]{SF10}; \end{axis} \end{tikzpicture} \end{document}
- How to Make Trajan Text Bold Using Pdflatex?by Jethro on January 29, 2026 at 8:34 pm
MWE: \documentclass[12pt]{book} \usepackage{trajan} \begin{document} \thispagestyle{empty} \LARGE \noindent\trjnfamily{HOW TO MAKE TRAJAN TEXT BOLD?}\\[20pt] \noindent\textbf{\trjnfamily{BUT THIS DOESN'T WORK}} \end{document} The output: Using pdflatex, I would like to make text bold using the trajan font; however, \textbf and \bfseries seem not to work. Is there a way to do this?
- Tagging: Alternative text to symbolby Svend Tveskæg on January 29, 2026 at 7:11 pm
Code Consider the following MWE: % lualatex test.tex \DocumentMetadata{ lang = da, tagging = on } \documentclass{article} \usepackage{siunitx} \begin{document} Displayed text on screen: \qty{15}{\celsius} Text read by screen reader: My green horse is awesome. \end{document} Question How do I make a screen reader read out, say, "My green horse is awesome." while the displayed text/symbol in the PDF file is the output from, say, \qty{15}{\celsius}?