Hot
- Using radians in polaraxis environment (PGFplots)by humanoferth on January 30, 2026 at 6:28 pm
I've been trying to graph some polar functions using PGFplots and I've been refrencing this section of the manual: https://tikz.dev/pgfplots/libs-polar where in 5.10.2 it says that I should be using datacs=polarrad to convert to polar coordinates, but the graphs have come out wrong, so I've been using degrees to get accurate graphs, though I would rather be using radians. Any ideas of what I'm doing wrong / what I can do to fix it? I've put a couple of bare-bones examples of what I mean below. \documentclass{report} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepgfplotslibrary{polar} \begin{document} \[\begin{tikzpicture}[baseline={(0,3)}] \begin{polaraxis} \addplot+ [domain=0:360] {cos(x)}; \end{polaraxis} \end{tikzpicture} \begin{tikzpicture}[baseline={(0,3)}] \begin{polaraxis} \addplot+ [domain=0:2*pi,data cs=polarrad] {cos(x)}; \end{polaraxis} \end{tikzpicture}\] \[\begin{tikzpicture}[baseline={(0,3)}] \begin{polaraxis} \addplot+ [domain=0:360] {cos(x)*sin(x)}; \end{polaraxis} \end{tikzpicture} \begin{tikzpicture}[baseline={(0,3)}] \begin{polaraxis} \addplot+ [domain=0:2*pi,data cs=polarrad] {cos(x)*sin(x)}; \end{polaraxis} \end{tikzpicture}\] \end{document} Also a bit of a side note, but is there an easy way to switch the axes from degrees to radians besides manually changing each one individually via the xticklabel command? Thanks!
- \NewTblrTableCommand, how to define it that will valid only locallyby Zarko on January 30, 2026 at 5:32 pm
In my document (textbook) I have lot of tables which can be divided into two groups regarding their layout. For layout of some rows in tables I define a command for their formatting for which I like to use in both groups, but in each group one parameter should be different as in the other group. This I try to solve on a way, that for one group I define command valid for one group, for the other group repat definition with slightly different parameters, but preserve the same name of command. To my pity, after first definition at another definition gives error: command is already defines regardless that each definition is done in closed group as you can se in the next (a bit silly, simplified) MWE: \documentclass[margin=3mm, preview]{standalone} \usepackage{xcolor} \usepackage{tabularray}% version 2025A or newer \begin{document} \begingroup \NewTblrTableCommand\subtitle[1]{% \SetCell[c=7]{l, bg=#1!10, font=\small\bfseries}% } \begin{tblr}{colspec = {*{7}{c}}, hlines, vlines} 1 & 2 & 3 & 4 & 5 & 6 & 7 \\ \subtitle{cyan} subtitle & & & & & & \\ \end{tblr} \endgroup some test between tables \begingroup \NewTblrTableCommand\subtitle[1]{% \SetCell[c=4]{l, bg=#1!10, font=\small\bfseries}% } \begin{tblr}{colspec = {*{4}{c}}, hlines, vlines} 1 & 2 & 3 & 4 \\ \subtitle{teal} subtitle & & & \\ \end{tblr} \endgroup \end{document} Questions: is possible locally redefine first definition with something like \renewcommand? how to limit command definitions by use of the \NewTblrTableCommand that it will be valid just in one group? does my approach to definition of commands and their use wrong? So far I see a way only with defining new parameter in command definitions which would tackle differences between their use in different tables. However, I'm interested for more convenient solution (in each of table are many occurrences of use this commands and I preferer to have short commands as much is possible). If I force compilation of above MWE, I get the following useless result:
- Can I change the font color to black as a scale of grays? [duplicate]by Ivanodivano on January 30, 2026 at 4:38 pm
I have written my thesis with the default black color in latex. The girl from the copy shop told me that that black is a composite black instead of a scale of grays, therefore it count as color and she can't automatically distinguish colored page from black and white ones. Is there a package or something that I can use to change it to scale of grays? Here's my setup: \documentclass[11pt, twoside, openright]{Thesis} %\usepackage{natbib} \usepackage[a-2b,mathxmp]{pdfx}[2018/12/22] \usepackage[OT1]{fontenc} \usepackage[english]{babel} \usepackage{braket} \usepackage{caption} \usepackage{subcaption} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{mathtools} \usepackage{mathrsfs} \usepackage{bbm} \usepackage{parskip} \usepackage{epigraph} \usepackage{lscape} \usepackage[table]{xcolor} \definecolor{black}{gray}{0} \usepackage{multirow} \usepackage{booktabs} \usepackage{array} \setlength{\tabcolsep}{10pt} \usepackage{placeins} \usepackage{cite} \usepackage{siunitx} \usepackage{derivative} \usepackage{algorithm} \usepackage{algpseudocode} % FONT packages \usepackage{textcomp} \usepackage{tgpagella} % Paper size B5 \usepackage{calc} \usepackage{geometry} \geometry{ headheight=4ex, includehead, includefoot, paper=b5paper, inner=15mm, % Inner margin outer=23mm, % Outer margin bindingoffset=10mm, % Binding offset top=20mm, % Top margin bottom=20mm, % Bottom margin } \usepackage[cam,b5,center,pdftex]{crop}
- Tikz size changeby Nick B on January 30, 2026 at 3:07 pm
With the help of AI I created the following: \documentclass{article} \usepackage[margin=1cm]{geometry} \usepackage{tikz} \usetikzlibrary{positioning} % Define colors extracted from the image \definecolor{headerblue}{RGB}{56, 84, 135} \definecolor{headerlight}{RGB}{218, 223, 232} \newcommand*{\Ex}[2]{ \begin{tikzpicture}[baseline=(label.base)] \node[boxstyle, fill=headerblue, text=white] (example) {Example #1\strut}; \node[boxstyle, fill=headerlight, text=black, right=0pt of example] (desc) {#2}; \draw[headerblue, thick] (example.north west) -- (desc.north east) -- (desc.south east) -- (example.south west) -- cycle; \end{tikzpicture} } \begin{document} \thispagestyle{empty} \begin{tikzpicture} % Define common style for the nodes \tikzset{ boxstyle/.style={ font=\sffamily\bfseries\Large, inner ysep=8pt, inner xsep=12pt, outer sep=0pt } } \node[boxstyle, fill=headerblue, text=white] (example) {Example 2\strut}; \node[boxstyle, fill=headerlight, text=black, right=0pt of example] (desc) {Two Distinct Linear Factors in the Denominator\strut}; \draw[headerblue, thick] (example.north west) -- (desc.north east) -- (desc.south east) -- (example.south west) -- cycle; \end{tikzpicture} \Ex{1}{I need some help} \end{document} I am trying use a newcommand so that I can type in the example number and the text without recopying the code. Here is what I have, which produces what I want but you can see that the color does not fill the box and also they are different heights. Any help is appreciated:
- How to tweak this inline chemical equation in a uniform framework?by Explorer on January 30, 2026 at 2:52 pm
What I want to typeset is something as below inline: Here below is my (ugly) attempt: \documentclass{article} \usepackage{lipsum} \usepackage{chemfig} \usepackage[version=4]{mhchem} \usepackage{extarrows} % https://tex.stackexchange.com/a/267541/322482 \makeatletter \DeclareRobustCommand{\textsupsub}[2]{{% \m@th\ensuremath{% ^{\mbox{\fontsize\sf@size\z@#1}}% _{\mbox{\fontsize\sf@size\z@#2}}% }% }} \makeatother \begin{document} \lipsum[2][1-6] HCHO + SO\textsupsub{2--}{3} + H\textsuperscript{+} $\xlongequal{\phantom{xxx}}$ \chemfig[atom sep=2em]{HO-[:30]-[:-30]S(=[:-120]O)(=[:60]O)-[:-30]O\rlap{${}^-$}} \lipsum[3][1-5] \ce{HCHO + SO_3^2- + H^+} $\xlongequal{\phantom{xxx}}$ \chemfig[atom sep=2em]{HO-[:30]-[:-30]S(=[:-120]O)(=[:60]O)-[:-30]O\rlap{${}^-$}} \lipsum[2] \end{document} which combined with: text mode's formula abruptly \xlongequal with abrupt \phantom chemfig which is not properly coordinated in length I wonder is that mechem or chemfig that could typeset this chemical equation in a uniform package framework, instead of composed of multiple isolated parts.
- Macro with mandatory argument in xint (xintexpr)by cis on January 30, 2026 at 12:30 pm
This is my first time using of xint.sty; therefore, I have a few questions: (1) Is \NewDocumentCommand{\sn}{m}{ subsn(expr, var1=value1; var2=#1) } the correct way to define a macro with a mandatory argument for xint? Or does xint provide its own method? (2) The defined command \sn{*} works. However, I can't say \def\x{0.61} \sn{\x}. What do I need to do? \documentclass[margin=10mm, varwidth]{standalone} \usepackage{xintexpr} \begin{document} \section{Test with \texttt{xint}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Is this the correct way to create a xint-macro? %%%%%%%% \NewDocumentCommand{\sn}{m}{% Normal Distr. (with max error of 1.2e-7) \xintieval[5]{subsn(% 'simultaneous substitutions' 0.5 * (2-h*exp( -0.5*x^2 -1.26551223 +1.00002368*h +0.37409196*h^2 +0.09678418*h^3 -0.18628806*h^4 +0.27886807*h^5 -1.13520398*h^6 +1.48851587*h^7 -0.82215223*h^8 +0.17087277*h^9) ), h=1/(1+0.25*sqrt(2)*x); x=#1 )}} \subsection{Direct input \textbackslash sn\{0.61\} - works} sn(0.61) = \sn{0.61} \def\x{0.61} \subsection{Direct input \textbackslash sn\{\textbackslash x\} - works not} sn(\x) = % \sn{\x} \end{document}
- Too much space after primeby bubba on January 30, 2026 at 10:38 am
When I write M'(t) or H''(t) to denote derivatives, I get an unpleasantly large space between the "prime" symbol and the parenthesis. I'm wondering if I perhaps have a corrupted font. Or do people think the output is good and as expected, and my tastes are weird? Second question: what's the best way to fix this? \documentclass{article} \begin{document} $$ \mathbf{M}'(t) = \mathbf{H}''(t) $$ \end{document}
- Make certain item "titles" of enumerate bold textby Roberto Rastapopoulos on January 30, 2026 at 10:06 am
For my homework I would like to make the hand in exercises in bold text, and the practice exercises in normal text. Currently, I have: \documentclass[12pt]{exam} \usepackage{enumitem} \begin{document} \begin{enumerate}[label=Exercise \arabic*.] \item \item \end{enumerate} \end{document} Which results in . But I would like to be able to say something like this: \begin{enumerate}[label=Exercise \arabic*.] \item* \item \end{enumerate} to give . Is there a way to edit the enumerate environment to achieve this in this simple manner?
- Calculate values of standard normal distribution table as macroby cis on January 30, 2026 at 9:18 am
I calc values of the Standard normal table (with 5-digit accuracy). So I wrote a calculation with numerica.sty (using approximate values of the error function). This works so far; if I put in a concrete value like ... [..., x=0.61]. But I would like to have this as a macro, say \sn{<#1>}, for example \sn{0.61} → 0.72907. I tried to put the whole thing into a newcommand, but this seems to be not that easy. I'd like to implement this inside pdflatex, using a package (not Lua, Mathematica, etc.). I've implemented it here using the numerica package because it worked without problems (including the use of the help-variable h, see MWE). However, I'm not sure if numerica is the best choice. The xintexpr package seems promising, but I'm currently unclear on its syntax. In any case: if anyone knows of a better implementation using a different package (e.g., xint.sty), it would be nice too. \documentclass[margin=10mm, varwidth]{standalone} \usepackage{numerica} \begin{document} \section{Test with \texttt{numerica}} \xdef\x{0.61} sn(\x) = \eval*{% 0.5 (2-h \exp( -0.5 x^2 -1.26551223 +1.00002368 h +0.37409196 h^2 +0.09678418 h^3 -0.18628806 h^4 +0.27886807 h^5 -1.13520398 h^6 +1.48851587* h^7 -0.82215223 h^8 +0.17087277 h^9)) }[h=1/(1+0.25*\sqrt{2}*x), x=0.61% cannot use \x here 🙁 ][5] \section{Test with \texttt{xint}} ... ? .... \end{document}
- When using tabbedenum, how can I align the text along the vertical blue line as shown in the figure?by Bayaraa Surenjav on January 30, 2026 at 7:52 am
My code is: \documentclass[12pt,A5paper,oneside]{book}% \usepackage[utf8]{inputenc}% \usepackage[english, mongolian]{babel}% \usepackage{amsmath, amsthm}% \pagestyle{empty} \usepackage{wrapfig} % %\setlength{\parindent}{0pt} % Мөр хоорондын зай %\setlength{\parskip}{\baselineskip} % Мөр хоорондын зай \usepackage{amsfonts} \usepackage{pst-node,amsmath} \usepackage[b]{esvect} \usepackage{multirow} % \usepackage{polynom} \usepackage{pgfplots} \usetikzlibrary{arrows,positioning} \usepackage{tkz-euclide} \usepackage{amsmath,amssymb} \usepackage{mathtools} \usepackage{tikz,witharrows} \usepackage{multicol}% \usepackage{pgfplots} \usetikzlibrary{shapes.symbols} \usetikzlibrary{shapes} \usepackage[normalem]{ulem} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usetikzlibrary{arrows} \usepackage{tikz} \usetikzlibrary{shapes.symbols,shapes.callouts} \usetikzlibrary{positioning} \usepackage{CJKutf8} \usepackage{amssymb} % \usepackage{graphicx, graphics,tipa}% \usepackage[left=20mm,right=20mm,top=15mm,bottom=15mm]{geometry} % \graphicspath{ {pic/} }% \renewcommand{\baselinestretch}{1} % Мөр хоорондын зай \usepackage{graphicx}% \usepackage{xcolor} % %geogebra zurag \usepackage{MnSymbol,wasysym} \usepackage{pgf,tikz} \usepackage{mathrsfs} \usetikzlibrary{arrows} \usepackage{parselines} \usepackage{mathtools} \usepackage{makecell} % \usetikzlibrary{calc,matrix}% \usepackage{array}% \usepackage{enumerate} % \usepackage[inline]{enumitem}%for enviroment % enumerate* \usepackage{tabto}% \usepackage{xlop} % \usepackage{pmboxdraw}% \usepackage[many]{tcolorbox}% \usepackage{blindtext, rotating}% \usepackage{setspace}% \usepackage{tipa}% \usepackage{arcs}% \usepackage{scalerel}% \usepackage{colortbl} \usepackage{secdot} \let\oldabs\abs \usepackage{stackengine}% \usepackage{CJK} \usepackage{mathtools} \usepackage{tcolorbox} \usepackage{pgfplots} \usepackage{fancyhdr} \usetikzlibrary{arrows.meta} \tcbuselibrary{hooks,breakable,skins} \newcommand{\set}[1]{\mathbb{#1}} \newtcolorbox{graphpaperBox}[1][]{ enhanced, sharp corners, breakable, colback=white, underlay={% \begin{tcbclipinterior} \draw[step=5mm, line width=0.2mm, black!20!white, shift={(interior.north west)}] (0,0) grid (interior.south east); \end{tcbclipinterior} } #1} \newenvironment{Tabbedenum}[2][] {\NumTabs{#2}\begin{enumerate*}[label=\emph{\alph*}), before={\unskip\hspace{\dimexpr-\parindent-1pt}\tab},itemjoin={\tab},#1]}% {\end{enumerate*}} \begin{document} \begin{enumerate} \item Цэцгийн дэлгүүрт 5 цахирмааг, 2 ширхэг сарнайтай багцалж авахад 11000 төгрөг, харин 2 цахирмаа, 2 сарнайтай багцалж авахад 8600 төгрөг төлөх байсан бол цахирмаа, сарнай тус бүрийн үнийг дараах алхмаар олоорой. \begin{Tabbedenum}[series=test]{1} \item[а)] Цахирмаа цэцгийн үнийг $x$-ээр, сарнайн үнийг $y$-ээр тэмдэглэе. Бодлогын өгөгдлийг ашиглан дараах байдлаар тэгшитгэлийг зохиовол: 5 цахирмаа, 2 сарнайтай багцалж авахад 11000 төгрөг тул $5x+2y=11000$ болно. 2 цахирмаа цэцэг, 2 улаан сарнай багцалж авахад 8600 төгрөг тул $2x+2y=8600$ болно. \item[б)] Хоёр хувьсагчтай шугаман тэгшитгэл үүснэ. \item[в)] Бодлогын шийд нь дээрх хоёр тэгшитгэлийг хоёуланг нь үнэн байлгах $x, ~y$ хос утгыг олох юм. Ийм утгыг олохдоо эдгээр тэгшитгэлүүдийг хослуулж дараах байдлаар илэрхийлж бодно. \end{Tabbedenum} \end{enumerate} \end{document}
- Change the syntax highlighting color in TexStudioby Duygu Yılmaz on January 30, 2026 at 7:29 am
How can I change the color of {flushleft} inside the parentheses in TeXStudio?
- Diagbox in a table: how to align elements to the right or belowby cis on January 30, 2026 at 6:11 am
Is it possible to configure \diagbox[*]{*}{*} so that the elements to the right or below are aligned? \documentclass[margin=5pt, varwidth]{standalone} \usepackage{diagbox} \begin{document} \begin{tabular}{c | c | *{3}{c}} \hline a & \diagbox{$b$}{$c$} & 0.1 & 0.2 & 0.3 \\ \hline 2 & 0 & 0.1 & 0.2 & 0.3 \\ 2 & 1 & 2.1 & 2.2 & 2.3 \\ 2 & 2 & 4.1 & 4.2 & 4.3 \\ \end{tabular} \end{document}
- pgfplotstable: only display the first of identical elements in a columnby cis on January 30, 2026 at 5:58 am
Small excerpt: I have a pgfplotstable of the type shown. The first column contains only twos, fives, etc. How can I display only the first element of each? Hint: Yes, I need to do it with pgfplotstable. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{pgfplotstable} \usepackage{diagbox} \begin{document} \pgfplotstabletypeset[col sep=comma, header=true, string type, display columns/1/.style={ column name={\diagbox{$b$}{$c$}}, column type={|c|}, }, every head row/.style={ before row=\hline, after row=\hline, }, every row no 3/.style={before row=\hline}, ]{ a, b, 0.1, 0.2, 0.3 2, 0, 0.1, 0.2, 0.3 2, 1, 2.1, 2.2, 2.3 2, 2, 4.1, 4.2, 4.3 5, 0, 0.1, 0.2, 0.3 5, 1, 5.1, 5.2, 5.3 5, 2, 10.1, 10.2, 10.3 5, 3, 15.1, 15.2, 15.3 5, 4, 20.1, 20.2, 20.3 5, 5, 25.1, 25.2, 25.3 } \end{document}
- How to add an OTF font?by Gary on January 30, 2026 at 3:58 am
Having a bit of trouble understanding how to add a font to ConTeXt. I downloaded Libre Caslon to test it from Font Squirrel site which are .otf files. I added them under /home/gary/programs/context/context-linux-64/tex/texmf/fonts/data/gust/libre-caslon. Then ran mtxrun --script fonts --reload --force and mtxrun --script font --list --all libre-caslon which returned identifier familyname fontname filename subfont instances librecaslondisplay librecaslondisplay librecaslondisplayregular librecaslondisplay-regular.otf librecaslondisplaynormal librecaslondisplay librecaslondisplayregular librecaslondisplay-regular.otf librecaslondisplayregular librecaslondisplay librecaslondisplayregular librecaslondisplay-regular.otf librecaslontextbold librecaslontext librecaslontextbold librecaslontext-bold.otf librecaslontextitalic librecaslontext librecaslontextitalic librecaslontext-italic.otf librecaslontextnormal librecaslontext librecaslontextitalic librecaslontext-italic.otf librecaslontextregular librecaslontext librecaslontextregular librecaslontext-regular.otf After that, trying \setupbodyfont[libre-caslon,12pt] or \setupbodyfont[librecaslon,12pt] or \setupbodyfont[librecaslontext,12pt] do not load anything other than the default latin modern. This places the libre-caslon folder near the termes folder and all that is needed there is \setupbodyfont[termes,12pt]. Would you please point me to what step I am failing to perform? Thank you. Added The direction from @MaxChernoff works, in that it now loads regular and italic but for some reason not bold. I don't have anything bold in my document but don't know if that is why. The filenames appear correct. There is no bi or sc in this font. \definefontfamily [LibreCaslon][serif] [Libre Caslon] [tf=file:librecaslontext-regular.otf, it=file:librecaslontext-italic.otf, bf=file:librecaslontext-bold.otf, bi=file:librecaslontext-bold.otf, sc=file:librecaslontext-regular.otf] \setupbodyfont[LibreCaslon,9.5pt]
- Fail to construct spiral gradually with beamer framesby D G on January 30, 2026 at 2:40 am
Objective: The spiral construction is shown gradually. Each iteration is on a separate frame. \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{frame}{step by step spiral construction} \begin{tikzpicture} \draw (0,0) foreach \a in {1,...,120} { \only<\a->{ -- ++({10*\a}:{pow(0.99,\a)}) } }; \end{tikzpicture} \end{frame} \end{document} Error: No file test.nav. ! Package tikz Error: Giving up on this path. Did you forget a semicolon?. See the tikz package documentation for explanation. Type H <return> for immediate help. ... l.16 \end{frame} ?
- Fill plot area with rainbow colorsby Brasil on January 29, 2026 at 11:53 pm
I would like to fill the plot area with the rainbow colors. The wavelength of the colors corresponds to the wavelength of the x-axis. I have the MWE example below. It works fine uless for the line \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); How can I fix it, please? \documentclass[tikz, border=1mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.5} \usepackage{color} \begin{document} \begin{tikzpicture} \small \begin{axis}[% width = 70mm, height = 50mm, % grid = both, xmin = 0.41, xmax = 0.73, % xtick = \empty, % xtick distance = 100, ymin = 1.4, ymax = 2.0, ytick distance = 0.2, xlabel = Wavelength ($\mu$m), ylabel = Refractive index, ] %--> FILL PLOT AREA \foreach \wl in {410,...,729}{ \definecolor{tmpcol}{wave}{\wl} \colorlet{mycol}[rgb]{tmpcol} \fill[mycol!30] (axis cs: \wl/1000, 1.402) rectangle (axis cs: \wl/1000+0.001, 1.998); } %--> Borosilicate glass BK7 \addplot[thick, domain=0.41:0.73] {1.5046 + 0.00420/x^2}; \node at (axis cs: 0.7, 1.57) [above]{BK7}; %--> Barium crown glass BaK4 \addplot[thick, domain=0.41:0.73] {1.5690 + 0.00531/x^2}; \node at (axis cs: 0.7, 1.52) [below]{BaK4}; %--> Dense flint glass SF10 \addplot[thick, domain=0.41:0.73] {1.7280 + 0.01342/x^2}; \node at (axis cs: 0.7, 1.745) [above]{SF10}; \end{axis} \end{tikzpicture} \end{document}
- LyX: KOMA-Script article does not display page numbersby Rich Shepard on January 29, 2026 at 9:48 pm
I have a 4-page article using KOMA-Script scrartcl (Article) class with the following preamble settings: \date{} \usepackage{mathpazo,amssymb} \usepackage{graphicx,relsize} \usepackage{scrlayer-scrpage} \usepackage{xcolor,colortbl} \usepackage{chngcntr,xurl} \definecolor{lightgray}{gray}{0.8} \pagestyle{scrheadings} The document compiles (page style 'headings') but the page numbers do not display. What have I missed? TIA, Rich MWE \documentclass{scrartcl} \date{} \usepackage{mathpazo,amssymb} \usepackage{graphicx,relsize} \usepackage{scrlayer-scrpage} \usepackage{xcolor,colortbl} \usepackage{chngcntr,xurl} \definecolor{lightgray}{gray}{0.8} \pagestyle{scrheadings} \begin{document} page one \clearpage page 2 \end{document}
- How to Make Trajan Text Bold Using Pdflatex?by Jethro on January 29, 2026 at 8:34 pm
MWE: \documentclass[12pt]{book} \usepackage{trajan} \begin{document} \thispagestyle{empty} \LARGE \noindent\trjnfamily{HOW TO MAKE TRAJAN TEXT BOLD?}\\[20pt] \noindent\textbf{\trjnfamily{BUT THIS DOESN'T WORK}} \end{document} The output: Using pdflatex, I would like to make text bold using the trajan font; however, \textbf and \bfseries seem not to work. Is there a way to do this?
- Tagging: Alternative text to symbolby Svend Tveskæg on January 29, 2026 at 7:11 pm
Code Consider the following MWE: % lualatex test.tex \DocumentMetadata{ lang = da, tagging = on } \documentclass{article} \usepackage{siunitx} \begin{document} Displayed text on screen: \qty{15}{\celsius} Text read by screen reader: My green horse is awesome. \end{document} Question How do I make a screen reader read out, say, "My green horse is awesome." while the displayed text/symbol in the PDF file is the output from, say, \qty{15}{\celsius}?
- Extarticle [14pt] option ignored on Overleaf with custom .sty package for math worksheetby Oregon Math Tutor on January 29, 2026 at 6:27 pm
I am working on Overleaf and trying to compile a worksheet in 14pt font using \documentclass[14pt]{extarticle}. However, the output PDF renders two different font sizes, as shown in the image below. I have tried loading lmodern to ensure scalable fonts are used, but the issue persists. I suspect something in my custom package or the class loading is silently blocking the size change. Questions: Is there a specific cache or driver issue on Overleaf that interferes with extarticle? Is there a more robust way (perhaps via the fontsize package) to force 14pt globally that overrides whatever conflict is happening here? Below is a single-file MWE that reproduces the issue (it generates the .sty file automatically). Thanks very much for taking time to assist me! % --- bundled-package.tex --- \begin{filecontents}[overwrite]{solvingguide.sty} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{solvingguide} % I suspect the issue might be here or in the interaction with extarticle \RequirePackage{lmodern} \RequirePackage{mathtools} \RequirePackage{amssymb} \RequirePackage{xcolor} \definecolor{highlightcolor}{RGB}{255, 255, 150} \newcommand{\mathhl}[1]{\colorbox{highlightcolor}{\ensuremath{\displaystyle#1}}} \endinput \end{filecontents} % --------------------------- \documentclass[14pt]{extarticle} \usepackage{solvingguide} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \begin{document} \section*{Problem (Should be 14pt)} A given line has the equation $2x + 12y = -1$. The font size here seems too small. \section*{Solution} \begin{align*} 2x + 12y &= -1 \\ y &= \mathhl{-\frac{1}{6}}x - \frac{1}{12} \end{align*} \end{document}
- Switching from beamer to ltx-talkby Svend Tveskæg on January 29, 2026 at 3:29 pm
Code Consider the following example (it is minimal in the sense that I need all the package for my "real" presentations and I don't know how to make the document compile even without the packages) % lualatex test.tex \DocumentMetadata{ lang = da, tagging = on } \documentclass[ aspectratio = 169, 9pt, serif, danish, xcolor = { svgnames, dvipsnames } ]{ltx-talk} \usepackage{fontspec} \setmainfont[ NFSSFamily = tgp, Extension = .otf, UprightFont = *-Regular, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic, Ligatures = { TeX, CommonOff } ]{texgyrepagella} \usepackage[ math-style = TeX ]{unicode-math} \setmathfont{texgyrepagella-math.otf} \setmathfont[ version = bold, FakeBold = 4 ]{texgyrepagella-math.otf} \DeclareSymbolFont{textdigits}{TU}{tgp}{m}{n} \SetSymbolFont{textdigits}{bold}{TU}{tgp}{b}{n} \Umathcode`0="7 \symtextdigits `0 \Umathcode`1="7 \symtextdigits `1 \Umathcode`2="7 \symtextdigits `2 \Umathcode`3="7 \symtextdigits `3 \Umathcode`4="7 \symtextdigits `4 \Umathcode`5="7 \symtextdigits `5 \Umathcode`6="7 \symtextdigits `6 \Umathcode`7="7 \symtextdigits `7 \Umathcode`8="7 \symtextdigits `8 \Umathcode`9="7 \symtextdigits `9 \usepackage{polyglossia} \setdefaultlanguage{danish} \usepackage{enumitem} \usepackage{pstricks-add} \usepackage{tikz} \usepackage{graphicx} \usepackage[ locale = DE ]{siunitx} \usepackage{hyperref} \usetheme{Malmoe} \useoutertheme{smoothbars} \usecolortheme{spruce} \setbeamercovered{highly dynamic} \setbeamertemplate{blocks}[rounded][shadow = true] \definecolor{pbblue}{HTML}{0A75A8}% filling color for the progress bar \definecolor{pbgray}{HTML}{575757}% background color for the progress bar \makeatletter \def\progressbar@progressbar{} % the progress bar \newcount\progressbar@tmpcounta% auxiliary counter \newcount\progressbar@tmpcountb% auxiliary counter \newdimen\progressbar@pbht % progressbar height \newdimen\progressbar@pbwd % progressbar width \newdimen\progressbar@tmpdim % auxiliary dimension \progressbar@pbwd = \linewidth \progressbar@pbht = 1.5ex % the progress bar \def\progressbar@progressbar{% \progressbar@tmpcounta = \insertframenumber \progressbar@tmpcountb = \inserttotalframenumber \progressbar@tmpdim = \progressbar@pbwd \multiply\progressbar@tmpdim by \progressbar@tmpcounta \divide\progressbar@tmpdim by \progressbar@tmpcountb \begin{tikzpicture}[rounded corners = 2pt, very thin] \shade[top color = pbgray!20, bottom color = pbgray!20, middle color = pbgray!50]% (0pt, 0pt) rectangle ++ (\progressbar@pbwd, \progressbar@pbht); \shade[draw = pbblue, top color = pbblue!50, bottom color = pbblue!50, middle color = pbblue]% (0pt, 0pt) rectangle ++ (\progressbar@tmpdim, \progressbar@pbht); \draw[color = normal text.fg!50] (0pt, 0pt) rectangle (\progressbar@pbwd, \progressbar@pbht) node[pos = 0.5, color = normal text.fg] {% \insertframenumber/\inserttotalframenumber% }; \end{tikzpicture}% } \addtobeamertemplate{headline}{} {% \begin{beamercolorbox}[wd = \paperwidth, ht = 4ex, center, dp = 1ex]{white}% \progressbar@progressbar% \end{beamercolorbox}% } \makeatother \definecolor{nicered}{rgb}{0.647,0.129,0.149} \setlist{ label = \protect\raisebox{3pt}{\colorbox{nicered}{\protect}}, topsep = 1.3ex, itemsep = 1.3ex } \def\punkt(#1,#2)[#3]#4{% \psdot[dotsize = 1pt 2](#1,#2) \uput[#3](#1,#2){$#4$}% } \makeatletter \def\pst@@@hlabel#1{\tiny $#1$} \def\pst@@@vlabel#1{\tiny $#1$} \makeatother \title[]{Svar til opgaverne om koordinatsystemer} \author{7.~årgang} \institute{Gyvelhøjskolen} \date{Februar 2026} \begin{document} \begin{frame} \titlepage \end{frame} \begin{frame}{Besvarelser af opgaverne} \visible<1->{Opgave~$1$:} \begin{minipage}[c]{0.49\textwidth} \begin{figure} \centering \tiny \psset{unit = 0.38} \begin{pspicture}(-6.2,-6.2)(7.2,7.2) \visible<2->{% \rput(0,0){$X$} } \end{pspicture} \end{figure} \end{minipage} \begin{minipage}[c]{0.49\textwidth} \begin{align*} \visible<3->{A &= (2,3)}\\ \visible<4->{B &= (-2,3)} \end{align*} \end{minipage} \end{frame} \end{document} Question How do I change the code in order to make it compilable with ltx-talk? (I don't even know where to start which is why this is sort of a "please do it for me" question. Sorry!) P.S. I have looked at the user manual to no avail, unfortunately.
- Unicode math + LuaLatex issue with fractions in exponentsby MagiicMushroom on January 29, 2026 at 12:45 pm
I am having a bug with Unicode math, where fractions in exponents do not behave well if there are multiple fonts loaded. Here is a MWE demonstration (LuaLatex 2025, replicated locally and on Overleaf): \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath}[version=NCMM] \setmathfont{XITS Math}[range = {}, version = XITS] % edit: the `version = XITS` is not required to replicate the bug \mathversion{NCMM} \begin{document} $a^\frac{3}{2}$ | $\lim$ | $a^\frac{3}{2}$ \end{document} This results in the following output: From testing, all exponents after the \lim seem to be fixed, though on my larger documents this disgrace of a workaround seems to have no effect. Interestingly, it has something to do with the \mathversion, because \documentclass{article} \usepackage{unicode-math} \setmathfont{NewComputerModernMath} \setmathfont{XITS Math}[range = {}] \begin{document} $a^\frac{3}{2}$ | $\lim$ | $a^\frac{3}{2}$ \end{document} Produces two bugged exponents: For context, if I remove the \setmathfont{XITS Math}... line or compile either MWE in XeLaTeX, there is no sizing bug with the exponents. I am not experienced with the internals of Unicode math, this range thing was to solve an issue with \mathcal (see here). Any temporary workaround would be appreciated.
- make datatool sort numericallyby Leo on January 29, 2026 at 11:50 am
I've got a problem with datatool. I already know a little about datatool, but couldn't find any answer in the documentation. The problem is the following: I read a csv file and want to sort the database by a column, which contains numbers (integers in fact, but it could be also real ones). The following mwe illustrates the problem: \documentclass{scrarticle} \begin{filecontents*}{data.csv} A, 20, 15 B, 21, 3 C, 6, 0 \end{filecontents*} \usepackage{datatool} \newcommand{\diff}{} \begin{document} \section*{initial csv} \DTLloaddb[noheader]{data}{data.csv} \DTLdisplaydb{data} \section*{sorted by Column2 (descending)} \DTLsort{Column2=descending}{data} \DTLdisplaydb{data} \section*{add Column4 as difference of C2 and C3} \DTLaddcolumn{data}{Column4} \DTLforeach{data}{ \x=Column2, \y=Column3 }{ \DTLgsub{\diff}{\x}{\y} \DTLappendtorow{Column4}{\diff} } \DTLdisplaydb{data} \section*{Sorted by Column4 (descending)} \DTLsort{Column4=descending}{data} \DTLdisplaydb{data} \end{document} Here the sorting by column 2 works just fine, but the sorting by column 4 doesn't. The logs give a warning, that there is no associated datatype for column 4, so datatool assumes a string and compares by letter. I couldn't find a way to add a datatype to that column (the docs say nothing, or I didn't find it). How can I add a datatype to the column?
- Adjusting text next to a wrapfig environment [closed]by Perch on January 29, 2026 at 10:35 am
Is there a way of getting the text starting from '1.3...' back to its position? This is how I coded it: \begin{wrapfigure}{l}{4cm} \begin{tikzpicture} \draw [thick ,->] (-2,0) -- (2,0); \draw [thick,->] (0,-2) -- (0,2); \draw [thick] (0,0) circle (1.5); \draw[thick,->] (0,0) -- (1.08,1.08); \draw (0.7,0.3) node {$r$}; \end{tikzpicture} \end{wrapfigure} \hspace{-5pt} Tomamos la parametrización de la circunferencia de centro $(0,0)$ y radio $r$ dada por $\alpha: t \in [0,2\pi] \mapsto (r\cos t, r \sin t)$. \\Se tiene que $\alpha'(t) = (-r\sin t,r\cos t)$, así, $$L(\alpha|_{[a,b]}) = \int_0^{2\pi} || \alpha'(t)|| dt = \int_0^{2\pi} \sqrt{(-r \sin t)^2 + (r \cos t)^2}dt = r \int _0^{2\pi}dt = 2\pi r,$$lo que coincide con la intuición. Cabe preguntarse ahora si la longitud depende de nuestra parametrización (que no debería). \subsection{Reparametrización de una curva.} \begin{defi}[]{} Supongamos que tenemos una curva parametrizada $\alpha:I \subset \R \to \R^n$. Se $f: I \subset \R \to I \subset \R$ un difeomorfismo (diferenciable, biyectiva y con inversa diferenciable). Decimos que $\beta:= \alpha \circ f$ es una \textbf{reparametrización } de $\alpha$. \end{defi} Note: the environment 'defi' is a newtcolorbox custom environment.
- Relative placement of horizontal ruleby speech1 on January 29, 2026 at 1:51 am
I want to format a document in latex with horizontal lines under each section heading that start at the beginning of the text and extend to the right margin. I have figured out how to manually space it, but I would like to find a way to get it to adjust based on the text. Here is my example document: \documentclass{article} \usepackage[letterpaper, margin=0.5in]{geometry} \usepackage[scaled]{helvet} \renewcommand\familydefault{\sfdefault} \usepackage[T1]{fontenc} \usepackage{lipsum} \begin{document} \setlength{\leftskip}{0.5in} \setlength{\rightskip}{0.5in} \centerline{\large \textbf{Section}} \hspace{6.98cm}\rule{10.27cm}{4pt} % how to calculate distance to match text above? \par \lipsum[1] \par \bigskip \centerline{\large \textbf{Additional Section}} \hspace{5.92cm}\rule{11.34cm}{4pt} % same question here \par \lipsum[2-3] \par \bigskip \hrule height 2pt depth 2pt width \textwidth \end{document} I found an example in another question for defining blank space: \-\pseudo{The length of blank space} Is there a way to subtract this length from the full text width to get the hspace width I need? Or is there a better way to solve this problem? I'm new to tex and this is my first time asking a question here, please let me know if more is needed, thanks!
- Extend custom \IMG macro: add percentage-based overlay label (white box + letter) at (x%, y%) with separate scaleby taiwan12 on January 28, 2026 at 10:12 pm
I have a basic macro that inserts a figure with \includegraphics, caption, and label: \documentclass{report} \usepackage{graphicx} \usepackage{float} \newcommand{\IMG}[4]{ \begin{figure}[H] \centering \includegraphics[scale=#1]{#2} \caption{#3} \label{fig:#4} \end{figure} } \begin{document} \IMG{0.5}{example-image}{Caption}{figA} \IMG{0.6}{example-image}{Caption}{figB} \end{document} I want to extend it so I can overlay a letter inside a white square with a black border on top of the image, with the position given in percentages of the image size, and with a separate scale that affects only the overlay (box + letter), not the image. Desired call syntax: \IMG{imgscale}{filename}{caption}{label}{y}{x}{letter}{overlayscale} Where: imgscale is passed to \includegraphics[scale=...] (scales the image) y and x are relative coordinates inside the image (fractions / percentages of the image size): (y=0, x=0) corresponds to the top-left corner of the image y increases downward (south) x increases to the right (east) e.g. y=0.10 means 10% from the top, x=0.05 means 5% from the left letter is something like A, B, etc. (only one letter) overlayscale scales only the overlay (white square + letter), not the image the letter should be centered inside the square Example usage I want: \IMG{0.5}{example-image}{Caption}{figA}{0.10}{0.05}{A}{1.2} This should place a small white square (black border) near the top-left, at 5% from the left and 10% from the top, and put the letter A inside it. I’m open to tikz, overpic, etc., as long as the coordinates are relative to the image (not the page). Ideally the overlay moves correctly when the image scale changes. It should look like this:
- Match Math Font to Text Fontby GregH on January 28, 2026 at 6:48 pm
Using XeLaTeX, one can easily set the math font to match the main text using the mathspec package. For example, using the open font Carlito on Overleaf, the code \documentclass{article} \usepackage{mathspec} \setallmainfonts{Carlito} \begin{document} 1 $1$ 2 $2$ 3 $3$; consider $f(x) = x^2 + 1$. \end{document} produces numbers lettering that match the main text font: As LuaLaTeX is now the recommended engine, and XeLaTeX support may not be continued, I am looking for a LuaLaTeX equivalent. I cannot find one. I thought the mathastext package was designed to solve my problem, but using \documentclass{article} \usepackage{fontspec} \setmainfont{Carlito} \usepackage{mathastext} \begin{document} 1 $1$ 2 $2$ 3 $3$; consider $f(x) = x^2 + 1$. \end{document} produces Clearly the numbers from math mode are typeset in a different font face. I also tried the unicode-math package with \setmathfont{Carlito}, but that produces the same/similar output with a warning that an OpenType Math font was expected. How do I get mathmode font to match the regular text font?
- Help align the numbers in this bespoke siunitx macroby Miloop on January 28, 2026 at 5:36 pm
I am writing a document where I keep having to write variables that fall between two numbers, say, 10 < x \leq 3 or in some cases even between two quantities such as 12.5 mg < x \leq 3.5 mg. I wrote a macro named \nestednumrange and \nestedqtyrange. Here is my minimal example: \documentclass{article} \usepackage{siunitx} \newcommand{\nestednumrange}[3]{% \ensuremath{\num{#1} #2 \num{#3}}% } \newcommand{\nestedqtyrange}[4]{% \ensuremath{\qty{#1}{#4} #2 \qty{#3}{#4}}% } \begin{document} \nestednumrange{3}{\leq x}{<2} \nestedqtyrange{3}{\leq c}{\leq 3}{\milli\gram} \end{document} I'm happy that is (somehow) works, but the output is a bit ugly, imho: How do I "center" the variable correctly? Should I perhaps add two more {}s specifically for the signs, so that they aren't linked to any element in the macro? Unfortunately, I don't know how to make the macro only accept operators like <, >, \leq, \geq, and =, and throw errors at others.
- Best ways to calculate sums in LaTeXby cis on January 28, 2026 at 2:13 pm
In many computer algebra systems, one can sum a sequence of numbers using the syntax sum(a(k), k, kStart, kEnd) for a sequence a(k) (of real and integer values) with the variable k. What's the best and fastest way to do this with LaTeX? For example, when you want to calculate thousands of values for a table. I've developed a MWE using foreach and fpeval. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{amsmath} \usepackage{tikz} \newcommand\Sum[4]{% \def\mysum{0}% \foreach #2 in {#3,...,#4}{% \def\psum{\fpeval{(#1)}}% \xdef\mysum{\fpeval{\mysum+\psum}}% }\mysum} \begin{document} Test 1: $\displaystyle\sum\limits_{k=1}^{100} k = \Sum{\k}{\k}{1}{100}$ \newcommand\binomial[2]{\fpeval{fact(#1)/(fact(#2)*fact(#1-#2))}} Test 2: $\displaystyle\sum\limits_{k=0}^{5} \dbinom{5}{k} = \Sum{ \binomial{5}{\k} }{\k}{0}{5} =2^5 = \fpeval{2^5}$ \end{document}
- Showcase of beautiful 'electrical circuit diagrams' done in TeX & friendsby cis on January 27, 2026 at 7:03 am
When I saw this thread How to customize CircuiTikz ac - dc symbols or this one Showcase of beautiful typography done in TeX & friends, I had the idea to add a showcase for electrical circuit diagrams. The package would typically be circuitikz. Feel free to post your large, small, or elegant circuit diagrams here in the community wiki. (I will also add some examples occasionally.) Attach your codes (if possible); this would be a great opportunity to learn from your coding and your style. \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors] \draw[] (0,0) to[R=$R_1$, a_=$1\Omega$, name=R1, invert] (3,0); \end{circuitikz} \end{document}