Hot
- combine column in tcolorboxby 조문수 on February 7, 2026 at 5:09 am
I want to merge columns using the side-by-side rule in tcolorbox. How can I create something like the image below using tcolorbox? | contents -1 | figure | | contents -2 |
- Test if item to be written is at the top of the page?by Gary on February 7, 2026 at 4:38 am
Is it possible to test within a before option command whether or not the item to be written is at the top of the page? For example, I tried in \setuphead before={\doiftopofpageelse{...true...}{...false...}} and it is always true even when the head item is not being written at the top of the page. Thank you. For example, every seciton below show "top of the page". Why? \setuplayout[height=4.7in,width=4in] \setuphead[section][ conversion=Romannumerals, sectionstopper={.}, align=center, before={\blank[0mm]}, beforesection={\doiftopofpageelse{\hrule{top of page}}{\hrule{not top of page}}}, after={\blank[5mm,]}, style={\tfa\it}, ] \starttext \showframe \startsection[title={Title One}] A paragraph of the to fill the line to observe the spacing. \stopsection \startsection[title={Title Two}] \input{ward} \stopsection \startsection[title={Title Three}] A paragraph of the to fill the line to observe the spacing. \stopsection \stoptext
- biblatex French "pp." and "dash" issue when writing page rangeby Jinwen on February 7, 2026 at 2:26 am
Not sure if this is the correct way to write things in French, but I usually prefer format like pp.~1--10 for page ranges. Based on the solutions to this question on pp. and this question on dash, now I have the following configuration: \DefineBibliographyStrings{french}{% pages = {pp\adddot}, } \DefineBibliographyExtras{french}{% \protected\def\bibrangedash{% --\penalty\hyphenpenalty}} which seems to work as expected. May I ask if it is indeed the "right" way to achieve this nowadays? Below is a MWE: \documentclass{article} \usepackage[french]{babel} \usepackage{biblatex} \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @article{dash, author = {Dashing, Walter Very}, year = {1942}, title = {Dashing Past a Hyphen}, journaltitle = {Life}, volume = {42}, number = {42}, pages = {123--321}, } \end{filecontents} \addbibresource{\jobname.bib} \DefineBibliographyStrings{french}{% pages = {pp\adddot}, } \DefineBibliographyExtras{french}{% \protected\def\bibrangedash{% --\penalty\hyphenpenalty}} \begin{document} \cite[142--242]{dash}. \printbibliography \end{document}
- Displaying equations involving TikZ graphics on a WordPress site with MathJaxby abcdf on February 7, 2026 at 12:09 am
I am writing a website using WordPress with MathJax. In my LaTeX documents, I use TikZ to construct equations that include graphics embedded in the math (for example, superscripts or subscripts connected by lines drawn with TikZ). I would like to display equations of this kind on my website as well. An example of the desired output is shown in the image below. While this works fine in LaTeX, I do not know how to achieve a similar result on a website using MathJax (or related tools such as tikzjax). Is this possible in principle? If so, what would be the recommended approach? Any help or pointers would be greatly appreciated. The following code produces the equation shown in the image in a LaTeX environment using TikZ. \documentclass[a4paper,15pt,riqno]{bxjsreport}%{bxjsarticle} \usepackage[ipa]{zxjafont} \usepackage{tikz-cd} \usetikzlibrary{calc} \usepackage{amsmath} \usetikzlibrary{tikzmark} \begin{document} \begin{align} a^{\tikzmarknode{X}{x}} +b^{\tikzmarknode{Y}{y}} =c^{\tikzmarknode{Z}{z}} \end{align} \tikz[remember picture,overlay]{ \coordinate (Xp) at ($(X.north)+(0,0.3ex)$); \coordinate (Yp) at ($(Y.north)+(0,0.3ex)$); \coordinate (Zp) at ($(Z.north)+(0,0.3ex)$); \path let \p1 = (Xp), \p2 = (Yp), \p3 = (Zp) in coordinate (TopX) at (\x1,{max(\y1,\y2,\y3)+2ex}) coordinate (TopY) at (\x2,{max(\y1,\y2,\y3)+2ex}) coordinate (TopZ) at (\x3,{max(\y1,\y2,\y3)+2ex}); \draw (Xp) -- (TopX); \draw (Yp) -- (TopY); \draw (Zp) -- (TopZ); \draw (TopX) -- (TopY) -- (TopZ); } \begin{align} d_{\tikzmarknode{X}{p}} +e_{\tikzmarknode{Y}{q}} =f_{\tikzmarknode{Z}{r}} \end{align} \tikz[remember picture,overlay]{ \coordinate (Xp) at ($(X.south)+(0,-0.3ex)$); \coordinate (Yp) at ($(Y.south)+(0,-0.3ex)$); \coordinate (Zp) at ($(Z.south)+(0,-0.3ex)$); \path let \p1 = (Xp), \p2 = (Yp), \p3 = (Zp) in coordinate (BottomX) at (\x1,{min(\y1,\y2,\y3)-2ex}) coordinate (BottomY) at (\x2,{min(\y1,\y2,\y3)-2ex}) coordinate (BottomZ) at (\x3,{min(\y1,\y2,\y3)-2ex}); \draw (Xp) -- (BottomX); \draw (Yp) -- (BottomY); \draw (Zp) -- (BottomZ); \draw (BottomX) -- (BottomY) -- (BottomZ); } \end{document}
- Forcing blank vertical space at the top of a page when force option alone doesn't do it?by Gary on February 6, 2026 at 10:41 pm
How can the blank space above \SectionTitle III be forced at the top of page 2 as it is on the top of page 1? I've tried using \blank[5mm,force] directly but with no change. Am I mis-using the \define command or \definedelimitedtext? I'm just trying to declare this command because it needs to be used many, many times in this document (and it is not a "real" section linked to headers or the TOC). It works, as is, when there is a pagebreak but not when the text flows such that the title starts at the top of a new page. Thank you. \setuplayout[height=4.5in,width=4in] \definedelimitedtext[ST][ spacebefore={5mm,force,fixed}, spaceafter=5mm, ] \define[1]\SectionTitle{% \startST \startalignment[middle] \tfa\it#1 \stopalignment \stopST} \starttext \showframe \SectionTitle{I. Title One} A paragraph of the to fill the line to observe the spacing. \SectionTitle{II. Title Two} \input {ward} \SectionTitle{III. Title Three} A paragraph of the to fill the line to observe the spacing. \SectionTitle{IV. Title Four} Paragraph. \stoptext Added In looking at this further, perhaps the space is being added but the distance is being counted from the end of the previous paragraph and not the top of the page; because the previous page does not reach the bottom since the last paragraph ends one line before the last possible print line. Something that appears closely related and confusing to me is that if change the body to \starttext \showframe \SectionTitle{I. Title One} A paragraph of the to fill the line to observe the spacing. \SectionTitle{II. Title Two} \input{ward} A new line of text to fill the space to reach the very last line. A new paragraph. \SectionTitle{III. Title Three} \stoptext the result is as expected below But, if remove the short "A new paragraph" just before section III, the result is as below; and what confuses me is why the last two lines of the last paragraph of page 1 are now moved to page 2. The same occurs if use \blank[5mm, force] \midaligned{III. Title Three} \blank[5mm] in that, once try to force the space at the top, the two lines of the previous paragraph move also. Is it possible to "separate" the before space from the previous paragraph? Thank you. Also, if, instead of trying to define a command to style a title that isn't a section in any real way, it is defined as a section or subsection that can be excluded from the TOC and headers, then all works as expected. For example, \setuplayout[height=4.5in,width=4in] \setuphead[section][ conversion=Romannumerals, sectionstopper={.}, align=center, before={\blank[5mm,force]}, after={\blank[5mm]}, style={\tfa\it}, ] \starttext \showframe \startsection[title={Title One}] A paragraph of the to fill the line to observe the spacing. \stopsection \startsection[title={Title Two}] {\input{ward} A new line of text to fill the space to reach the very last line.} \stopsection \startsection[title={Title Three}] A paragraph of the to fill the line to observe the spacing. \stopsection \startsection[title={Title Four}] A paragraph of the to fill the line to observe the spacing. \stopsection \stoptext renders This is what I expected would happen for my attempt at defining \SectionTitle command.
- How can I get text (marginnote) next to a tabularray-row?by lukascbossert on February 6, 2026 at 10:12 pm
I would like to have short information next to certain rows of tabularray-environment, like a marginnote. The content in the note is a macro (here just text). The issue I face is: ! Undefined control sequence. <argument> \@currbox l.68 \requestedFundingTable[A1] TeXnically it does not necessarily need to be a \marginpar but also anything that would get text next to the specific row. \documentclass{scrartcl} \usepackage{xcolor} \usepackage{tabularray} \UseTblrLibrary{siunitx} \UseTblrLibrary{functional} \ExplSyntaxOn \tl_new:N \l__tmp_body_staff_tl \tl_new:N \l__tmp_body_costs_tl \NewDocumentCommand{\requestedFundingTable}{o}{ Table~ #1 :\par \tl_clear:N \l__tmp_body_staff_tl \tl_clear:N \l__tmp_body_costs_tl \tl_put_right:Nn \l__tmp_body_staff_tl { \SetRow{red!20} \SetCell{font=\footnotesize\bfseries,halign=l} Staff & Qty & Sum \\ } \tl_put_right:Nn \l__tmp_body_costs_tl { \SetHline{-}{red,0.5pt} \SetRow{red!20} \SetCell{font=\footnotesize\bfseries,halign=l} Direct~ Costs & \SetCell[c=2]{c} Sum & \\ } % further processing in between \tl_put_right:Ne \l__tmp_body_staff_tl { category & 12 & 123 \\ } \tl_put_right:Ne \l__tmp_body_costs_tl { \SetRow{cmd={\marginpar{A note: #1}}} %<<<<<<<<<<<<<<<<<<<<<<<<< category & \SetCell[c=2]{c} 1234 & \\ } \begin{tblr}[ long, expand= \l__tmp_body_staff_tl \l__tmp_body_costs_tl, ]{ colspec = { *{1}{X[4,m]} *{2}{X[r, si={table-format=4}]} }, row{1,2} = {guard}, } CATEGORY & \SetCell[c=2]{c} year & \\ \l__tmp_body_staff_tl \l__tmp_body_costs_tl \end{tblr} } \ExplSyntaxOff \begin{document} \requestedFundingTable[A1] \requestedFundingTable[A2] \end{document}
- Memoir class + twocolumn: strategies for reliable full-width floats and strip environments across large documentsby Grant Petty on February 6, 2026 at 8:08 pm
I'm compiling a 25-chapter book using XeLaTeX and memoir in (for my first time) twocolumn mode. Each chapter is a separate file loaded via \include{}. Individual chapters compile correctly with \includeonly{}, but compiling the full book produces errors and layout failures that don't appear in either single-chapter or single-column mode. Specific symptoms: \enlargethispage throws "page is already too large" at locations where it works fine in single-chapter compilation \input of a file containing a float environment triggers "not in outer par mode," but pasting the same content inline works Float placement (figure*, table*, strip from cuted) becomes unpredictable — floats migrate to wrong pages with no obvious cause and can't be forced back without abandoning the float environment altogether. Environment: XeLaTeX + memoir class cuted package for strip environment placeins, dblfloatfix, float, afterpage, longtable, mdframed, tcolorbox, rotating, nowidow multicol (for one specific 3-column text block) What I've tried: Removing \enlargethispage at problem locations (works around the error but doesn't explain it) Replacing \input with literal content (works, but defeats the purpose) Adjusting float placement specifiers (inconsistent results) My question: For those who have successfully produced print-ready books in two-column memoir: what combination of packages, settings, and workflow practices gives you deterministic results with full-width floats? I'm less interested in debugging my specific errors than in learning whether there's a more robust foundation I should be building on.
- How to make f\left(x\right) not add extra space after f?by Nasser on February 6, 2026 at 8:01 pm
I tried all answers in Spacing around \left and \right and none of them work. I use code generate by computer CAS. And all the code generates \left(...\right). So not possible to do any manual editing of latex code generated. Only issue is that something like f\left(x\right) adds extra space between function name f and the parentheses. I am not talking about any space inside parentheses, but the space outside between function name and starting (. I only want this space to be the same as if code was written using f(x). Nothing else change. First, here is MWE showing the issue \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Compiled with lualatex gives Notice how the space after function name is larger when using \left(...\right) which is the second equation. I'd like the space after function names and starting ( in the second equation to be same as first equation as it looks better. Below are all my tries. Some of them fix the space after g and not after f and some solution fix the space after f but not after g. But there is no solution which produce same exact output for second equation as the first one. Try 1 (accepted answer in the above link) \documentclass[12pt]{article} \let\originalleft\left \let\originalright\right \renewcommand{\left}{\mathopen{}\mathclose\bgroup\originalleft} \renewcommand{\right}{\aftergroup\egroup\originalright} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives Notice the space after g in second equation have become too small. Try 2 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \usepackage{mathtools} \DeclarePairedDelimiter\pars{\lparen}{\rparen} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives No effect. Larger space after function names still exist. Try 3 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \let\originalleft\left \let\originalright\right \def\left#1{\mathopen{}\originalleft#1} \def\right#1{\originalright#1\mathclose{}} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives Again, now space after g is too small. Try 4 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \Umathopinnerspacing\displaystyle=0mu \Umathopinnerspacing\textstyle=0mu \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives Still, the space between function names and ( is not same in second equation as first equation. try 5 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \def\delim#1#2#3{ \mathopen{\left#1 \vphantom{#2} \right.} \kern-\nulldelimiterspace #2 \kern-\nulldelimiterspace \mathclose{ \left. \vphantom{#2} \right#3 } } \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives Still, the space between function names and ( is not same in second equation as first equation. Try 6 \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage{kpfonts,baskervald} \usepackage{amsmath} \usepackage{mleftright} \renewcommand{\left}{\mleft} \renewcommand{\right}{\mright} \begin{document} \begin{align*} \int \frac{dy}{g(y)} &= \int f(x) \, dx\\ \int \frac{dy}{g\left(y\right)} &= \int f\left(x\right) \, dx \end{align*} \end{document} Gives The space after f looks same as in equation 1, but the space after g in second equation is now too small.
- Siunitx and font and/or alignmentsby LeO on February 6, 2026 at 7:52 pm
I want to use siunitx for alignments within a currency table. Perhaps euros are not a scientific unit - but I haven't seen why this might be a problem. I want to use a different font. Anyway there seems to be a strange mixture which leads to a weird result. \documentclass[12pt]{article} \usepackage[margin=2.5cm]{geometry} \usepackage{fontspec} \setmainfont{Bitter}[Ligatures=TeX,Scale=MatchLowercase] \usepackage{tabularx, multirow} \usepackage[locale = DE]{siunitx} \begin{document} \begin{tabular}{S} \textbf{Betrag} \\ 120,00 €\\ -12,00 €\\ \large\textbf{108,00 €}\\ \end{tabular} \end{document} Only the header and the last line are in "Bitter" font. Addtionally I don't understand why the euro sign has an extra space in the 3rd line. The result of the given MWE has two weird aspects: The ammount 120€ and -12€ are NOT in the main font. Is there a way to keep it? the euro sign after -12 has a strange additional space. Is there a way to correct it? (to have only ONE extra space)?
- White line space at a table with hhline, colortbl and diagboxby cis on February 6, 2026 at 6:06 pm
What is the trick to get this white line between yellow and gray away? The rest is as it should be. Hint: all fills should become lightgray at the end, here different to see the effects. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{xcolor} \usepackage{colortbl}% \rowcolor, \cellcolor \usepackage{diagbox}% \diagbox \usepackage{hhline}% \hhline{~|-------|} and so on \setlength\arrayrulewidth{4pt}% test: correctness of the rules \begin{document} \begin{tabular}{c c | *{6}{c} |c|} \hhline{~ -| *{6}{-} |-} \rowcolor{yellow} \multicolumn{1}{c}{\cellcolor{white}aaa}% erase rule on the left & \cellcolor{white} bbb% & 9 & 8 & 7 & 6 & 5 & 4 & \diagbox{$p$}{$k$} \\ % \arrayrulecolor{blue} \hhline{~ ~| *{6}{~} |-} \rowcolor{lightgray} \multicolumn{1}{c}{\cellcolor{white}} & \multicolumn{1}{c|}{\cellcolor{white}} & \multicolumn{7}{c|} {{\tiny Here comes a text......}} \\ \hhline{~~| *{7}{-} |} \end{tabular} \end{document}
- Drawing diagrams in latex [duplicate]by Noah on February 6, 2026 at 4:43 pm
I’m relatively new at diagram drawing in latex. How would I go about drawing an upper half sphere with an elliptic curve plotted along it (to resemble the real projective plane)? I want it to look something like this where you have the upper-half sphere drawn and shaded in a solid light grey, and the intersection of the equation X^3-3XZ^2+3Z^3-Y^2Z=0 with the upper-half sphere, the point (0,1,0) annotated with infinity, and the viewing angle rotated as in the image (and possibly the curve in another colour). I really don’t like the usual 3D look but prefer the way the following attached images look. I’d greatly appreciate your help!
- pgfplotstable: how to use a list to show wanted columnsby cis on February 6, 2026 at 3:29 pm
If I have \def\IndexList{[index]1, [index]2, [index]4, [index]5}; why can't I say columns={No, \IndexList, [index]6}% works not! at a pgfplotstable? What do I have to do, to use a created list to show wanted columns? \documentclass[margin=5pt, varwidth]{standalone} \usepackage{pgfplotstable} \begin{document} \pgfplotstableread[col sep=comma, header=true]{ No, a, b, c, d, e, f 0, 1, 2, 3, 4, 5, 6 1, 1, 2, 3, 4, 5, 6 2, 1, 2, 3, 4, 5, 6 3, 1, 2, 3, 4, 5, 6 4, 1, 2, 3, 4, 5, 6 }{\mytable} \section{Normal Table} \pgfplotstabletypeset[]{\mytable} \section{Index List Table - works not with Index List} \def\IndexList{[index]1, [index]2, [index]4, [index]5} \pgfplotstabletypeset[ columns={No, [index]1, [index]2, [index]4, [index]5, [index]6}% works %columns={No, \IndexList, [index]6}% works not! ]{\mytable} \end{document}
- ltex with beamer overlay specificationsby BartBog on February 6, 2026 at 2:40 pm
Lately I have been using ltex (in VS Code) quite a lot for spell checking my LaTeX files. One question I have is: is it possible to configure it to behave better with beamer overlay specifications. For instance: when I write \uncover<.(1)->{text} currently, I get a warning Do you wish to insert an arrow? But clearly, this is not intended inside an overlay specification <>. Is it possible to disable warnings specifically inside such specifications? (adding "\\uncover<>": "ignore", to my "ltex.latex.commands": does not help. I guess it does not understand the <> delimiters. (see also a similar question I asked about chktex Chktex: disable warnings on beamer overlay specifications)
- Unequal parens sizes in numerator and denominator of a fractionby Knudsen on February 6, 2026 at 2:22 pm
Why are the parens on the numerator of this construction much bigger than the ones in the denominator? \documentclass{report} \usepackage{amsmath} \begin{document} \[ \frac{\left(q^k\right)} {\left(q^k\right)} \] \end{document}
- Bold + Italic Greek symbol in PlainTeXby GowriSaro on February 6, 2026 at 1:48 pm
I am aware that in LaTeX, \boldsymbol tag will produce Greek characters in Bold+Italic font, but how can I achieve this using PlainTeX, I tried with: $$ \alpha $$ \bye
- How to use the \convolution operator command provided by fontsetup with ConTeXT? (using PUA glyphs in ConTeXt)by Apoorv Potnis on February 6, 2026 at 11:54 am
The fontsetup package provides with a \convolution operator command to access a big star symbol from the New Computer Modern fonts. However, fontsetup works only with XeLaTeX and LuaLaTeX. How does one access this glyph from the NewCM fonts with ConTeXt? The \convolution command is defined in fspdefault.tex as \DeclareMathOperator*{\convolution}{\mathchoice{\char"E037}{\char"E036}{\char"E038}{\char"E039}}. The question essentially asks about using glyphs not encoded their Unicode slots (Private Use Areas?), as a Unicode slot for the glyph does not exist. LuaLaTeX MWE: \documentclass{article} \usepackage[newcmbb]{fontsetup} \begin{document} \[ \convolution_{1\le i\le n} a_i \] \[ \sum_{i=1}^n \convolution_{i=1}^n x_i \qquad \textstyle \sum\convolution_{i=1}^n x_i \qquad \scriptstyle \sum\convolution_{i=1}^n x_i \qquad \scriptscriptstyle \sum\convolution_{i=1}^n x_i \] \end{document}
- How to use the \convolution operator command provided by fontsetup with OpTeX? (using PUA glyphs in OpTeX)by Apoorv Potnis on February 6, 2026 at 11:38 am
The fontsetup package provides with a \convolution operator command to access a big star symbol from the New Computer Modern fonts. However, fontsetup works only with XeLaTeX and LuaLaTeX. How does one access this glyph from the NewCM fonts with OpTeX? The \convolution command is defined in fspdefault.tex as \DeclareMathOperator*{\convolution}{\mathchoice{\char"E037}{\char"E036}{\char"E038}{\char"E039}}. The question essentially asks about using glyphs not encoded their Unicode slots (Private Use Areas?), as a Unicode slot for the glyph does not exist. LuaLaTeX MWE: \documentclass{article} \usepackage[newcmbb]{fontsetup} \begin{document} \[ \convolution_{1\le i\le n} a_i \] \[ \sum_{i=1}^n \convolution_{i=1}^n x_i \qquad \textstyle \sum\convolution_{i=1}^n x_i \qquad \scriptstyle \sum\convolution_{i=1}^n x_i \qquad \scriptscriptstyle \sum\convolution_{i=1}^n x_i \] \end{document}
- Beamer sty file not workingby Dario on February 6, 2026 at 11:19 am
I have the following sty file: % ============================================================ % PanelDataExact — Beamer Theme % ============================================================ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{beamerthemePanelDataExact}[2026/02/06 stable theme] % ------------------------------------------------------------ % SAFE packages % ------------------------------------------------------------ \RequirePackage{etoolbox} \RequirePackage{xcolor} \RequirePackage{graphicx} \RequirePackage{xparse} % ------------------------------------------------------------ % FONTS % ------------------------------------------------------------ \RequirePackage[T1]{fontenc} \RequirePackage{fix-cm} \renewcommand{\familydefault}{\sfdefault} \renewcommand{\sfdefault}{lmss} \usefonttheme{professionalfonts} % ------------------------------------------------------------ % BASE BEAMER STRUCTURE % ------------------------------------------------------------ \mode<presentation>{ \usetheme{default} \usecolortheme{default} \setbeamertemplate{navigation symbols}{} } % ------------------------------------------------------------ % COLORS % ------------------------------------------------------------ \definecolor{panelblue}{RGB}{30,104,163} \definecolor{slidetitle}{RGB}{30,104,163} \definecolor{rulegray}{RGB}{180,180,180} % ------------------------------------------------------------ % TEXT SIZE OVERRIDES % ------------------------------------------------------------ \AtBeginDocument{ \renewcommand\normalsize{\fontsize{11.5pt}{13.8pt}\selectfont} \renewcommand\small{\fontsize{10.5pt}{12.6pt}\selectfont} } \setbeamerfont{itemize/enumerate body}{size=\normalsize} \setbeamerfont{itemize/enumerate subbody}{size=\normalsize} \setbeamerfont{itemize/enumerate subsubbody}{size=\normalsize} % ------------------------------------------------------------ % TIKZ + PLOTTING % ------------------------------------------------------------ \RequirePackage{tikz} \usetikzlibrary{arrows.meta,positioning,shapes.geometric,calc} \RequirePackage{pgfplots} \pgfplotsset{compat=1.18} \useinnertheme{circles} % ------------------------------------------------------------ % LEFT MARGIN % ------------------------------------------------------------ \newlength{\leftA} \makeatletter \setlength{\leftA}{\beamer@leftmargin} \makeatother \newcommand*\rulefill{% \leaders\hrule height 0.35pt depth 0pt\hfill\kern0pt} % ------------------------------------------------------------ % CUSTOM BULLETS % ------------------------------------------------------------ \newcommand{\panelsquare}{% \tikz[x=1ex, y=1ex]{ \draw[panelblue, line width=0.18ex] (0,0) rectangle (1.1,1.1); \filldraw[panelblue] (0.55,0.55) circle (0.13); }% } \AtBeginDocument{ \setbeamertemplate{itemize item}{\panelsquare} \setbeamertemplate{itemize subitem}{\panelsquare} \setbeamertemplate{itemize subsubitem}{\panelsquare} \setbeamertemplate{enumerate item}{\panelsquare} \setbeamertemplate{enumerate subitem}{\panelsquare} \setbeamertemplate{enumerate subsubitem}{\panelsquare} } % ------------------------------------------------------------ % INTUITION / DISCUSSION BOXES % ------------------------------------------------------------ \setbeamercolor{intuitionbox}{bg=blue!8, fg=black} \setbeamercolor{discussionbox}{bg=red!8, fg=black} \newenvironment{intuition}{ \begin{beamercolorbox}[rounded=true,shadow=true,sep=1em]{intuitionbox} \textbf{Intuition}% }{ \end{beamercolorbox}% } \newenvironment{discussion}{ \begin{beamercolorbox}[rounded=true,shadow=true,sep=1em]{discussionbox} \textbf{Discussion}% }{ \end{beamercolorbox}% } % ------------------------------------------------------------ % SECTION-LEVEL FRAME COUNTER % ------------------------------------------------------------ \newcounter{secframe} \gdef\currsection{} \AtBeginSection{ \setcounter{secframe}{0} \gdef\currsection{\secname} } \makeatletter \addtobeamertemplate{frametitle}{}{ \ifbeamer@plainframe\else \ifcsname isoverview\endcsname\else \stepcounter{secframe} \fi \fi } \makeatother % ------------------------------------------------------------ % HEADER % ------------------------------------------------------------ \makeatletter \setbeamertemplate{headline}{ \ifbeamer@plainframe\relax\else \vspace*{4.2mm} \hbox to \paperwidth{ \hskip\leftA \currsection\quad{\color{rulegray}\rulefill}\quad \ifcsname isoverview\endcsname\relax\else \thesection-\arabic{secframe}% \fi \hskip\leftA } \vspace*{6.2mm} \fi } \makeatother % ------------------------------------------------------------ % SLIDE TITLE % ------------------------------------------------------------ \setbeamertemplate{frametitle}{} \newcommand{\SlideTitle}[1]{% \vspace*{-2mm}% {\bfseries\color{slidetitle}\fontsize{15pt}{18pt}\selectfont #1}% \vspace*{5.6mm}% } % ------------------------------------------------------------ % BRAND + LOGO % ------------------------------------------------------------ \newcommand{\panelbrand}{} \newcommand{\setpanelbrand}[1]{\renewcommand{\panelbrand}{#1}} \newcommand{\panellogo}{example-image-a} \newcommand{\setpanellogo}[1]{\renewcommand{\panellogo}{#1}} \makeatletter \def\firstline#1\\#2\relax{#1} \AtBeginDocument{ \ifx\panelbrand\empty \ifx\beamer@shortinstitute\@empty \ifx\beamer@shorttitle\@empty \setpanelbrand{\beamer@shortauthor} \else \setpanelbrand{\beamer@shorttitle} \fi \else \edef\tmp{\expandafter\firstline\beamer@institute\relax} \setpanelbrand{\tmp} \fi \fi } \makeatother % ------------------------------------------------------------ % FOOTER % ------------------------------------------------------------ \makeatletter \setbeamertemplate{footline}{ \ifbeamer@plainframe\relax\else \vspace*{3mm} \hbox to \paperwidth{ \hskip\leftA \panelbrand\quad{\color{rulegray}\rulefill}\quad \IfFileExists{\panellogo.pdf}{ \raisebox{-0.2ex}{\includegraphics[height=10ex]{\panellogo.pdf}} }{ \IfFileExists{\panellogo.png}{ \raisebox{-4.5ex}{\includegraphics[height=10ex]{\panellogo.png}} }{ \raisebox{-4.5ex}{\color{black!45}\rule{2cm}{1ex}} } } \hskip\leftA } \vspace*{2mm} \fi } \makeatother % ------------------------------------------------------------ % TitleWithLogo (MiKTeX-safe) % ------------------------------------------------------------ \RequirePackage{expl3} \AtBeginDocument{ \ExplSyntaxOn \tl_new:N \tll@height \tl_new:N \tll@yshift \tl_set:Nn \tll@height {11.5mm} \tl_set:Nn \tll@yshift {-0.3ex} \keys_define:nnn { tll } { height } { \tl_set:Nn \tll@height {#1} } \keys_define:nnn { tll } { yshift } { \tl_set:Nn \tll@yshift {#1} } \RenewDocumentCommand{\TitleWithLogo}{O{} m m}{ \keys_set:nn {tll}{#1} \noindent \begin{minipage}[t]{0.78\linewidth} {\bfseries\color{slidetitle}\fontsize{15pt}{18pt}\selectfont #2} \end{minipage}% \hfill \begin{minipage}[t]{0.16\linewidth} \raggedleft \raisebox{\tll@yshift}{ \IfFileExists{#3.pdf}{ \includegraphics[height=\tll@height]{#3.pdf} }{ \IfFileExists{#3.png}{ \includegraphics[height=\tll@height]{#3.png} }{ \color{black!45}\rule{2cm}{1ex} }} } \end{minipage} \par\vspace*{5.6mm}% } \ExplSyntaxOff } % Title page \setbeamertemplate{title page}{ \vbox{} \vspace*{1ex} \TitleWithLogo[height=18mm]{\inserttitle}{\panellogo} \vspace*{0.6ex} {\color{slidetitle}\large\insertsubtitle\par} \vspace*{2ex} {\insertauthor\par} \vspace*{0.5ex} {\insertinstitute\par} } % ------------------------------------------------------------ % OVERVIEW FRAME % ------------------------------------------------------------ \newcounter{totalsections} \pretocmd{\beamer@section}{ \stepcounter{totalsections} \expandafter\xdef\csname sectiontitle\thetotalsections\endcsname{#1} }{}{} \newcommand{\sectick}{\ensuremath{\checkmark}} \newcommand{\SectionOverviewFrame}{ \begin{frame}[t] \gdef\isoverview{1} \makeatletter \expandafter\gdef\expandafter\currsection\expandafter{% \csname sectiontitle\thesection\endcsname} \makeatother \setcounter{secframe}{0} \SlideTitle{Overview} {\small \setbeamertemplate{itemize item}{} \setbeamertemplate{enumerate item}{} \foreach \x in {1,...,\thetotalsections} { \ifnum\x<\value{section} {\csname sectiontitle\x\endcsname}\hfill\sectick\\[2mm] \fi \ifnum\x=\value{section} {\color{slidetitle}\csname sectiontitle\x\endcsname}\\[2mm] \fi \ifnum\x>\value{section} {\csname sectiontitle\x\endcsname}\\[2mm] \fi } } \global\let\isoverview\undefined \end{frame} } \AtBeginSection{\SectionOverviewFrame} % ------------------------------------------------------------ % LISTINGS % ------------------------------------------------------------ \RequirePackage{listings} \definecolor{codebg}{RGB}{244,244,244} \lstdefinestyle{panelstata}{ basicstyle=\ttfamily\small, backgroundcolor=\color{codebg}, frame=single, rulecolor=\color{black!20}, breaklines=true, keepspaces=true, columns=fullflexible, showstringspaces=false, upquote=true } \lstset{style=panelstata} \typeout{*** PanelDataExact theme fully loaded (clean + safe) ***} which I want to use to compile the following presentation: \documentclass[professionalfonts,aspectratio=169]{beamer} \usetheme{PanelDataExact_clean} \title{Do Political Systems Affect Economic Outcomes?} \subtitle{Political Competition, FDI, Growth, and Inequality} \author{Name} \institute{Department of Economics\\ University of XXX} % Optional custom brand: % \setpanelbrand{Politics & Institutions} \begin{document} \begin{frame}[plain] \titlepage \end{frame} \section{Introduction} \begin{frame} \SlideTitle{What this lecture is about} \begin{itemize} \item ... \end{itemize} \end{frame} \section{Second Introduction} \begin{frame} \SlideTitle{What this lecture is about} \begin{itemize} \item ... \end{itemize} \end{frame} \end{document} But I keep receiving the following error message: ! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.287 } {}{} Any hint about? I have no clue about.
- Finding and displaying the intersection points of two surfacesby SH.Madadpour on February 6, 2026 at 10:23 am
How can I display the intersection of the following two surfaces in LaTeX? I have used the following codes as a default but I am not getting acceptable output. Is it possible to create a form to find its intersection points in LaTeX? Thanks a lot. \documentclass[border=3.14mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.16} \begin{document} \begin{tikzpicture} \begin{axis}[domain=0.01:30,xlabel=$x$] \addplot3[surf,domain={0:1},color=green]{x^3+y^3}; \addplot3[surf,domain={0:1},color=red]{(x*(1-y^2)^(.5)+y*(1-x^2)^(.5))^3}; \end{axis} \end{tikzpicture} \end{document}
- Chktex: disable warnings on beamer overlay specificationsby BartBog on February 6, 2026 at 8:49 am
Lately I have been using chktex quite a lot for ensuring consistency of my LaTeX files. One question I have is: is it possible to configure it to behave better with beamer overlay specifications. For instance: when I write \visible<.(1)>{text} currently, I get a warning 36. You should put a space in front of parenthesis But clearly, this is not intended inside an overlay specification <>. Is it possible to disable warnings specifically inside such specifications (without disabling this warning in the entire file or on a line-based basis)?
- tikz / xint: Read out (and calc with) fractions from list (or array) with xint or pgfmathby cis on February 6, 2026 at 8:45 am
How can I read out numbers from a list, say \def\pList{0.1, 1/6, 0.25, 0.4} (or array, say \def\pListArray{{\pList}}), with xint? Background: I want to keep fractions, like 1/6 in it's original form (not decimal value 0.1666 here). On the other hand, I need to calc 1-<value> too, and I want, in the case of 1/6 the value 5/6 (=1 - 1/6). I have a main document with a lot of xint content and calculations; therefore, for consistency reasons, it should be done with xint (it's clear that there are other packages or methods for this); and: There must be a method in the xint-package that I can't find in the manual. Does anybody know? \documentclass[margin=5pt, varwidth]{standalone} \usepackage{tikz} \usepackage{xintexpr} \begin{document} \def\pList{0.1, 1/6, 0.25, 0.4}% List \def\pListArray{{\pList}} \section{The pList} \pList \section{pgfmath-test for fraction-readout (bad)} p=\pgfmathprint{\pListArray[0]}, q=\pgfmathprint{1-\pListArray[0]} good. But p=\pgfmathprint{\pListArray[1]}, q=\pgfmathprint{1-\pListArray[1]} bad. \section{xint-test for fractions (good), but how to readout?} p=\xinteval{1/6}, q=\xinteval{1-1/6} \end{document}
- LaTeX on Windows 11 on Snapdragon chipby Mostafa Sabri on February 6, 2026 at 7:38 am
I'm considering buying a laptop with the Snapdragon X/X+ chip (such as Dell Inspiron 5441 or HP Omnibook 5). I believe the OS will be Windows 11 ARM. I heard of compatibility issues with certain apps and games, so I am asking to double check : Will I be able to install MikTex and work with Texniccenter as usual ? I know I can work on overleaf, but it's important for me to be able to work offline. Thanks very much !
- Space after \bmod in normal and script modeby Jinwen on February 6, 2026 at 6:27 am
\bmod seems to behave differently in text style and script style (here is just an example, in reality I am writing it on the arrow of a commutative diagram). Am I using this command in a wrong way? (I learned \bmod from here.) \documentclass{article} \begin{document} \( \bmod{\mathcal{N}} \) \( x^{\bmod{\mathcal{N}}} \) \end{document}
- Lua code for modifying kerning between math characters does not always workby Jinwen on February 6, 2026 at 4:38 am
Adopting the code from this answer and the linked answers, I would like to be able to adjusting the kerning between math characters (notably the spacing around parentheses/brackets). However, the code seems not to be always effective. For instance, in the following example, the configuration between (/[ and 𝑓 is working, but the kerning between characters (like 𝑓 and 𝑓, 𝑐 and 𝑓) does not work; if one uncomment the line \setmathfont[RawFeature=+mathcharkern]{Asana-Math.otf}... (i.e., using symbols from one font, and using characters from another font), then the specified kerning between 𝑐 and 𝑓 appears to work; but the kerning between (/[ and 𝑓 now fail to work, and the kerning between characters 𝑓 and 𝑓 still don't work. Is there perhaps something wrong in my configuration? Why cannot this code work as expected in general, and how to make it work in all situations? \documentclass{article} \usepackage{showkerning} \RequirePackage{luacode} \begin{luacode*} fonts.handlers.otf.addfeature { name = "mathcharkern", type = "kern", data = { ["("] = { ["𝑓"] = 300, }, ["["] = { ["𝑓"] = 300, }, ["𝑓"] = { ["𝑓"] = 500, }, ["𝑐"] = { -- c ["𝑓"] = 500, }, }, } \end{luacode*} \usepackage{unicode-math} \setmathfont[RawFeature=+mathcharkern]{KpMath-Regular.otf} % \setmathfont[RawFeature=+mathcharkern]{Asana-Math.otf}[range={it/{Latin,latin},bfit/{Latin,latin},up/num,bfup/num}] \begin{document} % \addfontfeature{+mathcharkern} \( (ff) \) \( [ff] \) \( cf \) \end{document} Modified code based on Clea F. Rees' and Max Chernoff's suggestion (not sure if I have understood correctly, the following code is still not working, honestly there seems to be no difference): \documentclass{article} \usepackage{showkerning} \RequirePackage{luacode} \begin{luacode*} fonts.handlers.otf.addfeature { name = "mathcharkern", type = "kern", data = { [utf8.codepoint "("] = { [utf8.codepoint "𝑓"] = 300, }, [utf8.codepoint "["] = { [utf8.codepoint "𝑓"] = 300, }, [utf8.codepoint "𝑓"] = { [utf8.codepoint "𝑓"] = 500, }, [utf8.codepoint "𝑐"] = { -- c [utf8.codepoint "𝑓"] = 500, }, }, } --[[ luaotfload doesn't publicly expose the `luaotfload.node_processor` function, and `luatexbase` doesn't expose the functions currently registered to a callback. However, `remove_from_callback` returns the function currently registered, so we can "pop" and save the function with `remove_from_callback`, and then re-register it with `add_to_callback`. ]] local node_processor = luatexbase.remove_from_callback( "pre_linebreak_filter", "luaotfload.node_processor" ) luatexbase.add_to_callback( "pre_linebreak_filter", node_processor, "luaotfload.node_processor" ) --[[ Also run the `luaotfload.node_processor` callback on display math. ]] if true then --[[ Set to `false` to disable. ]] luatexbase.add_to_callback("post_mlist_to_hlist_filter", function(...) local n = select(1, ...) if n.list then n.list = node_processor(n.list, select(2, ...)) return n else return node_processor(n, select(2, ...)) end end, "luaotfload.node_processor") end \end{luacode*} \usepackage{unicode-math} \setmathfont[RawFeature=+mathcharkern]{KpMath-Regular.otf} \setmathfont[RawFeature=+mathcharkern]{Asana-Math.otf}[range={it/{Latin,latin},bfit/{Latin,latin},up/num,bfup/num}] \begin{document} % \addfontfeature{+mathcharkern} \( (ff) \) \( [ff] \) \( cf \) \( fff \) \[ (ff) \] \[ [ff] \] \[ cf \] \[ fff \] \end{document}
- Animating light entry and radiation in a blackbody cavityby Sebastiano on February 5, 2026 at 9:04 pm
I am using the code from https://tikz.net/blackbody/ by Izaak Neutelings, which draws a blackbody cavity with an incoming yellow light beam and wavy red arrows representing the emitted radiation. I would like to animate the yellow light beam to show that light enters the cavity, and only afterward make the wavy red arrows appear to represent the radiation. % Author: Izaak Neutelings (March 2019) % Inspiration: https://tex.stackexchange.com/questions/203597/automatically-generate-graphics-which-shows-light-diffusion-on-a-rough-surface \documentclass[border=3pt,tikz]{standalone} \usetikzlibrary{decorations.pathmorphing,decorations.markings,calc} % for random steps & snake \usetikzlibrary{arrows.meta} % for arrow size \tikzset{>=latex} % for LaTeX arrow head \tikzstyle{radiation}=[-{Latex[length=2,width=1.5]},red!95!black!50,opacity=0.7,very thin,decorate, decoration={snake,amplitude=0.7,segment length=2,post length=2}] \begin{document} % BLACK BODY \begin{tikzpicture}[scale=1,rotate=10] \shade[top color=black!60,bottom color=black!80,shading angle=10] % background (7:1) arc (7:355:1); \fill[thick,black,postaction=decorate, % rough inner surface decoration={markings,mark=between positions 0.55 and 1 step 0.03 with { \node[transform shape,inner sep=1pt] (hit\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) {}; }}] (7:1) arc (7:353:1) --++ (-7:-0.18) decorate[decoration={random steps,segment length=2,amplitude=1pt}] {arc (-7:-353:0.82)} -- cycle; \draw[yellow] % connect light ray to random points (8:1.5) -- (hit6.center) -- (hit1.center) -- (hit15.center) -- (hit5.center) -- (hit9.center) -- (hit14.center) -- (hit2.center) -- (hit10.center) -- (hit3.center) -- (hit4.center) -- (hit11.center) -- (hit13.center); \foreach \ang in {-35,-5,35}{ \draw[radiation] (1,0)++(\ang:0.1 and 0.2) --++ (\ang:0.35); } \end{tikzpicture} % BLACK BODY - without infalling light \begin{tikzpicture}[scale=1,rotate=10] \shade[top color=black!60,bottom color=black!80,shading angle=10] % background (7:1) arc (7:355:1); \fill[thick,black,postaction=decorate, % rough inner surface decoration={markings,mark=between positions 0.55 and 1 step 0.03 with { \node[transform shape,inner sep=1pt] (hit\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) {}; }}] (7:1) arc (7:353:1) --++ (-7:-0.18) decorate[decoration={random steps,segment length=2,amplitude=1pt}] {arc (-7:-353:0.82)} -- cycle; \foreach \ang [evaluate={\angin=\ang-180+10*rand; \r=0.76+0.05*rand; \l=0.4+0.02*rand}] in {10,45,100,140,190,240,290,330}{ \draw[radiation] (\ang:\r) --++ (\angin:\l); } \foreach \ang in {-30,0,30}{ \draw[radiation] (1,0)++(\ang:0.05 and 0.16) --++ (\ang:0.35); } \end{tikzpicture} \end{document}
- How does mathrsfs and LaTeX generally store kerning information?by DiracComb16796 on February 5, 2026 at 7:58 pm
I am trying to explore how robust Typst is as an alternative to LaTeX by trying to convert some documents from LaTeX to Typst. One limitation I ran into is fonts, as some fonts standard to some mathematical circles aren't built into the Typst compiler. Moreover, Typst only accesses external fonts through .ttf and .otf files, which means any fonts that don't have versions with these files aren't gonna be able to make the jump, or at least not easily. Case in point, the mathrsfs font, used for things like Schwartz spaces or spaces of distributions in Distribution theory, or Lagrangian and Hamiltonian density in Quantum Field Theory, doesn't have .otf or .ttf files, as seen here. Now, as outlined in this post, there is a way to convert it from .pfb to .otf using Font Forge. However, kerning doesn't work for basic characters or subscripts/superscripts. Thus, did the conversion from .pfb to .otf destroy built-in kerning information, or does LaTeX store kerning information somewhere else, because kerning works just fine in LaTeX with \mathscr? EDIT: Okay, I've learned that the .afm files also provided in the same location are what hold the kerning information for the font. However, that leaves me more confused, because looking at, e.g. rsfs10.afm, we have: StartFontMetrics 2.0 Comment Copyright Conversion from mf curves by Metafog (c) 1995 Richard Kinch Comment Panose 3 0 5 5 4 0 0 9 0 2 FullName rsfs10 FontName rsfs10 FamilyName rsfs10 Weight Roman Notice Copyright (c) Taco Hoekwater, 1998. All rights reserved. Version 001.000 IsFixedPitch false ItalicAngle -12.00 FontBBox -2 -300 1240 728 Ascender 700 Descender -200 XHeight 233 CapHeight 728 UnderlinePosition -100 UnderlineThickness 50 StdHW 22 StdVW 22 EncodingScheme FontSpecific StartCharMetrics 27 C 66 ; WX 908 ; N B ; B 34 -14 928 708 ; C 67 ; WX 666 ; N C ; B 26 -19 812 714 ; C 68 ; WX 774 ; N D ; B 63 -31 849 708 ; C 69 ; WX 562 ; N E ; B 45 -8 711 708 ; C 70 ; WX 895 ; N F ; B 41 -22 990 728 ; C 71 ; WX 610 ; N G ; B 11 -22 737 717 ; C 72 ; WX 969 ; N H ; B 33 -22 1240 717 ; C 73 ; WX 809 ; N I ; B 58 -17 952 717 ; C 74 ; WX 1052 ; N J ; B 98 -300 1139 717 ; C 75 ; WX 914 ; N K ; B 33 -22 1200 717 ; C 76 ; WX 874 ; N L ; B 12 -17 1033 717 ; C 77 ; WX 1080 ; N M ; B 29 -36 1215 719 ; C 78 ; WX 902 ; N N ; B 33 -22 1206 719 ; C 79 ; WX 738 ; N O ; B 95 -8 803 708 ; C 80 ; WX 1013 ; N P ; B 94 -22 1033 717 ; C 81 ; WX 883 ; N Q ; B 54 -17 884 717 ; C 82 ; WX 850 ; N R ; B -2 -17 887 717 ; C 83 ; WX 868 ; N S ; B 32 -22 1018 708 ; C 84 ; WX 747 ; N T ; B 94 -22 995 728 ; C 85 ; WX 800 ; N U ; B 54 -17 959 717 ; C 86 ; WX 622 ; N V ; B 55 -17 857 717 ; C 87 ; WX 805 ; N W ; B 47 -17 1032 717 ; C 88 ; WX 944 ; N X ; B 103 -17 1132 717 ; C 89 ; WX 710 ; N Y ; B 57 -17 965 717 ; C 90 ; WX 821 ; N Z ; B 81 -17 1034 717 ; C 127 ; WX 278 ; N tie ; B 394 368 796 520 ; C 65 ; WX 803 ; N A ; B 35 -8 1000 717 ; EndCharMetrics StartKernData StartKernPairs 1 KPX B tie 194 EndKernPairs EndKernData EndFontMetrics with only the B and tie character having any sort of kerning information, so I am very confused how TeX/LaTeX is able to properly space these characters, especially with things like superscripts. I suppose it could be the sizing of the bounding boxes, but if that's so, why is Typst having issues?
- Make perfect circular diagramsby Fran on February 5, 2026 at 12:23 pm
I know that I can make circular diagrams with the nice smartdiagram package, but arrows do not fit perfectly in a imaginary circle. In fact, the diagram is far from a circle when there are only two or three nodes: \documentclass{standalone} \usepackage{smartdiagram} \begin{document} \smartdiagramset{ connection color=red, module shape= circle, circular distance=2cm, uniform color list=white for 6 items, uniform arrow color=true, arrow color=black} \smartdiagram[circular diagram:clockwise]{foo, bar} \end{document} I know also that there are several examples in this site about making circular diagrams without this package, but translating these examples to diagrams with a different numbers of nodes is complex, so I tried an automated solution with tikz (without really knowing what I was doing, I have to admit) so that I only have to modify a list of nodes in \mylist and little more to obtain the result: \documentclass[border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[ > = Stealth, every node/.style = {circle, draw, thick, minimum width=1cm, align=center} ] \def\mylist{foo, bar, baz} % play with this \foreach \x [count=\i from 1] in \mylist {\xdef\n{\i}} \def\radio{2cm} % and this if needed \foreach \texto [count=\i from 0] in \mylist{ \pgfmathsetmacro\ang{-\i*360/\n} \node (n\i) at (\ang:\radio) {\texto}; } \foreach \dummy [count=\i from 0] in \mylist{ \pgfmathsetmacro\j{int(mod(\i+1,\n))} \pgfmathsetmacro\angini{-\i*360/\n} \pgfmathsetmacro\angfin{-\j*360/\n} \pgfmathsetmacro\outang{mod(\angini - 90 + 720, 360)} \pgfmathsetmacro\inang {mod(\angfin + 90 + 720, 360)} \draw[->, thick, line width=1.4pt] (n\i) to[out=\outang, in=\inang, looseness=.9] (n\j); % and with the looseness } \end{tikzpicture} \end{document} Mainly it works. The problem is that like in smartdiagram, the arrows don't perfectly follow an imaginary circle, that was the idea behind getting involved in this business. Playing with looseness is possible to correct a bit the curvature of the arrows, but it's tedious and the result is never perfect. So, the result should be ideally near to the image below (that I modified manually in Inkscape) and still require minimal settings to adapt the code to diagrams of n nodes. Fixes of the MWE as well as alternative approaches are welcome. Edit Thank you all for the excellent suggestions. This time, I am truly sorry I can only accept one.
- Looking for a symbol like big \astby Dimitrios ANAGNOSTOU on February 5, 2026 at 9:16 am
The question is rather simple. How to obtain the following big asterisk symbol? I apologize if it is duplicate. Thank you very much.
- My LaTeX code is super slowby YCH817 on February 5, 2026 at 7:00 am
I want to do something like this : display binary operation evaluation in different ways (decomposing the binary evaluation in two unary evaluation, etc) with a much simple syntax, i.e. : Here I use postfix and infix notation for function applications, for example : in row 7 of this table, (c1 → c2) can be decomposed into c2 (c1 → _) , in which (c1 → _) is the first unary application (marked with blue framed box), c2 (c1 → _) is the second one (marked with blue framed box); and Homo stands for the Hom functor, Expo stands for Exponent operation in Cartesian Closed Category. However the compilation tooks so much time, I think I use too much \csname...\endcsname, \@ifnextchar and so on. Seeking for better solution like expl3 or LuaLaTeX. Here is the full MWE : \documentclass[10pt,a4paper]{article} % for font \usepackage{pifont} % for \ding \usepackage{fontspec} % for font % for programming \usepackage{etoolbox} % patch \usepackage{calc} % calculation \usepackage{keyval} % key-value settings % for layout \usepackage[ a4paper, ]{geometry} % \usepackage{multicol} % for multiple columns % for mathematics \usepackage{amsmath} % \usepackage{amssymb} % \usepackage{amsfonts} % for \mathbf \mathsf \mathit \usepackage{mathtools} % for \overbracket , \underbracket \usepackage{stackengine} % for \stackon , \stackunder % for color \usepackage[ dvipsnames, svgnames, table ]{xcolor} % % for boxes \usepackage[ export ]{adjustbox} % for box scaling \usepackage{relsize} % for relevative font size \linespread{2} \setlength\parindent{0pt} % cancel indent \setlength{\columnseprule}{.4pt} % set the width of rule used in multicolumn environment % ---- enable stack for math equations \stackMath % ----- adding boxes with colored frames \newcommand{\cfbox}[2][blue]{% \setlength{\fboxsep}{0pt}% \setlength{\fboxrule}{0.4pt}% \colorlet{currentcolor}{.}% {\color{#1}% \fbox{\color{currentcolor}\ensuremath{#2}}}% } % ---- delimiters : \def\vts#1{\lvert#1\rvert} % verts \def\prs#1{\left(#1\right)} % parentheses \def\bcs#1{\left\{#1\right\}} % braces \def\bks#1{\left[#1\right]} % brackets \def\plr#1{\vphantom{(fg)}\smash{#1}}% to restrict box height and depth \def\etc{\plr{\rm etc}} % et cetera \def\occ{\plr{\texttt{\_}}} % similar to _ in lean or haskell % ----- Following code used for register variable types \makeatletter \def\RegistVarType#1BG#2Font#3{ \colorlet{color#1}{#2} \expandafter\newif\csname ifColorVarType#1\endcsname % determine whether the variable is highlighted \expandafter\def\csname var#1\endcsname##1{% \setlength{\fboxsep}{0pt}% \setlength{\fboxrule}{0pt}% \let\RegistVarTypeCache=\relax \csname ifColorVarType#1\endcsname{% \gdef\RegistVarTypeCache{\colorbox{color#1}}% }\else{% \gdef\RegistVarTypeCache{\fbox}% }\fi% \RegistVarTypeCache{\ensuremath{\plr{#3 ##1}}}% } \csname ColorVarType#1true\endcsname % enable highlighting is default } % ----- Following code used for register a specific family of variables \def\RegistVarFreqType#1Name#2{ \@ifnextchar D% {\RegistVarFreqType@{#1}{#2}} {\RegistVarFreqType@{#1}{#2}Disp{#2}} } \def\RegistVarFreqType@#1#2Disp#3{% \expandafter\def\csname #1#2\endcsname{% \csname var#1\endcsname{{#3}^{}}% } \expandafter\def\csname #1#2n\endcsname##1{% \csname var#1\endcsname{{#3}_{##1}^{}}% } \@ifnextchar p {\RegistVarFreqType@Loop{#1}{#2}{p}{'}{#3}} {\relax} } \def\RegistVarFreqType@Loop#1#2#3#4#5p{% \expandafter\def\csname #1#2#3\endcsname{% \csname var#1\endcsname{{#5}#4}% } \expandafter\def\csname #1#2#3n\endcsname##1{% \csname var#1\endcsname{{#5}#4_{##1}}% } \@ifnextchar p {\RegistVarFreqType@Loop{#1}{#2}{#3p}{#4'}{#5}} {\relax} } % ----- Used for registering operation form (Type B) \def\RegistOprFormTypeBName#1Dflt#2{% \expandafter\newcommand\expandafter{\csname #1\endcsname}[1][#2]{\plr{\ensuremath{% \xrightarrow[\text{\scriptsize\(\plr{##1}\)}]{}% }}} } \def\RegistOprEvalTypeB#1Form#2{% \let\RegistOprEvalTypeB@opr=\relax% \expandafter\def\csname ev#2\endcsname{% \@ifnextchar [% {\csname ev#2@Yopt\endcsname} {\csname ev#2@Nopt\endcsname}% }% \expandafter\def\csname ev#2@Yopt\endcsname[##1]{% \def\RegistOprEvalTypeB@opr{\csname #2\endcsname[{##1}]}% \csname ev#2@\endcsname % <--- 移到这里! }% \expandafter\def\csname ev#2@Nopt\endcsname{% \def\RegistOprEvalTypeB@opr{\csname #2\endcsname}% \csname ev#2@\endcsname % <--- 移到这里! }% \expandafter\def\csname ev#2@\endcsname{% \@ifnextchar <% {\csname ev#2@YargL@\endcsname} {\@ifnextchar >% {\csname ev#2@YargR@\endcsname} {\@ifnextchar .% {\csname ev#2@YargL@Qp@\endcsname} {\RegistOprEvalTypeB@opr}}}% }% \expandafter\def\csname ev#2@YargL@Qp@\endcsname.##1{% \@ifnextchar .% {\csname ev#2@YargL@Qp@YargR@\endcsname{##1}}% {\relax}% }% \expandafter\def\csname ev#2@YargL@Qp@YargR@\endcsname##1.##2{% \@ifnextchar p% {\csname ev#2@YargL@Qp@YargR@Yp\endcsname{##1}{##2}}% {\csname evB#1\endcsname{\RegistOprEvalTypeB@opr}{##1}{##2}}% }% \expandafter\def\csname ev#2@YargL@Qp@YargR@Yp\endcsname##1##2p{% \csname evB#1p\endcsname{\RegistOprEvalTypeB@opr}{##1}{##2}% }% \expandafter\def\csname ev#2@YargL@\endcsname<##1{% \@ifnextchar p% {\csname ev#2@YargL@Yp@\endcsname{##1}}% {\csname ev#2@YargL@Np@\endcsname{##1}}% }% \expandafter\def\csname ev#2@YargL@Np@\endcsname##1{% \@ifnextchar .% {\csname ev#2@YargL@Np@YargR@\endcsname{##1}}% {\relax}% }% \expandafter\def\csname ev#2@YargL@Np@YargR@\endcsname##1.##2{% \@ifnextchar p% {\csname ev#2@YargL@Np@YargR@Yp\endcsname{##1}{##2}}% {\csname evB#1LR\endcsname{\RegistOprEvalTypeB@opr}{##1}{##2}}% }% \expandafter\def\csname ev#2@YargL@Np@YargR@Yp\endcsname##1##2p{% \csname evB#1LRp\endcsname{\RegistOprEvalTypeB@opr}{##1}{##2}% }% \expandafter\def\csname ev#2@YargL@Yp@\endcsname##1p{% \@ifnextchar .% {\csname ev#2@YargL@Yp@YargR@\endcsname{##1}}% {\csname evB#1Lp\endcsname{\RegistOprEvalTypeB@opr}{##1}}% }% \expandafter\def\csname ev#2@YargL@Yp@YargR@\endcsname##1.##2{% \@ifnextchar p% {\csname ev#2@YargL@Yp@YargR@Yp\endcsname{##1}{##2}}% {\csname evB#1LpR\endcsname{\RegistOprEvalTypeB@opr}{##1}{##2}}% }% \expandafter\def\csname ev#2@YargL@Yp@YargR@Yp\endcsname##1##2p{% \csname evB#1LpRp\endcsname{\RegistOprEvalTypeB@opr}{##1}{##2}% }% \expandafter\def\csname ev#2@YargR@\endcsname>##1{% \@ifnextchar p% {\csname ev#2@YargR@Yp@\endcsname{##1}}% {\csname ev#2@YargR@Np@\endcsname{##1}}% }% \expandafter\def\csname ev#2@YargR@Np@\endcsname##1{% \@ifnextchar .% {\csname ev#2@YargR@Np@YargL@\endcsname{##1}}% {\csname evB#1Rp\endcsname{\RegistOprEvalTypeB@opr}{##1}}% }% \expandafter\def\csname ev#2@YargR@Np@YargL@\endcsname##1.##2{% \@ifnextchar p% {\csname ev#2@YargR@Np@YargL@Yp\endcsname{##1}{##2}}% {\csname evB#1RL\endcsname{\RegistOprEvalTypeB@opr}{##2}{##1}}% }% \expandafter\def\csname ev#2@YargR@Np@YargL@Yp\endcsname##1##2p{% \csname evB#1RLp\endcsname{\RegistOprEvalTypeB@opr}{##2}{##1}% }% \expandafter\def\csname ev#2@YargR@Yp@\endcsname##1p{% \@ifnextchar .% {\csname ev#2@YargR@Yp@YargL@\endcsname{##1}}% {\csname evB#1Rp\endcsname{\RegistOprEvalTypeB@opr}{##1}}% }% \expandafter\def\csname ev#2@YargR@Yp@YargL@\endcsname##1.##2{% \@ifnextchar p% {\csname ev#2@YargR@Yp@YargL@Yp\endcsname{##1}{##2}}% {\csname evB#1RpL\endcsname{\RegistOprEvalTypeB@opr}{##2}{##1}}% }% \expandafter\def\csname ev#2@YargR@Yp@YargL@Yp\endcsname##1##2p{% \csname evB#1RpLp\endcsname{\RegistOprEvalTypeB@opr}{##2}{##1}% }% } \makeatother % ----- evaluation for unary operation \def\evU#1#2{\plr{\cfbox{% {#2}\mathop{#1}% }}} \def\evUp#1#2{\plr{\cfbox{% \prs{{#2}\mathop{#1}} }}} \def\evUn#1#2{\cfbox{% \plr{{#2}^{#1}} }} \def\evUnp#1#2{\cfbox{% \prs{\plr{{#2}^{#1}}} }} % ------- evaluation for binary operation (infix) \def\evBin#1#2#3{\cfbox[Purple]{\plr{% {#2}\mathbin{#1}{#3}% }}} \def\evBinp#1#2#3{\cfbox[Purple]{% \prs{\plr{{#2}\mathbin{#1}{#3}}}% }} \def\evBinLp#1#2{\plr{\cfbox{% \prs{{#2}\mathbin{#1}\occ} }}} \def\evBinRp#1#2{\plr{\cfbox{% \prs{\occ\mathbin{#1}{#2}} }}} \def\evBinLpR#1#2#3{%\plr{% \evU{\evBinLp{#1}{#2}}{#3} }%} \def\evBinRpL#1#2#3{%\plr{% \evU{\evBinRp{#1}{#3}}{#2} }%} \def\evBinLpRp#1#2#3{%\plr{% \evUp{\evBinLp{#1}{#2}}{#3}% }%} \def\evBinRpLp#1#2#3{%\plr{% \evUp{\evBinRp{#1}{#3}}{#2}% }%} \def\evBinLR#1#2#3{\plr{\cfbox{% \cfbox{\plr{{#2}\mathbin{#1}{}}}{#3}% }}} \def\evBinLRp#1#2#3{\plr{\cfbox{% \prs{\cfbox{\plr{{#2}\mathbin{#1}{}}}{#3}}% }}} \def\evBinRL#1#2#3{\plr{\cfbox{% {#2}\cfbox{\plr{{}\mathbin{#1}{#3}}}% }}} \def\evBinRLp#1#2#3{\plr{\cfbox{% \prs{{#2}\cfbox{\plr{{}\mathbin{#1}{#3}}}}% }}} \begin{document} % ----- Regist variable types \RegistVarType{obj}BG{pink}Font{\sf} \RegistVarType{cat}BG{Rhodamine}Font{\sf} % ----- Regist frequently used variables \RegistVarFreqType{obj}Name{c}ppppp \RegistVarFreqType{cat}Name{C}ppppp % ----- Regist constants \RegistVarFreqType{cat}Name{Cat}Disp{Cat} \RegistVarFreqType{cat}Name{Set}Disp{Set} % ----- Regist operators, Disp stands for Display \RegistOprFormTypeBName{Homo}Dflt{\catC} % functor : hom % ----- Regist operator evaluation types \RegistOprEvalTypeB{in}Form{Homo} \verb|$\evHomo[\catC]$| will produce $\evHomo[\catC]$; \\ \verb|$\evHomo[\catC].{\objcn1}.{\objcn2}$| will produce $\evHomo[\catC].{\objcn1}.{\objcn2}$; \\ \verb|$\evHomo[\catC].{\objcn1}.{\objcn2}p$| will produce $\evHomo[\catC].{\objcn1}.{\objcn2}p$; \\ \verb|$\evHomo[\catC]<{\objcn1}.{\objcn2}$| will produce $\evHomo[\catC]<{\objcn1}.{\objcn2}$; \\ \verb|$\evHomo[\catC]<{\objcn1}.{\objcn2}p$| will produce $\evHomo[\catC]<{\objcn1}.{\objcn2}p$; \\ \verb|$\evHomo[\catC]<{\objcn1}p$| will produce $\evHomo[\catC]<{\objcn1}p$; \\ \verb|$\evHomo[\catC]<{\objcn1}p.{\objcn2}$| will produce $\evHomo[\catC]<{\objcn1}p.{\objcn2}$; \\ \verb|$\evHomo[\catC]<{\objcn1}p.{\objcn2}p$| will produce $\evHomo[\catC]<{\objcn1}p.{\objcn2}p$; \\ \verb|$\evHomo[\catC]>{\objcn2}.{\objcn1}$| will produce $\evHomo[\catC]>{\objcn2}.{\objcn1}$; \\ \verb|$\evHomo[\catC]>{\objcn2}.{\objcn1}p$| will produce $\evHomo[\catC]>{\objcn2}.{\objcn1}p$; \\ \verb|$\evHomo[\catC]>{\objcn2}p$| will produce $\evHomo[\catC]>{\objcn2}p$; \\ \verb|$\evHomo[\catC]>{\objcn2}p.{\objcn1}$| will produce $\evHomo[\catC]>{\objcn2}p.{\objcn1}$; \\ \verb|$\evHomo[\catC]>{\objcn2}p.{\objcn1}p$| will produce $\evHomo[\catC]>{\objcn2}p.{\objcn1}p$; \end{document} The code for the syntax shown in the image is inside \def\RegistOprEvalTypeB, and you will find control sequence which name include following strings : Yopt : stands for "Yes, option exists" Nopt : stands for "No , option does not exist" YargL : stands for "Yes, argument on the left exists" NargL : stands for "No , argument on the left does not exist" Yp : stands for "Yes, add parentheses" Np : stands for "No , don't add parentheses" YargR : stands for "Yes, argument on the right exists" NargR : stands for "No , argument on the right does not exist" For example , For example , \csname ev#2@Yopt\endcsname means optional argument exists \csname ev#2@Nopt\endcsname means optional argument does not exist \csname ev#2@\endcsname means optional argument detection has finished, @ in the end means require further detection; \csname ev#2@YargL@\endcsname means argument on the left detected, @ in the end means require further detection: \csname ev#2@YargL@Yp@\endcsname means first parentheses is detected, @ in the end means require further detection; \csname ev#2@YargL@Np@YargR@\endcsname means argument on the right detected, @ in the end means require further detection; \csname ev#2@YargL@Np@YargR@Yp\endcsname means second parentheses is detected, output (c2 (c1 → _)) with two blue frame boxes otherwise output c2 (c1 → _) with two blue frame boxes otherwiseoutput (c1 → _) with one blue frame box \csname ev#2@YargL@Np@\endcsname means first parentheses is not detected, @ in the end means require further detection; \csname ev#2@YargL@Np@YargR@\endcsname means argument on the right detected, @ in the end means require further detection; \csname ev#2@YargL@Np@YargR@Yp\endcsname means second parentheses is detected, output (c1 → c2) with two blue frame boxes otherwise output c1 → c2 with two blue frame boxes otherwise do nothing \csname ev#2@YargR@\endcsname means argument on the right detected, @ in the end means require further detection; \csname ev#2Yarg@Yp\endcsname means first parentheses is detected, @ in the end means require further detection; \csname ev#2@YargR@Yp@YargL@\endcsname means argument on the left is detected, @ in the end means require further detection; \csname ev#2@YargR@Yp@YargL@Yp\endcsname means second parentheses is detected, output (c1 (_ → c2)) with two blue frame boxes otherwise output c1 (_ → c2) with two blue frame boxes otherwise output (_ → c2) with one blue frame box \csname ev#2YargR@Np\endcsname means first parentheses is not detected, @ in the end means require further detection; \csname ev#2@YargR@Np@YargL@\endcsname means argument on the left detected, @ in the end means require further detection; \csname ev#2@YargR@Np@YargL@Yp\endcsname means second parentheses is detected, output (c1 → c2) with two blue frame boxes otherwise output c1 → c2 with two blue frame boxes otherwise do nothing \csname ev#2@YargL@Qp@\endcsname meansbinary evaluation will not be decomposed into two unary evaluation . @ in the end means require further detection; \csname ev#2@YargL@Qp@YargR@\endcsname meansargument on the right is detected,@ in the end means require further detection; \csname ev#2@YargL@Qp@YargR@Yp\endcsname meansparentheses is detected,output (c1 → c2) with single violet box otherwiseoutput c1 → c2 with single violet box
- Left-aligning lines of text to left edge of right-aligned line?by Dan Li on February 5, 2026 at 1:36 am
What I’m trying to accomplish is best illustrated as follows: The first line (“Monday, December 22, 2025, 16:00 EST”) is right-aligned to the text width (possibly by \hfill, but not a hard requirement). The second line (“New York City, New York”) needs to be left-aligned to the left edge of that first line. In other words, the start of the M in “Monday” and N in “New York” are vertically aligned. How can this be done?