• How to use Greek letters for all SI prefixes with the same font in siunitx?
    by Sebastiano on June 2, 2025 at 9:21 pm

    I am using the siunitx package to typeset units in my LaTeX document. By default, when I want to use Greek letters for SI prefixes like micro, the package siunitx give me a different font style for the Greek letters, such as μ for micro or μA for microamperes. Is there a way to tell siunitx to use the regular Greek letters (italic or upright) for all SI prefixes with the same font of the document? \documentclass[12pt]{article} \usepackage{amsmath,amssymb} \usepackage{siunitx} \begin{document} Una spira quadrata di lato 7,20 cm è immersa in un campo magnetico di modulo $B=\qty[per-mode = symbol]{30.0}{ \mu\tesla}$ diretto perpendicolarmente alla sua superficie. Calcola il valore del flusso attraverso la spira. Di quanto occorre ruotare la spira affinché il flusso si riduca a un terzo. Una spira quadrata di lato 7,20 cm è immersa in un campo magnetico di modulo $B=\qty[per-mode = symbol]{30.0}{ \micro\tesla}$ diretto perpendicolarmente alla sua superficie. Calcola il valore del flusso attraverso la spira. Di quanto occorre ruotare la spira affinché il flusso si riduca a un terzo. \end{document} For my students I use the font URW-Classico:

  • How to add endpoint dots to the axes and to a function graph in TikZ/PGFPlots?
    by Sebastiano on June 2, 2025 at 8:54 pm

    I am trying to plot the graph of a function like f(x)=e^x in TikZ/PGFPlots. I would like to add endpoint dots to the graph, similar to those seen in some mathematical diagrams. In other words, I want the curve and the axes to end with a "dot" or a "symbol" at the last point of the function. Here is my basic code for plotting f(x)=e^x: \documentclass[12pt]{article} \usepackage{pgfplots} \begin{document} \begin{figure} \centering \begin{tikzpicture} \begin{axis}[ axis on top, axis equal, axis lines=middle, xmin=-3, xmax=3, % Ensure rounded values for the domain ymin=-.25, ymax=1, % Ensure rounded values for the range xtick={-2,-1,0,1, 2}, % Explicit ticks for x-axis ytick={0,1}, % Explicit ticks for y-axis samples=1000, % Ensure sufficient sample points width=12cm, % Optional: define width for the plot height=8cm, % Optional: define height for the plot legend pos=south west, legend style={fill=gray!10,draw=none,cells={anchor=west}}, enlargelimits=true, ] % Plot functions with colors using addplot \addplot[orange, very thick, smooth,domain=-3:3]{e^x}; \addlegendentry{$f(x)=e^x$} \end{axis} \end{tikzpicture} \end{figure} \end{document} I would like to know how I can add endpoint dots at the ends of the axes and of the graph, so that visually ends like this image:

  • Recreate this Platonic solids separator
    by Alex Bogatskiy on June 2, 2025 at 7:22 pm

    I encountered this very cool separator in a book and was wondering how to reproduce it in an efficient way. TikZ could work but I'm worried it would be quite slow if used many times in a long document (like a book). Perhaps there's a font that has these glyphs, or a LaTeX way of creating such a font from TikZ figures?

  • LaTeX Error: Counter too large. - Too many subsections (more than 26)
    by Dalton Cézane on June 2, 2025 at 6:08 pm

    I have a document that is using IEEEtran template and it is with more than 26 subsections. This is generating the following error: LaTeX Error: Counter too large. Seaching here in StackOverflow and other sites, I tried putting the following code in the beggining of the section, but it does not work: \renewcommand*{\thesubsection}{\alphalph{\value{subsection}}}. My main file has the following packages: \documentclass[journal]{IEEEtran} \usepackage[english]{babel} \usepackage{csquotes} \usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig} \usepackage{hyperref} \usepackage{alphalph} \usepackage{graphicx} \graphicspath{ {./images/} } \hyphenation{op-tical net-works semi-conduc-tor IEEE-Xplore} \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \usepackage{balance} \newtheorem{theorem}{Theorem} \usepackage{diagbox} \usepackage{multirow} \usepackage[normalem]{ulem} \useunder{\uline}{\ul}{} \usepackage{booktabs} % Keywords command \providecommand{\keywords}[1] { \small \textbf{\textit{Keywords---}} #1 } \begin{document} ... \input{sectionx} \medskip %\printbibliography \bibliographystyle{IEEEtran} \bibliography{ref.bib} \end{document} And below I put the code I am using in the sectionx file: \section{My Section} \label{sec:mysec} \renewcommand*{\thesubsection}{\alphalph{\value{subsection}}} %... \subsection{sub} \label{subsec} \subsection{sub1} \label{subsec1} %... Can anyone please tell me what I am doing wrong?

  • How can I draw "rounded stars" in TikZ?
    by user319109 on June 2, 2025 at 2:08 pm

    I'm trying to draw rounded stars in TikZ that look similar to what so many AI applications nowadays are using. They look like the following: I modified some LaTeX code from another question to draw a single star that looks like the following: However, as you can see, the inner and outer angles are pointed and not rounded. I assume you can use some kind of (Bezier?) curves to draw the rounded points, but my TikZ skills are not high enough to know how to do this and I can't come up with the proper keywords to figure out how I can tackle this. How might I be able to draw these rounded stars? My code: \documentclass[tikz,dvipsnames]{standalone} \usepackage{tikz} \newcommand{\tstar}[5]{% inner radius, outer radius, tips, rot angle, options \pgfmathsetmacro{\starangle}{360/#3} \draw[#5] (#4:#1) \foreach \x in {1,...,#3} { -- (#4+\x*\starangle-\starangle/2:#2) -- (#4+\x*\starangle:#1) } -- cycle; } \begin{document} \begin{tikzpicture} \tstar{1.75}{4}{4}{45}{thick,draw=none,fill=Purple} \end{tikzpicture} \end{document}

  • \bcancel changes the per-mode of siunitx
    by pejsek on June 1, 2025 at 10:12 pm

    When using \bcancel inside the unit expression of siunitx package commands, somehow the per-mode changes. Same for \xcancel. Also, the "m" is italic. With \cancel, everything is fine. \documentclass{article} \usepackage{siunitx} \usepackage{cancel} \begin{document} \qty[per-mode=power]{2}{\cancel\metre\per\second} \qty[per-mode=power]{2}{\bcancel\metre\per\second} \end{document} How to make \bcancel not change the siunitx behaviour? This brought me to this question. Using the provided answer and changing \cancel to \bcancel revives the problem. EDIT Below is my use case. I created a workaround that doesn't use \qty command but still keeps the spacing and inter-unit-product consistent with siunitx settings. \documentclass{article} \usepackage{siunitx} \usepackage{cancel} \newcommand*{\symbolInterUnit}{\ensuremath{{}\cdot{}}} \sisetup{inter-unit-product = \symbolInterUnit} \begin{document} \[ \frac{\qty{119}{\raiseto{\bcancel{2}}\metre\per\cancel\second\squared}}% {\qty{4}{\vphantom{\metre}}\bcancel{\mathrm{m}}\symbolInterUnit% \cancel{\mathrm{s}^{-2}}}% =\qty{29.75}{\metre} \] \end{document}

  • Problem with delimiters in newpxmath
    by Matemáticos Chibchas on June 1, 2025 at 8:15 pm

    The following code \documentclass{article} \usepackage{amsmath} %\usepackage{newpxmath} \begin{document} \begin{gather*} \lVert \wedge \rVert \\ \lvert \wedge \rvert \\ \{ \wedge \} \end{gather*} \end{document} yields The contents inside the delimiters are clearly centered, which is no longer the case if the newpxmath package is invoked: How can this misalignment be solved?

  • How to use quotation marks in ConTeXt?
    by Jasper on June 1, 2025 at 7:29 pm

    I want to quote something in ConTeXt, but the typical LaTeX syntax is producing the wrong result. \starttext ``Get off my lawn!'' yelled the old man. \stoptext

  • Color-graded ybar chart
    by stuck on June 1, 2025 at 2:24 pm

    I wish to create something similar in appearance to this chart 1 (from #ShowYourStripes) where the bars are color graded to the corresponding value but I don't think I understand the proper use of point meta. Here is a MWE of my current situation: \documentclass[tikz, border=5pt]{standalone} \usepackage{pgfplots, pgfplotstable} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ ybar interval, ymin=-1, ymax=1, axis x line=none, axis y line=none, xtick=\empty, ytick=\empty, bar width=0.2cm, height=3cm, point meta=explicit, colormap={bluewhitered}{ rgb255(0cm)=(0,0,255); rgb255(0.5cm)=(255,255,255); rgb255(1cm)=(255,0,0) } ] \addplot+[ ybar, draw=none, colormap name=bluewhitered, fill=mapped color, ] table[x expr=\coordindex, y=anomaly, meta=anomaly] { anomaly -0.8 -0.6 -0.4 -0.2 0.0 0.1 0.3 0.5 0.7 0.9 }; \end{axis} \end{tikzpicture} \end{document}

  • Metapost code no output in ConTeXt
    by 青山漫步 on June 1, 2025 at 2:16 am

    Why does the Metapost code in the luametafun.pdf document produce no output in ConTeXt ver: 2025.02.28 ? Here is a minimal test environment: \starttext \startMPcode path p ; p := lmt_samplefunction [ preamble = "local sin = math.sin", code = "return sin(x)", xmin = -5*pi, xmax = 5*pi, ymin = -1, ymax = 1, % tolerance = 0.001, ] scaled 10 ; draw p withpen pencircle scaled 10 withcolor "darkred" ; drawdot p withpen pencircle scaled 2.5 withcolor white ; \stopMPcode \startMPcode path p ; p := lmt_parametricplot [ preamble = "local sin, cos = math.sin, math.cos", xcode = "2*cos(t/3)*cos(t)", ycode = "2*cos(t/3)*sin(t)", tmin = 0, tmax = 4*pi, tolerance = 0.001, ] ysized 5cm ; draw p withpen pencircle scaled 10 withcolor "darkred" ; drawdot p withpen pencircle scaled 2.5 withcolor white ; \stopMPcode \stoptext

  • Improve booktabs table by fixing minor issues
    by XavierO on May 31, 2025 at 9:42 pm

    I am using the LaTeX package booktabs to present some results obtained in the paper. The style looks great, except for two minor issues that I don't know how to fix. The main one is the horizontal line below $m=20$, which does not extend to the end of the table. The other one is more delicate, as I am not sure if it is possible to fix it without massively changing the layout of the header. Ideally, the word "Region" should be aligned with the horizontal lines cmidrules, i.e. vertically centred in its cell. I will leave here an image of the table and the mwe to generate it. Other style suggestions to improve the appearance are also welcome. Thank you in advance. PS: The table is generated using the Springer template svjourn3 together with the mathptmx package. I have decided not to include it in the mwe, as I expect it to make no difference. \documentclass[10pt,a4paper]{article} \usepackage{booktabs} \usepackage{pdflscape} \begin{document} \begin{landscape} \begin{table}[h] %\centering \begin{tabular}{@{}lccccccccccccccc@{}} \toprule & \multicolumn{3}{c}{$m = 3$} & \multicolumn{3}{c}{$m = 5$} & \multicolumn{3}{c}{$m = 10$} & \multicolumn{3}{c}{$m = 15$} & \multicolumn{3}{c}{$m = 20$} \\ \cmidrule(r){2-4} \cmidrule(r){5-7} \cmidrule(r){8-10} \cmidrule(r){11-13} \cmidrule(r){14-16} \multicolumn{1}{l}{Region} & $\ell_\alpha$ & $\ell_{\Xi} / m$ & $\ell_{\xi}/m$ & $\ell_\alpha$ & $\ell_{\Xi} / m$ & $\ell_{\xi}/m$ & $\ell_\alpha$ & $\ell_{\Xi} / m$ & $\ell_{\xi}/m$ & $\ell_\alpha$ & $\ell_{\Xi} / m$ & $\ell_{\xi}/m$ & $\ell_\alpha$ & $\ell_{\Xi} / m$ & $\ell_{\xi}/m$ \\ \midrule Australia & $3.48 \%$ & $6.1$ & $35.45$ & $5.26\%$ & $9.4$ & $57.00$ & $5.85\%$ & $11.0$ & $64.13$ & $5.07\%$ & $ 9.9$ & $56.29$ & $4.20\%$ & $8.5$ & $47.19$ \\ Canada & $3.19\%$ & $9.8$ & $38.33$ & $5.29\%$ & $15.1$ & $58.36$ & $5.87\%$ & $17.5$ & $65.71$ & $5.09\%$ & $15.8$ & $57.65$ & $4.23\%$ & $13.5$ & $48.41$ \\ Europe & $3.50\%$ & $194$ & $38.86$ & $5.30\%$ & $296$ & $59.25$ & $5.90\%$ & $335$ & $66.88$ & $5.15\%$ & $297$ & $59.14$ & $4.13\%$ & $251$ & $50.11$\\ Germany & $3.48\%$ & $23.5$ & $40.06$ & $5.28\%$ & $35.8$ & $61.22$ & $5.90\%$ & $40.4$ & $69.24$ & $5.15\%$ & $35.6$ & $61.33$ & $4.32\%$ & $30.1$ & $52.06$ \\ Switzerland & $3.48\%$ & $2.3$ & $38.55$ & $5.29\%$ & $3.5$ & $58.90$ & $5.90\%$ & $4.1$ & $66.66$ & $5.13\%$ & $3.7$ & $58.94$ & $4.27\%$ & $3.1$ & $49.79$ \\ United States & $3.50\%$ & $80.0$ & $37.74$ & $5.30\%$ & $123$ & $57.46$ & $5.88\%$ & $141$ & $64.66$ & $5.10\%$ & $127$ & $56.79$ & $4.25\%$ & $108$ & $47.75$ \\ \bottomrule \end{tabular} \caption{Numerical results.} \label{tab:results} \end{table} \end{landscape} \end{document}

  • Tikzducks : star patterns on jacket produce vertical shift
    by Maïeul on May 31, 2025 at 3:39 pm

    Looking in the tikzducks handbook, I saw that it is possible to add stars to the duck's jacket. Unfortunately, it seems to produce a spurious vertical space. See this MWE \documentclass{article} \usepackage{tikzducks} \begin{document} \begin{tikzpicture} \AddToHook{tikzducks/clothing}{ \path[pattern={Stars[distance=1.7mm, radius=0.5mm,angle=32]}, pattern color=yellow] \duckpathjacket; } \duck[jacket=black,bowtie, graduate=gray!20!black, tassel=red!70!black] \RemoveFromHook{tikzducks/clothing} \end{tikzpicture} \begin{tikzpicture} \duck[jacket=black,bowtie, graduate=gray!20!black, tassel=red!70!black] \end{tikzpicture} \hrule \end{document} Which produces My question is simple, but I have no idea of the answer : how to avoid such vertical shift ?

  • How is ~ different from \nobreakspace in zref-clever?
    by user743115 on May 31, 2025 at 2:29 pm

    In zref-clever-german.lang, we see namesep = {\nobreakspace} , pairsep = {~und\nobreakspace} , listsep = {,~} , lastsep = {~und\nobreakspace} , tpairsep = {~und\nobreakspace} , tlistsep = {,~} , tlastsep = {~und\nobreakspace} , notesep = {~} , rangesep = {~bis\nobreakspace} , I always thought ~ and \nobreakspace do the same: insert a space at which there can be no line break. So why do we see the two versions above? (After all, ~ is faster to type and faster to read by a computer, so the author could've used ~ everywhere. Or the author could have insisted on the readability by a human and could've used \nobreakspace everywhere. But no; we see a mixture.)

  • Declaring \setupbodyfont in a Lua macro does not change the font in ConTeXt
    by Jasper on May 31, 2025 at 12:48 pm

    This file produces the desired output: % mwe2.tex \setupbodyfont [% modern% ,18pt% ,sansserif% ] \starttext The quick brown fox \stoptext However, this one does not: % mwe.tex \ctxloadluafile{mwe} \main -- mwe.lua function main() context( [[ \setupbodyfont [ modern, 18pt, sansserif ] \starttext The quick brown fox \stoptext ]] ) end interfaces.implement { name = "main", public = true, arguments = { }, actions = main, }

  • There is no (U+F5825) in font, even though the glyph exists
    by FKranhold on May 31, 2025 at 12:11 pm

    I would like to use the glyph U+F5825 (a big ast, to be used as an operator), which is contained in the MinionMath font. I have also checked that character in my copy of the OTF with fontforge, so I am certain that the glyph exists. However, the following MWE (to be compiled with LuaLaTeX) \documentclass{standalone} \usepackage{unicode-math} \setmathfont{MinionMath-Regular} \begin{document} $\symbol{"F5825}$ \end{document} does not lead to the desired result; instead I receive the following error: Missing character: There is no 󵠥 (U+F5825) in font name:MinionMath-Regular:mode=base;script=math;language=dflt;mathfontdimen=xetex;! (I know, this MWE cannot be reproduced without a copy of the commercial font MinionMath-Regular; but due to its simplicity, my mistake might still be tracable.)

  • How to get a half or demi star symbol in LaTeX?
    by Name on May 31, 2025 at 11:05 am

    Is there a way to get a "half star" (half of \ast) symbol like the one shown in the below image? I tried using Detexify, but it did not find anything. Also, I could not find this symbol in the document "The Comprehensive LaTeX Symbol List (by Scott Pakin)." Does anyone know how to create or find a half star in LaTeX?

  • Curved or circular wires with circuitikz
    by Sebastiano on May 31, 2025 at 10:49 am

    In a physics textbook for the fourth year of an Italian high school with a focus on science and mathematics, pag. 407 "Le risposte della fisica - Edizione nuovo Esame di Stato by Antonio Caforio and Aldo Ferilli vol. 4", I see two circuits S1 and S2 where the wires are curved or circular paths — a non-standard, yet visually appealing style (I have added an image for the question 13 below). I’d like to ask whether it’s possible to reproduce such diagrams using the current features of the circuitikz package — that is, circuits with curved or closed-loop wires while still using the standard electrical symbols. I’ve looked through the official documentation but couldn’t find a way to achieve this kind of representation. Here’s a link to the textbook for reference: https://www.mondadorieducation.it/catalogo/le-risposte-della-fisica-edizione-nuovo-esame-di-stato-0063708/ Many thanks in advance to anyone who can help — especially to the very knowledgeable users who frequently share great advice on circuitikz! My MWE: \documentclass[a4paper,12pt]{article} \usepackage{circuitikz} \begin{document} \begin{tikzpicture} \draw (6, 7) to[battery2] (4, 7); \draw (4, 7) -- (4, 5) -- (6, 5) -- (6, 7); \draw (9, 5) to[battery2] (9, 7); \draw (9, 7) |- (7, 7) -| (7, 5) -- (9, 5); \end{tikzpicture} \end{document}

  • How to declare double square bracket as delimiter? [duplicate]
    by Akira on May 31, 2025 at 7:51 am

    I have a tex file (to be processed by pdfLaTeX): \documentclass{amsart} \begin{document} We have $[\![ m , n ]\!]$. However, \[ \left [\![ \frac{1}{2} , \frac{1}{3} \right ]\!] \] \end{document} I am aware of \DeclareMathDelimiter (from e.g. here) but don't know how to use it. I am aware of \ldbrack \rdbrack from the package mathabx, but \ldbrack \rdbrack is thicker and using mathabx changes the font. Can we make [\![ ]\!] into a variable-sized delimiter?

  • \int has problem with macro producing stix symbol
    by Akira on May 30, 2025 at 4:42 pm

    I followed this great answer to reproduce the delimiter \lParen \rParen from package stix: \documentclass{amsart} \usepackage{mathtools} %%%%%%%%%%%%% \makeatletter \DeclareFontEncoding{LS2}{}{\@noaccents} \makeatother \DeclareFontSubstitution{LS2}{stix}{m}{n} \DeclareSymbolFont{largesymbols}{LS2}{stixex}{m}{n} \DeclareMathDelimiter{\lParen}{\mathopen} {largesymbols}{"DE}{largesymbols}{"02} \DeclareMathDelimiter{\rParen}{\mathclose}{largesymbols}{"DF}{largesymbols}{"03} %%%%%%%%%%%%% \begin{document} Now we can use $\lParen Y \rParen$ together with the Computer Modern font. However, \begin{equation} \begin{dcases} A & = \int_0^1 f (s) d s , \\ B & = \int_0^1 g (s) d s . \end{dcases} \end{equation} \end{document} Could you explain why \begin{dcases} \end{dcases} and \int do not work as usual? How can we fix this problem?

  • Defining \emph to be bold and underlined // interaction with cloze package
    by user1 on May 30, 2025 at 2:36 pm

    I want \emph so result in bold, underlined text. Additionally I found an interaction with the cloze package, which I use in other parts of my document… \documentclass{scrbook} \usepackage{ulem} %\useunder{\uuline}{\bfseries}{\textbf} %\useunder{\uline}{\ulined}{} %\useunder{\uline}{\bfseries}{\textbf} %\DeclareEmphSequence{\useunder{\uuline}{\bfseries\uline}{\emph}} \DeclareEmphSequence{\bfseries} %\def\ULforem{\useunder{\uline}{\emph}{\emph}} % Interacts with \usepackage[hide]{cloze} \begin{document} This word is \emph{very} important. \end{document}

  • Regarding \setmathfont[range={}]{}{}, why does it not work?
    by 菲德烈 on May 30, 2025 at 8:05 am

    \documentclass{article} \usepackage{amsmath} \usepackage{fontspec} \usepackage{unicode-math} \setmathfont{NewComputerModernMath} \setmathfont[range={"24B6-"24CF}]{STIX Two Math} \begin{document} $\char"24B6$ $Ⓑ$ \end{document} After compiling the code, the character Ⓑ still doesn't appear, even though STIX Two Math does contain this symbol. During compilation, the log shows: Missing character: There is no Ⓐ (U+24B6) in font NewComputerModernMath-Regular /OT:script=math;language=dflt;! Missing character: There is no Ⓑ (U+24B7) in font NewComputerModernMath-Regular /OT:script=math;language=dflt;! This means the font range setting did not take effect. Why is that? I'm using TeX Live 2024 and compiling with XeLaTeX. Is this a bug, or is the code written incorrectly?

  • How can I make sum symbol be the same height as int symbol?
    by DAGO on May 29, 2025 at 4:40 pm

    In Spivak, Calculus on Manifolds, the summation and integral symbols are the same height. I would like to resize the \sum symbol so that it's heigth is the same as the \int symbol. I have seen this solution in another question \documentclass{article} \usepackage{amsfonts} \usepackage{mathtools} \newcommand{\ssum}{% \mathop{% % get the dimensions of \sum in \displaystyle \sbox0{$\displaystyle\sum$}% % lower the stretched \sum by its height and raise it by the height % of the unstretched symbol; give it the height it should have % and the right depth \raisebox{-0.55pt}{\scalebox{0.8}[1.5]{\copy0}}% }\displaylimits } \begin{document} \[\ssum_{\varphi\in\Phi}\int\limits_A\varphi\cdot f\] \end{document} and tried to manually make it work. Thank you.

  • Use remember picture several times in a single document
    by Miyase on May 29, 2025 at 2:00 pm

    My goal is to be able to draw a vertical line on the left side of a paragraph (the line and the paragraph having the exact same height). I know that the changebar package can do that, but I also want to add a counter to each line. I'm trying a solution based on tikzmark to generate nodes at the beginning and end of the paragraph, and use those nodes to draw the line. It works fine as long as there's a single paragraph with a vertical line, but if there are two or more, all the vertical lines end up stacked on top of each other next to the last paragraph. I assume that I'd need to make TikZ "forget" the previous use of remember picture, but I have no idea how to do that. Here's a MWE where the second and fourth paragraphs should both have a vertical line with a counter. \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark, calc} \newcounter{trouvert} \setcounter{trouvert}{1} \newcommand{\trouv}[1]{ \tikzmark{A}#1\par\tikzmark{B} \begin{tikzpicture}[remember picture, overlay] \coordinate (A2) at (pic cs:A); \coordinate (B2) at (pic cs:B); \coordinate (B3) at ($(B2)+(-0.8,1em)$); \coordinate (A3) at ($(B3|-A2)+(0,1em)$); \draw[very thick] (B3)--(A3); \coordinate (C) at ($(B3)!0.5!(A3)$); \draw ($(C)-(0.5,0)$) circle (0.3) node{\arabic{trouvert}}; \end{tikzpicture} \stepcounter{trouvert} } \begin{document} A computer can have various sorts of memory. Some are slow but big, like a hard drive, others are fast but smaller, like RAM. \trouv{The latter (RAM stands for Random Access Memory), will be where Python programs will store variables most of the time.} The unit of memory is the byte (unit symbol B). In practice, some of its multiples—such as the megabyte (MB)—are more commonly used. \trouv{The latter (RAM stands for Random Access Memory), will be where Python programs will store variables most of the time.} \end{document} And here's the resulting output: Of course this might not be a good way to do this. I'd be grateful for a way to make the above code work, or a completely different solution (as long as the paragraph's layout and indentation aren't messed up by the vertical line).

  • When \multirow{2}{*} columns, overfull wrapping text goes outside cell
    by Christianidis Vasilis on May 29, 2025 at 12:52 pm

    I want the wrapping text inside the cell to enlarge the cell instead of pushing the text outside it. Currently: \documentclass[12pt,twocolumn,a4paper]{article} \usepackage{multirow}%tables and vertical merging \begin{document} \begin{table} \centering \begin{tabular}{|c|c|c|} \hline \textbf{Byte} & \textbf{Usage} & \textbf{Notes} \\ \hline 36 & Halogen2 op hours Low Byte (not implemented) & \multirow{2}{*}{\parbox{5cm}{ Halogen Lamp ADC raw values. Notes on how to process them are shown below}}\\ \cline{1-2} 37 & ADCLow &\\ \hline \end{tabular} \end{table} \end{document} produces this: Where I want the text on the right to enlarge the cell instead of overflowing. (Bonus if the rows on the left equally-change their size). I do not need this to be automatic, I could use code that manually resizes the row to be higher. I have tried using \parbox, \rule to manually resize the cell but didnt produce any desirable results.

  • Adjusting spacing on subscript of binomial coefficient
    by diracdeltafunk on May 29, 2025 at 12:51 pm

    I am writing a bunch of equations involving $q$-binomial coefficients, denoted $\binom{n}{k}_q$. On my machine (in display mode), this renders as I'd like to reduce the amount of spacing between the left paren and the subscript -- here's a quick photoshop bodge of what I'd like to achieve: I can acheive something like this by using \binom{n}{k}_{\!\!q}, but I would guess that this ugly hack is not best practice. What's the best way to acheive this?

  • LuaLaTeX overline in text mode
    by yannisl on May 29, 2025 at 9:12 am

    Consider the following code that draws and overline over characters using Lua and unicode combining diacritic (0x0305). Note this is not a macron, but an overline, used in some books to indicate Babylonian numbers and in other scripts like Nubian or Coptic an abbreviation. I am looking to make the code a bit more robust and flexible. Currently produces errors when passing unicode chars like \overlineit{ⲡⲛⲁ} which is possibly with me using |string.sub| rather than a utf8 equivalent. Can the command \overlineit be defined entirely using the token library and how? \documentclass{article} \usepackage{fontspec} %\newfontfamily\copticfont{SNR.ttf} better font \newfontfamily{\copticfont}{Noto Sans Coptic} \setmainfont{Doulos SIL} % or Gentium Plus \usepackage{luacode} \makeatletter\let\percentchar\@percentchar\makeatother \def\aphantom{\phantom{t}} \NewDocumentCommand{\overlineit}{m}{\directlua{% local overbar = utf8.char(0x0305) local dottedcircle = utf8.char(0x25CC) local s = "" str = [[#1]] for i = 1, utf8.len(str) do local ch = string.sub(str, i, i) if ch:match("[\percentchar d \percentchar a]") then local temp = ch..overbar tex.sprint(temp) elseif ch=="~" then tex.sprint(dottedcircle..overbar) else tex.sprint(ch) end end }% } \begin{document} The Babylonian notation of 560 is: \overlineit{560} and only spaces \overlineit{~~~~}.\overlineit{cc c560;} Examples: Coptic or Nubian abbreviations"\\ Another example: \overlineit{12345}. %{\copticfont \overlineit{ⲡⲛⲁ}}% fails as "{" reade through coptic range {\copticfont ⲡ\char"0305ⲛ\char"0305ⲁ\char"0305} \end{document}

  • Incorrect Section Number Referencing by \ref
    by Dave on May 28, 2025 at 6:38 pm

    I am attempting to reference a handful of subsubsections in my document, but the reference number produced by \ref is incorrect. It currently concatenates the entire section numbering hierarchy together, such that the output is: When it should just be: I'm not sure what's causing the issue but I'm using the revtex4-2 document class and I manually define the section numbering in my preamble. So assume it must be an issue somewhere there, all the preamble that I believe may be relevant to my problem is: \documentclass[12pt, onecolumn]{revtex4-2} % Font size (12pt) and column number (one or two). \usepackage{tocloft} % Removes trailing dots in section labelling \usepackage{titlesec} % for customising section titles \renewcommand{\thesection}{\arabic{section}} \renewcommand{\thesubsection}{\thesection.\arabic{subsection}} \renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}} \begin{document} \section{A section} \section{Another section} \subsection{A subsection} \subsubsection{subsubsection} \label{sec:subsubsec1} ... seen in section \ref{sec:subsubsec1} \end{document} Let me know if there's any more preamble that may be relevant, any help with this would be much appreciated!

  • Should \mathop{f}(x) be used instead of f(x)?
    by JMC on May 28, 2025 at 3:33 pm

    This question probably pertains to taste just as much as to LaTeX best practices. When typesetting a simple function application, should mathop be used to reduce the space between the function and the parentheses enclosing its argument, in cases where the function is itself a variable like f(x)? MWE: \documentclass{article} \usepackage{mathtools} \usepackage{unicode-math} \setmainfont{Tex Gyre Pagella} \setmathfont{Tex Gyre Pagella Math} \begin{document} $f(x)$ vs $\mathop{f}(x)$ \end{document} Compare: To me, the second clearly looks better and more "correct", but I feel like nobody seems to use mathop for this purpose even though, in this case, "f" is an operator. Is this something that should be done?

  • Listing Emergency stop on near a new page
    by Dumbo on May 27, 2025 at 5:47 pm

    I am having a weird bug with listingsutf8. The minimal way to reproduce this is \documentclass[12pt, twoside]{article} \usepackage{geometry} \usepackage{blindtext} \usepackage[utf8]{inputenc} \usepackage[most]{tcolorbox} \usepackage[french]{babel} \selectlanguage{french} \usepackage{amsmath} \usepackage{listingsutf8} \geometry{left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.50cm} \setlength{\headheight}{16pt} \setlength\parindent{0pt} \begin{document} \section{Gradient Conjugué} % (fold) \label{sec:Gradient Conjugu} Just some maths \begin{align} \Delta\alpha_k&=-\Delta\tau\sum_m S^{-1}_{km}g_m, \end{align} \Blindtext[3] \begin{lstlisting}[language=Python] def cg(x0, A, b, kmax, tol): r = b - np.dot(A, x0) p = r for k in range(kmax): a = np.dot(r, r) / np.dot(p, np.dot(A, p)) x0 = x0 + a * p nrm_r = np.dot(r, r) r = r - a * np.dot(A, p) if np.dot(r, r) < tol: return x0 beta = np.dot(r, r) / nrm_r p = r + beta * p return x0 \end{lstlisting} \end{document} This does not compile with an emergency stop. It will compile if text before the listing is removed or if some code inside the listing is removed. It will also compile if the geometry of the page is changed, or if the tcolorbox package is removed, even though it is not used right now. It will also compile if the label of the section is removed. The log does not contain anything that seems usefull, other than a warning that appeared after I removed \usepackage[T1]{fontenc} while looking for a minimal working example. If text shifts around, the amount of lines of code needed to be removed from the listing will vary. As presented here, removing return x0 will successfully compile, but in my full document I had to remove up to p = r, but the listing appeared right to the top of the new page in my full document. Trying to reproduce this with a \clearpage instead of placeholder text never failed to compile. I have no idea why it behaves like that, all inputs will be appreciated.

  • TikZ package coding
    by Chesso on May 27, 2025 at 5:30 pm

    I'm trying to use the TikZ package to construct the picture above. I have the following code, but I keep receiving error messages. \documentclass{article} \usepackage{float} \usepackage{tikz} \begin{document} \begin{figure}[H] \begin{tikzpicture}[shorten >= 1pt, node distance=2cm, on grid, auto] \node[state, initial] (U0) at (0, 0){$U_0$}; \node[state] (U1) at (3, 2) {$U_1$}; \node[state] (U2) at (3, -2) {$U_2$}; \node[state, accepting] (U3) at (6, 0) {$U_3$}; \path[->] (U0) edge [bend right] node {(a)} (U2) (U0) edge [bend left] node {(b)} (U1) (U1) edge [bend left] node {(a)} (U3) (U1) edge node {(b)} (U2) (U2) edge [loop below] node {(a, b)} () (U3) edge [loop right] node {(a, b)} (); \end{tikzpicture} \end{figure} \end{document}