• tabular text besides image
    by 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?

  • Access to overlay information in beamer article class?
    by JSpitzm on March 27, 2026 at 10:40 am

    I know that beamerarticle does not know much of overlays. Is there still a way to access slide changes that would happen in presentation mode from within article mode maybe by patching some beamer(article) definitions? Background is that I would like to add in my article (i.e. the notes to the presentation) markers on each slide change. This is easy for new frames, but I didn't find a way to also do it for new slides within a frame (\beamer@slideinframe is always 1). Edit: here is a MWE as requested: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{beamerarticle} % Define slide change marker \newcommand*\fw{[PP]} % Add marker when new frame starts \AddToHook{env/frame/begin}{% \AddToHookNext{para/begin}{\llap{\fw\hspace{1em}}} } \begin{document} \begin{frame} A new frame starts \begin{itemize}[<+->] \item One \item Two \item Three \end{itemize} \end{frame} \begin{frame} Another frame starts \end{frame} \end{document} The output is: What I want is to add the [PP] marker on every slide change (not only new frame). Consider it an indicator to click forward to the next slide.

  • `crossreftools` command `crtcref{...}` does not include environment name
    by PhoemueX on March 27, 2026 at 10:00 am

    I am trying to follow this answer to fix the references generated by cleveref in section titles. However, the command crtcref proposed in that answer only gives the number of the theorem, without the "name" (i.e., "Theorem" or "theorem"). Here is my minimal code and below the content of the aux file. \documentclass{article} \usepackage{hyperref} \usepackage{cleveref} \newtheorem{theorem}{Theorem}[section] \usepackage{crossreftools} \pdfstringdefDisableCommands{% \let\Cref\crtCref \let\cref\crtcref } \listfiles \begin{document} \section{Test} \begin{theorem}\label{thm:main} text \end{theorem} many pages \section{Proof of \Cref{thm:main}} % correctly typeset, but bookmark does not include "theorem" \crtCref{thm:main}\\ % only prints "1.1" \crtcref{thm:main} % only prints "1.1" \end{document} \relax \providecommand\hyper@newdestlabel[2]{} \providecommand\HyField@AuxAddToFields[1]{} \providecommand\HyField@AuxAddToCoFields[2]{} \@writefile{toc}{\contentsline {section}{\numberline {1}Test}{1}{section.1}\protected@file@percent } \newlabel{thm:main}{{1.1}{1}{Test}{theorem.1.1}{}} \newlabel{thm:main@cref}{{[theorem][1][1]1.1}{[1][1][]1}{}{}{}} \@writefile{lla}{\contentsline {section}{\numberline {\crtrefnumber{thm:main}}thm:main}{1}{theorem.1.1}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {2}Proof of \Cref {thm:main}}{1}{section.2}\protected@file@percent } \gdef \@abspage@last{1} Finally, here are the versions of the relevant packages: cleveref.sty 2018/03/27 v0.21.4 Intelligent cross-referencing crossreftools.sty 2020/07/19 - v1.0

  • Table with varying number of cells per row
    by fpuentegomez on March 27, 2026 at 8:45 am

    I am trying to replicate the table in the image: As you can see, it has varying number of cells in some of the rows. Sample of what I've tried so far (contains only the rows with varying number of cells): \documentclass{article} \usepackage{tabularx} \begin{document} % 1st table with only 1 cell per row \begin{tabularx}{\textwidth}{|>{\centering\arraybackslash}X|} \hline \textbf{LX -- Left Seat LVO}\\ \end{tabularx} % 2nd table with 4 cells per row \begin{tabularx}{\textwidth}{|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|} \hline \textbf{Weights/CG} & A320 & A330 & A350\\ \end{tabularx} % 3rd table with one cell per row \begin{tabularx}{\textwidth}{|>{\centering\arraybackslash}X|} \hline Profile A: Takeoff Perf: FlySmart\\ \end{tabularx} % 4th table with 5 cells per row \begin{tabularx}{\textwidth}{|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|>{\raggedleft\arraybackslash}X|} \hline \textbf{Weights/CG} & A320 CEO & A320 NEO & A330 & A350\\ \hline \end{tabularx} \end{document} I have tried to concatenate tabularx environments because I would like it to fill the whole page laterally, but the problem is that those are different tables, which creates two problems: There are tiny (but still noticeable) gaps in the borders of the cells right after every \end{tabularx} If the "whole table" doesn't fit in the page it is split by one of the \begin{tabularx} instead of filing the page. Is it possible to create everything in a single table? Are there other table packages that you would recommend? Thank you very much in advance

  • The indentation of the proof name is not right when invoking babel under some settings
    by 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{russian} \babelfont[russian]{rm}[Scale=MatchUppercase, ItalicFont={NewCM10-Italic.otf}, BoldFont={NewCM10-Bold.otf}, BoldItalicFont={NewCM10-BoldItalic.otf}]{NewCM10-Regular.otf} \babelfont[russian]{sf}[Scale=MatchUppercase, ItalicFont={NewCMSans10-Oblique.otf}, BoldFont={NewCMSans10-Bold.otf}, BoldItalicFont={NewCMSans10-BoldOblique.otf}]{NewCMSans10-Regular.otf} \babelfont[russian]{tt}[Scale=MatchUppercase, ItalicFont={NewCMMono10-Italic.otf}, BoldFont={NewCMMono10-Bold.otf}, BoldItalicFont={NewCMMono10-BoldOblique.otf}]{NewCMMono10-Regular.otf} \usepackage{amsthm} \theoremstyle{theorem} \newtheorem{theorem}{定理} \begin{document} \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. Is there is any way to fix this when I still add main=chinese,provide=* before the babel package?

  • Banded Multicolored Outlined With Copy Paste (final version)
    by keymasta on March 27, 2026 at 5:02 am

    The spec: Multiple color bands 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. \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{pgfplots} \usepackage{accsupp} \usepackage{pdfrender} \newcommand{\MulticolorOutline}\[3\]{% \begin{tikzpicture}\[baseline\] \node\[anchor=base, inner xsep=0pt, inner ysep=.5pt, outer sep=0pt, opacity=0\] (n) at (0,0) {#3}; \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{}% \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)}}\MulticolorOutline{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

  • Ensure \ExplSyntaxOn inside \input'ed file
    by Miguel V. S. Frasson on March 27, 2026 at 2:40 am

    I have a huge intarray with more than 20k entries, that is to be loaded in some specific cases, so in that specific context, it is \inputed as an external file. The external file has content similar to \intarray_const_from_clist:Nn \g_large_intarray { 15173522, 6038, 173925, 15055255, 5164, 267192, 15044248, 4368, 362979, 14990746, 4547, 460026, 14910139, 410, 557703, 14909833, (skipping more than 2k lines of code...) } The macro that loads this file may be used inside \ExplSyntaxOn/Off regime or outside. If I add \ExplSyntaxOn/\ExplSyntaxOff to the file, if it is used inside ExplSyntax regime, it turns it off after loading it. MWE: \begin{filecontents}{foo.tex} \ExplSyntaxOn % foo code with L3 commands \int_eval:n {1+3} \ExplSyntaxOff \end{filecontents} \documentclass{article} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % code loaded in a package, user doesn't control it \ExplSyntaxOn % conditional loading, skipped in this MWE % \bool_new:N \g_foo_loaded_bool % \bool_set_false:N \g_foo_loaded_bool \cs_new:Nn \meaningful_cmd: { % some relevant commands... input foo if some condition holds \int_compare:nNnT 1 > 0 { \input{foo} } } % user command that can be used inside or outside ExplSyntax regime \NewDocumentCommand{\MeaningfulCmd}{} { \meaningful_cmd: } \ExplSyntaxOff % end of package %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \MeaningfulCmd % User may want to use ExplSyntax and \MeaningfulCmd inside it \ExplSyntaxOn \MeaningfulCmd % ERROR ! "Missing $ inserted" % as \ExplSyntaxOff was called in foo.tex and now _ is math subscript \int_eval:n { 3 * 5 } \ExplSyntaxOff \end{document} Is there a kind of \TempExplSyntaxOn that saves what \ExplSyntaxOn changes and when one call a fictional command like \TempExplSyntaxOff, restores the scenario, so it may be used in this context? PS.: Afterwards, I came out with a workaround: define a user command like \NewDocumentCommand{\DefineMyIntarray}{ m } { \intarray_const_from_clist:Nn \g_large_intarray { #1 } } that can be used in the external life, avoiding the need to call \ExplSyntaxOn (I will use this solution). Edit: I won't use anymore this solution that passes a huge argument to a command as @jps pointed out. So this question looses it urgency, but it is still an interesting question, as one could want to “safely” input a file with arbitrary L3 code.

  • In a `tabularray` environment, drawing horizontal and vertical lines three times thicker than other lines
    by 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}

  • Producing an Elliptical Ring of Different Images
    by DDS on March 26, 2026 at 9:43 pm

    This question is an extension of--- Producing an Elliptical Ring of Images Consider the code: \documentclass{book} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \fill[green!35!black] rectangle (6,8); \draw[ decoration={markings, mark=between positions 0 and 1 step 1/4 with { \node {\includegraphics[width=2.5em]{example-image}}; } }, decorate ] (3,4) ellipse (2cm and 3cm); \end{tikzpicture} \end{center} \end{document} which produces the output: QUESTION: How may I distribute four different images (say, example-image, example-image-, example-image-b, and example-image-c) over the four displayed nodes? I compile with xelatex. Thank you.

  • hline between colored rows in tblr
    by Sak on March 26, 2026 at 8:45 pm

    I’m coloring the background of some rows, i have a drawn some hlines leaving the boundary between rows 4 and 5 in column 1 without an hline. Visually, I still get a thin white gap where that missing hline would be, even though both rows cells are fully background‑colored. I tried to “fill” that gap by drawing an hline with the same color as the background, and also by using tblrtikzabove/tblrtikzbelow to paint over the gap as a possible workaround. In all of these cases, a visible artifact remains: a narrow strip that is a slightly different shade or just white than the surrounding background, so the line is still noticeable. I cannot globally change rows/rowsep or similar table‑wide settings, because I need to scope this behavior and later add specific hlines at selected positions. What I’m looking for is a way, localized to certain row boundaries, to either eliminate that white gap entirely or fill it without causing the visible shade difference, ideally without having to restructure the whole table. \documentclass{article} \usepackage{tabularray} \usepackage{graphicx} \usepackage{geometry} \geometry{margin=0in} %\usepackage{showframe} \usepackage{siunitx} \usepackage{xcolor} \usepackage{bm} \UseTblrLibrary{tikz} \UseTblrLibrary{varwidth} \begin{document} \centering \vspace*{1em} \scalebox{0.59}{ \begin{tblrtikzabove}%tikz attempt %\draw[color=blue] (h4-|v1) -- (h4-|v3); \end{tblrtikzabove} \begin{tblr}{ colspec = { Q[c,wd=3.5cm]%1 Q[c,wd=2cm]%2 Q[c,wd=2cm]%3 Q[c,wd=2cm]%4 Q[c,wd=1.5cm]%5 Q[c,wd=1.5cm]%6 Q[c,wd=2cm]%7 Q[c,wd=2cm]%8 Q[c,wd=1.7cm]%9 Q[c,wd=1.7cm]%10 Q[c,wd=1.7cm]%11 Q[c,wd=1.7cm]%12 Q[c,wd=1.7cm]%13 Q[c,wd=1.7cm]%14 },rowsep=6pt, row{1}={h,ht=2.5cm,font=\sffamily\Large},row{2}={ht=2cm,font=\sffamily\bfseries\Large,h},row{3}={ht=.7cm,font=\sffamily\bfseries\Large},row{4}={ht=.6cm,font=\sffamily\bfseries\large},row{Z}={c,m,font=\Large\sffamily,ht=.8cm}, vlines, hline{Z,Y,1}={solid},hline{1-Z}={3-Z}{solid}, row{1-Y}={fg=red,bg=blue}, %hline{4}={1-2}{blue}, } \SetCell[r=3]{c} {\textbf{Designation}} & \SetCell[r=3]{c} \textbf{Mass per metre} & \SetCell[r=2]{c} \textbf{Depth of section} & \SetCell[r=2]{c}\textbf{Width of section} & \SetCell[c=2]{c} \textbf{Thickness} & & \SetCell[r=2]{c} \textbf{Root radius} & \SetCell[r=2]{c} \textbf{Depth between fillets} & \SetCell[c=2]{c,wd=3.4cm} \textbf{Ratios for local buckling} & & \SetCell[c=2]{c,wd=4cm} \textbf{Second moment of area} & & \SetCell[c=2]{c,wd=3.4cm} \textbf{Radius of gyration} \\ & & & & \textbf{of web} & \textbf{of flange} & & & \textbf{Flange} & \textbf{Web} & \textbf{x--x} & \textbf{y--y} & \textbf{x--x} & \textbf{y--y} \\ & & $\bm{D}$ & $\bm{B}$ & $\bm{t}$ & $\bm{T}$ & $\bm{r}$ & $\bm{d}$ & $\bm{B/2T}$ & $\bm{d/t}$ & $\bm{I_{xx}}$ & $\bm{I_{yy}}$ & $\bm{r_{xx}}$ & $\bm{r_{yy}}$ \\ \textbf{Serial size} & kg/m & mm & mm & mm & mm & mm & mm & & & \si{\textbf{cm}^{\bm{4}}} & \si{\textbf{cm}^{\bm{4}}} & cm & cm \\ 356 × 171 × 45 & 45.0 & 351.4 & 171.1 & 7.0 & 9.7 & 12.7 & 306.6 & 8.82 & 43.8 & 12195 & 811 & 14.50 & 3.75 \\ \end{tblr}} \end{document} my end goal

  • How can I customize ordered list labels when using a LaTeX preamble with pandoc on a github-flavored markdown source file?
    by Rich006 on March 26, 2026 at 7:22 pm

    I have a markdown source file [source.md] List: 1. first item 1. second item I also have a latex preamble file [preamble.tex] \usepackage{enumitem} \setlist[enumerate]{label=[\Alph*]} I run pandoc source.md --from gfm --include-in-header preamble.tex --output out.pdf I would expect the output to look like: List [A] first item [B] second item but instead it is List 1. first item 2. second item How can I modify the preamble to get the expected result?

  • 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?

  • tikz, drawing edge with option "double"
    by Zarko on March 26, 2026 at 4:13 pm

    I'm just curious why drawing a line with edge doesn't consider option double. For example: \documentclass[margin=1pt, 11pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[auto=right, Jvmes/.style args = {#1/#2}{very thick, double distance=#1, draw=#2, double=#2!30}, Jvmes/.default = 2mm/orange, ] \draw[Jvmes] (0,0) -- ++ (0,1); % works as expected \draw[Jvmes] (1,0) edge ++ (0,1); % doesn't works \end{tikzpicture} \end{document}

  • Resizing fonts inside a BibLaTeX entry that requires another script
    by 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?

  • How to restore Type1-style subscript placement when using unicode-math?
    by tmc on March 26, 2026 at 2:20 pm

    I recently noticed that switching from Type1 Latin Modern to OpenType Latin Modern (via unicode-math) changes the placement of subscripts (and superscripts) in both inline and display math. Inline math Consider \sum_{k = 1}^{n} a_{k}. With Type1 Latin Modern (loaded via the lmodern package), the result looks like this: Notice how the subscripts sit compactly: the subscript k in the operator does not protrude far below the baseline; also notice the subscript k in the term of the sum. With OpenType Latin Modern and unicode-math, the result is as follows: Notice that the subscript k on the operator protrudes noticeably further below the baseline, and the subscript k in a_{k} also drops lower. I prefer the Type1 behavior, where the subscripts are more compact and the overall inline expression feels tighter, so that the formula wont't stick out too much. The following GIF might also be helpful to further notice the differences: the first frame is Type1 Latin Modern and the second frame is OpenType Latin Modern. Display math A similar, but opposite, issue appears in displayed sums: with unicode-math, the upper limit n of the index of summation appears noticeably closer to the \sum operator than with Type1 fonts. I am happy with this aspect of the unicode-math behavior. However, the subscript k in the term a_{k} once again drops lower with unicode-math. This may be fine in this context, since it is a formula in display mode (hence, one does not need to be concerned with how it fits with subsequent lines in a paragraph); nevertheless, for consistency with the inline case, I would also prefer to restore the Type1 behavior for subscript placement. Here is a GIF — the first frame is without unicode-math, and the second frame is with unicode-math: Minimal working example (MWE) For Type1 Latin Modern, compile with pdftex: \documentclass{article} \usepackage{lmodern} \begin{document} \(\sum_{k = 1}^{n} a_{k}\) \[ \sum_{k = 1}^{n} a_{k} \] \end{document} For OpenType Latin Modern via unicode-math, compile with luatex: \documentclass{article} \usepackage{unicode-math} % Latin Modern Math is the default font; included for clarity. \setmathfont{Latin Modern Math} \begin{document} \(\sum_{k = 1}^{n} a_{k}\) \[ \sum_{k = 1}^{n} a_{k} \] \end{document} Question Is there a way to restore subscript placement as in the Type1 Latin Modern defaults, without switching back to Type1 fonts? Also, should I do it? That is: would this break other features where one would actually want the subscript placement of unicode-math?

  • Customize local TOC
    by theflame on March 26, 2026 at 1:59 pm

    I am working with the documentclass{scrbook}. My file is made of: 4 chapters + an appendix with 3 chapters. I would like: A global ToC that shows Chapters with Sections + Chapters of the appendix (without the sections). I can achieve this with \setcounter{tocdepth}{1} \tableofcontents \chapter{AAA} \chapter{BBB} \appendix \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} \chapter{EEE} \chapter{FFF} However, I also want a local ToC for every chapter of the appendix, including all the sections of that appended-chapter (which should not be present in the main ToC). I managed to insert the local ToC with \localtableofcontents from the package etoc, but I have: either (1) all sections in the main ToC and in all localToc, or (2) no sections of the appended-chapters in the ToC, but then the localToC are empty.

  • Multi attribute lists
    by mf67 on March 26, 2026 at 1:25 pm

    I'm trying to understand “lists” and made an attempt to store 2 attributes (name and dates); \documentclass{book} \ExplSyntaxOn \prop_new:N\g_personA_prop \prop_new:N\g_personB_prop \newcommand\storeperson[3]{ \prop_gput:Nnn\g_personA_prop{#1}{#2} \prop_gput:Nnn\g_personB_prop{#1}{#3} } \newcommand\person[1]{ \prop_item:Nn\g_personA_prop{#1}~(\prop_item:Nn\g_personB_prop{#1}) } \ExplSyntaxOff \storeperson{001}{Johann Sebastian Bach}{1685–1750} \storeperson{002}{Ludwig van Beethoven}{1770–1827} \begin{document} \person{001} and \person{002} \end{document} Is this the correct way? Is there a better way to store multiple attributes? Is the ~ the correct “hard space” code? I think I read that ~ is treated differently in latex3. (Credit to Ulrike Fischer, who originally made another (one-attribute) macro from which I “Frankenstein’ed” the above attempt.)

  • How to refer the total chapter number and current chapter number in `shipout/background`?
    by Explorer on March 26, 2026 at 9:13 am

    I want something decorative layout like this, where the magenta node indicated the current chapter(just for example): I have the following code now: \documentclass[12pt,oneside,openany]{book} \usepackage{libertine} \usepackage{lipsum} \usepackage{tikz,tikzpagenodes} \usetikzlibrary{matrix} \pagestyle{empty} \usepackage[showframe]{geometry} \usepackage{totcount} \regtotcounter{chapter} \ExplSyntaxOn \tl_new:N \l_matrix_content_tl \int_step_inline:nn {10} { \ifnum #1=4\relax%<-just for example \tl_put_right:Nn \l_matrix_content_tl {|[fill=magenta]|} \fi \tl_put_right:Nn \l_matrix_content_tl {#1\\} } % I want something like this.. but not work % \int_step_inline:nn {\total{chapter}} { % \ifnum #1=\thechapter\relax % \tl_put_right:Nn \l_matrix_content_tl {|[fill=magenta]|} % \fi % \tl_put_right:Nn \l_matrix_content_tl {#1\\} % } \AddToHook{shipout/background}{ \put (0pt,-\paperheight) {% \begin{tikzpicture}[% overlay,remember~picture, ]% % \node[draw,anchor=west,font=\sffamily\bfseries\Huge] at (current page marginpar area.west) {\thechapter/\total{chapter}}; \matrix[ anchor=east, matrix~of~nodes, nodes={draw, align=center,fill=cyan, minimum~size=1.2cm,font=\sffamily\bfseries\Huge}, row~sep=.75cm, column~sep=0mm, inner~sep=0pt, outer~sep=0pt, ] (m) at (current~page.east){% \l_matrix_content_tl }; \end{tikzpicture}% }% } \ExplSyntaxOff \begin{document} \chapter{First Chapter} \lipsum[1-10] \chapter{Second Chapter} \lipsum[1-10] \chapter{Third Chapter} \lipsum[1-10] \end{document} I want to construct the \l_matrix_content_tl with: \int_step_inline:nn {\total{chapter}} { \ifnum #1=\thechapter\relax \tl_put_right:Nn \l_matrix_content_tl {|[fill=magenta]|} \fi \tl_put_right:Nn \l_matrix_content_tl {#1\\} } which complain that: ! Missing number, treated as zero. <to be read again> \def l.24 } ? I guess that \total{chapter} could be empty within the first run, but I have no idea of when and where(or how to delay) to construct the token list?

  • How to complete a full TeX Live installation in the sharelatex container of Overleaf Community Edition?
    by RDiezDiaz on March 26, 2026 at 8:05 am

    Once I access the sharelatex container using bin/shell from the overleaf-toolkit folder, I start a new full installation of the latest TeX Live version in the usual way without using tlmgr install scheme-full, because it does not work. After it finishes, I'm not sure what exactly needs to be done so that the web app can compile my documents. I've tried running tlmgr path add, but it doesn't change the version shown by tlmgr --version. If I export the PATH variable directly inside the container, the version does change, but my documents still won't compile after committing the changes with docker and updating config/version. Does anyone know what actually needs to be done? Thank you.

  • Incompatibilities bewteen xfrac and lua-unicode-math
    by PHL on March 26, 2026 at 7:25 am

    The following MWE gives 3 warnings Font shape in size <3.486> not available with lua-unicode-math, but none with unicode-math % !TEX TS-program = lualatex \documentclass{article} \usepackage{xfrac}% \sfrac for a/b fractions \usepackage{lua-unicode-math} %\usepackage{unicode-math} \begin{document} \(\sfrac{4}{5}\) \end{document} It is unclear to me if the fix should be on the xfrac side or on the lua-unicode-side. The three warnings are for OT1/cmr/m/n, OML/cmm/m/it and OMS/cmsy/m/n. Changing the separator (as in \sfrac{4}[L]{5}) does not remove the warnings.

  • How to make good use of `tikz-ext.paths.ortho` library to make four-segmented arrow?
    by Explorer on March 26, 2026 at 6:06 am

    The code used the powerful tikz-ext package from Qrrbrbirlbel: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{ext.paths.ortho} \begin{document} \begin{tikzpicture} \node[draw,fill=cyan] (Root) {Root}; \node[draw,fill=magenta] at (-1,-1) (nodeA) {NodeA}; \node[draw,fill=magenta] at (1,-1) (nodeB) {NodeB}; \node[draw,fill=teal] at (3,-1) (nodeC) {NodeC}; \draw[-latex] (Root) |-| (nodeA); \draw[-latex] (Root) |-| (nodeB); \coordinate (aux) at (2,-.75);% I don't want the aux here, `-0.75' is not always easy to determine \draw[-latex,magenta,thick] (Root) |-| (aux) |- (nodeC); \end{tikzpicture} \end{document} which gives: The actual desired result is something like: My code's problem is that, in the actual case, that is not always easy to know exactly the coordinate of aux, says (2,-.75). I wonder whether some extension or patch to plot the FOUR segmented arrow what I want elegantly? Edited: Claim: The difficulity here is that the nodes' position are not always on grid, says (0.123,2.324) for some outer effects, and determine the aux point with absolute distance is not always accurate. Thus, I prefer a "non-absolute-coordinate" solution here, without \coordinate (aux) at (2,-.75).

  • Defining list of commands using \foreach
    by 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?

  • How to Vertically Stretch Arched Words
    by Jethro on March 25, 2026 at 10:52 pm

    MWE: \documentclass[12pt]{book} \usepackage{tikz,xcolor,scalefnt,scalerel} \usetikzlibrary{decorations.text} \begin{document} \thispagestyle{empty} {\Huge{\scalefont{1.25}{ \begin{tikzpicture} \path[-latex,white!30!black,postaction={decorate},decoration={text along path,text={HOW TO ADD A VERTICAL STRETCH?},text color={black},text align=center}] (7,0) arc [start angle=180,end angle=0,radius=7]; \end{tikzpicture}}}} \end{document} which produces: How may I add a vertical stretch to the letters? I have called in the scalerel package and tried placing \vstretch{}{} at various places in the code, but to no avail. It is necessary that I compile the code with xelatex.

  • Nesting decorations in TikZ disconnects subpath
    by Sandy G on March 25, 2026 at 9:49 pm

    The decorations in the decorations.fractals library can be used to create fractal lines by applying the decoration repeatedly to an originally straight path. (This can be done with decorations from other libraries as well.) For example, the code \begin{tikzpicture}[decoration=Koch snowflake] \draw decorate{decorate{decorate{(0,0)--(3,0)}}}; \end{tikzpicture} produces the expected result. When a decoration is applied to a subpath however, nesting the decoration produces a result I did not expect. Namely, the decorated subpath appears to be disconnected from the path as a whole. Consider the following image: which is produced by the code below. A single iteration of the decoration produces a closed path (orange) as expected. But when the decoration is nested (blue) the --cycle does not close the whole path, only the portion beginning with the decoration. If you look closely, you can see that the first segment of the path is not connected to the decorated portion. What is the reason for this behavior? Note the partial fix in purple does not solve the problem (unless one only wanted to fill the path without drawing it) but it does show that the --cycle is not the problem—the issue is the missing connection between the initial segment and the decorated segment. \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations.fractals} \begin{document} \begin{tikzpicture}[decoration=Koch snowflake] \draw[help lines] (0,0) grid (5,3); \draw[orange, very thick] (1,0)--(0,0) decorate{--(0,3)}--cycle; \draw[blue, very thick] (3,0)--(2,0) decorate{decorate{--(2,3)}}--cycle; \draw[purple, very thick] (5,0)coordinate(A)--(4,0) decorate{decorate{--(4,3)}}--(A); \end{tikzpicture} \end{document}

  • Gray vector appears with fading in TikZ
    by 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} \def\V{2.8} \def\A{1.2} \draw[myblue, line width=1.2pt, decoration={markings, mark=at position 0.0833 with {\arrow{Latex[length=3mm, width=2.5mm]}}, mark=at position 0.4167 with {\arrow{Latex[length=3mm, width=2.5mm]}}, mark=at position 0.75 with {\arrow{Latex[length=3mm, width=2.5mm]}} }, postaction={decorate}] (0,0) circle (\R); \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}$}; \node[dot] (P1) at (90:\R) {}; \draw[vvec] (P1) -- ++(180:\V) node[midway, above=2pt] {\Large $\vec{v}$}; \draw[avec] (P1) -- ++(270:\A) node[midway, right=2pt] {\Large $\vec{a}$}; \node[dot] (P2) at (210:\R) {}; \draw[vvec] (P2) -- ++(300:\V) node[midway, below left=2pt] {\Large $\vec{v}$}; \draw[avec] (P2) -- ++(30:\A) node[midway, below right=2pt] {\Large $\vec{a}$}; \node[dot] (P3) at (330:\R) {}; \draw[vvec] (P3) -- ++(60:\V) node[midway, below right=2pt] {\Large $\vec{v}$}; \draw[avec] (P3) -- ++(150:\A) node[midway, below=2pt] {\Large $\vec{a}$}; \end{tikzpicture} \end{center} \end{document}

  • Online tool to write LaTeX formulas on a non-editable PDF
    by Sebastiano on March 25, 2026 at 8:26 pm

    Suppose I have a PDF containing Math or Physics exercises, but it is not editable. I would like to know if there is an online tool or web service that allows me to: Upload the PDF. Preview the pages. Write LaTeX formulas directly on top of the PDF (for example, as annotations or overlays). Basically, I am looking for a way to add formulas written in LaTeX to the original PDF without having to recreate the entire document from scratch. Are there any tools like this available? Addendum: After my question I have found PDF Annotator but it is not free.

  • longtable cell is not expanded when using multirow
    by Snowrabbit on March 25, 2026 at 5:52 pm

    I like to use longtable because table will be long and span several pages. But I have a problem using multirow in the longtable, the cell is not expanded vertically. How to use multirow correctly in a longtable? Can someone explain in simple terms why the cell doesn't expand? If you have any suggestions for improvements to the code, I would be grateful 🙂 \documentclass{article} \usepackage{longtable} \usepackage{multirow} \usepackage{multicol} \usepackage{lipsum} \usepackage[table]{xcolor} \usepackage{array} \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} \begin{document} \begin{longtable}[c]{|L{1cm}|L{3cm}|L{1cm}|L{7cm}|} \caption{Long table with multirow} \label{tab:long table with multirow}\\ \hline \rowcolor{lightgray}\textbf{Col 1} & \textbf{Col 2} & \textbf{Col 3} & \textbf{Col 4}\\ \hline \endfirsthead \hline \rowcolor{lightgray}\textbf{Col 1} & \textbf{Col 2} & \textbf{Col 3} & \textbf{Col 4}\\ \hline \endhead 1 & Name 1 & 42 & \multirow[t]{3}{=}{\lipsum[1]} \\ 2 & Name 2 & & \\ 3 & Name 3 & & \\ \hline \end{longtable} \end{document} This is what I get: This is the desired result: I apologize if the question has already been answered elsewhere and please provide a reference.

  • sourcesanspro and siunitx conflict
    by Paul on March 25, 2026 at 2:20 pm

    I'm using sourcesanspro as my default text font to write my thesis (with fourier for the math mode), along with siunitx to deal with number and units printing. Everything was working just fine until I decided to update all of my packages with miktex and especially the sourcesans package. The error I got is : ! Use of ??? doesn't match its definition. ??? ! LaTeX Error: Erroneous variable \l__siunitx_print_version... l.27 ...mathrm{l} \left[\unit{\ohm\per\kilo\meter} \right] \cdot x \left[\un... If you say, e.g., \def\a1{...}', then you must always put 1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. This error happen for every siunitx command (\qty, \unit, \num) used in math mode. Outside of math mode (in text mode), it seems to be ok. Here is a MWE : \documentclass[12pt]{article} \usepackage[utf8]{inputenc}\usepackage[T1]{fontenc} \usepackage[default]{sourcesans} % Police Source Sans \usepackage{amsmath,mathtools,amssymb,amsthm,amsfonts,bm,siunitx,commath,xfrac} % Math Presets \sisetup{detect-family=true, detect-mode=true, detect-weight=true, detect-shape=true} %police pour siunitx \begin{document} $\unit{\ohm\per\kilo\meter}$ \unit{\ohm\per\kilo\meter} \qty{90}{\kilo\volt} \end{document} I reported this bug to the sourcesans package git hub (https://github.com/silkeh/latex-sourcesanspro/issues/10#issue-4128078876) and still waiting for a response. What should I do ? Should I try to manually roll back the update ? How should i do that ? Thanks for your help

  • ltx-talk: \visible command not working as I expected
    by Svend Tveskæg on March 25, 2026 at 12:50 pm

    Consider the following (almost?) MWE: % lualatex test.tex \DocumentMetadata{ lang = da, tagging = on } \documentclass{ltx-talk} \usepackage{fontspec} \usepackage{pstricks} \begin{document} \begin{frame}{\visible<1->{Exercise}} \begin{enumerate} \item \visible<2->{A} \visible<3->{B} \visible<4->{% \begin{center} \begin{pspicture}(8,2) \psframe(8,2) \end{pspicture} \end{center}}% \end{enumerate} \end{frame} \end{document} Do to the order of the visible<n->{} commands, I expected the PSTricks drawing to not show up before the 4th slide but it is drawn right from the beginning. Question How do I fix the above-mentioned "issue"? Thanks in advance.

  • The order of \pgfkeys always mattered in tikz's option?
    by Explorer on March 25, 2026 at 12:11 pm

    I have the following code example: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \draw[->,>=latex] (0,0) -- (1,1); \end{tikzpicture} \begin{tikzpicture} \draw[>=latex,->] (0,0) -- (1,1); \end{tikzpicture} \begin{tikzpicture} \node[draw,fill=magenta] (tmp) {node}; \node[draw,fill=cyan,below=of tmp,node distance=.5cm] {below}; \end{tikzpicture} \begin{tikzpicture} \node[draw,fill=magenta] (tmp) {node}; \node[draw,fill=cyan,node distance=.5cm,below=of tmp] {below}; \end{tikzpicture} \end{document} Which gives the following: What I get confused is that: ->,>=latex and >=latex,-> behaves the same below=of tmp,node distance=.5cm honer the default value node distance=1cm, and node distance=.5cm,below=of tmp honer the previous node distance=.5cm Why caused the difference between >= and node distance? How to know whether an option's order is important with \pgfkeys? Edited: As jps commented: Keys are generally ordered as key code is executed in the order given. Whether the order of keys then matters strongly depends on the key code. The way to know whether an option's order matters is to either know the implementation by heart, or trial and error and Jasper Habicht supplemented that: Some keys only store a value in a macro that is later retrieved (which is true for the arrow settings, for example). The values stored in the macros are only retrieved when the arrows is drawn, that is at the end of the path. But other keys actually use values that are stored in macros and if these values are set my other keys, the order is relevant. But as was said above: You really need to know how the implementation is exactly to know whether the first or the second holds in a specific case. Here below is my follow-up doubt: In my understanding, "TikZ keys are applied in the order they are given", so is the following always safer (avoid the unexpected behavior of below=of tmp,node distance=.5cm)? >=latex,->: define the arrow style at first, then set the arrow node distance=.5cm,below=of tmp: set the distance at first, then apply the position