Hot
- Trail or trace of a moving charged particleby Sebastiano on July 8, 2026 at 12:31 pm
I think in 2019 I built the following image with Adobe Illustrator for my book. Now, since there are so many images in pdf, I am slowly creating them in TikZ code. I wanted to know if there is something to create a trail for the blue particle similar to the main image or any other idea you have. Thank you. \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows.meta} \tikzset{rhtip/.tip={Triangle[line width=1pt, fill=white, length=9pt, width=9pt]}, pics/clock/.style args={#1/#2}{ code={ \def\dist{0.38} \draw[thin] (0,0) circle (\dist); \draw[line width=.7pt] (0,0) -- ({0.16*cos(90-30*#1-0.5*#2)}, {0.16*sin(90-30*#1-0.5*#2)}); \draw[line width=.7pt] (0,0) -- ({0.28*cos(90-6*#2)}, {0.28*sin(90-6*#2)}); } } } \begin{document} \begin{tikzpicture}[scale=.8] \draw[->] (0,0) -- (4.8,0) node[right] {$x$}; \draw[->] (0,0) -- (0,4.8) node[above] {$z$}; \draw[->] (0,0) -- (1.8,1.1) node[above] {$y$}; \node at (-0.4,4.3) {$\Sigma$}; \shade[ball color=cyan] (2.7,1.2) circle (0.2); \draw[brown!80!black,line width=2pt,-rhtip] (2.9,1.2)--(3.8,1.2) node[midway,above left] {$\mathbf{u}$}; \pic at (2.5,2.5) {clock={1/10}}; \node[blue!60!black] at (3.35,2.9) {$C(u)$}; \begin{scope}[shift={(5,1)}] \draw[->] (0,0)--(4.5,0) node[right] {$x'$}; \draw[->] (0,0)--(0,4.8) node[above] {$z'$}; \draw[->] (0,0)--(1.8,1.1) node[above] {$y'$}; \node at (-0.4,4.3) {$\Sigma'$}; \draw[magenta,line width=2pt,-rhtip] (0,3.6)--(1.8,3.6) node[midway,above] {$\mathbf{v}$}; \draw[green!60!black,line width=2pt,-rhtip] (2.1,1.3)--(3.7,1.3) node[midway,below] {$\mathbf{u}'$}; \pic at (2.5,2.5) {clock={2/20}}; \node[blue!60!black] at (3.55,2.9) {$C'(u')$}; \end{scope} \end{tikzpicture} \end{document}
- How to custom arrow style with `chemfig` within `\hreac`?by Explorer on July 8, 2026 at 12:23 pm
This post is the follow-up of my previous question and jlab's answer, together with the comment: You can't use custom arrows with \hreac. It's why I redefined an existing one. Here below is the code to show "You can't use custom arrows with \hreac." % https://tex.stackexchange.com/a/764525 % https://tex.stackexchange.com/a/484655 \documentclass{article} \usepackage{chemfig} \ExplSyntaxOn \definearrow3{===}{% \CF_arrowshiftnodes{#3}% \path[allow ~ upside ~ down](\CF_arrowstartnode)--(\CF_arrowendnode)% node[pos=0,sloped,yshift=\CF_arrowdoublesep](\CF_arrowstartnode @u0){}% node[pos=0,sloped,yshift=-\CF_arrowdoublesep](\CF_arrowstartnode @d0){}% node[pos=1,sloped,yshift=\CF_arrowdoublesep](\CF_arrowstartnode @u1){}% node[pos=1,sloped,yshift=-\CF_arrowdoublesep](\CF_arrowstartnode @d1){};% \draw (\CF_arrowstartnode @u0)--(\CF_arrowstartnode @u1);% \draw (\CF_arrowstartnode @d1)--(\CF_arrowstartnode @d0);% \CF_arrowdisplaylabel{#1}{0.5}+\CF_arrowstartnode{#2}{0.5}-\CF_arrowendnode% } \ExplSyntaxOff \begin{document} \schemestart A\arrow{===}B \schemestop \hreac A >{===} B \endhreac \end{document} The custom arrow style === here, was allowed in \schemestart...\schemeend, but NOT within \hreac...\endhreac: \CF_error ...e {Package \CFname \space Error: #1.} l.28 >{===} ? Any suggestion on allowing === with \hreac? IMHO, === was common-seen with stoichiometric equation (see texdoc chemformula, sec 9. Arrows). If possible, if chemfig could provide more user-friendly interface to custom arrow, that would be better.
- Nomenclature in 4 columns in 2 column documentby Hkp on July 8, 2026 at 8:13 am
I am trying to create a two-column nomenclature section in LaTeX. My goal is to have the nomenclature entries fill the first column and then continue automatically in the second column on the same page (similar to the normal behavior of a two-column document). I am currently using the following code: \input{nomenclature} \begin{multicols}{2} \printnomenclature[0.06\textwidth] \end{multicols} The code successfully creates two columns, but the nomenclature only fills the first column. Instead of continuing to the second column on the same page, it starts a new page. I have attached an example showing the issue. Could anyone please suggest how to fix this problem or recommend a better approach? Thank you very much for your help. Here is one one of my example with the same problem: \documentclass[10pt,twocolumn,a4paper]{article} \usepackage{nomencl} \makenomenclature \usepackage{multicol} \begin{document} \title{Test} \author{} \date{} \maketitle % Problematic part \begin{multicols}{2} \printnomenclature[0.06\textwidth] \end{multicols} \nomenclature[Y]{AR}{Aspect Ratio} \nomenclature[Y]{EOC}{Extended Outlet Channel} \nomenclature[Y]{HEx}{Heat Exchanger} %Roman \nomenclature[A]{$a$}{Dimensionless thermal diffusivity} \nomenclature[A]{${A_{cr,d}}$}{As-designed cross-sectional area of channels in the HEx} \nomenclature[A]{${A_{s,d}}$}{As-designed surface area of the channels in the HEx} \nomenclature[A]{${A_{s,Iso,eff.}}$}{Isolation effective surface area} \nomenclature[A]{$A_j$}{Eigenfunction coefficient} \nomenclature[A]{Bi}{Biot number} \nomenclature[A]{$c_{p,m}$}{Specific heat capacity under constant pressure} \nomenclature[A]{$c_{s}$}{Mean adiabatic speed of sound} \nomenclature[A]{$D_h$}{Hydraulic diameter} % Greek \nomenclature[G]{$\alpha$}{mean heat transfer coefficient (Biot number calculations)} \nomenclature[G]{$\alpha_{CWHF}$}{mean heat transfer coefficient with the constant wall heat flux calculation methodology} \nomenclature[G]{$\alpha_{CWT}$}{mean heat transfer coefficient with the constant wall temperature calculation methodology} \nomenclature[G]{$\Delta p$}{pressure drop} \nomenclature[G]{$\Delta\xi$}{standard error of the arithmetic mean} \nomenclature[G]{$\zeta$}{measured quantity} \nomenclature[G]{$\Theta$}{Dimensionless temperature} \nomenclature[G]{$\theta$}{Alternative dimensionless temperature notation (if used)} \nomenclature[G]{$\lambda$}{mean heat conductivity (Biot number calculations)} \nomenclature[G]{$\lambda_m$}{mean heat conductivity} \nomenclature[G]{$\lambda_j$}{Eigenvalue (j-th mode)} \nomenclature[G]{$\mu_m$}{mean dynamic viscosity} \nomenclature[G]{$\Phi_j$}{Eigenfunction (j-th mode)} \nomenclature[G]{$\xi$}{arithmetic mean} \nomenclature[G]{$\rho$}{mean density} \nomenclature[G]{$\sigma$}{standard deviation} % Subscripts \nomenclature[L]{$0$}{Reference (2D thermally fully developed length calculations)} \nomenclature[L]{$avg.$}{Average} \nomenclature[L]{$b$}{Bulk} \nomenclature[L]{$con$}{Contraction} \nomenclature[L]{$expn$}{Expansion} \nomenclature[L]{$h$}{Hydraulic} \nomenclature[L]{$hyd$}{Hydrodynamic} \nomenclature[L]{$i$}{individual data point over time} \nomenclature[L]{$in$}{Inlet} \nomenclature[L]{$j$}{individual measurement position at one axial position} \nomenclature[L]{$m$}{Mean} \nomenclature[L]{$out$}{Outlet} \nomenclature[L]{$w$}{Wall} \nomenclature[L]{$\infty$}{Infinity} \end{document} I also created one additional TEX file to create nomenclature: TEXFile name(without .tex extension)= latexmkrc add_cus_dep('nlo', 'nls', 0, 'makenomenclature'); sub makenomenclature { system("makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\""); }
- How to tweak baseline in the state of chemical substances in chemfig `hreac` environment?by Explorer on July 8, 2026 at 8:11 am
I want to replicate the following: Where (l) for liquid, and (g) for gas, now I have the following code: \documentclass{article} \usepackage[stixtwo]{fontsetup} \usepackage{chemfig} \usepackage{extarrows} \begin{document} \setchemfig{atom sep=1.5em} \hreac \chemfig{CO_2}(g) + \chemfig{[:210]O*3(--(-)-)}(g) % > ${}\xlongequal{\phantom{xxxx}}{}$ % not work with good baseline \chemfig{[:-90]O=*5(-O--(-)-O-)}(l) \endhreac \end{document}
- How to prevent \setmainfont from affecting \mathbf in LaTeX?by Vincent on July 8, 2026 at 8:05 am
I want to set the main text font to Arial using:\setmainfont{Arial} but I don't want the font used by \mathbf to be affected by Arial. I want \mathbf to keep the original default font. How can I achieve this? The following is my code: \documentclass{ctexart} \usepackage{amsmath,amssymb} \setmainfont{Arial} \begin{document} Hello world! with \verb|\setmainfont{Arial}| $\mathbf{N}_{+}$ \end{document} which gives: Noted that \mathbf also changed the N, which was not I was after, I want the Hello world! to be sans serif with Arial, while the \mathbf{N} gives the default bold N symbol with latinmodernmath.otf, the serif one as below:
- Context: How to achieve the exact equivalent of LaTeX's [H] float placement for figures in ConTeXt? [duplicate]by Nasser on July 8, 2026 at 5:54 am
ps. I had help with google AI working on this, but it could not figure how to do it either. I am translating a document from LaTeX to ConTeXt. In LaTeX, I use \begin{figure}[H] (from the float package) to entirely disable floating. It forces the image to stay exactly where it is written, and guarantees that any text written below the figure code stays below it on the page (instead of flowing backward to fill vertical gaps). I am trying to achieve this same behavior in ConTeXt using the export=yes backend, but my text written after the figure keeps jumping above it if the image is pushed to a new page. Here is my context code, and below that the latex code and screen shot showing the difference. context: \setupbackend[export=yes] \setupwhitespace[big] \starttext And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text \startplacefigure[ title={This is the figure caption}, reference={fig:myimage}, location={force,none} %location={here,always} ] \externalfigure[image][width=0.95\textwidth] \stopplacefigure THIS TEXT SHOULD ALWAYS BE BELOW the image above. \stoptext compiling using context B.tex gives Here is the latex compiled with lualatex \documentclass[12pt,oneside]{book} \usepackage{graphicx} \usepackage{float} \begin{document} And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text And this is some text. some random text \begin{figure}[H] \centering \includegraphics[width=0.95\textwidth]{example-image-a} \end{figure} THIS TEXT SHOULD ALWAYS BE BELOW the image above. \end{document} This is the PDF I have tried location={force}, location={here,always}, and location={force,none}, but none of them match the absolute non-floating behavior of [H]. If the image is large, the trailing text still flows backward to the previous page. How can I turn off floating entirely for a \startplacefigure block while preserving the automatic numbering, caption title, and cross-reference hook? TL 2026 on Linux. ps. google AI also asked me to add this to my question: "Mentions export=yes: This is critical because some custom box hacks in ConTeXt bypass the exporter. Telling them you need the XML export ensures they provide a solution that safely preserves your tags for your Python script."
- tex4ht: different math generated for math in array on the HTML than PDFby Nasser on July 8, 2026 at 3:59 am
This MWE \documentclass[12pt,oneside]{book} \usepackage{amsmath} \usepackage{array} \begin{document} \[ \begin {array}{>{\displaystyle }r @{\;} >{\displaystyle }l} y'&=y^{{1}/{3}}\\ y \left (0\right )&=1\\ \end {array} \] \end{document} compiled with lualatex gives But using make4ht -ulm default -a debug B.tex "mathjax,htm" gives The raw html is <!DOCTYPE html> <html lang='en-US' xml:lang='en-US'> <head><title></title> <meta charset='utf-8' /> <meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' /> <meta content='width=device-width,initial-scale=1' name='viewport' /> <link href='B.css' rel='stylesheet' type='text/css' /> <meta content='B.tex' name='src' /> <script>window.MathJax = { tex: { tags: "ams", }, }; </script> <script async='async' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' type='text/javascript'></script> </head><body> <div class='mathjax-block'>\[ \begin {array}{>{\displaystyle }r @{\;} >{\displaystyle }l} y'&=y^{{1}/{3}}\\ y \left (0\right )&=1\\ \end {array} \]</div> </body> </html> Is there a way to fix the formatting in HTML so it is like the PDF (i.e. the spacings around the = is off in mathjax) ps. I know I can change the latex. But I have important reason for using \begin {array}{>{\displaystyle }r @{\;} >{\displaystyle }l} instead of say align or something else (too long to explain here, it depends on context I am using this latex code in). This is only a MWE to show the difference. So I do not want to change the latex code. ps. It should be possible to correct this using new mathjax configuration in my .cfg, but I am not sure how. I think I know of only one person who would know how to do this 🙂 Update Here is screen shot showing difference between fonts used by V 3.5 and V 4.0
- context: image location and the export folder created confusionby Nasser on July 8, 2026 at 12:01 am
I am using context. When I add this line to the .tex file in order to export an XML file: (If I do not add this, no XML will be generated) \setupbackend[export=yes] and say my file is called A.tex, context automatically creates a folder called A-export/ and then puts the created XML file inside this folder. I am using python to convert the XML to HTML. But the problem is that my image folder is now one level above where the XML file is. Here is the tree I have A.tex images/image_1.pdf %this folder has all images A-export/A.xml In my .tex code I have \externalfigure[images/image_1][width=0.75\textwidth] So when I cd to A-export folder and try to convert A.xml to A.htm, all references inside A.xml point to images/image_1 but this is not the correct path now, as this is relative to the parent folder. Question is: Is there a way to tell context NOT to create A-export/ at all, and just put the XML file and any other files it generates using the command content A.tex in same folder? This will make life much simpler. This way I can use my python convert script and not have to manually copy things around or adjust image file paths in XML each time? TL 2026 on Linux
- Cleveref custom cross-reference type gets swallowed in presence of amsmathby Ben Steffan on July 7, 2026 at 5:51 pm
I am trying to solve the same problem as the OP of this question, that is, set up some way to distinguish between equations and diagrams in a document and have it automatically be recognized by cleveref. The top answer there works beautifully... that is, as long as you don't load amsmath. If you do load it, then \cref will start referring to diagrams as equations again. For sake of self-containedness, here's an MWE based on that in the linked answer: \documentclass{article} \usepackage{tikz} \usetikzlibrary{cd} %\usepackage{amsmath} \usepackage{hyperref} \usepackage[noabbrev]{cleveref} \newcounter{diagram} \newenvironment{diagram}[1][]{% \begin{equation}% \begin{tikzcd}[#1]% \setcounter{diagram}{\value{equation}}% \addtocounter{diagram}{-1}% \refstepcounter{diagram}% }{% \end{tikzcd}% \end{equation}% } \crefname{diagram}{diagram}{diagrams} \creflabelformat{diagram}{(#2#1#3)} \begin{document} \begin{diagram}\label{diag:a} A \ar[r] & B \end{diagram} The above is \cref{diag:a}. \end{document} This produces the diagram together with "The above is diagram (1).", as desired. If you uncomment line 5, it instead produces the diagram with "The above is equation (1)." I'd be grateful for a solution with a similar use pattern that works in the presence of amsmath. In particular, I'd like to avoid the triple nesting \begin{diagram} \begin{equation} \begin{tikzcd} % ... \end{tikzcd} \end{equation} \end{diagram} that is common to the other answers at the linked question, if possible.
- What is the correct way to use the longextra style of glossaries-extra with groups?by Tristan Nemoz on July 7, 2026 at 3:12 pm
I'm trying to use the longextra, and more particularly the long-name-desc-loc style of glossaries-extra, but I'm encountering one problem : the table overflows on the margin. MWE: \documentclass[a4paper, 11pt]{book} \usepackage{showframe} % Margins \usepackage[% a4paper,% inner=1.5in,% outer=1in,% top=1in,% bottom=1in% ]{geometry} \usepackage[linktocpage=true]{hyperref} \usepackage[ debug=true,% toc=false, section=section, acronym,% Define acronyms' glossary nomain,% Don't define main glossary record, stylemods=longextra, style=long-name-desc-loc ]{glossaries-extra} \setabbreviationstyle[acronym]{long-short} \newglossary[slg]{symbolslist}{syi}{syg}{Notations used throughout the thesis} \newcommand{\glsparam}[3][]{\glslink[#1]{#2}{\expandafter\csname #2\endcsname{#3}}} \renewcommand*{\glslongextraGroupHeading}[2]{% \glsxtrgetgrouptitle{#2}{\thisgrptitle}% \glslongextraHeaderFmt\thisgrptitle \tabularnewline*\noalign{\vskip\normalbaselineskip}% } %\glslongextraSetWidest{Generic functions} \glsxtrsetgrouptitle{glsgroupset}{Sets} \newcommand{\unitarygls}[1]{\ensuremath{\mathcal{U}_{#1}}} \newglossaryentry{unitarygls}{% user1={unitarygls},% name=\ensuremath{\unitarygls{d}},% description={The unitary group in dimension \(d\)}, type=symbolslist, group={glsgroupset} } \newcommand{\unitary}[1]{\glsparam{unitarygls}{#1}} \glsxtrsetgrouptitle{glsgroupfunctions}{Generic functions} \DeclareMathOperator{\Negl}{negl} \newcommand{\neglgls}[1]{\ensuremath{\Negl\left(#1\right)}} \newglossaryentry{neglgls}{% user1={neglsgls},% name={\neglgls{x}},% description={A negligible function of \(x\). That is, for any polynomial \(P\), we have \(\neglgls{x}<\frac{1}{P(x)}\) for sufficiently large \(x\)}, type=symbolslist, group={glsgroupfunctions} } \newcommand{\negl}[1]{\glsparam{neglgls}{#1}} %% Haar measures \glsxtrsetgrouptitle{glsgrouphaarmeasures}{Haar measures} \newcommand\haarugls[1]{\ensuremath{\mu_{\unitary{#1}}}} \newglossaryentry{haarugls}{% user1={haarugls},% name={\haarugls{d}},% description={The Haar measure on \(\unitary{d}\)}, type=symbolslist, group={glsgrouphaarmeasures} } \newcommand{\haaru}[1]{\glsparam{haarugls}{#1}} \begin{document} \setglossarysection{chapter} \printunsrtglossary[type=symbolslist] \newpage Let us use \unitary{d} here. \end{document} I'm compiling using latexmk with this .latexmkrc file and using LuaLaTeX. If I remove the groups, then the page doesn't overflow, but the page number still doesn't show up. I tried to use glslongextraSetWidest, which makes the table overflow less, but it still doesn't fit exactly right. Am I not using the right compilation method? What am I missing here?
- `hidden` attribute in `\HCode` removed unless given valueby Stephen Powell on July 7, 2026 at 3:00 pm
When I convert this file \documentclass{article} \begin{document} \HCode{<span hidden>}abc\HCode{</span>} \HCode{<span hidden="true">}def\HCode{</span>} \end{document} to HTML using make4ht (MikTeX 24.4), the relevant part of the output is: <span>abc </span> <span hidden='true'>def</span> It seems that the attribute hidden has been stripped from the first <span>, where it has no value, but kept in the second <span>, where it is given a (redundant) value. Is this the intended behavior or a bug? Is it documented somewhere?
- Equation numbers with symbol not colored in the alignat environmentby Sebastiano on July 7, 2026 at 1:18 pm
Why are equation numbers not colored in the alignat environment? Equation numbers are colored correctly in equation (for example), but not in alignat. Is this expected behavior, or am I missing some configuration? Related: An elegant aspect for enumerate the equations of a book \documentclass{book} \usepackage[most,theorems, breakable,skins]{tcolorbox} \usepackage{mathtools,amssymb,amsthm} \usepackage[margin=1in]{geometry} \usepackage[svgnames, dvipsnames, table, x11names]{xcolor} \usepackage{pifont} \definecolor{ocre}{RGB}{243,102,25} %---------------------------------------------------------------------------------- % Change number equations with sections %---------------------------------------------------------------------------------- \usepackage{chngcntr} \counterwithin{equation}{section} \renewcommand{\theequation}{\thesection-\arabic{equation}} \newcommand{\eqnnumsymbol}{\textcolor{ocre}{\reflectbox{\ding{228}}}} \makeatletter \newtagform{bbrackets}% <name> [\textbf]% Internal style {(}% Left bracket {\ifnum\pdfstrcmp{\@currenvir}{equation}=0 \eqnnumsymbol% \else \ifnum\pdfstrcmp{\@currenvir}{align}=0 \eqnnumsymbol% \fi \fi )}% Right bracket \makeatother \usetagform{bbrackets} \newcounter{dummy} \numberwithin{dummy}{section} \theoremstyle{ocrenumbox} \newtheorem{theoremeT}[dummy]{Teorema} \newtheorem{problem}{Problema}[chapter] \newtheorem{exerciseT}{Esercizio}[chapter] \theoremstyle{blacknumex} \newtheorem{exampleT}{Esempio}[chapter] \theoremstyle{blacknumbox} \newtheorem{vocabulary}{Vocabolario}[chapter] \newtheorem{definitionT}{Definizione}[section] \newtheorem{corollaryT}[dummy]{Corollario} \newtheorem{lemmaT}[dummy]{Lemma} \newtheorem{osservationT}[dummy]{Osservazione} \theoremstyle{ocrenum} \newtheorem{propositionT}[dummy]{Proposizione} % Definition box \newtcolorbox{dBox}{ enhanced, breakable, colback=LightGoldenrodYellow, colframe=LightSlateGray, boxrule=0pt, borderline west={4pt}{0pt}{LightSlateGray}, sharp corners, left=5pt, right=5pt, top=2pt, bottom=5pt, before skip=7pt, after skip=7pt } \newenvironment{definition} {\begin{dBox}\begin{definitionT}} {\end{definitionT}\end{dBox}} \begin{document} \begin{definition} Data $y_{0}\in\mathcal{C}^{1}([a,b])$ e $\delta>0$ si definiscono due intorni di $y_{0}$: \begin{alignat}{2} \mathcal{I}_{\delta}^{0}(y_{0}) &=\{y\in\mathcal{C}^{1}([a,b])\colon d_{0}(y,y_{0})<\delta\} &\qquad& \text{\textbf{intorno forte} di $y_{0}$ in $\mathcal{C}^{1}([a,b])$,}\\ \mathcal{I}_{\delta}^{1}(y_{0}) &=\{y\in\mathcal{C}^{1}([a,b])\colon d_{1}(y,y_{0})<\delta\} && \text{\textbf{intorno debole} di $y_{0}$ in $\mathcal{C}^{1}([a,b])$.} \end{alignat} \begin{equation} \mathcal{I}_{\delta}^{0}(y_{0}) \end{equation} \end{definition} \begin{equation} \mathcal{I}_{\delta}^{0}(y_{0}) \end{equation} \end{document} Addendum %------------------------------------------------------------------- % Change number equations with sections with ding %------------------------------------------------------------------- \usepackage{chngcntr} \counterwithin{equation}{section} \newcommand{\eqnnumsymbol}{\textcolor{ocre}{\reflectbox{\ding{228}}}} \newcommand{\eqnformat}{% \ifnum\pdfstrcmp{\@currenvir}{equation}=0 \bfseries\sffamily% \else \ifnum\pdfstrcmp{\@currenvir}{align}=0 \bfseries\sffamily% \else \ifnum\pdfstrcmp{\@currenvir}{multline}=0 \bfseries\sffamily% \else \ifnum\pdfstrcmp{\@currenvir}{gather}=0 \bfseries\sffamily% \else \mdseries \fi\fi\fi\fi} \newtagform{bbrackets}% <name> [\eqnformat]% Internal style {(\bgroup}% {\ifnum\pdfstrcmp{\@currenvir}{equation}=0 \eqnnumsymbol% \else \ifnum\pdfstrcmp{\@currenvir}{align}=0 \eqnnumsymbol% \else \ifnum\pdfstrcmp{\@currenvir}{multline}=0 \eqnnumsymbol% \else \ifnum\pdfstrcmp{\@currenvir}{gather}=0 \eqnnumsymbol% \fi\fi\fi\fi \egroup)}% Right bracket \usetagform{bbrackets}
- Vertically center cells in tabularray [duplicate]by Thomas on July 7, 2026 at 12:19 pm
I'm trying to display three logos for the first slide of a presentation, that have various sizes and dimensions. I'm trying to align them vertically, but I do not manage to set the option of my tblr environment right. I found a silimar question on this forum, but the solution proposed (vertically center the last column only) is not working in my case. The example of this previous topic works well, but when I try to use it with my images, the other cells are no longer vertically centered but aligned at the bottom... Here is a MWE, I my beamer I use \includegraphics instead of the TikZ macros here, but the results is the same. \documentclass{article} \usepackage{tikz} \usepackage{tabularray} \newcommand{\logoA}{\tikz \draw [fill=red!50] (0,0) rectangle (2,1);} \newcommand{\logoB}{\tikz \draw [fill=blue!50!yellow] (0,0) rectangle (3,1);} \newcommand{\logoC}{\tikz \draw [fill=green!50] (0,0) circle (1.2cm);} \begin{document} \begin{tblr}{colspec = {Q[c,m]Q[c,m]Q[c,m]}} \hline \logoA & \logoB & \logoC \\ \hline % hline only for visualize the border of the table \end{tblr} \end{document}
- Cannot use the variable (obtained from shell) in hyperrefby myhsia on July 7, 2026 at 10:37 am
Inspired by \sys_get_shell:nnN seems to strip newlines from shell output, I want to use the variable obtained from the shell in hyperref: both the link and text. But two problems arise: For the text, it returns You can't use `the character t' after \the. <argument> t Then, I have to use \tl_gset:No (Only o-type works! For e-, x-, f- types, none of them work) instead of \tl_gset:Ne. The text appears correctly. For the link: \filename hasn't expanded (since o-type expands only once), and I cannot use e-, x-, or f- type. After I clicked the link in PDF, it returns https://test.xyz//tl_retokenize:n {tmpabc.myhsia} How to make it fully expanded in the first arg of \hyperref? MWE \documentclass{article} \usepackage{hyperref} \begin{filecontents}{tmpabc.myhsia} test \end{filecontents} \begin{document} \ExplSyntaxOn \NewDocumentCommand \Getfilename { m } { \__ctxdoc_shell_hash:e {#1} } \tl_new:N \filename \cs_new_protected:Nn \__ctxdoc_shell_hash:n { \sys_get_shell:nnN { ls ~ *. '#1' } { \cctab_select:N \c_other_cctab \endlinechar=10 } \l_tmpa_tl \tl_set:No \filename { \tl_retokenize:V \l_tmpa_tl } } \cs_generate_variant:Nn \__ctxdoc_shell_hash:n { e } \ExplSyntaxOff \Getfilename {myhsia} \title{zzz} \author{asjkl\thanks{% \href{https://test.xyz/\filename}{test~\filename} }} \maketitle \end{document} EDIT: I've also tried \endlinechar=13/15/12/11... as described in the TeX Book, but none of them work
- `\lastpagenumber` is off by oneby guemax on July 7, 2026 at 7:32 am
I noticed that the \lastpagenumber is always one higher than the actual amount of pages (for example, showing 2 in a one page PDF instead of 1). It does not depend on the number of pages, I have seen this in one, two and three page PDFs. This is my MWE: \setuppagenumbering[location=,] \starttext Current: \pagenumber \\ Last: \lastpagenumber \stoptext This also applies to \totalnumberofpages, \lastpage. My version is 2026.02.19 11:49. Thanks in advance!
- Left indices for atomsby Brasil on July 6, 2026 at 10:03 pm
Is it possible to right align the left upper and lower indices that characterize atomic properties using \chemfig? Example: \chemfig{^{14}_6C} prints out the following: However, I would like to have the following: How to get it? EDIT: adding a MWE \documentclass[border=1mm]{standalone} \usepackage{chemfig} \begin{document} \chemfig{^{14}_6C} \end{document}
- Simplest way to fill format text using a loop, preferably using built in loops?by scribe on July 6, 2026 at 9:29 pm
Here is what I want to do in LaTeX but in Python, data = [ ('path/to/file1', 'Caption for file1.', 'fig:label1'), ('path/to/file2', 'Caption for file2.', 'fig:label2'), ('path/to/file3', 'Caption for file3.', 'fig:label3'), ('path/to/file4', 'Caption for file4.', 'fig:label4') ] for entry in data: print( f'\\begin{{figure}}[htbp]\n\ \\centering\n\ \\includegraphics[width=0.8\\textwidth]{{{entry[0]}}}\n\ \\caption{{{entry[1]}}}\n\ \\label{{{entry[2]}}}\n\\end{{figure}}' ) This will result in the following text over the console, \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{path/to/file1} \caption{Caption for file1.} \label{fig:label1} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{path/to/file2} \caption{Caption for file2.} \label{fig:label2} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{path/to/file3} \caption{Caption for file3.} \label{fig:label3} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{path/to/file4} \caption{Caption for file4.} \label{fig:label4} \end{figure} How do I do this but in LaTeX? I know how to run simple loops like shown here: https://www.dickimaw-books.com/latex/admin/html/docsvlist.shtml \newcommand*{\mylist}{Parrot,Canary,Zebra,Arara,Duck}% \makeatletter \@for\thisitem:=\mylist\do{\thisitem. } \makeatother However, I not sure how to run a loop over a list of lists and index the inner list.
- How to get a dedicated geometry only for the two pages following the page dedicated to the chapter title?by Denis Bitouzé on July 6, 2026 at 4:31 pm
For a LaTeX class I'm currently working on, based on a graphic designer work, I need to change the \chapter command (roughly) as follows: the chapter title has to be typeset on a (odd) dedicated page, with a dedicated geometry, the two following pages, which contain the beginning of the chapter text, have to be typeset with a dedicated geometry, the following pages (until the next chapter) have to be typeset with the default geometry. The following MCE is a (clearly fragile) attempt to do so, which: works as expected with simple paragraphs (Lorem ipsum), doesn't work with a “real” document (\blinddocument), as shown: pages 3-7: the default geometry is restore starting on page 6, versus pages 9-13: the default geometry isn't restore starting on page 12. Do you understand what's going on and how to get the expected result? \documentclass{book} \usepackage{geometry} \usepackage{lipsum} \usepackage{fgruler} \usepackage{afterpage} \usepackage{blindtext} \geometry{ % Default geometry (small margin, just for the example) showframe, paperwidth=200mm, paperheight=250mm, margin=1cm } \renewcommand{\chapter}[1]{% \cleardoublepage \newgeometry{% Dedicated geometry for the chapter title (dedicated) page % (\newgeometry induces clearpage) tmargin=5cm, centering, } \thispagestyle{empty} \begin{center} \Huge\bfseries#1 % Chapter title \end{center} \newgeometry{% Dedicated geometry for the two pages following the chapter % title (dedicated) page tmargin=3cm } \afterpage{% On the following page \afterpage{% On the following page… \aftergroup\restoregeometry % … restore the default geometry } } } \begin{document} \fgruler*[type=in]{alledges} \lipsum[1] \chapter{Test} \lipsum[1-35] \blinddocument \lipsum[1-35] \end{document}
- Creating an A0 Conference poster [closed]by Happy Vilakazi on July 6, 2026 at 2:56 pm
Hi everyone I am trying to recreate the attached poster, but Im not winning...I have tried to code as shown below, please assist: % ============================================================================ % Microscopic Nucleus--Nucleus Interaction Potentials in CDCC Calculations % of Weakly Bound Nuclei % Happy Vilakazi & Prof. N.K. Timol -- UNISA / NRF / SAIP % % A0 portrait poster built with tcolorbox's "poster" library. % Compile with: pdflatex cdcc_poster.tex (run twice) % % IMAGE PLACEHOLDERS: search for "REPLACE" to find where the real logos, % QR code and nuclei density images should be dropped in. % ============================================================================ \documentclass[a0paper,portrait]{a0poster} \usepackage[margin=1.2cm]{geometry} \usepackage[T1]{fontenc} \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} \usepackage{amsmath,amssymb} \usepackage{graphicx} \usepackage{booktabs,multirow,array} \usepackage{enumitem} \usepackage{tikz} \usetikzlibrary{arrows.meta,positioning,decorations.pathreplacing,calc,shadows.blur} \usepackage[poster]{tcolorbox} \usepackage{pifont} % \ding checkmarks \usepackage{ragged2e} % ---------------------------------------------------------------------------- % Colour palette % ---------------------------------------------------------------------------- \definecolor{posterNavy}{RGB}{25,42,94} % section header bars \definecolor{posterNavyDark}{RGB}{16,28,66} \definecolor{posterMaroon}{RGB}{122,20,34} % main title \definecolor{posterRed}{RGB}{198,28,40} % accents / subheadings \definecolor{posterCream}{RGB}{253,249,240} % motivation box fill \definecolor{posterGrey}{RGB}{245,246,248} % page background boxes \definecolor{posterGreen}{RGB}{20,110,60} \definecolor{posterBlue}{RGB}{30,90,170} \definecolor{posterOrange}{RGB}{235,120,20} % ---------------------------------------------------------------------------- % Box styles % ---------------------------------------------------------------------------- \tcbset{ posterblock/.style={ enhanced, colback=white, colframe=posterNavy, boxrule=1.2pt, arc=4mm, fonttitle=\Large\bfseries, coltitle=white, colbacktitle=posterNavy, titlerule=0mm, toptitle=2.5mm, bottomtitle=2.5mm, halign title=center, left=5mm, right=5mm, top=4mm, bottom=4mm, drop fuzzy shadow=black!30 }, redblock/.style={ posterblock, colbacktitle=posterMaroon, colframe=posterMaroon } } % Numbered white circle used in the Objectives box \newcommand{\numcircle}[1]{% \tikz[baseline=-0.6ex]{\node[circle,fill=posterNavy,text=white, inner sep=1.2mm,font=\large\bfseries]{#1};}} % Green check bullet used in Expected Outcomes \newcommand{\greencheck}{\textcolor{posterGreen}{\ding{51}}~} % Placeholder macro: prints a framed grey box until the real image exists. % Usage: \imgplaceholder{width}{height}{label} \newcommand{\imgplaceholder}[3]{% \begin{tikzpicture} \node[draw=black!40, fill=black!8, minimum width=#1, minimum height=#2, align=center, font=\small\color{black!60}] {#3}; \end{tikzpicture}} \pagestyle{empty} \begin{document} \begin{tcbposter}[ poster = {showframe=false, columns=12, rows=100, spacing=8mm}, boxes = {posterblock} ] % ============================================================================ % HEADER % ============================================================================ \posterbox[blankest, interior engine=path, halign=center, valign=center] {name=header, column=1, span=12, row=1, rowspan=7}{% \begin{minipage}{0.16\linewidth}\centering % REPLACE with: \includegraphics[width=\linewidth]{unisa_logo.png} \imgplaceholder{10cm}{4cm}{UNISA logo}\\[4mm] % REPLACE with: \includegraphics[width=0.7\linewidth]{atom_graphic.png} \imgplaceholder{7cm}{7cm}{Atom graphic} \end{minipage}\hfill \begin{minipage}{0.60\linewidth}\centering {\veryHuge\bfseries\color{posterMaroon} Microscopic Nucleus--Nucleus\\[2mm] Interaction Potentials in CDCC\\[2mm] Calculations of Weakly Bound Nuclei\\[8mm]} {\LARGE\bfseries Happy Vilakazi$^{1}$, Prof.\ N.K.\ Timol$^{2}$}\\[5mm] {\Large\itshape\color{posterBlue} $^{1}$Department of Physics, University of South Africa (UNISA), South Africa\\[1mm] $^{2}$University of South Africa (UNISA), South Africa} \end{minipage}\hfill \begin{minipage}{0.20\linewidth}\centering % REPLACE with NRF + SAIP logos side by side \imgplaceholder{6.5cm}{4cm}{NRF logo}\hspace{2mm}% \imgplaceholder{6.5cm}{4cm}{SAIP logo}\\[4mm] % REPLACE with: \includegraphics[width=5cm]{qr_code.png} \imgplaceholder{5cm}{5cm}{QR code}\\[1mm] {\normalsize\bfseries\color{posterRed} SCAN ME for more information} \end{minipage}} % ============================================================================ % ROW 1 : ABSTRACT | MOTIVATION + RESEARCH PROBLEM | OBJECTIVES % ============================================================================ \posterbox[redblock, title=ABSTRACT] {name=abstract, column=1, span=4, row=8, rowspan=15}{% \justifying Weakly bound and halo nuclei exhibit strong coupling to the continuum, making breakup an essential reaction mechanism that significantly influences elastic scattering, fusion and transfer reactions. Traditional calculations often employ phenomenological Woods--Saxon optical potentials, whose parameters depend heavily on experimental elastic-scattering data. This study investigates a microscopic alternative by constructing nucleus--nucleus interaction potentials using the double-folding model with M3Y effective nucleon--nucleon interactions. These potentials are incorporated into the Continuum Discretized Coupled Channels (CDCC) framework to examine their influence on breakup observables. The work aims to improve the predictive capability of reaction models for weakly bound nuclei where experimental data remain scarce.} \posterbox[blankest] {name=midcol, column=5, span=4, row=8, rowspan=15}{% \begin{tcolorbox}[posterblock, title=1.\ \ MOTIVATION, colback=posterCream] \begin{itemize}[leftmargin=8mm, itemsep=1.5mm, label=\textcolor{posterNavy}{\textbullet}] \item Breakup strongly influences nuclear reactions. \item Continuum couplings affect reaction observables. \item Important for exotic nuclei and nuclear astrophysics. \item Necessary for reliable radioactive beam experiments. \end{itemize} \end{tcolorbox} \vspace{4mm} \begin{tcolorbox}[redblock, title=2.\ \ RESEARCH PROBLEM] Current CDCC calculations generally use phenomenological Woods--Saxon potentials which: \begin{itemize}[leftmargin=8mm, itemsep=1mm, label=\textcolor{posterRed}{\textbullet}] \item require elastic-scattering data \item are phenomenological \item have limited predictive capability. \end{itemize} \vspace{2mm} \begin{center} \textbf{\color{posterRed} This study investigates:\\ Can microscopic double-folding potentials\\ improve CDCC predictions?} \end{center} \end{tcolorbox}} \posterbox[title=3.\ \ OBJECTIVES] {name=objectives, column=9, span=4, row=8, rowspan=15}{% \begin{itemize}[leftmargin=14mm, itemsep=5mm, label={}] \item \numcircle{1}\ \ Construct microscopic nucleus--nucleus potentials using the double-folding model. \item \numcircle{2}\ \ Implement M3Y--Reid and M3Y--Paris interactions (density-independent and density-dependent). \item \numcircle{3}\ \ Perform CDCC calculations for weakly bound nuclei. \item \numcircle{4}\ \ Examine continuum--continuum coupling effects. \item \numcircle{5}\ \ Compare calculated observables with experimental data. \end{itemize}} % ============================================================================ % ROW 2 : WEAKLY BOUND & HALO NUCLEI | DOUBLE-FOLDING MODEL % ============================================================================ \posterbox[title=4.\ WEAKLY BOUND \& HALO NUCLEI] {name=halo, column=1, span=3, row=23, rowspan=18}{% \centering {\large\bfseries Examples of nuclei studied}\\[4mm] % REPLACE the nine placeholders below with the density-distribution images \newcommand{\nuc}[1]{\begin{minipage}{0.3\linewidth}\centering \imgplaceholder{5.6cm}{5.6cm}{}\\[-13mm]{\color{white}\bfseries #1}\\[9mm] \end{minipage}} \nuc{$^{6}$Li}\hfill\nuc{$^{7}$Li}\hfill\nuc{$^{8}$B}\\[3mm] \nuc{$^{11}$Be}\hfill\nuc{$^{11}$Li}\hfill\nuc{$^{15}$B}\\[3mm] \nuc{$^{20}$C}\hfill\nuc{$^{30}$F}\hfill\nuc{$^{37}$F}\\[4mm] These nuclei have low separation energies and extended spatial distributions.} \posterbox[title=5.\ DOUBLE-FOLDING MODEL] {name=dfm, column=4, span=9, row=23, rowspan=18}{% \begin{minipage}[t]{0.36\linewidth} {\large\bfseries\color{posterRed} 5.1 Geometry}\\[3mm] \centering \begin{tikzpicture}[scale=1.1, >=Stealth] % projectile (blue) and target (red) density clouds \shade[inner color=posterBlue!80, outer color=posterBlue!10] (0,0) circle (2.3); \shade[inner color=posterRed!80, outer color=posterRed!10] (8,-0.8) circle (2.6); \fill (0,0) circle (2.5pt) node[below left] {\small Projectile $\rho_P(r_1)$}; \fill (8,-0.8) circle (2.5pt) node[below right] {\small Target $\rho_T(r_2)$}; % interaction points \fill[posterRed] (1.4,1.4) circle (2pt); \fill[posterRed] (6.9,0.9) circle (2pt); % vectors \draw[->, thick] (0,0) -- (1.4,1.4) node[midway, left] {$r_1$}; \draw[->, thick] (8,-0.8) -- (6.9,0.9) node[midway, right] {$r_2$}; \draw[->, very thick] (0,0) -- (8,-0.8) node[midway, below] {$R$}; \draw[->, thick, posterRed, dashed] (1.4,1.4) -- (6.9,0.9) node[midway, above] {$s = R + r_2 - r_1$}; \end{tikzpicture} \end{minipage}\hfill \begin{minipage}[t]{0.31\linewidth} {\large\bfseries\color{posterRed} 5.2 Folding Potential}\\[3mm] The nucleus--nucleus potential is written as \begin{equation*} V(R) = V_D(R) + V_E(R) \end{equation*} $V_D$: Direct part \hfill $V_E$: Exchange part\\[3mm] \begin{tcolorbox}[colback=posterGreen!5, colframe=posterGreen, boxrule=1pt, arc=2mm] \begin{equation*} V_D(R) = \iint \rho_P(r_1)\,\rho_T(r_2)\,v_D(s)\, dr_1\, dr_2 \end{equation*} with \quad $s = \left| R + r_2 - r_1 \right|$ \end{tcolorbox} \end{minipage}\hfill \begin{minipage}[t]{0.28\linewidth} {\large\bfseries\color{posterRed} 5.3 M3Y Effective Interaction}\\[3mm] M3Y interaction consists of direct (D) and exchange (E) parts. \begin{align*} v_D(s) &= \sum_{i=1}^{3} G_{Di}\, \frac{e^{-s/r_i}}{s/r_i}\\[2mm] v_E(s) &= \sum_{i=1}^{3} G_{Ei}\, \frac{e^{-s/r_i}}{s/r_i} \end{align*} \vspace{1mm} {\bfseries Two parametrizations:}\\[1mm] \textcolor{posterNavy}{\textbullet}~\textbf{M3Y--Reid}\hspace{8mm} \textcolor{posterNavy}{\textbullet}~\textbf{M3Y--Paris} \end{minipage}} % ============================================================================ % ROW 3 : M3Y PARAMETERS | DENSITY DEPENDENCE | CDCC FRAMEWORK % ============================================================================ \posterbox[title=6.\ \ M3Y PARAMETERS] {name=params, column=1, span=4, row=41, rowspan=17}{% The coefficients of the Reid and Paris M3Y interactions.\\[3mm] \centering \renewcommand{\arraystretch}{1.35} \begin{tabular}{@{}l l r r@{}} \toprule \textbf{Coefficient} & \textbf{Units} & \textbf{Reid} & \textbf{Paris}\\ \midrule $G_{D1}$ & MeV & 7999 & 11062 \\ $G_{D2}$ & MeV & $-2134$ & $-2537.5$ \\ $G_{D3}$ & MeV & 0 & 0 \\ $G_{E1}$ & MeV & 4631.4 & $-1524.25$\\ $G_{E2}$ & MeV & $-1787.1$ & $-518.75$\\ $G_{E3}$ & MeV & $-7.847$ & $-7.847$ \\ $r_1$ & fm & 0.25 & 0.25 \\ $r_2$ & fm & 0.40 & 0.40 \\ $r_3$ & fm & 1.414 & 1.414 \\ $G_{e}$ & MeV\,fm$^3$ & $-276$ & $-592$\\ $k_{v}$ & MeV$^{-1}$ & 0.002 & 0.003 \\ \bottomrule \end{tabular}} \posterbox[title=7.\ DENSITY DEPENDENCE] {name=density, column=5, span=3, row=41, rowspan=17}{% \centering Density-dependent factor:\\[6mm] \begin{tcolorbox}[colback=posterGreen!5, colframe=posterGreen, boxrule=1pt, arc=2mm] \begin{equation*} F(\rho) = C\left[\,1 + \alpha\, e^{-\beta\rho} - \gamma\rho\,\right] \end{equation*} \end{tcolorbox} \vspace{6mm} Accounts for nuclear matter saturation and medium effects.} \posterbox[title=8.\ \ CDCC FRAMEWORK] {name=cdcc, column=8, span=5, row=41, rowspan=17}{% \centering \begin{tikzpicture}[>=Stealth, node distance=8mm, scale=0.95] % weakly bound projectile \node[align=center, font=\small\bfseries] (plab) at (0,3.2) {Weakly Bound\\ Projectile ($a = b + x$)}; \draw[dashed, thick] (0,0.8) circle (1.5); \fill[posterNavy] (-0.5,0.9) circle (10pt) node[left=2mm] {\small $b$}; \fill[posterBlue!70] (0.9,0.5) circle (6pt) node[right=1mm] {\small $x$}; \draw (-0.2,0.8) -- (0.7,0.55) node[midway, above] {\small $x$}; % discretisation \node[align=center, font=\small\bfseries] (dlab) at (5,3.2) {Discretisation of\\ Continuum}; \foreach \y/\l in {2.2/{\varepsilon_1}, 1.7/{\varepsilon_2}, 1.2/{\varepsilon_3}} \draw[thick, posterBlue] (4.2,\y) -- (5.8,\y) node[right] {\small $\l$}; \node at (5,0.6) {$\vdots$}; \draw[thick, posterBlue] (4.2,-0.2) -- (5.8,-0.2) node[right] {\small $\varepsilon_N$}; \draw[decorate, decoration={brace, mirror, amplitude=6pt}] (4.0,-0.5) -- (6.6,-0.5); % coupled channel matrix \node[align=center, font=\small\bfseries] at (9.6,3.2) {Coupled Channels\\ Equations}; \node at (9.6,1.0) {$\begin{bmatrix} U_{11} & \cdots & U_{1N}\\ \vdots & \ddots & \vdots\\ U_{N1} & \cdots & U_{NN} \end{bmatrix}$}; % observables \node[align=center, font=\small\bfseries] at (14,3.2) {Observables}; \node[draw=posterNavy, thick, rounded corners=2mm, align=center, inner sep=3mm, font=\small] (obs) at (14,1.0) {Elastic Scattering\\ Breakup\\ Fusion\\ Transfer}; % arrows \draw[->, very thick] (1.8,0.8) -- (3.6,0.8); \draw[->, very thick] (7.0,0.8) -- (7.9,0.8); \draw[->, very thick] (11.4,0.8) -- (12.4,0.8); % footer \node[font=\small] at (7,-1.6) {Continuum--continuum couplings included}; \end{tikzpicture}} % ============================================================================ % ROW 4 : METHODOLOGY | EXPECTED OUTCOMES % ============================================================================ \posterbox[title=9.\ \ METHODOLOGY] {name=method, column=1, span=8, row=58, rowspan=12}{% \centering \begin{tikzpicture}[>=Stealth, node distance=9mm, mstep/.style={draw=posterNavy, thick, rounded corners=2mm, fill=posterNavy!6, minimum height=2.6cm, minimum width=3.4cm, align=center, font=\small\bfseries, inner sep=2mm}] \node[mstep] (a) {Nuclear\\ Densities\\ (HFB / RMF)}; \node[mstep, right=of a] (b) {Double\\ Folding\\ (DFM)}; \node[mstep, right=of b] (c) {Microscopic\\ Optical\\ Potential}; \node[mstep, right=of c] (d) {FRESCO\\ Code}; \node[mstep, right=of d] (e) {CDCC\\ Calculations}; \node[mstep, right=of e] (f) {Observables\\ (Elastic, Breakup,\\ Fusion)}; \node[mstep, right=of f] (g) {Comparison with\\ Experimental\\ Data}; \foreach \i/\j in {a/b, b/c, c/d, d/e, e/f, f/g} \draw[->, very thick, posterRed] (\i) -- (\j); \end{tikzpicture}} \posterbox[title=10.\ \ EXPECTED OUTCOMES] {name=outcomes, column=9, span=4, row=58, rowspan=12}{% \begin{itemize}[leftmargin=2mm, itemsep=2mm, label={}] \item \greencheck Microscopic optical potentials with reliable physical basis. \item \greencheck Improved description of elastic scattering. \item \greencheck Reliable breakup cross sections and angular distributions. \item \greencheck Better understanding of continuum--continuum effects. \item \greencheck Comparison of M3Y--Reid vs M3Y--Paris interactions. \item \greencheck Improved predictive power for exotic nuclei. \end{itemize}} % ============================================================================ % ROW 5 : SIGNIFICANCE | FUTURE WORK | SOFTWARE & TOOLS % ============================================================================ \posterbox[title=11.\ \ SIGNIFICANCE] {name=signif, column=1, span=4, row=70, rowspan=12}{% \begin{itemize}[leftmargin=8mm, itemsep=2mm, label=\textcolor{posterMaroon}{\textbullet}] \item Improves microscopic reaction modelling. \item Reduces dependence on phenomenological potentials. \item Contributes to drip-line nuclear physics. \item Supports planning of future radioactive ion beam experiments. \item Relevant for nuclear astrophysics (reaction rates). \end{itemize}} \posterbox[title=12.\ \ FUTURE WORK] {name=future, column=5, span=4, row=70, rowspan=12}{% \begin{itemize}[leftmargin=8mm, itemsep=2mm, label=\textcolor{posterNavy}{\textbullet}] \item Include pairing and deformation effects. \item Extend to more halo nuclei and three-body projectiles. \item Investigate continuum--continuum couplings in detail. \item Employ alternative density functionals and interactions. \item Apply to reactions of astrophysical importance. \end{itemize}} \posterbox[title=13.\ \ SOFTWARE \& TOOLS] {name=tools, column=9, span=4, row=70, rowspan=12}{% \centering \newcommand{\tool}[2]{\begin{minipage}[t]{0.23\linewidth}\centering \imgplaceholder{3.6cm}{3.6cm}{}\\[1mm] {\normalsize\bfseries #1}\\[0.5mm]{\small #2}\end{minipage}} % REPLACE the four placeholders with the software icons \tool{FRESCO}{CDCC Code}\hfill \tool{DFM}{Double-Folding Code}\hfill \tool{HFB / RMF}{Nuclear Densities}\hfill \tool{Python / Fortran}{Programming}} % ============================================================================ % ROW 6 : REFERENCES | CONTACT % ============================================================================ \posterbox[title=14.\ \ SELECTED REFERENCES] {name=refs, column=1, span=8, row=82, rowspan=13}{% \small \begin{minipage}[t]{0.49\linewidth} \begin{enumerate}[leftmargin=10mm, itemsep=1.5mm, label={[\arabic*]}] \item N.\ Austern, I.\ J.\ Thompson and M.\ Kamimura, \textit{Phys.\ Rep.}\ \textbf{154}, 125 (1987). \item N.\ Keeley et al., \textit{Prog.\ Part.\ Nucl.\ Phys.}\ \textbf{59}, 579 (2007). \item M.\ Yahiro et al., \textit{Prog.\ Theor.\ Phys.}\ \textbf{120}, 767 (2008). \item G.\ R.\ Satchler and W.\ G.\ Love, \textit{Phys.\ Rep.}\ \textbf{55}, 183 (1979). \item D.\ T.\ Khoa, G.\ R.\ Satchler and W.\ von Oertzen, \textit{Phys.\ Rev.\ C}\ \textbf{56}, 954 (1997). \end{enumerate} \end{minipage}\hfill \begin{minipage}[t]{0.49\linewidth} \begin{enumerate}[leftmargin=10mm, itemsep=1.5mm, label={[\arabic*]}, start=6] \item I.\ J.\ Thompson and F.\ M.\ Nunes, \textit{Nuclear Reactions for Astrophysics}, Cambridge University Press (2009). \item B.\ Mukeru, T.\ Sithole and L.\ Tomio, \textit{J.\ Phys.\ G}\ \textbf{51}, 095103 (2024). \item T.\ Tanihata et al., \textit{Prog.\ Part.\ Nucl.\ Phys.}\ \textbf{68}, 215 (2013). \end{enumerate} \end{minipage}} \posterbox[redblock, title=CONTACT] {name=contact, column=9, span=4, row=82, rowspan=13}{% \begin{itemize}[leftmargin=12mm, itemsep=4mm, label={}] \item \tikz[baseline=-0.5ex]{\node[circle,draw=posterNavy,thick,inner sep=1.5mm] {\scriptsize\bfseries @};}\ \ vilakah@unisa.ac.za \item \tikz[baseline=-0.5ex]{\node[circle,draw=posterNavy,thick,inner sep=1.5mm] {\scriptsize\bfseries T};}\ \ +27 12 429 3111 \item \tikz[baseline=-0.5ex]{\node[circle,draw=posterNavy,thick,inner sep=1.5mm] {\scriptsize\bfseries P};}\ \ Department of Physics, UNISA, Pretoria, South Africa \end{itemize} \vspace{4mm} \hfill{\LARGE\bfseries\color{posterMaroon} Define tomorrow.}} \end{tcbposter} \end{document}
- Heavy bold \mathsf{} in mtpro2by Sebastiano on July 6, 2026 at 2:45 pm
What is the command to use in mtpro2 (here the v. lite https://ctan.org/pkg/mtp2lite) the heavy bold \mathsf{F}? Actually I not remembering this. I have tried with \boldsymbol, \boldmath but nothing. \documentclass{article} \usepackage{amsmath} \usepackage[lite]{mtpro2} \begin{document} $\mathsf{F}\mathbold{\mathsf{F}} \mbf{\mathsf{F}}$ \end{document} I can't use bm package because there is mtpro2. I have seen the pag. 6/7 of the documentation: https://tug.ctan.org/fonts/mtp2lite/texmf/doc/fonts/mtpro2/mtpro2.pdf.
- Why itemize move upward in the second frame? [duplicate]by vi pa on July 6, 2026 at 9:17 am
\documentclass{beamer} \usepackage{tikz} \setbeamertemplate{navigation symbols}{} \begin{document} \begin{frame} \begin{itemize} \item why \item itemize \item move \item upwards \item in the second frame? \end{itemize} \end{frame} \begin{frame} \begin{itemize} \item why \item itemize \item move \item upwards \item in the second frame? \end{itemize} \begin{tikzpicture}[remember picture,overlay] \fill (current page.center) circle[radius=.5cm]; \end{tikzpicture} \end{frame} \end{document} tikzpictures with overlay should have no bounding box. Why in the second frame the same itemize of the first frame move upward?
- Placing two TikZ figures side by side without scaling or affecting page geometry [duplicate]by Sebastiano on July 6, 2026 at 8:35 am
I am trying to place two TikZ figures side-by-side , but I am running into layout issues. In my document structure, I cannot use \resizebox or scale the figures, because there are too many elements that would conflict with my existing layout and typography constraints. For the same reason, I also want to avoid changing the x and y unit scales inside the TikZ pictures. My goal is to keep both figures at their natural size and still arrange them horizontally on the same line, respecting the page geometry. However, despite trying different approaches, the result is not satisfactory: the figures either overlap, break the margins, or force unwanted scaling. Is there a reliable way to force two TikZ pictures to stay side-by-side without resizing them and while respecting the page layout constraints? \documentclass{article} \usepackage[top=2.5cm,bottom=2.2cm, left=3.2cm,right=1.5cm,headsep=10pt,a4paper]{geometry} \usepackage{graphicx} \usepackage{subcaption} \usepackage{tikz} \usetikzlibrary{arrows.meta} \tikzset{ rhtip/.tip={ Triangle[ fill=white, line width=0.8pt, length=8pt, width=8pt ] } } \begin{document} \begin{figure}[htbp] \centering \begin{subfigure}{0.48\textwidth} \centering \begin{tikzpicture}[x=0.6cm,y=0.6cm, font=\large] \draw[->] (0,0)--(6,0) node[right]{$x$}; \draw[->] (0,0)--(0,4) node[above]{$y$}; \node[below left] at (0,0){$O$}; \node[draw,circle] at (-1,3){$\Sigma$}; \begin{scope}[shift={(1.1,1.1)}] \draw[->] (0,0)--(6,0) node[right]{$x'$}; \draw[->] (0,0)--(0,4) node[above]{$y'$}; \node[below right] at (0,0){$O'$}; \node[draw,circle] at (1.5,3){$\Sigma'$}; \end{scope} \draw[-rhtip, line width=2pt, red!80!black] (6.2,3)--(7.5,3); \node[below] at (6.85,2.8){$\mathbf{v}$}; \end{tikzpicture} \caption{$\Sigma'$ in moto rispetto a $\Sigma$} \end{subfigure} \begin{subfigure}{0.48\textwidth} \centering \begin{tikzpicture}[x=0.6cm,y=0.6cm, font=\large] \draw[->] (0,0)--(6,0) node[right]{$x$}; \draw[->] (0,0)--(0,4) node[above]{$y$}; \node[below left] at (0,0){$O$}; \node[draw,circle] at (-1,3){$\Sigma$}; \begin{scope}[shift={(1.1,1.1)}] \draw[->] (0,0)--(6,0) node[right]{$x'$}; \draw[->] (0,0)--(0,4) node[above]{$y'$}; \node[below right] at (0,0){$O'$}; \node[draw,circle] at (1.5,3){$\Sigma'$}; \end{scope} \draw[-rhtip, line width=2pt, orange!80!black] (7.5,3)--(6.2,3); \node[above] at (6.85,3.1){$-\mathbf{v}$}; \end{tikzpicture} \caption{VelocitĂ relativa opposta} \end{subfigure} \caption{Due sistemi di riferimento inerziali in moto relativo rettilineo uniforme.} \end{figure} \end{document}
- When we tessellate a surface by triangulating a Cartesian grid of points, the result neglects important features in nontrivial illustrationsby Jasper on July 6, 2026 at 12:36 am
I want to plot the surface in this image: This "MWE" does not run, though it conveys what I'm trying to do. \documentclass[tikz,border=1cm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture}[ declare function={ f(\x,\y)=sqrt((\x/2)^2+(\y)^2-1); g(\x,\y)=f(\x,\y)/abs(f(\x,\y)); h(\x,\y)=1/(((\x-10)^2+(\y-2)^2)^2+1); i(\x,\y)=g(\x,\y)+h(\x+\y); j(\x,\y)=i(\x,\y)+1/((\x)^2+(\y+10)^2-1); } ] \begin{axis}[ hide axis, view={-30}{30}, scale=3, unit vector ratio=1 1 1 ] \addplot3[ surf, color=black, opacity=0.2, samples=10, samples y=10, domain = 1:15, domain y = 0:\fpeval{2*pi}, z buffer=sort, ] ( {x}, {y}, {j(x,y)} ); \end{axis} \end{tikzpicture} \end{document} When we tessellate a surface domain by taking a Cartesian product of sequences along both dimensions and triangulating the resulting grid, the result will ultimately neglect important features in nontrivial illustrations. In this particular case, there are small regions of exceptionally high detail, and a nonlinear ridge, while most of the surface is undetailed. Why in the world would we waste so many triangles on those regions, slowing down everything, when we could instead strategically sample the domain, and Delaunay triangulate? This questions seeks that. I want, and have been studying for some time, a domain tessellation technique which does this: samples along the boundaries of the domain like sewing along a seam. We would then be able to use a post triangulation filter to remove any simplices which are outsite this seam. samples point singularities explitly, as well as along singularity curves as though they were a seam. ALSO samples a "seam" around asymptotic regions, so that a boolean filter can remove post-triangulation simplices which are within the asymptotic region. This "seam" should be dependent on the strength of the asymptote, in terms of how closely we sample it. AND very importantly, it will strategically sample according to curvature, so that nondetailed regions aren't wastefully samples, allowing us to logistically sample regions of higher curvature. Samples important calculus based points, curves, and regions, such as maxima and minima (including when they are along ridges, as in my example), and inflection ploints (including the same), etc. In my view, this is one of the biggest problems facing modern mathematics illustration as a practise.
- Custom enumerate items using item optionsby profj on July 5, 2026 at 9:04 pm
I'm trying to customize item labels within an enumerate list on the fly, using the item options. However, I don't fully understand how it works. The code below produces unexpected results, and different patterns emerge for the first layer of the list and the second layer of the list. I'm trying to do this without using the enumitem package, if possible. I know how to manually edit the items, but want the counter to be more automated in the inner list. Here is a minimum working example: \documentclass{article} \begin{document} \begin{enumerate} \item[\theenumi.] Why is this 0, instead of 1? \begin{enumerate} \item[\theenumii.] Why is this blank? \item[\theenumii.] Why is this blank? \item[\theenumii.] Why is this blank? \end{enumerate} \item And this adds one to the counter \item And this adds one to the counter \end{enumerate} \begin{enumerate} \setcounter{enumi}{1} \item[\theenumi.] Now this is 1, as expected. \begin{enumerate} \setcounter{enumii}{1} \item[\theenumii.] And this is a, as expected. \item[\theenumii.] Why doesn't this add one to the counter? \item[\theenumii.] Why doesn't this add one to the counter? \end{enumerate} \item And why does this still add one to the counter? \item And why does this still add one to the counter? \end{enumerate} \end{document} Here's the output:
- PDF Type 6 shadings: How to properly build them using TeX?by Jasper Habicht on July 5, 2026 at 8:19 pm
This question might be off-topic, but the reason I ask it here is that I want to eventually create a module for a LaTeX package to enable the use of conic gradients via PDF Type 6 shadings which are also known as Coons Patch Mash Tiling. Also, please do not read this as "fix my issue for me" question. Rather, I appreciate any pointers to where I could be wrong. I understand that this topic is highly specialised, so I don't expect anybody to actually fix it completely or even partially. Now, as far as I understand, such shadings are essentially encoded as object stream in a PDF with the following object structure as basis (of course the object number and the contents of the stream and its length are different in a real document): 1 0 obj << /ShadingType 6 /ColorSpace /DeviceRGB /BitsPerCoordinate 16 /BitsPerComponent 8 /BitsPerFlag 2 /Decode [ 0 100 0 100 0 1 0 1 0 1 ] /Length 0 >> stream 00... endstream The stream defines the patches. Each path can be thought of a (distorted) rectangle of which the four sides are described as cubic Bézier curves. Therefore, each of the four edges of the patch has four control points, which means that there are twelve such points needed to describe a patch. Also, each corner of the patch is assigned a color. Now, in a mesh, the patches are attached to each other so that they share a common edge. To identify the shared edge, a flag is added to each patch which describes which edge is shared. A 0 flag identifies the initial patch, a 1 flag means that the right edge of the previous patch is used as the left edge of the current patch. There are more flags, but we only need these two for this case. If edges are shared, the relevant control points and colors are omitted in the description of the patch in the stream. So, if we take the sizes as described by /BitsPerCoordinate, \BitsPerComponent and /BitsPerFlag (let us assume 16, 8, and 2 respectively, also let us assume RGB), we get the following binary representation of the a patch with flag 0: Flag: 2 bits Points: 12 points, 16 bits for the x coordinate, 16 bits for the y coordinate Colors: 4 colors, 8 bits for the red part, 8 bits for the green part, 8 bits for the blue part For a patch with flag 1, we get: Flag: 2 bits Points: 8 points, 16 bits for the x coordinate, 16 bits for the y coordinate Colors: 2 colors, 8 bits for the red part, 8 bits for the green part, 8 bits for the blue part Maybe I got something wrong here already, which might explain why things don't work. Anyways, my question is why the following does not result in the desired output. My idea for a conic shading was to create patches that look like slices of a pie. Like this: I first tried without the rounded edge and just set the control points to be equal to the relevant corner, hoping that this would result in a triangle-shaped rectangle. So my patches would adhere to the following logic: Patch 1: Flag = 0 Points: (50, 50) (50, 50) (100, 50) (100, 50) (100, 50) (50, 100) (50, 100) (50, 100) (50, 50) (50, 50) (50, 50) (50, 50) Colors: (255,0,0) (191,0,64) (191,0,64) (255,0,0) Patch 2: Flag = 1 Points: (50, 100) (0, 50) (0, 50) (0, 50) (50, 50) (50, 50) (50, 50) (50, 50) Colors: (128,0,128) (128,0,128) Patch 3: Flag = 1 Points: (0, 50) (50, 0) (50, 0) (50, 0) (50, 50) (50, 50) (50, 50) (50, 50) Colors: (64,0,191) (64,0,191) Patch 4: Flag = 1 Points (50, 0) (100, 50) (100, 50) (100, 50) (50, 50) (50, 50) (50, 50) (50, 50) Colors: (0,0,255) (0,0,255) But, the output is totally not what it should look like although I think that the stream is correct. Acrobat also complains about something being wrong. It looks like this: 21 0 obj << /ShadingType 6 /ColorSpace /DeviceRGB /BitsPerCoordinate 16 /BitsPerComponent 8 /BitsPerFlag 2 /Decode [ 0 100 0 100 0 1 0 1 0 1 ] /Length 350 >> stream 20002000200020003FFFE0003FFFE0003FFFE00020003FFFE0003FFFE0003FFFE00020002000200020002000200020003FC0002FC0102FC0103FC00018000FFFF00008000000080000000800080008000800080008000800080008000800080800080400020002000000020000000200000002000200020002000200020002000200010002FD0002FD80000000FFFF8000FFFF8000FFFF8000800080008000800080008000800080000000FF0000FF endstream endobj So, my question is: What am I missing? Where is the probably simple but basic problem? The following is an MWE intended for testing. It contains a few helper funcitons and the relevant functions from the package where the code eventually is supposed to be included. It should work with PDFLaTeX and LuaLaTeX: \DocumentMetadata{uncompress} \documentclass[]{article} \usepackage{l3draw} \ExplSyntaxOn % a few helper functions \cs_new:Npn \__hawkdraw_tuple_use_i:w ( #1 , #2 ) {#1} \cs_new:Npn \hawkdraw_tuple_use_i:n #1 { \fp_to_dim:n { \exp_last_unbraced:Ne \__hawkdraw_tuple_use_i:w { \fp_eval:n {#1} } } } \cs_new:Npn \__hawkdraw_tuple_use_ii:w ( #1 , #2 ) {#2} \cs_new:Npn \hawkdraw_tuple_use_ii:n #1 { \fp_to_dim:n { \exp_last_unbraced:Ne \__hawkdraw_tuple_use_ii:w { \fp_eval:n {#1} } } } \cs_new_protected:Npn \hawkdraw_support_pdfliteral:n #1 { \sys_if_engine_luatex:TF { \tex_pdfextension:D literal {#1} } { \tex_pdfliteral:D {#1} } } \cs_new_protected:Npn \hawkdraw_support_pdfxform:nnN #1#2#3 { \tex_immediate:D \tex_pdfxform:D \tl_if_empty:nF {#1} { attr {#1} } resources {#2} #3 } \cs_new_protected:Npn \hawkdraw_support_pdflastxform: { \tex_pdflastxform:D } \cs_new_protected:Npn \hawkdraw_support_pdfrefxform:N #1 { \tex_pdfrefxform:D \int_use:N #1 \scan_stop: } \cs_generate_variant:Nn \hawkdraw_support_pdfrefxform:N { c } % === % relevant code from the package \box_new:N \l__hawkdraw_shading_object_box \cs_new_protected:Npn \hawkdraw_shading_set:nnn #1#2#3 { \hbox_set_to_wd:Nnn \l__hawkdraw_shading_object_box { 100bp } { \vbox_to_ht:nn { 100bp } { \skip_vertical:n { 0pt plus 1fil } \hawkdraw_support_pdfliteral:n { /Sh ~ sh } } \skip_horizontal:n { 0pt plus 1fil } } \pdf_object_new:n { hawkdraw_shading_ #1 } \tl_if_empty:nTF {#3} { \pdf_object_write:nne { hawkdraw_shading_ #1 } { dict } { #2 } } { \pdf_object_write:nne { hawkdraw_shading_ #1 } { stream } { {#2} {#3} } } \hawkdraw_support_pdfxform:nnN { } { /Shading ~ << ~ /Sh ~ \pdf_object_ref:n { hawkdraw_shading_ #1 } ~ >> } \l__hawkdraw_shading_object_box \int_const:cn { c__hawkdraw_shading_ #1 _int } { \hawkdraw_support_pdflastxform: } } \cs_new_protected:Npn \hawkdraw_shading_use:n #1 { \hawkdraw_support_pdfrefxform:c { c__hawkdraw_shading_ #1 _int } } % === \cs_new:Npn \hawkdraw_convert_bin_to_hex:n #1 { \__hawkdraw_convert_bin_to_hex_aux:w #1 \q_stop } \cs_generate_variant:Nn \hawkdraw_convert_bin_to_hex:n { e } \cs_new:Npn \__hawkdraw_convert_bin_to_hex_aux:w #1 \q_stop { \int_compare:nNnF { \tl_count:n {#1} } < { 4 } { \__hawkdraw_convert_bin_to_hex_aux:NNNNw #1 \q_stop } } \cs_new:Npn \__hawkdraw_convert_bin_to_hex_aux:NNNNw #1#2#3#4#5 \q_stop { \int_format:nn { \int_from_bin:n {#1#2#3#4} } { 1X } \__hawkdraw_convert_bin_to_hex_aux:w #5 \q_stop } % === \cs_generate_variant:Nn \color_export:nnN { e } \cs_generate_variant:Nn \str_set_convert:Nnnn { Ne } \seq_new:N \l__hawkdraw_shading_conic_colors_seq \seq_new:N \l__hawkdraw_shading_conic_colors_bin_seq \cs_new_protected:Npn \hawkdraw_shading_conic_stream:N #1 { \tl_set:Ne #1 { \hawkdraw_convert_bin_to_hex:e { \seq_map_indexed_function:NN \l__hawkdraw_shading_conic_colors_bin_seq \__hawkdraw_shading_conic_stream_aux:nn } } } \cs_new:Npn \__hawkdraw_shading_conic_stream_aux:nn #1#2 { % skip first entry representing color at first edge \int_compare:nNnF {#1} = { 1 } { % flag (2 bit) \int_format:nn { \int_compare:nNnTF {#1} = { 2 } { 0 } { 1 } } { 0>2b } % four patches for each of the n colors % patch is pie segment going from 0 to 360 / ( n * 4 ) % points of first patch (12 points, 2 x 16 bits each \int_compare:nNnT {#1} = { 2 } { \prg_replicate:nn { 2 } { \__hawkdraw_shading_conic_stream_point_polar:nn { 0 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 2 ) } } \prg_replicate:nn { 2 } { \__hawkdraw_shading_conic_stream_point_polar:nn { 1 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 2 ) } } } \__hawkdraw_shading_conic_stream_point_polar:nn { 1 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 2 ) } \prg_replicate:nn { 3 } { \__hawkdraw_shading_conic_stream_point_polar:nn { 1 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 1 ) } } \prg_replicate:nn { 3 } { \__hawkdraw_shading_conic_stream_point_polar:nn { 0 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 1 ) } } \__hawkdraw_shading_conic_stream_point_polar:nn { 0 } { 360 / ( \seq_count:N \l__hawkdraw_shading_conic_colors_bin_seq - 1 ) * ( #1 - 2 ) } % colors (4 colors, 3 x 8 bits each) \int_compare:nNnT {#1} = { 2 } { \seq_item:Nn \l__hawkdraw_shading_conic_colors_bin_seq { #1 - 1 } } #2 #2 \int_compare:nNnT {#1} = { 2 } { \seq_item:Nn \l__hawkdraw_shading_conic_colors_bin_seq { #1 - 1 } } } } \cs_new:Npn \__hawkdraw_shading_conic_stream_point_polar:nn #1#2 { % get from point polar % normalize to 65535 \int_format:nn { \fp_to_int:n { \hawkdraw_tuple_use_i:n { ( 50bp , 50bp ) + ( \draw_point_polar:nn { #1 * 50bp } {#2} ) } / 100bp * 65535 } } { 0>16b } \int_format:nn { \fp_to_int:n { \hawkdraw_tuple_use_ii:n { ( 50bp , 50bp ) + ( \draw_point_polar:nn { #1 * 50bp } {#2} ) } / 100bp * 65535 } } { 0>16b } } \cs_new_protected:Npn \__hawkdraw_shading_color_set_bin_value:n #1 { \seq_put_right:Ne \l__hawkdraw_shading_conic_colors_bin_seq { \int_format:nn { \int_from_hex:n {#1} } { 0>24b } } } \cs_generate_variant:Nn \__hawkdraw_shading_color_set_bin_value:n { V } % start , % start!25!mid , start!50!mid , start!75!mid , mid , % mid!25!end , mid!50!end , mid!75!end , end \cs_new_protected:Npn \hawkdraw_shading_color_set_bin_values:n #1 { \seq_clear:N \l__hawkdraw_shading_conic_colors_bin_seq \seq_set_from_clist:Nn \l__hawkdraw_shading_conic_colors_seq {#1} \seq_map_indexed_inline:Nn \l__hawkdraw_shading_conic_colors_seq { \int_compare:nNnTF {##1} = { 1 } { \color_export:enN { \seq_item:Nn \l__hawkdraw_shading_conic_colors_seq { 1 } } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl } { \color_export:enN { \seq_item:Nn \l__hawkdraw_shading_conic_colors_seq { ##1 - 1 } ! 75 ! ##2 } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl \color_export:enN { \seq_item:Nn \l__hawkdraw_shading_conic_colors_seq { ##1 - 1 } ! 50 ! ##2 } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl \color_export:enN { \seq_item:Nn \l__hawkdraw_shading_conic_colors_seq { ##1 - 1 } ! 25 ! ##2 } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl \color_export:enN { ##2 } { HTML } \l__hawkdraw_shading_color_value_tmp_tl \__hawkdraw_shading_color_set_bin_value:V \l__hawkdraw_shading_color_value_tmp_tl } } } \cs_new_protected:Npn \hawkdraw_shading_conic:n #1 { \int_if_exist:cF { c__hawkdraw_shading_ conic . #1 _int } { \hawkdraw_shading_color_set_bin_values:n {#1} \hawkdraw_shading_conic_stream:N \l_tmpa_tl \hawkdraw_shading_set:nnn { conic . #1 } { /ShadingType ~ 6 ~ /ColorSpace ~ /DeviceRGB ~ /BitsPerCoordinate ~ 16 ~ /BitsPerComponent ~ 8 ~ /BitsPerFlag ~ 2 ~ /Decode ~ [ ~ 0 ~ 100 ~ % x 0 ~ 100 ~ % y 0 ~ 1 ~ % R 0 ~ 1 ~ % G 0 ~ 1 ~ % B ] ~ } { \tl_use:N \l_tmpa_tl } } } \ExplSyntaxOff \begin{document} \ExplSyntaxOn \hawkdraw_shading_conic:n { red , blue } \hbox_set:Nn \l_tmpa_box { \hawkdraw_shading_use:n { conic.red,blue } } \box_use:N \l_tmpa_box \ExplSyntaxOff \end{document}
- French text in superscriptby Phil8544 on July 5, 2026 at 4:08 pm
What package I have to use if I want to get French text in superscript? I want to write "57ème croche sur 92" with the term "ème" in superscript.
- How can I format the total value of a counter (as printed by `total` from totcount)?by modallyFragile on July 5, 2026 at 12:36 pm
I use countwords to count the number of words in some LaTeX documents. The package counts words into a standard LaTeX counter. I then use totcount to display this wordcount at the beginning of the document. The number is generally in the thousands. Totcount provides a single macro \total{<counter>} for printing the eventual value of a counter, but it doesn't do any intelligent formatting, like dividing thousands with a comma/space (and fair enough -- very few situations call for counters in the thousands!). I would like to print the eventual value of the counter at the beginning of the document in a nicely formatted way. How can I do this? Based on other discussions of formatting counters, I have tried using numprint and siunitx, but neither of these work -- MWEs below. TIA! Failure #1 numprint \documentclass{article} \title{Foobar} % For counting words \usepackage{countwords} \newcounter{words} \setcounter{words}{0} % For printing final value \usepackage{totcount} \regtotcounter{words} % For dummy text \usepackage{lipsum} \usepackage{numprint} \begin{document} \maketitle % Prints `1112' (no comma) \total{words} % `Should' print `1,112', but gives an error. \numprint{\total{words}} \countwordsstart{words} \lipsum[1-12] \countwordsstop{words} \end{document} I get an error: ./test.tex:27: Package numprint Error: Invalid characters `\def ' in mandatory argument of (numprint) \numprint. Allowed are (numprint) `0123456789.,eEdD+-\pm '. Failure #2 siunitx \documentclass{article} \title{Foobar} % For counting words \usepackage{countwords} \newcounter{words} \setcounter{words}{0} % For printing final value \usepackage{totcount} \regtotcounter{words} % For dummy text \usepackage{lipsum} \usepackage{siunitx} \begin{document} \maketitle % Prints `1112' (no comma) \total{words} % `Should' print `1,112', but gives an error. \num[group-separator={,}]{\total{words}} \countwordsstart{words} \lipsum[1-12] \countwordsstop{words} \end{document} I get an error: ./test.tex:27: Package siunitx Error: Invalid number '\def \c@words@totc {\c@words@totc (siunitx) }1112'. I also looked at fmtcount but found it doesn't cover thousands separators.
- Spacing of `\hline`by zgrizz on July 4, 2026 at 10:46 pm
I'm wondering why columns in tabular seem to not add space but \hline does. Is there a way to make it so that everything overlaps? \documentclass{article} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \setlength{\tabcolsep}{0pt} \begin{document} Line\\ Line \vspace*{-2\baselineskip} \begin{tabular}{|l|} \hline Line\\ \hline Line\\ \hline \end{tabular}%\par\prevdepth=\dp\strutbox \vspace*{-2\baselineskip} Line\\ Line \end{document} EDIT: Thank you to all who answered. Using David Carlisle's comment, I now have the below: \documentclass{article} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \setlength{\tabcolsep}{0pt} \setlength{\lineskip}{0pt} \begin{document} \def\newhline{% \noalign{\kern-.5\arrayrulewidth}\hline\noalign{\kern-.5\arrayrulewidth}% } Line\\ Line \vspace*{-2\baselineskip} \begin{tabular}[t]{|l|} \newhline % <- causing problems Line\\ \newhline Line\\ \newhline \end{tabular}\par\prevdepth=\dp\strutbox % for overlap \vspace*{-2\baselineskip} Line\\ Line \end{document} Seems the top \newhline prevents everything from lining up.
- Adjusting a tikz pictureby Joao Paulo Guardieiro on July 4, 2026 at 1:59 pm
I want to draw the graph of z = x^2 + y^2, and I am using tikz for that. I used the following command: \begin{tikzpicture}[ x={(1cm,0cm)}, y={(-0.6cm,-0.35cm)}, z={(0cm,1cm)}, line join=round, line cap=round, scale=1, ] % Axes \draw[->] (0,0,0) -- (2,0,0); \draw[->] (0,0,0) -- (0,2.5,0); \draw[->] (0,0,0) -- (0,0,4); % Graph \draw[thick,smooth,variable=\t,domain=-1.8:1.8] plot ({\t},{0},{\t*\t}); % Circle that gives a 3d impression \draw[thick,smooth,variable=\t,domain=0:360] plot ({1.8*sin(\t)},{1.8*cos(\t)},{3.24}); \end{tikzpicture} However, the circle does not "fit" the graph: How can I adjust this?
- braces in delimited argumentsby user2026844 on July 1, 2026 at 3:10 pm
I have a complicated environment that scans for presence of tokens and "patches" them by adding some tokens before. I implemented this using macros with arguments delimited by the tokens I want to patch. Once the patching is done, I'd like to respect the token stream as much as possible (i.e. make it as close to the original as possible). However, whenever the text between the delimiters is exactly of the form "{ text }", the braces are sadly removed. I'd like to find a way to avoid this behavior. I had a look here but I'm afraid this will change the token stream too much, so I'm wondering if there is a simpler fix. Edit: Better MWE based on David's reply. Goal: Implement such a patch command so that the token stream after \patch is as close as possible (identical?) to the original one. \documentclass{article} \def\Z{Z} % Does not work with first def of \A \def\patch\A#1\Z{patched:\A#1\Z} % Does not work with second def of \A \def\patch\A#1{\xpatch\A{{#1}}} \def\xpatch\A#1\Z{patched:\A#1\Z} \begin{document} First def of A :\def\A#1{(A #1)} \A{arg} \Z \patch\A{arg} \Z \A{arg}\Z \patch\A{arg}\Z Second def of A:\def\A[#1]{(A #1)} \A[arg] \Z \patch\A[arg] \Z \A[arg]\Z \patch\A[arg]\Z \end{document} Output (first def of \A) (A arg) Z patched:(A arg) Z (A arg)Z patched:(A a)rgZ Thanks a lot for your help!