• Bizarre interaction between `microtype` package and \eqref macro
    by John Pardon on December 30, 2025 at 11:14 pm

    I would have thought that if I declare \let\stdeqref\eqref, then the \stdeqref macro and the \eqref macro would be interchangeable. But here is an example where it fails! Moreover, this failure is (somehow) caused by the microtype package?! What is going on, and how to fix it? \documentclass{article} \usepackage{microtype} \usepackage{amsmath} \let\stdeqref\eqref \begin{document} \begin{equation}\label{a} A \end{equation} This is good spacing: \eqref{a}\allowbreak\eqref{a} This is bad spacing: \stdeqref{a}\allowbreak\stdeqref{a} But the bad spacing becomes good if we remove microtype! \end{document} The reason I'm asking is that I would like to redefine the \eqref macro in a way which uses the usual \eqref macro as a subcomponent, via the usual strategy I've seen time and time again on this site: \let\stdeqref\eqref \renewcommand\eqref[1]{Something fancy containing \stdeqref{#1} etc.} but that doesn't work anymore if \let isn't behaving as expected . . .

  • Drawing Only a Portion of an Oval Frame
    by DDS on December 30, 2025 at 10:39 pm

    Consider the following code which I compile with xelatex: \documentclass{book} \usepackage{graphicx} \usepackage[abs]{overpic} \usepackage{tikz} \definecolor{cadmiumgreen}{rgb}{0.0, 0.42, 0.235} % 0, 107, 60 \definecolor{Gold}{RGB}{228,168,73} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \clip (0,0) ellipse (4.25cm and 5.5cm); \draw[line width=5pt,Gold,fill=cadmiumgreen] ellipse (4.25cm and 5.5cm); \node at (0,0) {\includegraphics[scale=.37,clip, trim = 0 0 0 0]{example-image-a}}; \draw[line width=12pt,Gold!70!black] ellipse (4.25cm and 5.5cm); \end{tikzpicture} \end{center} \end{document} with the output: QUESTION: How may I draw only a part of the 12pt-thick oval frame; in particular, relative to the node (0,0), draw the frame from only -45 degrees to 225 degrees in a clockwise fashion (instead of from -90 degrees to 270 degrees which gives the entire oval)? Thank you.

  • Increase vertical spacing for the boxed choice in enumext
    by Sebastiano on December 30, 2025 at 9:24 pm

    I'm using the enumext package to create multiple-choice questions. In my case, the answer labels are boxed letters, produced using the wrap-label key. The issue is that the boxed letters appear too close to each other vertically. I would like to know the correct way to increase the vertical spacing between the boxed labels, without unnecessarily changing the text spacing or breaking the column alignment. Here a MWE: \documentclass[a4paper,12pt]{article} \usepackage{amsmath, amssymb} \usepackage{graphicx} \usepackage{enumext} \begin{document} \begin{enumext}[label=\textbf{Domanda} \arabic*.,wrap-label=\textbf{#1},list-indent=0pt, save-ans=test] \item Lion \setenumext[keyans]{label=\Alph*,font=\small,nosep,wrap-label={\fbox{\makebox[\height]{##1}}}} \begin{keyans}[columns=2,nosep,mini-env={0.4\linewidth}] \item \item \item \item \miniright \includegraphics[scale=.4]{example-image.png} \end{keyans} \end{enumext} \end{document}

  • Ensure wrapfigure fits on page and appears immediately after text, otherwise break page
    by taiwan12 on December 30, 2025 at 7:32 pm

    I'm defining a custom command in LaTeX that shows a heading, a wrapped image, and some text. Currently, the image is displayed using wrapfigure inside a \des command: \documentclass{article} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{lipsum} \usepackage{parskip} \newsavebox{\imageHolder} \NewDocumentCommand{\wrapimage}{ O{0.5} m }{ \sbox{\imageHolder}{\includegraphics[scale=#1]{#2}} \begin{wrapfigure}{L}{\wd\imageHolder} \usebox{\imageHolder} \end{wrapfigure} } \NewDocumentCommand{\des}{m m m}{ \textbf{#1} \wrapimage{#2} #3 } \begin{document} \des{A}{example-image-a}{\lipsum[1]} \des{B}{example-image-b}{\lipsum[1]} \des{C}{example-image-c}{\lipsum[1]} \end{document} Problem: I want the wrapped image to always appear immediately after the heading ("A", "B"). However, if the image is too large to fit on the remaining space of the page, it should start on the next page instead of overlapping or leaving awkward whitespace. Currently, wrapfigure sometimes floats and breaks the layout in ways I don't want. Question: How can I modify my \des or \wrapimage command so that: The image is always placed right after the heading. If it doesn't fit on the current page, LaTeX automatically starts a page break before the heading + image. The image still wraps text if there is enough space. Any advice on how to achieve this behavior with wrapfigure (or an alternative) would be greatly appreciated.

  • ignore part of formula in horizontal alignment
    by Tamas Papp on December 30, 2025 at 4:56 pm

    I would like to make LaTeX ignore part of a formula in horizontal alignment, ie center it as if that part did not exist. In some sense, the opposite of \phantom. MWE: \documentclass[12pt]{article} \begin{document} \begin{centering} $+$\\ % mark the center visually $3.0$\\ % reference, should align with this $-3.0$\\ % how to remove - from centering? $-3.0\phantom{-}$\\ % this works, but is inelegant \end{centering} \end{document} I could make this work by adding a \phantom of the part copied on the other side, but this feels like a kludge. Is there a way to make the - in the above example show up, but not participate in the horizontal size calculation?

  • XeLaTeX - fontable
    by Rajesh TeXnicians on December 30, 2025 at 2:28 pm

    How can we generate a font table for the XITSMath-Bold font using the XeLaTeX compiler? \documentclass{article} \usepackage{fontspec} \usepackage{fonttable} \begin{document} \fonttable{XITSMath-Bold} \end{document}

  • Weird Issue in Bibliography with BibLatex
    by DaVarPhi on December 30, 2025 at 1:44 pm

    I'm using a template in Overleaf to make a mock article for practice, but it used natbib instead of biblatex so I attempted to replace the package and did all of the suitable replacements (like \citep to \parencite) But, it produced this "ugly" bibliography like below. Notice the bold texts Here is my bib file @book{sutton1998, title = {Reinforcement Learning: An Introduction}, author = {Sutton, Richard S. and Barto, Andrew G.}, year = {1998}, publisher = {MIT Press}, } @inproceedings{togelius2015, title = {AI Researchers, Video Games Are Your Friends!}, author = {Togelius, Julian}, booktitle = {Proceedings of the International Joint Conference on Computational Intelligence}, pages = {3--18}, year = {2015}, publisher = {Springer} } @incollection{johnson2016, author = {Johnson, Mark}, title = {Bullet Hell: The Globalized Growth of Danmaku Games and the Digital Culture of High Scores and World Records}, booktitle = {Transnational Contexts of Culture, Gender, Class, and Colonialism in Play: Video Games in East Asia}, pages = {17--42}, publisher = {Springer}, year = {2016} } @book{koziel2019, title = {Speedrun Science: A Long Guide to Short Playthroughs}, author = {Koziel, Eric}, year = {2019}, publisher = {Fangamer} } @inproceedings{li2019, author = {Li, Raymond C. and Ahn, Jun Min and Esteron, Zachary Tyler and Hong, Qiyin}, title = {Collision Avoidance with Deep Reinforcement Learning}, booktitle = {Proceedings of the 2019 Purdue Undergraduate Research Conference}, year = {2019} } @online{chen2025, author = {Chen, Jackson}, title = {Summer Games Done Quick 2025 Raises \$2.4 Million for Doctors Without Borders}, year = {2025}, organization = {Engadget}, url = {https://www.engadget.com/gaming/summer-games-done-quick-2025-raises-24-million-for-doctors-without-borders-182314037.html}, urldate = {2025-12-31} } And some MWE \input{preamble} \begin{document} LOREM IPSUM DOLOT SIT AMET \parencite{chen2025} LOREM IPSUM DOLOT SIT AMET \parencite{johnson2016} LOREM IPSUM DOLOT SIT AMET \parencite{koziel2019} LOREM IPSUM DOLOT SIT AMET \parencite{li2019} LOREM IPSUM DOLOT SIT AMET \parencite{sutton1998} LOREM IPSUM DOLOT SIT AMET \parencite{togelius2015} \newpage \input{bibliography} \end{document} that produces also an ugly citation Here are the content of preamble.tex that I think directly contributed to the bibliography and also the template for bibliography.tex %preamble.tex \documentclass[12pt,a4,american]{extreport} \usepackage[utf8]{inputenc} \usepackage[indonesian]{babel} \usepackage[T1]{fontenc} \usepackage{relsize} \usepackage{times} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage{actuarialsymbol} \usepackage{lipsum} \usepackage{geometry} \usepackage[onehalfspacing]{setspace} \usepackage{parskip} \usepackage{microtype} \usepackage{fancyhdr} \usepackage[ pdftex, bookmarks=true, unicode=true, pdfusetitle, bookmarksnumbered=true, bookmarksopen=true, breaklinks=true, pdfborder={0 0 1}, backref=page, colorlinks=false ]{hyperref} \usepackage[noabbrev, capitalise]{cleveref} \usepackage{xcolor} \usepackage[style=authoryear, backend=biber]{biblatex} \DeclareDelimFormat{nameyeardelim}{\addcomma\space} \addbibresource{citation.bib} \usepackage{xurl} \usepackage[nottoc,numbib]{tocbibind} % bibliography.tex \clearpage \phantomsection \addcontentsline{toc}{chapter}{BIBLIOGRAPHY} \nocite{*} \printbibliography[heading=bibintoc, title={BIBLIOGRAPHY}] I don't know what I did wrong here. I have checked the custom settings file of the template and there are no other command that modify the bibliography and I've done the suitable replacements. Any help? EDIT : Added MWE and all the relevant files content.

  • Nested \foreach loop with changing start value
    by Charlie on December 30, 2025 at 12:48 pm

    Im trying to put a text inside a rectangle node in ~104 pages using tikz only if the text has a width less than 355pt. If this text is wider than that, another text will be found that fits this criteria. The text is provided by a python script run from \input command that sequentially obtains the text, out of a pool of 150 different texts. The approach I'm following consists in using a nested \foreach with a variable starting value, that calls this python script, as follows: \newcounter{testcount} \setcounter{testcount}{1} \foreach \i in {1,...,104}{ \foreach \j in {\value{testcount},...,150}{% \renewcommand{\lorem}{{\tiny \input{|python3 loremipsum/loremipsum.py --lorem Ipsum --dolor \j\space --sit 1}}} % \lorem command was defined as empty in preamble \setbox0=\hbox{\lorem} \loremwidth=\wd0 \ifdim\loremwidth > 355 pt \lorem \setcounter{testcount}{\j} \breakforeach \else {} \fi } } Placing the text into the rectangle is not a problem, that's why I ignored this part. However, when I try to compile this using xelatex, I get the following error: ! Missing number, treated as zero. <to be read again> : l.58 } ! Missing endcsname inserted. <to be read again> c@testcount l.58 } ! Use of ??? doesn't match its definition. <argument> ??? ! LaTeX Error: c@testcount invalid in file name. Lost: space... l.58 } ! Missing endcsname inserted. <to be read again> c@testcount l.58 } ! Use of ??? doesn't match its definition. <argument> ??? ! LaTeX Error: c@testcount invalid in file name. Lost: space... l.58 } ! Missing endcsname inserted. <to be read again> c@testcount l.58 } ! Use of ??? doesn't match its definition. <argument> ??? ! LaTeX Error: c@testcount invalid in file name. Lost: space... l.58 } Sometimes, the nested \foreach seem to work with no problems, but when its starting value changes the errors are thrown. The question is: How can I set the start value of the nested \foreach by the the value of counter testcount (which in turn is given by the value of \j)? What am I doing wrong here? Here is the whole code: \documentclass[a5paper,12pt, openany]{book} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tikzpagenodes} \usepackage{array} \usepackage{etoolbox} \usepackage{pgffor} \usepackage{fontspec} \usepackage[right=1cm, left=1.5cm, top=1cm,bottom=2cm]{geometry} \usetikzlibrary{arrows, positioning, calc, shapes} \newcommand{\lorem}{% }% \begin{document} \newdimen\loremwidth \newcounter{testcount} \setcounter{testcount}{1} \foreach \i in {1,...,5}{ \foreach \j in {\value{testcount},...,15}{% % \renewcommand{\lorem}{{\tiny \input{|python3 loremipsum/loremipsum.py --lorem Ipsum --dolor \j\space --sit 1}}} \setbox0=\hbox{\lorem} \loremwidth=\wd0 \ifdim\loremwidth > 355 pt \lorem \setcounter{testcount}{\j} \breakforeach \else {} \fi } } \end{document} Merry Christmas and happy new year! Best regards, C.

  • circuitikz: How to use circuitikz inside a TikZ-matrix
    by cis on December 30, 2025 at 11:27 am

    Is it possible to use circuitikz-shapes as cells inside a TikZ-matrix? (I mean, as cells <*> & <*> & <*> ... \\, how to place nodes afterwards is already clear.) If I put in |[tgenericshape]|{} I get an error ! Package PGF Math Error: Unknown function base (in 'base'). \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \usetikzlibrary{matrix} \begin{document} \begin{circuitikz}[] \node[tgenericshape, label=center:GS0](G0){}; \matrix[matrix of nodes, nodes in empty cells, draw, column sep=11mm, ] at (0,-2) (m){ 1 & 2 & 3 \\ %|[tgenericshape, label=center:GS1]|{} & |[fill=pink]|{Test} & \\ does not work }; \end{circuitikz} \end{document}

  • Font type differs PDFLaTeX and XELaTeX
    by GowriSaro on December 30, 2025 at 10:31 am

    PDFLaTeX produced the output for the below code: \documentclass[10pt]{book} \RequirePackage[T1]{fontenc}% \RequirePackage[]{palatino}% \begin{document} This is for test $a+b=c$ \end{document} XELaTeX produced the output for the below code: \documentclass[10pt]{book} \RequirePackage[no-math]{fontspec}% \RequirePackage[]{unicode-math}% \setmainfont{EB Garamond} \setmathfont{XITS Math} \begin{document} This is for test $a+b=c$ \end{document} Font type differs for the both the PDFs, for PDFLaTeX it showed as Type: Type 1 but for XELaTeX it showed as Type 1 (CID), please advise that both are same or differs, as I'm not an expert in font handling. Also, is this possible to make as Type 1 for both LaTeX engines? All your suggestions are most welcome

  • Multiple footnotes in a figure caption with hyperref in LaTeX
    by taiwan12 on December 30, 2025 at 8:57 am

    I have a problem with hyperref and footnotes inside figure captions. I want to add footnotes to the caption text, so I’m using \footnotemark inside the caption and \footnotetext after the figure. However, when I click the hyperlinked footnote marks in the PDF, the links point to the wrong footnotes (the numbering and the anchors don’t match anymore). In the PDF, the footnote numbers are not correct, but the hyperref links jump to the wrong footnote text. How can I fix this so that the links point to the correct footnotes? \documentclass[12pt]{report} \usepackage{graphicx} \usepackage{float} \usepackage{hyperref} \hypersetup{colorlinks} \usepackage{lipsum} \begin{document} Some text \footnote{footnote I} Some text \footnote{footnote II} \lipsum[1] \begin{figure}[H] \centering \includegraphics[scale=0.3]{example-image} \caption[AAA, BBB, CCC]{AAA\protect\footnotemark, BBB\protect\footnotemark, CCC\protect\footnotemark} \label{fig:A} \end{figure} \footnotetext{figure caption footnote I} \footnotetext{figure caption footnote II} \footnotetext{figure caption footnote III} Some text \footnote{footnote III} Some text \footnote{footnote IV} \begin{figure}[H] \centering \includegraphics[scale=0.3]{example-image} \caption[DDD,EEE]{DDD\protect\footnotemark, EEE\protect\footnotemark} \label{fig:B} \end{figure} \footnotetext{figure caption footnote IV} \footnotetext{figure caption footnote V} \footnotetext{figure caption footnote VI} \lipsum[1] \end{document}

  • circuitikz: How to read out the value of bipoles/length
    by cis on December 30, 2025 at 8:55 am

    According to the manual, section 3.1.4.1 "Components size", bipoles/length (default 1.4cm) is the central parameter; "which can be interpreted as the length of a resistor (including reasonable connections): all other lengths are relative to this value." How can I read out bipoles/length? I tried \pgfmathsetlengthmacro\Rlength{ %\ctikzvalueof{bipoles/length}% does not work %\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}% does not work 5mm% works } without success. What do I have to do? \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \pgfmathsetlengthmacro\Rlength{ %\ctikzvalueof{bipoles/length}% does not work %\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}% does not work 5mm% works } \begin{circuitikz}[european resistors] \draw[] (0,0) to[R, name=R0] (2,0); \draw[red] (R0.west) -- +(\Rlength,0) node[below=3mm]{\Rlength}; \end{circuitikz} \ctikzset{bipoles/length=22.5mm,}% test for value change \begin{circuitikz}[european resistors] \draw[] (0,0) to[R, name=R0] (2,0); \draw[red] (R0.west) -- +(\Rlength,0) node[below=3mm]{\Rlength}; \end{circuitikz} \end{document}

  • background color of 2 columns
    by JamesDoe on December 30, 2025 at 6:42 am

    How can I split my document in two (using paracol I think), such that the left part of the document occupies 30% of the page, and the right part occupies 70%, and set the background color of the left part to gray ? The whole left part needs to be gray, whether there is text or not, and with no margin. There is a header on top that is not part of this two column layout, which is set using tikz. My current text, for reference : \documentclass{article} \usepackage{expkv-cs} \usepackage{fontawesome} \usepackage[T1]{fontenc} % required ? \usepackage[margin=1cm, a4paper]{geometry} % required ? \usepackage[utf8]{inputenc} % required ? \usepackage{tikz} \usepackage{paracol} \usepackage{xcolor} \usepackage{lipsum} \setlength{\parindent}{0cm} % required ? \ekvcSplit\header { textColor={}, backgroundColor={}, firstName={}, lastName={}, occupation={}, leftContent={}, rightContent={} } { \tikz[remember picture, overlay, every node/.style={text=#1}] { \node[rectangle, fill=#2, anchor=north, minimum width=\paperwidth, minimum height=3cm](header) at (current page.north){}; \node[anchor=center](name) at (header.center) {\Huge #3 \bfseries\MakeUppercase{#4}}; \node[below](occupation) at (name.south) {#5}; \node[align=left, anchor=west](leftContent) at (header.west) [xshift=0.5cm] {#6}; \node[align=left, anchor=east](rightContent) at (header.east) [xshift=-0.5cm] {#7}; } } \begin{document} \header{ textColor={white}, backgroundColor={darkgray}, firstName={Jack}, lastName={Sparrow}, occupation={Pirate}, leftContent={ \faGlobe\; English\\ \faBirthdayCake\; 1690\\ \faCar\; Licence }, rightContent={ \faEnvelope\; jack@sparrow.com\\ \faPhone\; 333 5647380\\ \faMapMarker\; On a ship } } \vspace{5cm} % how to set to header size ? \begin{paracol}{2} \lipsum[1] \switchcolumn \lipsum[1] \end{paracol} \end{document}

  • How to reproduce `listings` style features (right-side numbers, stepnumber) in `piton`?
    by d7ek on December 30, 2025 at 5:21 am

    In the listings package, \lstset{numbers=right,stepnumber=3,numberfirstline} gives right-aligned line numbers and numbering every third line. I would like to achieve the same behavior using the piton package instead of listings, but I can’t find equivalent options in the documentation. \documentclass{article} \usepackage{piton,xcolor} \PitonOptions{line-numbers,} %\usepackage{listings} %\lstset{ % numbers=right, % stepnumber=3, % numberfirstline %} \begin{document} %\begin{lstlisting}%[firstnumber=2] \begin{Piton} print("Hello world") x = 1 + 1 print(x) x = 1 + 2 print(x) x = 2 + 2 print(x) \end{Piton} %\end{lstlisting} \end{document}

  • Is it possible to create a circular document?
    by Brendan Langfield on December 30, 2025 at 3:11 am

    I recently learned that it's possible to set fully custom page dimensions using geometry. However as far as I can tell, you can only do rectangular document shapes. Is it possible to use the geometry package or some other method to make the document itself circular?

  • List with one item in an enviroment issue
    by murray on December 30, 2025 at 2:40 am

    The following code produces the output shown. It uses an enviroment inside which there is a description list with just one item. Note the blank line before \item. With that, or with instead, {} or \mbox{}, the code compiles as expected. However, removing that blank line before \item causes error "Something's wrong--perhaps a missing \item when compilation reaches the line \end{oneproperty}. Why does this happen, and how can the definition of oneproplis or oneproperty be modfied so as to avoid the error? \documentclass{article} \usepackage{enumitem} \newlength{\oneproplabelwd} % NB: default is parentheized 2-char sf \settowidth{\oneproplabelwd}{\textsf{(SN)}} % NB: Enclose actual item name in parens, \label[...] in optional arg! \newlist{oneproplis}{description}{1} \newenvironment{oneproperty}[1]{% \setlist[oneproplis,1]{% font=\normalfont\textsf, wide, leftmargin=\dimexpr\parindent+\oneproplabelwd+\labelsep, itemsep=0pt, topsep=2pt, format={\normalfont\textsf}, }\begin{oneproplis}% \upshape} {\end{oneproplis}} \begin{document} \noindent A relation $\leq$ in a set $X$ is said to \emph{well-order} $X$ if it partially orders $X$ and: % \settowidth{\oneproplabelwd}{\textsf{(WO)}} \begin{oneproperty} \item[(WO)\label{property:wo}] Each nonempty subset of $X$ has a least element. \end{oneproperty} \end{document}

  • True-false with `enumext` package
    by Sebastiano on December 29, 2025 at 10:39 pm

    I know very little about the enumext package. My intention is customize block true-false where I can choose the number of columns and create a structure similar to this one. I currently use two macros \newcommand{\truefalse}{\hfill\framebox[1.25em][c]{V}\quad\framebox[1.25em][c]{F}} \newcommand{\squarecap}[1]{\fbox{\makebox[\height]{#1}}} outside the enumext package with enumitem. Here a MWE: \documentclass[a4paper,12pt]{article} \usepackage{mathtools,amssymb} \usepackage{enumext} \usepackage{enumitem} \newcommand{\truefalse}{\hfill\framebox[1.25em][c]{V}\quad\framebox[1.25em][c]{F}} \newcommand{\squarecap}[1]{\fbox{\makebox[\height]{#1}}} \begin{document} \begin{enumext}[label=\textbf{Domanda} \arabic*.,wrap-label=\textbf{#1},list-indent=0pt, save-ans=test] \item My coat is \begin{keyans*}[columns=2,label=\Alph*,wrap-label=\squarecap{#1},labelwidth=1.5em] \item blue. \item green. \item lemon. \item magenta. \end{keyans*} \end{enumext} \textbf{Vero o falso?} \begin{enumerate} \item Se $f(x)=x^2-1$ allora $f(0)=0$\truefalse; \item La funzione $y=3x-2$ passa per l'origine degli assi cartesiani \truefalse; \item $|x+2|+|x-2|=0$ non ha soluzioni\truefalse; \item $2|x-1|<0$ per ogni $x\in\mathbb{R}$, $x\neq 1$\truefalse. \end{enumerate} \end{document}

  • How can I place a mercator map on an overlay tikzpicture?
    by TobiBS on December 29, 2025 at 9:54 pm

    I want to precisely place a mercatormap on my page and hence use the remember picture,overlay options. But I find no way to e.g. put the top left corner of my map to the center of the page. Here is my MWE: \def\mrcpkgprefix{} \documentclass{scrartcl} \usepackage{mercatormap} \begin{document} \begin{tikzpicture}[remember picture, overlay] \node at (current page.center) {E.g. left Corner of the map here?}; \mrcdefinemap{west=9.1,east=9.45,south=48.7,north=48.95,tile size=1cm,zoom=14} \path[draw,fill=green!10] (mrcmap.south west) rectangle (mrcmap.north east); \mrcdrawnetwork \coordinate (Stuttgart) at (mrcq cs:48.775556:9.182778); \node at (Stuttgart) {Stuttgart}; \end{tikzpicture} \end{document} Any idea which option or trick can help to do what I want to achieve?

  • tex4ebook and package adforn do not communicate with each other and give an error
    by Thomkrates on December 29, 2025 at 7:30 pm

    I would like to use the package adforn for decorative purposes. But with tex4ebook I get an error message. Here is a MWE: \documentclass{article} \usepackage{tex4ebook} % for LuaLaTeX font setting \usepackage{unicode-math} \usepackage{ebgaramond} \setmathfont{Garamond-Math} \usepackage{fontspec} \usepackage{adforn} \begin{document} The package adforn with \scalebox{2}[2]{\adfflatleafoutlineright} gives an error when compling with tex4ebook \end{document} The error message is tex4ht warning: package fontspec was prevented from loading ) (c:/texlive/2025/texmf-dist/tex/latex/adforn/adforn.sty (c:/texlive/2025/texmf-dist/tex/latex/svn-prov/svn-prov.sty) ! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.318 } The package fontspec I need for other purposes. Is there a possibility to adjust tex4ebook to the package adforn?

  • How to adjust spacing for flalign* environment
    by Artic on December 29, 2025 at 6:00 pm

    The code \begin{flalign*} x^2-3x+2&>0&&\\ (x-1)(x-2)&>0&& \end{flalign*} \begin{flalign*} &x-1=0 & x-2=0&&\\ &x_1=1 & x_2=2&& \end{flalign*} resulting as in the image. How can I adjust the spacing in areas 1 and 2 as in the image?

  • Using LuaTex for IPA characters of phonetic alphabet gives unusual and incorrect results
    by Thomkrates on December 29, 2025 at 5:06 pm

    I have translated two words of a German name with two special phonetic translators and get phonetic characters that do not show correctly with LuaTeX. And additionally I would need the correct setting also in the epub with tex4ebook. Here is the MWE: \documentclass{article} \usepackage{tex4ebook} % LuaLaTeX \usepackage{unicode-math} \usepackage{ebgaramond} \setmathfont{Garamond-Math} \usepackage{fontspec} \begin{document} [ɛˈk ɔ̃ˈsɑ̃ː] \end{document} See the image below for the result out of LuaTeX: The next image is the correct displaying in the epub with tex4ebook: EDIT 1: When using \usepackage{newunicodechar} and the lines: \newunicodechar{ɑ̃}{\textasciitilde{ɑ}} \newunicodechar{ɔ̃}{\textasciitilde{ɔ}} or the lines \newunicodechar{ɑ̃}{\~{ɑ}} \newunicodechar{ɔ̃}{\~{ɔ}} I get the following error message: ! Package newunicodechar Error: Invalid argument. See the newunicodechar package documentation for explanation. Type H <return> for immediate help. ... l.22 \newunicodechar{ɑ̃}{\textasciitilde{ɑ}} The first argument to \newunicodechar is either too long or an invalid sequence of bytes Invalid sequence of bytes?

  • How to make gibberish text in METAFONT [closed]
    by Grzegorz Brzczyszczykiewicz on December 29, 2025 at 5:06 pm

    I want to make a meaningless gibberish character in METAFONT that I will use in gibberish text, and does not mean anything. The character should resemble a vertical line that is thick at the top and thin at the bottom, and smoothly transitions thick to thin. The ends of the stroke should be rounded. It should be mapped to the "A" glyph slot in the font. It should be made with a single pen stroke, not faked by overlapping different strokes.

  • testing a token's status, if active or not
    by Frigeri on December 29, 2025 at 4:10 pm

    In expl one can test if a token is active or not (just using \token_if_active:) well, I wanted to test if a given token was already active before making it active with my own definition (to, perhaps, reduce the odds of a conflict with others packages). But I ran into the following problem: \documentclass{article} \ExplSyntaxOn \tl_const:Nn \c__pack_exc_tl {!} \cs_new:Npn \pack_test_activ: { \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} } \begin{document} as~expected: \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} \char_set_catcode_active:N ! still~ok: \cs_set:Npn ! {Hi,} \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} but: \pack_test_activ: \end{document} \ExplSyntaxOff I mean, there is a way to make the test in \pack_test_activ in which I can test the current status of the toke ! (better said, at execution time, and not with its value at definition time? EDIT Of course, rescan: \documentclass{article} \ExplSyntaxOn \tl_const:Nn \c__pack_exc_tl {!} \cs_new:Npn \pack_test_activ: { \tl_set_rescan:Nnn \l__pack_tmp_tl {} {!} \exp_args:NV \token_if_active:NTF \l__pack_tmp_tl {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} } \begin{document} as~expected: \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} \char_set_catcode_active:N ! still~ok: \cs_set:Npn ! {Hi,} \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} (now ok:) \pack_test_activ: \end{document} \ExplSyntaxOff There is another way, or this is it?

  • Use some characters from the text font instead of the corresponding ones from mtpro2
    by ncant on December 29, 2025 at 2:10 pm

    I'm typesetting my math document in Times New Roman using XeLaTeX and the fontspec package. I'm using mtpro2 as the math font, but I've noticed that certain letters, such as u, v and w, look quite different from their TNR italic counterparts (maybe because it's advertised as a Times-compatible font). Considering I'm already using the fontspec package, I tried ditching mtpro2 entirely and using other math fonts. I consulted the LaTeX Stack Exchange master list of maths fonts and tried XITS Math, TeX Gyre Termes Math and STIX Two Math. However, these fonts lack some features that I really like about mtpro2, such as round brackets (especially for matrices) and the letter z identical to the letter z in TNR. mtpro2 is here to stay. Next, I found the 'mathastext' package, which enables alphanumeric glyphs from the text font to be used in maths environments. For example, \usepackage[basic, italic]{mathastext} replaces all the alphanumeric characters in the maths font with the corresponding characters in the text font. However, this approach led me to another issue: the spacing between letters is awful, especially the subscripted ones. Since my only issue is with the letters u, v, and w, is there a way to just replace those three and use the rest of the mtpro2 glyphs? The code I'm using for my document is really bog standard: \documentclass{memoir} % Throw an error if this is not XeLaTeX. \usepackage{ifxetex} \RequireXeTeX \usepackage[lite]{mtpro2} \usepackage[no-math]{fontspec} \setmainfont{Times New Roman} \begin{document} \end{document} Any help would be appreciated.

  • circuitikz: European Amplifier (en amp) without pins or with absolut valued pin length
    by cis on December 29, 2025 at 12:10 pm

    I want to create an en amp with a pin length of 0 - alternatively: a pin length with a clearly defined value, for example 5mm. I tried to transfer the "trick" \ctikzset{tripoles/en amp/port width=1, tripoles/en amp/width=1.19, % = 1.7*0.7 } from 4.20.2.2 "Input and output pins symbols"; but this only works with op amp. What do I have to do? \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[] \ctikzset{tripoles/en amp/port width=1, tripoles/en amp/width=1.19, % = 1.7*0.7 } \node[en amp, en amp text={No pins}, label={[yshift=-12mm]below:works not} ] (A){please!}; %% --> Trick from 4.20.2.2 "Input and output pins symbols" \ctikzset{tripoles/op amp/port width=1, tripoles/op amp/width=1.19, % 1.7*0.7 } \draw (3,0) node[op amp, color=blue, label={[yshift=-12mm]below:works} ]{}; \end{circuitikz} \end{document}

  • an error with using a variable defined by pgfmathsetmacro in "let...in..."
    by Khánh Bùi on December 29, 2025 at 10:30 am

    An error occurs when I try to create the point C1. How can I fix this? \documentclass[12pt,a4paper]{book} \usepackage[left=1cm, right=1cm, top=2cm, bottom=2cm]{geometry} \usepackage{mathtools, amssymb, amsthm, amsmath} \usepackage{tikz} \usetikzlibrary{intersections,calc} \begin{document} \begin{tikzpicture} \path (2,5) coordinate (B) (4,0) coordinate (C) ($(B)!1/3!(C)$) coordinate (L) ; % CALCULATE BL and CL and assign them to \bl and \cl respectively \path let \p1 = (B), \p2 = (C), \p3 = (L), \n1 = {veclen(\x1-\x3,\y1-\y3)}, \n2 = {veclen(\x2-\x3,\y2-\y3)} in \pgfextra{ \pgfmathsetmacro{\bl}{\n1} \pgfmathsetmacro{\cl}{\n2} } ; \path ($(C) + (30:\cl)$) coordinate (C1) ; \draw[fill=red] (C1) circle (2pt); \end{tikzpicture} \end{document} after compiling, it said : test.tex: error: 32: Undefined control sequence. ($(C) + (30:\cl) test.tex: error: 32: Missing number, treated as zero. ($(C) + (30:\cl) test.tex: error: 32: Undefined control sequence. ($(C) + (30:\cl) test.tex: error: 32: Argument of \pgfmath@@onquick has an extra }. ($(C) + (30:\cl) test.tex: error: 32: Paragraph ended before \pgfmath@@onquick was complete. ($(C) + (30:\cl)

  • How to get a vertically centered horizontal line within text, like a custom emdash?
    by Gary on December 29, 2025 at 4:45 am

    I'm very likely overlooking the obvious, of course, and was hesitant to ask such a basic question; but would you please direct me to a command(s) that can generate a horizontal line, as in this hackish example. Previously I used \rule[0.5ex]{10pt}{0.8pt} in LaTeX; but couldn't get that to work in ConTeXt. I've been through many of the rule and bar commands in ConTeXt but cannot locate something like this. All I've managed thus far is to add a thick overstrike on top of some emdashes. If a reason why is important, I'm trying to match some old texts that use longer and thicker lines (relative to emdash) in outline headings. Thank you. \setupbar[overstrikes][color=blue,rulethickness=2pt,continue=yes,unit=pt,offset=4] \define[1]\HBar { \overstrikes{--- --- ---} } \starttext This is a hacked \HBar{} blue line, sort of centered vertically. \stoptext

  • Three fonts supports for polyglossia package?
    by Explorer on December 28, 2025 at 5:32 pm

    The code is partially taken from egreg's this answer. I want to typeset the following three languages with three fonts: English: EB Garamond Chinese: FandolSong Greek: Old Standard Noted that I want to write an "English and Chinese" mixed article(which means that it need to switch frequently) to introduced the third language——Greek. As below: \documentclass{book} \usepackage{fontspec} \usepackage{polyglossia} \setmainlanguage{english} \setmainfont{EB Garamond}% English \newfontfamily{\chinesefont}{FandolSong}% Chinese \setotherlanguage{greek} \newfontfamily{\greekfont}{Old Standard}% Greek \begin{document} I want to typeset an article, whose main text is the combination of English, Chinese, which is used to introduced the Greek letters. I want three fonts for them. So, I want to use English and Chinese, switching frequently. And use Greek fonts in whole paragraph. \bigskip English: English Saṃskṛtāvāk Chinese: {\chinesefont 英语、中文 01234 这是一个测试} Greek: {\greekfont τὸν πόλεμον τῶν Ἀθηναῖος} It works well. However, what I want in the real case, is as follows: \bigskip An paragraph of English and Chinese, which shifts frequently. 我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。 {\chinesefont 我是英语} English {\chinesefont 和中文} Chinese {\chinesefont 混排。} is okay, but extremely difficult to switch... Then a paragraph of Greek letters. \textgreek{Θουκυδίδης Ἀθηναῖος ξυνέγραψε τὸν πόλεμον τῶν Πελοποννησίων καὶ Ἀθηναίων, ὡς ἐπολέμησαν πρὸς ἀλλήλους, ἀρξάμενος εὐθὺς καθισταμένου καὶ ἐλπίσας μέγαν τε ἔσεσθαι καὶ ἀξιολογώτατον τῶν προγεγενημένων, τεκμαιρόμενος ὅτι ἀκμάζοντές τε ᾖσαν ἐς αὐτὸν ἀμφότεροι παρασκευῇ τῇ πάσῃ καὶ τὸ ἄλλο Ἑλληνικὸν ὁρῶν ξυνιστάμενον πρὸς ἑκατέρους, τὸ μὲν εὐθύς, τὸ δὲ καὶ διανοούμενον.} It's hard for \texttt{polyglossia} to support an English font together another Chinese font. Is that any ideas? \end{document} I can't set Chinese and English fonts seperately, so frequently switch is quite difficult. I have also tried Fallback, but it doesn't work: \setmainfont[Fallback=FandolSong]{EB Garamond} If somebody get familiar with ctex-bundle, to set Chinese fonts and English fonts seperately, we could use: \usepackage{ctex} \setmainfont{EB Garamond} \setCJKmainfont{FandolSong} However, polyglossia is a little bit conflict with ctex(That maybe my another question or issues). So, this post, I was only after for a ployglossia(or babel) solution.

  • Weird Overleaf error
    by DavidIsDumb on December 28, 2025 at 2:31 am

    I'm writing some math stuff using overleaf but it broke mysteriously. I wrote: \documentclass[11pt]{scrartcl} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage[shortlabels]{enumitem} \usepackage[framemethod=TikZ]{mdframed} \usepackage{amsmath,amssymb,amsthm} \usepackage{epigraph} \usepackage[colorlinks]{hyperref} \usepackage{microtype} \usepackage{mathtools} \usepackage[headsepline]{scrlayer-scrpage} \usepackage{thmtools} \usepackage{listings} \usepackage{derivative} \renewcommand{\epigraphsize}{\scriptsize} \renewcommand{\epigraphwidth}{60ex} \ihead{\footnotesize\textbf{Some text here}} \ohead{\footnotesize Some text here} \providecommand{\re}{\text{Re}} \providecommand{\im}{\text{Im}} \providecommand{\ol}{\overline} \providecommand{\eps}{\varepsilon} \providecommand{\half}{\frac{1}{2}} \providecommand{\dang}{\measuredangle} \providecommand{\CC}{\mathbb C} \providecommand{\FF}{\mathbb F} \providecommand{\NN}{\mathbb N} \providecommand{\QQ}{\mathbb Q} \providecommand{\RR}{\mathbb R} \providecommand{\ZZ}{\mathbb Z} \providecommand{\dg}{^\circ} \providecommand{\ii}{\item} \providecommand{\alert}{\textbf} \providecommand{\opname}{\operatorname} \providecommand{\ts}{\textsuperscript} \DeclareMathOperator{\sign}{sign} \providecommand{\tarc}{\mbox{\large$\frown$}} \providecommand{\arc}[1]{\stackrel{\tarc}{#1}} \reversemarginpar \providecommand{\printpuid}[1]{\marginpar{\href{https://otis.evanchen.cc/arch/#1}{\ttfamily\footnotesize\color{green!40!black}#1}}} \mdfdefinestyle{mdgreenbox}{linecolor=ForestGreen,backgroundcolor=ForestGreen!5, linewidth=2pt,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[headfont=\bfseries\sffamily\color{ForestGreen!70!black}, mdframed={style=mdgreenbox},headpunct={.},]{thmgreenbox} \mdfdefinestyle{mdredbox}{frametitlefont=\bfseries,innerbottommargin=8pt, nobreak=true,backgroundcolor=Salmon!5,linecolor=RawSienna,} \declaretheoremstyle[headfont=\bfseries\color{RawSienna}, mdframed={style=mdredbox},headpunct={\\[3pt]},postheadspace=0pt,]{thmredbox} \mdfdefinestyle{mdblackbox}{linecolor=black,backgroundcolor=RedViolet!5!gray!5, linewidth=3pt,nobreak=true,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[mdframed={style=mdblackbox}]{thmblackbox} \declaretheorem[style=thmredbox,name=Problem]{problem} \declaretheorem[style=thmblackbox,name=Outline,numbered=no]{sol} \declaretheorem[style=thmgreenbox,name=Claim,numbered=no]{claim*} \usepackage{asymptote} \begin{asydef} size(8cm); // set a reasonable default usepackage("amsmath"); usepackage("amssymb"); settings.tex="pdflatex"; settings.outformat="pdf"; import geometry; void filldraw(picture pic = currentpicture, conic g, pen fillpen=defaultpen, pen drawpen=defaultpen) { filldraw(pic, (path) g, fillpen, drawpen); } void fill(picture pic = currentpicture, conic g, pen p=defaultpen) { filldraw(pic, (path) g, p); } pair foot(pair P, pair A, pair B) { return foot(triangle(A,B,P).VC); } pair centroid(pair A, pair B, pair C) { return (A+B+C)/3; } \end{asydef} \begin{document} \title{Some text here} \subtitle{Some text here} \author{Some text here} \date{\today} \maketitle \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} \end{document} When I compile there is no error message, but the last line has a red circle saying "unexpected \end{problem} after $" and the line before that says "unclosed $ found at \end{problem}". All the other probs with this format didn't break, so there's probably no problem with the \end. However, I found that if I type \begin{problem}[some text here] Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} instead for the problem part nothing happens! No error if I delete like half a paragraph. Can somebody explain what is happening? Edit: Also in the first case autocompile doesn't work, saying that my code has errors that must be fixed first before that can run, but for the second case autocompile works. I also found out that autocompile works when I type: \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0.) \end{problem} for the problem, but the last line has the following error message: LaTeX Error: Command \end{mdframed} invalid in math mode. \ (button saying suggest fix using AI) \ Missing $ inserted. \ Missing } inserted. \ Extra }, or forgotten \endgroup.

  • DNA helix and chromosome symbols built in tikz-pgf
    by Sebastiano on December 27, 2025 at 10:22 pm

    I'm wondering if there are predefined symbols chromosomes-dna in pdfLaTeX or done in TikZ similar to those used in biology textbooks. Here two examples: What libraries can I use to create the envelope curves in blue for the "X"? (For the 2-nd figure, credit from wikipedia https://en.wikipedia.org/wiki/Chromosome#/media/File:Chromosome.svg)