Hot
- pdfTeX warning (dest): name{cite.ZhouXiaofei2021}by Mohamed on March 29, 2026 at 11:18 pm
How to fix this problem pdfTeX warning (dest): name{cite.ZhouXiaofei2021} has been referenced but doe s not exist, replaced by a fixed one
- Fonts missing Italics in Arabicby Knudsen on March 29, 2026 at 7:32 pm
If one produces a bibliography containing entries in Arabic, you are bound to have to use slanted text, no matter how rare this is in Arabic. Producing it in "Amiri", by Khaled Hosny, yields a text that has titles in slanted text just fine: But producing it either in Arial or Noto leaves the slanted text out and Arial is even missing a character: as one can see in this short MWE: \documentclass{article} \begin{filecontents}[overwrite]{arabic.bib} @book{Guillemin-Pollack:Persian, author = {Guillemin, Victor and Pollack, Alan}, title = {\foreignlanguage{arabic}{ﺕﻮﭘﻮﻟﻭﮋﯾ ﺪﯿﻓﺭﺎﻨﺴﯿﻟ ﻢﻗﺪﻣﺎﺘﯾ}}, publisher = {\foreignlanguage{arabic}{ﺱﺎﺤﻟ ﺎﻧﺪﯿﺸﻫ ﺖﻫﺭﺎﻧ }}, note = {\foreignlanguage{arabic}{ﺕﺮﺠﻤﻫ: ﻢﻫﺪﻳ ﻦﺠﻔﻳ ﺥﻭﺎﻫ}}, year = {2006}, pages = {108}, } @book { promenade:ar, AUTHOR = {Ghys, Étienne}, title = {\foreignlanguage{arabic}{ﻥﺯ ﻩﺓ ﺓﺭﺎﻴﻀﻳﺎﺘﻳ}}, note = {\foreignlanguage{arabic}{ﺕﺮﺠﻣﺓ: ﺢﻣﺯﺓ ﺦﻠﻴﻓ}}, PUBLISHER = {ENS Éditions}, address = {Lyon}, YEAR = {2023}, PAGES = {318}, } @book{polya-ar, author = {Pólya, George}, title = {\foreignlanguage{arabic}{ﻚﻴﻓ ﺖﺤﻟ ﻢﺳﺎٔﻟﺓ ﺮﻳﺎﻀﻳﺓ : ﻢﻨﺣﻯ ﺝﺪﻳﺩ ﻒﻳ ﺎﻠﻃﺮﻴﻗﺓ ﺎﻟﺮﻳﺎﻀﻳﺓ }}, publisher = {\foreignlanguage{arabic}{ﺎﻠﻤﻨﻈﻣﺓ ﺎﻠﻋﺮﺒﻳﺓ ﻞﻠﺗﺮﺠﻣﺓ،}}, address = {\foreignlanguage{arabic}{ ﺐﻳﺭﻮﺗ، ﻞﺒﻧﺎﻧ}}, date = {2016}, } \end{filecontents} \usepackage{fontspec} \usepackage{csquotes} \usepackage[english, bidi=basic-r]{babel} \babelprovide[import=ar, mapdigits, language=Default]{arabic} \babelfont{rm}{Times New Roman} % Default font for LTR \babelfont[arabic]{rm}{Arial} % No italic, missing a character %\babelfont[arabic]{rm}{Noto Naskh Arabic} % No italic %\babelfont[arabic]{rm}{Amiri} % Has upright and slanted \usepackage[backend=biber, style=authoryear, autolang=other, url=false, isbn=false, language=auto]{biblatex} \addbibresource{arabic.bib} \begin{document} \nocite{*} \printbibliography \end{document} Is italics missing in two widely distributed fonts, by design, or something wrong with this LaTeX set-up? Same for the missing character in Arial? Obs: Traditional italics are rare in Arabic, and "slanted" Arabic is almost entirely a modern, Western-influenced invention. Arial and Arial Italic are distributed with Windows and MacOS. For Unix one can install it using sudo apt install ttf-mscorefonts-installer. NoTO is OpenSource and distributed bu Google.
- How easy... to write a program that [closed]by peter petersen on March 29, 2026 at 6:05 pm
How easy is it to do a program for 2s complement? That's changing a number into it. What's the best programming language?
- Beamer miniframes: side-by-side gets shifted when \beamergotobuttonby scottkosty on March 29, 2026 at 5:18 pm
I am using code that makes it so the mini frames are on the same line as the section names. However, when I remove navigation symbols and use \beamergotobutton{}, the mini frames can "jump" (i.e., have vertical shift). The problem does not occur if I use "smoothbars" instead. I have the following example file, modified from Beamer miniframes: side-by-side section names and navigation dots. % Source - https://tex.stackexchange.com/a/88403 % Posted by diabonas, modified by community. Modified again by scottkosty to show problem. % Retrieved 2026-03-29, License - CC BY-SA 3.0 \documentclass[compress]{beamer} % using "smoothbars" does not give the same behavior. \useoutertheme[subsection=false]{miniframes} % remove the navigation bar \setbeamertemplate{navigation symbols}{} \usepackage{etoolbox} \makeatletter \patchcmd{\slideentry}{\advance\beamer@tempdim by -.05cm}{\advance\beamer@tempdim by\beamer@vboxoffset\advance\beamer@tempdim by\beamer@boxsize\advance\beamer@tempdim by 1.2\pgflinewidth}{}{} \patchcmd{\slideentry}{\kern\beamer@tempdim}{\advance\beamer@tempdim by 2pt\advance\beamer@tempdim by\wd\beamer@sectionbox\kern\beamer@tempdim}{}{} \makeatother \begin{document} \section{Sec 1} \subsection{} \frame{}\frame{hello \beamergotobutton{anything}}\frame{}\frame{} \section{Sec 2} \subsection{} \frame{}\frame{}\frame{}\frame{} \end{document} I get the following output. The problem can be seen on the second image of the sequence. On the second image, the first mini frame dot is shifted upwards for some reason.
- Why is "every [shape] node" applied before node options?by karlh on March 29, 2026 at 3:35 pm
As a sort of follow-up to a previous question, why is "every [shape] node" applied after node options? For example, \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[every rectangle node/.style={draw=black, minimum width=1cm,minimum height=1cm}] \node [rectangle] {hello!}; \node [rectangle] at (2.5,0) {hello again!}; \node [rectangle,minimum height=2cm] at (0,-2) {Hello, world!}; \bgroup \tikzset{every rectangle node/.style={draw=black,minimum width=1cm, minimum height=2cm}} \node [rectangle] at (2.5,-2) {Hello, world!}; \egroup \node [rectangle] at (0,-3.75) {goodbye!}; \end{tikzpicture} \end{document} which produces The two "Hello, world!" boxes should look the same, but because of the order in which things are applied, they do not. Creating a group with "every rectangle node" fixes it, as in the example, but is cumbersome. (The bgroup...egroup guards prevent the \tikzset settings from propagating to the rest of the picture, too.) My main question: Why is "every [shape] node" applied after the node options, overriding what is (presumably) the user's choice for that particular object, and is there interest from TikZ developers in changing that default to restore what seems to me to be the more intuitive behavior, that is, applying the "every [shape] node" settings just before the node's optional arguments, so the optional arguments override anything that is applied "globally"? If it would be helpful for me to raise this as an issue on Github, I can do that.
- Draw a TikZ path behind cell content and rules in nicematrixby projetmbc on March 29, 2026 at 2:47 pm
I want to draw a TikZ connector between two cells in a NiceTabular, but the path always appears on top of the rules (hvlines) and the text. If I use \CodeAfter, it's on top, and I can't use \CodeBeforebecause the nodes (i-j) are not recognized. How can I draw this path on the background layer? \documentclass[border = 3pt]{standalone} \usepackage{nicematrix} \usepackage{tikz} \begin{document} \renewcommand{\arraystretch}{1.2} \begin{NiceTabular}{>{\bfseries}*{6}{c}}[ hvlines, corners = NW, ] \RowStyle{\bfseries} & A & B & C & D & E \\ A & & & 1 & 1 & \\ B & & & & 1 & 1 \\ C & 1 & & & & 1 \\ D & 1 & 1 & & & \\ E & & 1 & 1 & & % \CodeAfter \tikz\draw[red, ->] (4-1.east) -| (1-2.south); \end{NiceTabular} \end{document}
- Keeping underlined text within the confines of the marginsby user143462 on March 29, 2026 at 2:40 pm
How do I modify the \newcommand in the preamble in order for the underlined text to be properly contained by the margins? I got it here: underline omitting the descenders. Also, my code will not compile without the \usepackage{tikz} in the preamble. I don't have a tikzpicture environment in my code. This is bizarre. \documentclass[10pt]{amsart} \usepackage{soul} \usepackage{tikz} \makeatletter \newcommand*{\whiten}[1]{\llap{\textcolor{white}{{\the\SOUL@token}}\hspace{#1pt}}} \DeclareRobustCommand*\myul{% \def\SOUL@everyspace{\underline{\space}\kern\z@}% \def\SOUL@everytoken{% \setbox0=\hbox{\the\SOUL@token}% \ifdim\dp0>\z@ \raisebox{\dp0}{\underline{\phantom{\the\SOUL@token}}}% \whiten{1}\whiten{0}% \whiten{-1}\whiten{-2}% \llap{\the\SOUL@token}% \else \underline{\the\SOUL@token}% \fi}% \SOUL@} \begin{document} In 2007, a team led by Alice Storey analyzed a chicken bone found in El Arenal, Chile, dating it to 1321--1407 CE~---~over a century before Europeans invaded the region, bringing their own chickens. Storey also found that the El Arenal chicken shared a unique genetic mutation with the ancient chicken breeds of the Polynesian Islands in the Pacific. Thus, \myul{Polynesian peoples, not later Europeans, probably first introduced chickens to South America.} \end{document}
- What is a better approach to plot the double path style as a subpath?by Explorer on March 29, 2026 at 3:03 am
I want to replicate something as below: Now is my code, but good with the conjunction (the double path's start and end, and the glitch of double), even with line join=round: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture}[line join=round] \coordinate (start) at (0,1.5); \coordinate (end) at (0,0); \draw[magenta] (start) -- ++(3,0) coordinate (doublestart) ++(-.5,-1.5) coordinate (doubleend) -- (end); \draw[cyan,double,double distance=2.5pt] (doublestart) .. controls ++(.25,-.75) and ++(-.3,1) .. (doubleend) ; \end{tikzpicture} \end{document}
- Embracing the future (LuaTeX, LaTeX3, ...): where to start? [closed]by PHL on March 29, 2026 at 1:14 am
Which ressources (and in which order) would you recommend to learn modern (lua)(La)TeX(3) for an advanced user? I do not intend to write packages, but I would like to be able to write some moderately complicated simple macros(1) using lua/explsyntax. The emphasis is on learning things that will probably still be useful in a few years, even if it might be experimental now (for example: lua-unicode-math instead of unicode-math). (1) Concrete example: write lecture notes for a math class. So both expl3 (for the typesetting) and lua (for computations/graphics) might be useful; but not necessarily together. For context: I started to use TeX 20 years ago. At the time I read lshort, The LaTeX Companion (2e) and the TeXbook. This allowed me to became an advanced user of LaTeX and produce documents of far better quality than the one produced by some old professors still using deprecated methods and preamble full of outdated packages. With the years passing I started to add more and more packages to my preamble, as fixltx2e to finally discover that they became obsolete. Moreover, a lot as happens these past 20 years and it seems that LuaTeX, LaTeX3 and tagging are the future (and to some extend the present) of LaTeX, so it seems reasonable to start anew.
- Multiple authors with multiple affiliations in beamer [closed]by Mat Hunt on March 28, 2026 at 10:48 pm
Okay, a simple question: How do I add multiple authors with multiple affiliations to my Beamer presentation? The simple(but apparently incorrect) way is to use the authblk package and have \author[1]{Fred} \author[2}{Dave} \affil[1]{MI5} \affil[2]{MI6} and that would be it. Use the \maketitle, and that would be it. I don't have any authors. What is going on?
- Change the anchor of the arrow tip from arrows.metaby Sigur on March 28, 2026 at 7:22 pm
I'm using the Circle[] arrow tip from arrows.meta TikZ library. But I'd like to have the center of the circle at the segment points. Observe below that the circle at the (0,0) is not exactly there. MWE \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} \draw[{Circle[]}-{Circle[]}] (0,0) -- (0.5,1); \draw[{Circle[]}-{Circle[]}] (0,0)+(90:1cm) -- +(-90:1cm); \end{tikzpicture} \begin{tikzpicture} \draw[{Circle[]}-{Circle[]}] (0,0) -- (0.5,1); \draw[{Circle[]}-{Circle[]}] (0,1) -- (0,-1); \end{tikzpicture} \end{document}
- How to embed and syntax-highlight EBNF in a LaTeX documentby IA7 on March 28, 2026 at 4:40 pm
I am currently writing a LaTeX document which will involve quite a fair bit of EBNF (Extended Backus-Naur Form). It would be incredibly convenient for the reader of this document if the EBNF was automatically syntax highlighted, but I cannot find a way to do this. If it helps, I am using luaLaTeX and my EBNF snippets are all in external files so I don't have to surround them with a verbatim environment.
- .bib file not working due to a .bib entryby Sam Street on March 28, 2026 at 4:15 pm
Why do .bib files sometimes not work due to bibliography entries? (I do not have any specific problem right now, but thought it might be good to have a page that addresses common issues for example some special characters cause an issue).
- A follow-up question on the scale behavior of different approaches of `\pic`?by Explorer on March 28, 2026 at 2:48 pm
My question is arisen from my previous one, and more specific: As Sammy contributed the excellent solution, says: I find nodes to be an unreliable way to draw circles as the size of the circle depends on it's contents and the value of inner sep. I therefore set inner sep=0pt and specified minimum size. I have the following test example further more: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{calc} \begin{document} \tikzset{ methodA/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm] node[circle,pos=0.75,fill=cyan,inner sep=3pt] {}; }, methodB/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm] node[circle,pos=0.75,fill=magenta,inner sep=0pt,minimum size=.35cm] {}; }, methodC/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm]; % manual decide the "pos-0.75" \fill[violet] ($(1,0)+(45:1cm)$) circle[radius=3pt]; % but I dislike this method, which need two paths, I would always prefer only one command, if possible.And not always easy to control the "pos" instead of angle... }, } \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodA}; \pic [scale=1.5] {methodA}; \draw[thick] (-2,-1) -- pic[pos=.25,scale=1.5] {methodA} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(1)inner sep+scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodB}; \pic [scale=1.5] {methodB}; \draw[thick] (-2,-1) -- pic[pos=.25,scale=1.5] {methodB} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(2)minimum size+scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodC}; \pic [scale=1.5] {methodC}; \draw[thick] (-2,-1) -- pic[pos=.25,scale=1.5] {methodC} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(3)path+scale}; \end{tikzpicture} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodA}; \pic [transform shape,scale=1.5] {methodA}; \draw[thick] (-2,-1) -- pic[pos=.25,transform shape,scale=1.5] {methodA} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(4)inner sep+transform shape,scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodB}; \pic [transform shape,scale=1.5] {methodB}; \draw[thick] (-2,-1) -- pic[pos=.25,transform shape,scale=1.5] {methodB} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(5)minimum size+transform shape,scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodC}; \pic [transform shape,scale=1.5] {methodC}; \draw[thick] (-2,-1) -- pic[pos=.25,transform shape,scale=1.5] {methodC} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(6)path,scale}; \end{tikzpicture} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodA}; \pic [transform shape,scale=1.5] {methodA}; \draw[thick] (-2,-1) -- pic[pos=.25,transform canvas={scale=1.5}] {methodA} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(7)inner sep+transform canvas,scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodB}; \pic [transform shape,scale=1.5] {methodB}; \draw[thick] (-2,-1) -- pic[pos=.25,transform canvas={scale=1.5}] {methodB} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(8)minimum size+transform canvas,scale}; \end{tikzpicture} \begin{tikzpicture} \draw[gray] (-2,-2) grid (6,3); \pic {methodC}; \pic [transform shape,scale=1.5] {methodC}; \draw[thick] (-2,-1) -- pic[pos=.25,transform canvas={scale=1.5}] {methodC} (6,-1); \node[font=\ttfamily,anchor=north west] at (-2,3) {(9)path+transform canvas,scale}; \end{tikzpicture} \end{document} which gives: Now let's consider in such case, I want to \pic the following figure: That is actually a logo, which I want to be \pic[scale](or rotate) at other positions for multiple times. Just to plot the figure as \pic, there are at least three methods, I think: \tikzset{ methodA/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm] node[circle,pos=0.75,fill=cyan,inner sep=3pt] {}; }, methodB/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm] node[circle,pos=0.75,fill=magenta,inner sep=0pt,minimum size=.35cm] {}; }, methodC/.pic={ \draw (0,0) arc[start angle=180,end angle=0,radius=1cm]; % manual decide the "pos-0.75" \fill[violet] ($(1,0)+(45:1cm)$) circle[radius=3pt]; % but I dislike this method, which need two paths, I would always prefer only one command, if possible.And not always easy to control the "pos" instead of angle... }, } In the test result above, their behaviour varied with: simply scale=... transform canvas={scale=...} transform shape,scale=... My question is: I wonder why these scale setting on three approach of \pic are different? (A quite natural follow-up question. IMHO, that is the same one, not asking multiple questions at the same time), when I know "That is actually a logo, which I want to \pic[scale](or rotate) at other positions for multiple times." in advance, how could I select the proper drawing method, to avoid further issues later? Edit My simple opinion on the three approaches without considering that it would be \pic and scale: I would prevent two \path method(method C), which I think that is not elegant syntax enough compared with the others With node on the path and control the radius, just with one command, I prefer these two(method A and B) As for trade-off between inner sep=0pt,minimum size=10pt and inner sep=1cm, I think the first one is better, for the sake of better semantics of a circle node...
- Unwanted gap after CC: when wrapping long email listby Erwann on March 28, 2026 at 2:32 pm
When the Cc: line is long, LaTeX wraps it but leaves an extra gap after the label. I don’t want to use `tabular because the content should wrap. Are there any other options? \documentclass[12pt]{article} \usepackage[margin=1in]{geometry} \usepackage{tcolorbox} \usepackage{hyperref} \usepackage{parskip} \pagestyle{empty} % --- email header --- \newcommand{\EmailSubject}{Example Email Subject} \newcommand{\EmailTo}{recipient@example.com} \newcommand{\EmailCc}{cc1@long-example.com, cc2@long-example.com, cc3@example.com, cc4@example.com} \begin{document} \begin{center} {\LARGE\bfseries Example Flyer Title} \end{center} \bigskip \begin{center} \textbf{You can use the following email template:} \end{center} \bigskip \begin{tcolorbox}[colback=gray!5,colframe=black,title=Email Template] \textbf{Subject:} \EmailSubject \medskip \textbf{To:} \EmailTo \medskip \textbf{Cc:} \EmailCc \bigskip Dear Recipient, \medskip [Body of the email goes here.] \medskip Sincerely, \medskip [Name] [Link or Contact Info] \end{tcolorbox} \end{document}
- When and why do we change the order of expansion?by user110391 on March 28, 2026 at 1:19 pm
Let me know if this question is too broad and I will try to narrow it. So, I am trying to learn expl3, and I am using Gemini, a code project and various articles as my tools. The main article I've been reading is this one, and it has helped. So has Gemini. Gemini is making a lot of mistakes and causing confusion, but for some of the basics, it has helped me a lot (I noticed my ability to understand the linked-to article improved after talking with Gemini). But now, Gemini is seemingly no longer able to teach me, because I've reached the end of its more-accurate-than-not region. It cannot precisely and rigorously explain how TeX does macro expansion. As a result, I do not understand it. Gemini seems to have a bias to unnecessarily utilize expansion signatures and use/eval functions (and therefore it has to utilize more _protected and \exp_not:n functions), which is really making a mess of its code. The code compiles correctly, but with massive amounts of unnecessary pre-expansion. And that is thusly making me really confused about when and why we change the order of expansion. [BTW, perhaps unneccesary expansion combined with nonetheless relatively advanced code is a good indicator of AI-written LaTeX?] So, for context, here is the extent of my understanding till now, taken from the linked-to article: \newcommand{\cmda}{abcd} \uppercase{abcd\cmda} %ABCDabcd So, in this example, we're shown that using \uppercase here does NOT produce the output ABCDABCD. This is explained through the fact that \uppercase is acting on letters, and leaves control sequences unchanged. Now, \cmda is control sequence, but its defintion is a string of letters. So, if we could pre-expand \cmda, then we could get the result ABCDABCD. The article explains two ways to do this, but I'm more interested in why we have to do this in the general case. And I wonder if the above example gives me a general understanding of when expansion is needed. So, when we have a function and we DON'T need to expand it, is it simply because the control sequence is "readable/expandable" by that function, and the function is thusly able to act on its definition? My current understanding can be summed up as this: If you want the function to act on a control sequence's definition, and if the function doesn't expand its input for you, you have to expand the input for it. How to expand depends on how many layers you want to expand, and what the control sequence is (function or variable). Knowing when to pre-expand (and knowing when to protect from pre-expansion) thus reduces to knowing which functions don't, and do, expand for you. I have a feeling this is insufficient, however. Like it isn't a fully general explanation. And even if it is general, it seems imprecise. I would like to be able to break things down into the eyes-vs-mouth-vs-stomach analogy and understand how TeX parses the text and when it expands each component thereof. I currenly have an idea of the mouth expanding everything with a default order, and then the text reaches the stomach fully expanded, and there it gets converted by the PDF engine into points on paper. Understanding this pipeline at high level of detail and rigor would make everything a lot simpler to me. The core idea of expansion and the ordering thereof is simple, but the devil is in the details.
- A \catcode, \everypar and environment problemby sgmoye on March 28, 2026 at 11:49 am
I'm trying to make a simple topic-comment environment. The code here accomplishes this, except for the very first entry. Making the ; active is straightforward, but does not seem to take effect for the first line of the environment. Why and what am I missing? \documentclass{article} \usepackage[textwidth=3in]{geometry} \usepackage{xparse} \newlength{\ingindent} \begingroup \lccode`~=`\^^M \lowercase{% \endgroup%% \NewDocumentCommand{\topic}{s o u{~}}% #3=the line {% \hangindent3em \leftskip\ingindent \bfseries\sffamily #3\par \normalfont \addtolength{\ingindent}{1em}% }% }% \NewDocumentCommand{\comment}{}{% comment in italics \leavevmode\normalfont\itshape } \begingroup \catcode`;=\active \gdef\changesc{\let;=\comment} \endgroup \NewDocumentEnvironment{showit}{O{}}{% \parskip1ex \catcode`;=\active \changesc \obeylines \everypar={\topic} }{} \parindent0pt \begin{document} \thispagestyle{empty} \begin{showit} ;This is a start without a topic and the <semicolon> is apparently not yet active~--~why? Adding \string\leavevmode\ or \string\null\ before the semicolon does work topic 1 topic 2; with some comment topic 3; a comment with actually rather a lot of bla bla bla ;a comment without topic, and the <semicolon> is active topic 4; and a concluding comment a lonely topic \end{showit} \end{document}
- Aligning Theorem/Definition Numbering with Sections in Slidesby RFZ on March 28, 2026 at 10:14 am
I am preparing slides for a talk, and everything looks good. However, I want the numbering of my Definitions, Theorems, and Propositions to be aligned with the sections and to be non-repeating, something like this: Section 1: Theorem 1.1 Definition 1.2 Proposition 1.3 Theorem 1.4 Section 2: Theorem 2.1 Definition 2.2 In my current version, the theorems, definitions, and propositions are numbered sequentially (1, 2, 3, …). How can I fix my current code? Here is the relevant block of my code: \documentclass[]{beamer} \usepackage{tikz} \usepackage{amsthm,amsmath} % ------------------------ % Unified block style % ------------------------ \setbeamercolor{block title}{bg=blue, fg=white} \setbeamercolor{block body}{bg=blue!20, fg=black} % ------------------------ % Custom theorem style using plain 'block' % ------------------------ \makeatletter \def\th@unified{% \normalfont \def\inserttheoremblockenv{block} % use plain block } \makeatother \theoremstyle{unified} % ------------------------ % Single counter for all numbered environments % ------------------------ \newtheorem{proposition}[theorem]{Proposition} % shares the counter % ------------------------ % Unnumbered environments % ------------------------ \newtheorem*{remark}{Remark} \newtheorem*{question}{Question} \newtheorem*{openquestion}{Open question} % ------------------------ % Beamer settings % ------------------------ \setbeamertemplate{theorems}[numbered] \mode<presentation>{\usetheme{Madrid}} \setbeamertemplate{caption}[numbered] \setbeamertemplate{bibliography item}{\insertbiblabel} % ------------------------ % Title info % ------------------------ \title[XX]{XX} \author{XX} \institute[]{XX} \date{XX} \begin{document} \end{document}
- How to change vertical spacing above and below lists when using the parskip option of KOMA-Script and enumitem?by Simon on March 28, 2026 at 12:06 am
I use a template that utilizes the document class scrreprt and thus the KOMA-Script and 1.5x line spacing. Following given guidelines, paragraphs should be separated by vertical spacing and not by indentation, which is why I put the option parskip=full- in the preamble. In order to adopt the appearance of lists to the given guidelines, I included the package enumitem and set the parameters topsep, partopsep, parsep, and itemsep, accordingly. Almost everything works as intended, with one exception: The vertical spacing above and below lists appears bigger than intended and should be smaller. I have prepared an MWE that describes the desired result. How can the MWE be modified, so that the issue regarding the vertical spacing is resolved? Changing topsep=0pt to topsep=-18pt resolves this issue only for below the list and topsep=-36pt only for above the list, despite them having a symmetric effect according to both answers on \topsep, \itemsep, \partopsep, \parsep - what do they each mean (and what about the bottom)?. Thanks in advance! P.S.: The lists without the KOMA-Script also do not fit the given guidelines, yet, it should be mentioned that the KOMA-Script changes the formatting of lists (this behavior is mentioned in its documentation) on top. MWE: \documentclass[a4paper,12pt,parskip=full-]{scrreprt} \usepackage[left=3.5cm,right=3cm,top=3.5cm,bottom=2.5cm]{geometry} \pagenumbering{gobble} \usepackage[onehalfspacing]{setspace} \usepackage{enumitem} \setlist{topsep=0pt,partopsep=18pt,parsep=18pt,itemsep=-18pt}%alternatively:topsep=-18pt or topsep=-36pt \begin{document} I want to write about \begin{enumerate} \item this, and \item that, \end{enumerate} without ending the paragraph, so there should appear 1.5x line spacing (= 18pt) above, within, and below the list, but not the increased vertical spacing of a full line that is reserved for the space between the end and the beginning of two paragraphs as follows. \par Furthermore, a list usually has something to do with its preceding and/or following text and hence is put in the same paragraph like in the example above or here, where it is preceded by a colon: \begin{enumerate} \item A sentence about this, and \item one about that \end{enumerate} ends right here. However, a list could potentially also have nothing to do with its preceding and/or following text and hence they are put into seperate paragraphs -- of which one ends with this sentence -- and show the increased vertical spacing of a full line. \par \begin{enumerate} \item A sentence on these. \item A sentence on those. \end{enumerate} \par This here is about something totally different, hence the new paragraph. Last but not least, one should not forget about paragraphs within an item of a list, as they should be seperated by the increased vertical spacing of a full line: \begin{enumerate} \item The first paragraph of the first item. \par The second paragraph of the first item. \item The second item. \end{enumerate} This line concludes the MWE. \end{document}
- Different types of lines in tree diagramby user242399 on March 27, 2026 at 5:25 pm
I am making a horizontal tree diagram and want the lines (or part of them) to look different in different parts of the diagram. I want to use continuous and dashed lines. Below is an example of what I want to be able to do. I want the lines to be dashed near the root and continuous as they get close to the nodes. The lines can be slightly curved or not, but I specifically do not want them to meet at the root. And a MWE: \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{trees} \begin{document} \begin{tikzpicture}[ grow=right, level distance=3cm, sibling distance=1.5cm, every node/.style={thick, minimum size=8mm} ] \node {Root} child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, dashed] { node {C} } child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, dashed] { node {B} child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, solid] { node {B3} } child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, solid] { node {B2} } child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, solid] { node {B1} } } child [edge from parent path={(\tikzparentnode.east) -- (\tikzchildnode.west)}, dashed] { node {A} }; \end{tikzpicture} \end{document}
- Ignoring the tail of the letter "g" in setting the baseline of text in nodes of a tikz diagramby user143462 on March 27, 2026 at 4:22 pm
I would like the baseline of "with nitrogen" to be aligned with the bottom edge of the square shaded gray. The bottom of the tail (descender) in the "g" is currently setting the baseline for the phrase. I tried using \makebox[0pt]. Same edit for the other node. \documentclass[10pt]{amsart} \usepackage{tikz} \begin{document} \begin{tikzpicture}[x=1cm,y=1.5cm] %The key is drawn. The keys in other bar graphs have sample regions that are squares with edge length 0.25 centimeters. As the vertical dimension is scaled by 150%, the heights of the sample squares must be scaled by 2/3. \path[fill=gray] (6, {2 + (2/3)*0.125}) -- (6.25, {2 + (2/3)*0.125}) -- (6.25, {2 + (2/3)*0.375}) -- (6, {2 + (2/3)*0.375}) -- cycle; \draw (6, {2 +(2/3)*0.125}) -- (6.25, {2 +(2/3)*0.125}) -- (6.25, {2+(2/3)*0.375}) -- (6, {2+(2/3)*0.375}) -- cycle; \node[anchor=south west, inner sep=0, font=\small] at (6.375, {2 + (2/3)*0.125}){\makebox[0pt][l]{with nitrogen}}; \path[fill=black] (6, {2 - (2/3)*0.125}) -- (6.25, {2 - (2/3)*0.125}) -- (6.25, {2 - (2/3)*0.375}) -- (6, {2 - (2/3)*0.375}) -- cycle; \draw (6, {2 - (2/3)*0.125}) -- (6.25, {2 - (2/3)*0.125}) -- (6.25, {2 - (2/3)*0.375}) -- (6, {2 - (2/3)*0.375}) -- cycle; \node[anchor=south west, inner sep=0, font=\small] at (6.375, {2 - (2/3)*0.375}){without nitrogen}; \draw (5.875, {2 - (2/3)*0.5}) -- (5.875, {2 + (2/3)*0.5}) -- (8.85, {2 + (2/3)*0.5}) -- (8.85, {2 - (2/3)*0.5}) -- cycle; \end{tikzpicture} \end{document}
- Scale the \pic failed even with transform canvas?by Explorer on March 27, 2026 at 3:13 pm
I have the following tikzpicture with \pic: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture}[ orbit/.pic={ \draw[ultra thick,gray] (0,2) arc[start angle=90,delta angle=360,x radius=.85cm, y radius=2cm] node[pos=.6,circle,fill=white,minimum size=15pt] {} node[pos=.6,circle,fill=gray] {} ; }, atom/.pic={\fill[#1] circle[radius=8pt];}, nuclear/.pic={ \pic{orbit};\pic[rotate=120] {orbit};\pic[rotate=-120] {orbit}; \foreach \i in {30,150,270}{ \pic at (\i:.45) {atom=gray};} \foreach \i in {90,210,330}{ \pic at (\i:.45) {atom=cyan};} \pic {atom=gray}; } ] % \pic{orbit};\pic[rotate=120] {orbit};\pic[rotate=-120] {orbit}; % \foreach \i in {30,150,270}{ \pic at (\i:.45) {atom=gray};} % \foreach \i in {90,210,330}{ \pic at (\i:.45) {atom=cyan};} % \pic {atom=gray}; \pic {nuclear}; \end{tikzpicture} \end{document} That is what I was after! Then I want to add this the the chapter, noted that it need lualatex with ctexbook: \documentclass[fontset=fandol]{ctexbook} \usepackage[ a4paper, hmargin=1.5cm, vmargin=2.5cm, ]{geometry} \usepackage{zhlipsum} \usepackage{tikz} \newcommand\chaptertitleformat[1]{% \begin{tikzpicture}[ orbit/.pic={ \draw[ultra thick,gray] (0,2) arc[start angle=90,delta angle=360,x radius=.85cm, y radius=2cm] node[pos=.6,circle,fill=white,minimum size=15pt] {} node[pos=.6,circle,fill=gray] {} ; }, atom/.pic={\fill[##1] circle[radius=8pt];}, nuclear/.pic={ \pic{orbit};\pic[rotate=120] {orbit};\pic[rotate=-120] {orbit}; \foreach \i in {30,150,270}{ \pic at (\i:.45) {atom=gray};} \foreach \i in {90,210,330}{ \pic at (\i:.45) {atom=cyan};} \pic {atom=gray}; } ] \draw[thick,magenta] (1.25,-.2) node[circle,draw,fill=gray!75,inner sep=1.5pt,anchor=west] {} -- node[pos=.15,above,anchor=south] {#1} % pic[pos=0.9,above=1cm,transform canvas={scale=0.5}] {nuclear} %<-!! here pic[pos=0.9,above=1cm=scale=0.5] {nuclear} %<-!! here ++(.85\textwidth,0) node[circle,draw,fill=gray!75,inner sep=1.5pt,anchor=west] {} ; \end{tikzpicture}% } \ctexset{ chapter = { name = {}, numbering = false, titleformat = \chaptertitleformat } } \begin{document} \chapter{AAAA} \section{aaaa} \zhlipsum[1-3] \end{document} I was after something as below: However, I have tried scale=0.5 or transform canvas={scale=0.5}, but all failed, it didn't scale all the \pic! I was not sure that caused by nested \pic? If possible, I don't want to modifiy the tikzpicture code too much, how to scale all the \pic in this specific case?
- tabular text besides imageby Viesturs on March 27, 2026 at 12:32 pm
In a tabular environment, text needs to be placed symmetrically besides a drawing: Code: \documentclass[a4paper]{article} \usepackage{graphicx} \begin{document} \begin{tabular}[t]{@{}c@{\hspace{0.5cm}} l@{}} \includegraphics[width=0.9cm]{example-image-a} & \begin{minipage}[t]{10cm} % [t] ensures top alignment line 1\\ line 2\\ \end{minipage} \end{tabular} \end{document} Output: Text is hanging below the image. How to place the image and text side by side symmetrically?
- The indentation of the proof name is not right when invoking babel under some settingsby M. Logic on March 27, 2026 at 8:09 am
First a minimal working sample is as follows. \documentclass{ctexbook} \usepackage[bidi=default,main=chinese,provide=*]{babel} \babelprovide{hebrew} \babelfont[hebrew]{rm}[Scale=MatchUppercase, ItalicFont={NewCM10-Italic.otf}, BoldFont={NewCM10-Bold.otf}, BoldItalicFont={NewCM10-BoldItalic.otf}]{NewCM10-Regular.otf} \babelprovide{persian} \babelfont[persian]{rm}[Scale=MatchUppercase, ItalicFont={ParsiMatn-Italic.ttf}, BoldFont={ParsiMatn-Bold.ttf}, BoldItalicFont={ParsiMatn-BoldItalic.ttf}]{ParsiMatn-Regular.ttf} \usepackage{amsthm} \theoremstyle{theorem} \newtheorem{theorem}{定理} \begin{document} \foreignlanguage{hebrew}{נ. ניסן} \foreignlanguage{persian}{أهل السنة} \begin{theorem} 测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字 \end{theorem} \begin{proof} 测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字 \end{proof} \begin{proof}[解答] 测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字 \end{proof} \end{document} As you see, in order to input some non-Chinese texts I invoke the babel package, and to solve the problem in the link I add main=chinese,provide=* before the babel package. But it makes the indentation of the proof name be not right, while to my surprise the the indentation of the proof name resetted is right. Note that I have to use XeLaTeX for some special settings, and that I use MacTex 2026 the latest version, and the problem comes out after I update it. Is there is any way to fix this when I still add bidi=default,main=chinese,provide=* before the babel package?
- Banded Multicolored Outlined With Copy Paste And Arbitrary Colors LuaLaTeXby keymasta on March 27, 2026 at 5:02 am
The spec: Any number of (arbitrary) color bands that we specify filling text Stroked outline Same positioning as normal text No extra text in the pdf stream (for copy-paste behavior you would expect) Ok and we're back to it! Previous versions have led here. None of the solutions so far have checked every box. We got as far as implementing 1-3. This is why this question is not a duplicate of the linked questions. None of the linked solutions implement 4 which is important to me. They all draw the text multiple times which unfortunately shows up in the pdf stream. I think that it is because for each \node the text is written again, This final version should have completely normal text-selection behavior, i.e, only ONE copy of the text. I have a new macro that attempts to use \accsupp to hide the extra copies of the text, but it does not work when I test it on Sumatra. I think that it does fix it for screen readers though which is why I kept it. It will however work when I try it in random other pdf readers like chrome. What I really want here is something that somehow only writes the text once, while looking exactly as this does, so that it should work in almost all pdf viewers. % !TEX TS-program = lualatex \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{pgfplots} \usepackage{accsupp} \usepackage{pdfrender} \newcommand{\TextShadeContour}[3]{% \begin{tikzpicture}[baseline] % Define reference node invisibly — needed for clip coordinates \node[anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt, opacity=0] (n) at (0,0) {#3}; % Scope contains all the cumulative clips from the loop \BeginAccSupp{method=plain,ActualText={}}% \begin{scope}% \foreach \c in {1,2,...,#1}{% \pgfplotscolormapaccess[1:#1]{\c}{ShadingColor}% \definecolor{colortemp}{rgb}{\pgfmathresult}% \pgfmathparse{1-(\c-1)/#1}% \clip let \p1=(n.south west), \p2=(n.north east), in% (n.south west) rectangle (\x2, \y1+\pgfmathresult*\y2-\pgfmathresult*\y1);% \node[colortemp, anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt]% {#3};% }% \end{scope}% \EndAccSupp{}% % Stroke is now outside the scope, so clipping is fully reset \node[anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt] at (0,0) {\textpdfrender{ TextRenderingMode=Stroke, LineWidth=0.5pt, StrokeColor=#2, MiterLimit=0.5, LineJoinStyle=Round }{#3}}; \end{tikzpicture}% }% \begin{document} \pgfplotsset{colormap={ShadingColor}{rgb255=(112,128,144) rgb255=(255,159,101)}}\TextShadeContour{3}{black}{13}\\ \end{document} The question is (maybe) how to use pdf literal commands to do it. My own knowledge of pdf internals is non-existent. Or it's about drawing the path of the text from within tikz vs. the actual text. Hopefully we don't have to use ghostscript or anything funky. Ideally this will just work in a way where we define the macro once and then use it. I know a pdf file can contain this. I can prove it with this typst MWE. If you run it and copy paste the whole line, it will do it just as we want (stuff and other stuff): #let multicolor_outline(content, colors) = { let grad = gradient.linear(..colors, angle:270deg) set text(stroke: 0.3pt, fill: grad.sharp(colors.len())) box(content) } #multicolor_outline([stuff], (red, orange, yellow, green, blue, purple)) and #multicolor_outline([other stuff], (purple, blue)) Previous discussion (which does not involve functional copy-pasting): Question 1 Question 2
- In a `tabularray` environment, drawing horizontal and vertical lines three times thicker than other linesby user143462 on March 26, 2026 at 11:16 pm
I only want two modifications to the pdf file that is made from the following code: First, I do not want the separation between the first row, which is really the column headers, and the second row, which is really the first row of data. Second, I would like an equally thick vertical line separating the first column from the second column. (Again, the first column is really headers for data in the subsequent columns.) \documentclass[10pt]{amsart} \usepackage[utf8]{inputenc} \usepackage{soul} \usepackage{ragged2e} \usepackage{mathtools,array} \usepackage{tabularray} \usepackage{adjustbox} \usepackage{makecell} \begin{document} \begin{center} \begin{tblr}{colspec={Q[c,m,2.9cm]Q[c,m,2.3cm]Q[c,m,3cm]Q[c,m, 3cm]}, hlines, vlines={0.8pt}, vline{1,5}={1}{-}{}, vline{1,5}={2}{-}{0.8pt},row{1}={font=\bfseries}} {Baseline concentration\\of annual precipitation} & {\% change in\\water entering\\aquifers} & {\% change in\\surface water \\used for\\irrigation} & {\% change in\\groundwater used for\\irrigation} \\ \hline[2.4pt] %\hlines={1.6pt}{solid} {Precipitation is currently\\somewhat concentrated}&4.9&0.4&0.9 \\ {Precipitation is currently\\evenly distributed}&11.0&9.0&7.9 \end{tblr} \end{center} \end{document}
- Why does the hook in \chapter fail?by Explorer on March 26, 2026 at 4:56 pm
I have to automatially switch from two-multicols and onecolumn mode with \chapter, here below is what I was after: \documentclass[openany]{book} \usepackage{multicol} \usepackage{lipsum} \begin{document} \chapter{AAAAAAAAAAAAAAAA} \begin{multicols}{2} \section{11} \lipsum[1-3] \section{22} \lipsum[1-3] \end{multicols} \chapter*{BBBBBBBBBBBBBBBBB} \begin{multicols}{2} \section*{11} \lipsum[1-3] \section*{22} \lipsum[1-3] \end{multicols} \chapter{CCCCCCCCCCCCCCCCC} \begin{multicols}{2} \section{11} \lipsum[1-3] \section{22} \lipsum[1-3] \end{multicols} \end{document} However, I want to hook to switch the one/two-columns with \chapter, I tried with: \documentclass{book} \usepackage{multicol} \usepackage{lipsum} \makeatletter \AddToHook{cmd/chapter/before}{\ifnum\col@number>1\end{multicols}\fi\clearpage} \AddToHook{cmd/chapter/after}{\begin{multicols}{2}} \AtEndDocument{\ifnum\col@number>1\end{multicols}\fi} \makeatother \begin{document} \chapter{AAAA} \lipsum[1-3] \chapter*{BBBB} \lipsum[1-3] \chapter{CCCC} \lipsum[1-3] \end{document} but it complained with: ! Argument of \hook_use:nnw has an extra }. <inserted text> \par l.13 \chapter {AAAA} ? Looks like there exists some group mismatch ;-( I wonder why this happened? And how to achieve what I want?
- Resizing fonts inside a BibLaTeX entry that requires another scriptby Knudsen on March 26, 2026 at 2:45 pm
If you are using biblatex on an entry that use another script, biblatex applies the language rules of that entry, ignoring the style and size of the keys in the bibliography as a whole. For example, if you have an entry in English and another in Chinese, it applies the Chinese font on the entire entry, and the numbers, parens of the key will use the arabic numbers of that Chinese font instead of the numbers being used in the text. Resulting on what you see above where each script will have a different key with its own numbers. I attempted to correct this by creating a sort of hybrid font that has the Chinese characters and, for example, Times Roman numerals, in LuaLaTeX. I have succeeded in changing the font by a fall-back scheme as in here: \documentclass{report} % 1. The Multi-lingual Bibliography Database \begin{filecontents*}{multilingual.bib} @book{rudin:zh, author = {Walter Rudin}, title = {实分析与复分析}, translator = {戴牧民 and 张更容 and 郑顶伟 and 李世余}, publisher = {机械工业出版社}, address = {北京}, year = {2006}, langid = {chinese}, } @book{rudin:jp, author = {Walter Rudin}, title = {実解析と複素解析}, translator = {水野 弘文}, publisher = {共立出版}, address = {東京}, year = {1995}, langid = {japanese}, } @book{rudin:kr, author = {Walter Rudin}, title = {실해석학과 복소해석학}, translator = {김성기 and 김도상 and 계승혁}, publisher = {한티미디어}, address = {서울}, year = {2011}, langid = {korean}, } @BOOK{rudin:en, title = {Real and Complex Analysis}, author = {Walter Rudin}, publisher = {McGraw-Hill Book Co.}, address = {New York}, year = {1987}, langid = {english}, } \end{filecontents*} % 2. Localization Files for all three languages \begin{filecontents*}{chinese.lbx} \ProvidesFile{chinese.lbx}[2025/12/29 Chinese strings] \InheritBibliographyExtras{english} \DeclareBibliographyStrings{% % translator = {{译者}{译}}, bytranslator = {{译}{译}}, andothers = {{等}{等}}, } \end{filecontents*} \begin{filecontents*}{japanese.lbx} \ProvidesFile{japanese.lbx}[2025/12/29 Japanese strings] \InheritBibliographyExtras{english} \DeclareBibliographyStrings{ translator = {{翻訳者}{訳}} } \end{filecontents*} \begin{filecontents*}{korean.lbx} \ProvidesFile{korean.lbx}[2025/12/29 Korean strings] \InheritBibliographyExtras{english} \DeclareBibliographyStrings{ translator = {{번역자}{역}} } \end{filecontents*} \usepackage{fontspec} \setmainfont{Times New Roman} % 3. The Cascading Lua Fallback Array % The engine will check these fonts in exact order for missing characters. \directlua{ luaotfload.add_fallback("cjkfallback", { "Noto Serif CJK SC:mode=node;scale=0.74;", % Checks Chinese first "Noto Serif CJK JP:mode=node;scale=0.74;", % Falls to Japanese (for Kana/unique Kanji) "Noto Serif CJK KR:mode=node;scale=0.74;" % Falls to Korean (for Hangul) }) } \usepackage{polyglossia} \usepackage{csquotes} \setmainlanguage[variant=american]{english} \setotherlanguage{chinese} \setotherlanguage{japanese} \setotherlanguage{korean} % 4. Create the Hybrid Fonts for Polyglossia % We give Polyglossia three separate font commands so it passes all internal % script checks, but they all secretly point to the exact same Times+Fallback hybrid! \newfontfamily\chinesefont{Times New Roman}[RawFeature={fallback=cjkfallback}] \newfontfamily\japanesefont{Times New Roman}[RawFeature={fallback=cjkfallback}] \newfontfamily\koreanfont{Times New Roman}[RawFeature={fallback=cjkfallback}] \usepackage[style=authoryear, language=auto, autolang=other, backend=biber]{biblatex} \addbibresource{multilingual.bib} \makeatletter \AtBeginDocument{% \def\blx@ifhyphenationundef#1{\@secondoftwo}} \makeatother \begin{document} \nocite{*} \printbibliography \end{document} but I failed in controlling the size of the font, and CJK shows up in a much larger size that would be appropriate for a text involving two scripts. How can I rescale the CJK scrip to something that is usual, like 0.72 in this construct, without affecting the size of the numerals, which are coming from another font?
- Defining list of commands using \foreachby Lorenzo Riva on March 25, 2026 at 11:02 pm
I want to use a \foreach loop to define a series of commands of the form \bf\l where \l runs through the uppercase letters of the alphabet and \bf\l evaluates to \mathbf{\l}. This is so that I don't have to manually define \bfA, \bfB, etcetera at the start of all my documents. I've tried the following setup (patched together from Defining a newcommand, with variable name, inside another newcommand): \documentclass{article} \usepackage{amsmath,pgffor} \foreach \l in {A,B,C,D} { \expandafter\newcommand\csname bf\l\endcsname{ \mathbf{\l}% } } \begin{document} $\bfA$ $\bfB$ $\bfC$ $\bfD$ \end{document} It resulted in four errors, namely that the four commands are undefined. Where am I going wrong, and why does this not work?
- Gray vector appears with fading in TikZby Sebastiano on March 25, 2026 at 8:33 pm
In TikZ, for my previous answer here: Circular Motion when I use the fading library to create a vector with a fading effect, a smaller gray vector appears inside the main vector. Why does this happen, and is there a way to prevent the inner gray vector from being visible? \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} \usetikzlibrary{arrows.meta, decorations.markings} \usetikzlibrary{fadings} \usepackage{newtxmath} \definecolor{myblue}{RGB}{0, 119, 200} \definecolor{mygreen}{RGB}{27, 175, 78} \definecolor{myorange}{RGB}{245, 130, 32} \begin{document} \begin{center} \begin{tikzpicture}[ vvec/.style={mygreen, line width=2.5pt, -{Latex[length=5mm, width=4mm]}}, avec/.style={myorange, line width=2.5pt, -{Latex[length=5mm, width=4mm]}}, dot/.style={circle, fill=black, inner sep=0pt, minimum size=7pt} ] \def\R{2.5} \draw[gray!20, line width=4mm, -{Latex[length=7mm, width=8mm]}, path fading=north] (155:\R+0.8) arc (155:205:\R+0.8); \node at (180:\R+1.5) {\Large $\boldsymbol{\omega}$}; \end{tikzpicture} \end{center} \end{document}