Hot
- babel: adding hypenations for a language variantby blackcat on December 14, 2025 at 1:22 pm
In Belarusian we have several language variants and two of them are supported with Babel and Polyglossia. But hyphenation rules are made for default variant only and so they are used by both variants. I have made a file with hyphenation patterns for the alternative spelling and I can use them putting them as hyph-be.tex in the project directory. I want to make them available to other users. But the problem is that I cannot understand how to add them. I see that Babel has babel-be.ini file that doesn't have any language variants but there is also babel-belarusian package that provides support for alternative spelling using \languageattribute{belarusian}{classic} and when I build my project I see that both files are used: (/usr/share/texlive/texmf-dist/tex/generic/babel-belarusian/belarusian.ldf ... (/usr/share/texlive/texmf-dist/tex/generic/babel/locale/be/babel-belarusian.tex So it seems for me that the right way to add them is: create a babel locale file, e.g. be-classic.ini set hyphenrules = be-classic in it How to ensure that Babel will use this new ini file instead of babel-belarusian? How to make them coexist?
- Compiling documentation of Brian Hamilton Kelly's Greek fonts (based on CM)by Apoorv Potnis on December 14, 2025 at 12:49 pm
I want to compile the greek.tex file in Brian Hamilton Kelly's Greek fonts: https://ctan.org/pkg/kelly-greek-font. The file is available here: https://ctan.org/tex-archive/fonts/greek/kelly. This is a very old file (last updated 1992-09-27) and when one tries to compile it using pdflatex, one gets the message Entering LaTeX 2.09 COMPATIBILITY MODE. The file does not compile and we get the following error. ! Undefined control sequence. l.105 \@addfontinfo \@vpt{\def\pgr{\@prtct\gr@vpt}% How do I compile this file? I want to see the Greek glyphs in the font, and the package does not seem to provide a compiled pdf/djvu to preview. My primary motivation is that the Greek glyphs are based on Knuth's Greek glyphs, and other Greek fonts are generally based on other designs, such as Didot.
- Evolution of “Computer Modern” or who lowered the dot on the “i”?by Alain Stalder on December 14, 2025 at 12:27 pm
In the process of hopefully migrating some documents from pdflatex that use Computer Modern fonts (mostly Sans) to LuaLaTeX, I am looking at the different variants that have evolved since the original METAFONT Computer Modern family. The good news for me is that the differences seem to be smaller than it first appeared, both regarding glyphs and metrics. The most prominent difference in Latin Modern with “plain English characters” is that the dot on the lowercase letter “i” is a bit lower, at least in the Sans variants (except in ligatures like “fi” where the height of the dot matches the too of the “f”). Was that a conscious choice in Latin Modern? Or maybe already in an earlier variant which I could not find, yet? (Computer Modern Unicode and CM-Super seem to have the original height of the dot on the “i”.) CTAN does list various Computer Modern variants and there is also some info in its external references, but I was wondering if there is maybe additional historical info about the evolution of “Computer Modern” variants, maybe a TUGboat article about that or maybe that someone who was already somewhat involved at the time would still remember? Below some examples with sources and — to make sure — the font that was actually used from the console log, and some differences noticed in the example text. pdflatex / Computer Modern (the reference; same result with \usepackage{amsfonts}, as expected): % !TEX TS-program = pdflatex \documentclass{article} \renewcommand\familydefault{\sfdefault} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/type1/public/amsfonts/cm/cmss10.pfb> \end{document} pdflatex / CM-Super: % !TEX TS-program = pdflatex \documentclass{article} \usepackage[T1]{fontenc} \renewcommand\familydefault{\sfdefault} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/type1/public/cm-super/sfss1000.pfb> \end{document} (Different “ß” and different spacing before “, rest same incl. “i”.) LuaLaTeX / Computer Modern Unicode: % !TEX TS-program = lualatex \documentclass{article} \usepackage{fontspec} \setmainfont{CMU Sans Serif} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/opentype/public/cm-unicode/cmunss.otf> \end{document} (Same alternative “ß” as CM-Super, different space after ”, denser ellipsis, rest same incl. “i”) LuaLaTeX / AMS Type 1 converted to OpenType (using FontLab 8 on Mac): % !TEX TS-program = lualatex \documentclass{article} \usepackage{fontspec} \setmainfont{ams-cmss10.ttf} \begin{document} % emulated ellipsis… Liegenstraße 95 in “larger” Wil.\,.\,. % <./ams-cmss10.ttf> \end{document} (Almost identical to Computer Modern (as expected), except line overall a bit denser and had to emulate the ellipsis, same “i”.) LuaLaTeX / Latin Modern: % !TEX TS-program = lualatex \documentclass{article} \renewcommand\familydefault{\sfdefault} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/opentype/public/lm/lmsans10-regular.otf> \end{document} Here the dot on the “i” is a bit lower. Also, the “a” has the same metric but is shifted a bit to the right. Also, more space inside “...”, and also denser ellipsis. Diff between LM and AMS OpenType (would be practically the same to pdflatex / Computer Modern, but wanted to stick to OpenType, into the future): The dot on the “i” is lowered and the “a” is shifted, otherwise letters just shifted a tiny little bit, but maybe that would be just a rendering artefact/limitation, at some point becomes the princess and the pea… But overall, seems like an “AMS to OpenType x Latin Modern” (as new font or maybe a virtual font on-the-fly) could already come close to the original pdflatex / Computer Modern look and feel for texts that could already be typset with the limitations regarding language support of pdflatex / Computer Modern.
- How to draw a parabola in Ipe?by Dominik Mokriš on December 14, 2025 at 12:13 pm
Note: This question has been closed as off-topic on stackoverflow.com. I believe it's on-topic here under the [ipe] Tag. How can you draw a parabola in ipe? Usually, I use "Splines [I]" but it's not exactly convenient, as I need to construct four control points so that they correspond to a degree-elevated Bézier curve. Recently, I noticed the option "Ipelets > Goodies > Make parabolas". However, I am failing to guess the correct inputs. Here's what I tried: Make a line segment using "Lines and polylines [P]." Create a point using "Marks [M]." Select the line, press "Shift" and select the point. Go to "Ipelets > Goodies > Make parabolas." This fails with the following message. Neither in the manual, nor googling around have I found any further hints. Ideas?
- Custom commands allow tabularray to add columns through loopsby Clara on December 14, 2025 at 12:01 pm
\documentclass{article} \usepackage{tabularray} \begin{document} \ExplSyntaxOn \newcommand{\Repeat}[1]{\int_step_inline:nnn {1}{#1}{##1 A}} % Need change A to & \ExplSyntaxOff \begin{tblr}[expand={\Repeat}]{hlines,vlines} \Repeat{6} a & b & c \\ \end{tblr} \end{document} I have a requirement. I hope to define a command that can take one parameter and generate the specified column. I want to use tabularray instead of others. Is there any solution that can allow the current code to run? What I want to achieve is in the comment.
- Consistent line spacing inside and outside tableby user383619 on December 14, 2025 at 8:43 am
I have some text above and below a table and I want all lines of text to have the same line spacing. The issue is that text outside the table has different spacing than text within the table. As you can see in the screenshot, the baseline of the text above and below the table is different. MWE to demonstrate the issue: \documentclass{article} \usepackage{tabularx} \setlength\tabcolsep{0pt} \begin{document} Above table \begin{tabularx}{\textwidth}{l} \hline Inside table \\ \hline Inside table \\ \hline Inside table \\ \hline \end{tabularx} Below table \end{document}
- Not matching partial patternby Erwann on December 14, 2025 at 7:05 am
I was expecting TRUE for all four: what could I be missing? tex: \documentclass{article} \ExplSyntaxOn \msg_new:nnn{__erw_debug}{generic}{#1} % Test 1: \tl_if_regex_match:nnTF { -num$ } { author-num } {\msg_term:nnn{__erw_debug}{generic}{Test~1:~TRUE}} {\msg_term:nnn{__erw_debug}{generic}{Test~1:~FALSE}} % Test 2: \tl_if_regex_match:nnTF { -num } { author-num } {\msg_term:nnn{__erw_debug}{generic}{Test~2:~TRUE}} {\msg_term:nnn{__erw_debug}{generic}{Test~2:~FALSE}} % Test 3: \tl_if_regex_match:nnTF { num$ } { author-num } {\msg_term:nnn{__erw_debug}{generic}{Test~3:~TRUE}} {\msg_term:nnn{__erw_debug}{generic}{Test~3:~FALSE}} % Test 4: \tl_if_regex_match:nnTF { ^author-num$ } { author-num } {\msg_term:nnn{__erw_debug}{generic}{Test~4:~TRUE}} {\msg_term:nnn{__erw_debug}{generic}{Test~4:~FALSE}} \ExplSyntaxOff \begin{document} \end{document} terminal: $ pdflatex debug-133.tex This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode (./debug-133.tex LaTeX2e <2025-06-01> patch level 1 L3 programming layer <2025-08-13> (/opt/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/opt/texlive/2025/texmf-dist/tex/latex/base/size10.clo)) Test 1: FALSE Test 2: FALSE Test 3: FALSE Test 4: TRUE (/opt/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./debug-133.aux) (./debug-133.aux) ) No pages of output. Transcript written on debug-133.log Manual: https://mirrors.ctan.org/macros/latex/required/l3kernel/interface3.pdf
- weird brackets appear in my glossby Miguel Bendito 龍福佑 on December 14, 2025 at 7:05 am
I am writing a syntax paper where I use glosses with the expex package; however, I can't achieve the look I want. As in the first picture, I would like the gloss to align with the words, ignoring the subscripts. Yet, every time I use the \nogloss feature, weird brackets appear, and the gloss is not aligned with the text as you can see on the second picture. What can I do? \pex \begingl \gla Lǐsì \lbrack \nogloss{ \textsubscript{VP}} kū \lbrack \nogloss{[\textsubscript{ExtP}} de \lbrack \nogloss{[\textsubscript{SC}} shǒu pà shī le\rbrack \rbrack \rbrack.// \glb Lisi cry DE handkerchief wet PERF .// \glft `Lisi cried his handkerchief wet.'// \endgl \begin{flushright} (Huang 2006: 70) \end{flushright} \xe
- Why does \changefontsize from the fontsize package mess with \centering?by palapapa on December 14, 2025 at 5:44 am
MWE: \documentclass{article} \usepackage{anyfontsize} \usepackage[fontsize = 40]{fontsize} \begin{document} \centering \changefontsize{40} aaa \end{document} Notice how I am changing the font to the same size, yet the problem still happens. The large font size makes it easier to see that the line is off-center. Result: If I swap the order of \changefontsize and \centering or remove \changefontsize, the text will be correctly centered. Why is this?
- PDF size increase after second compilation: from 35.4 MB to 60.6 MBby Math Attack on December 14, 2025 at 4:08 am
I'm writing a PDF about 250 pages long, inside it there are about 300 images and about 180 subsections (this is just to give you an idea of the file size, but I don't know if they're helpful in resolving the issue.) I noticed this thing: when I compile it the first time without all the other files (.toc, .aut, .aux, etc...) the pdf file weighs 35.4 MB but the table of contents is not created; if I compile it a second time the index is created but the file size increases to 60.6 MB. How is it possible that there is a 70% increase in size just by compiling it a second time? Does it have to do with the table of contents/links created? Is there a way to reduce it? 60.6 MB seems exaggerated to me.
- ConTeXt: Fixed width on floatby gxono on December 14, 2025 at 12:52 am
I have something like the following. \definefloat[figure:text][figure] [default=here, frame=on, offset=1em] \setupcaption[figure:text] [location={bottom, right}, width=0.4\textwidth, align={right}, spacebefore=halfline] \startdocument \startchapter[title={Test}] \input knuth \startplacefloat[figure:text] [title={Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}, reference=fig:nonexisting] \externalfigure[figure][height=3cm, width=4cm] \stopplacefloat \input knuth \stopchapter \stopdocument that returns something like this I’d like the float’s width to always be \textwidth, regardless of the image’s width. I tried width and minwidth, but it doesn’t work. The result I expect would be something like this: UPDATE The idea is that, regardless of the width I choose for the image, the container should have a width of \textwidth (the container, not the image). In the following image, the red line only marks the edge of the image. Note that the image has a particular width, but the container spans the full width.
- Tikz and arabtex for arrows on arabic alphabetby abd 01 on December 13, 2025 at 10:53 pm
Currently I use arabtext (enter link description here). But now I'm facing the problem of create xy-pictures including arabic characters. In particular I'm wondering how to obtain the following pictures. The following code is my initial attempt: \documentclass[12pt,a4paper,twoside]{book} \usepackage{arabtex} \usepackage{tikz} \begin{document} \begin{figure}[] \centering \begin{tikzpicture} \node (a) at (3,3) {a}; \node (b) at (-1,-1) {\scalebox{5}{\fontsize{92pt}{32pt}\selectfont \textbf{< `>}}}; \draw [->] (b) -- (a); \end{tikzpicture} \caption{} \end{figure} \end{document} Unfortunately required arrows shall indicate the flow of the arabic characters drawing. I appreciate any suggestion or reference. Thanks in advance for your time.
- LuaTeX no longer accepts font settingsby Alexander Wittmann on December 13, 2025 at 9:36 pm
OS: ubuntu TeX-install: tlmgr (daily updates) TeX-editor: emacs/auctex All of a sudden, i.e. after my latest tlmgr-update, which didn't complain and which didn't install a new LuaTeX-script (only lua-unicode-math.sty), LuaTeX fails to recognize any font-settings. \defaultfontfeatures, \setmainfont etc. aren't recognized. Simple example \documentclass{scrartcl} \defaultfontfeatures+{Scale=MatchUppercase,Renderer=HarfBuzz} \defaultfontfeatures+{Ligatures=TeX} \defaultfontfeatures+[\rmfamily,\sffamily,\ttfamily]{PunctuationSpace=1.5} \defaultfontfeatures+[\rmfamily,\sffamily]{Numbers=OldStyle,% Ligatures=Common} \setmainfont{TeXGyrePagellaX} \setsansfont{TeXGyreHeros} \setmonofont{TeXGyreCursor}[Scale=MatchLowercase] \begin{document} bla \end{document} Running luatex luaTeX-Test.tex I suddenly get Running `LaTeX' on `luaTeX-Test' with ``lualatex --jobname=luaTeX-Test -file-line-error -interaction=nonstopmode luaTeX-example.tex'' This is LuaHBTeX, Version 1.22.0 (TeX Live 2025) restricted system commands enabled. [...] ./luaTeX-Test.tex:2: Undefined control sequence. <recently read> \defaultfontfeatures l.2 \defaultfontfeatures +{Scale=MatchUppercase,Renderer=HarfBuzz} ./luaTeX-Test.tex:2: LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.2 \defaultfontfeatures+ {Scale=MatchUppercase,Renderer=HarfBuzz} ./luaTeX-Test.tex:3: Undefined control sequence. l.3 \defaultfontfeatures +{Ligatures=TeX} ./luaTeX-Test.tex:4: Undefined control sequence. l.4 \defaultfontfeatures +[\rmfamily,\sffamily,\ttfamily]{PunctuationSpace=1.5} ./luaTeX-Test.tex:5: Undefined control sequence. l.5 \defaultfontfeatures +[\rmfamily,\sffamily]{% Fractions=On,% ./luaTeX-Test.tex:8: Undefined control sequence. l.8 \setmainfont {TeXGyrePagellaX} ./luaTeX-Test.tex:9: Undefined control sequence. and so on and so forth. Finally, LuaTeX uses lmroman-fonts. missing \begin{document} I had before, so I don't care. I don't even know whether the problem lies in LuaTeX, tlmgr, emacs or whereever.
- Adding two differently commented implementations in two different documentationsby Ankaa on December 13, 2025 at 9:31 pm
I currently have a .dtx file containing the following three tags: <*doc-fr> ... </doc-fr> <*doc-en> ... </doc-en> <*package> ... </package> Running the .ins file (see below) then produces three files: a .sty file and two .tex files, each containing documentation in French and English. l3build is subsequently called to typeset the two .tex files with the appropriate build.lua configuration. I would like, however, to provide a commented (preferably, in both French and English) implementation in the two documents. As I'm not using a classic dtx structure with \DocInput, I'm not sure how I can achieve this. The obvious method would be to do it manually, i.e type the source code again by hand and comment it, but that would take a lot of time. I therefore wonder if I can still apply the usual method with the macrocode environment, where one writes: %<*driver> \documentclass{l3doc} \begin{document} \DocInput{intexgral.dtx} \end{document} %</driver> % Here is a documented macro % \begin{macrocode} \cs_new_protected:Npn \__example_macro:Nnn { ... } % \end{macrocode} Short example of the current structure of my project: %<*doc-fr> \documentclass{article} \begin{document} Documentation in French \section{Implémentation} > implementation here < \end{document} %</doc-fr> % %<*doc-en> \documentclass{article} \begin{document} Documentation in English \section{Implementation} > implementation here < \end{document} %</doc-en> % %<*package> \ProvidesExplPackage{...} %</package> .ins file: \generate{ \file{intexgral.sty}{\from{intexgral.dtx}{package}} \file{intexgral-en.tex}{\from{intexgral.dtx}{doc-en}} \file{intexgral-fr.tex}{\from{intexgral.dtx}{doc-fr}} } Thank you in advance for the help.
- TikZ, \x^2 != \x * \x?by ana on December 13, 2025 at 8:04 pm
Why do the two \draw commands produce two different plots? Shouldn't they both produce a parabola? How do you use the ^2 notation to plot a parabola? \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[domain=-1:1] plot (\x, \x^2); \draw[domain=-1:1] plot (\x, \x * \x); \end{tikzpicture} \end{document}
- Graphing the function y=x^2sin(1/x)by azetina on December 13, 2025 at 6:50 pm
Consider the following MWE: \documentclass{article} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis equal, axis lines = middle, xlabel = $x$, ylabel = $y$, xmin = -0.4, xmax = 0.4, ymin = -0.4, ymax = 0.4, grid = both, grid style = {line width=.1pt, draw=gray!10}, major grid style = {line width=.2pt, draw=gray!50}, samples = 200, legend pos = north west, width = 10cm, height = 8cm ] % Plot the curve \addplot[domain=-0.4:0.4, thick, blue] {x^2*sin(1/x)}; \addlegendentry{$y = x^2\sin(1/x)$} % Tangent line at (1, -2) \addplot[domain=-0.5:0.5, thick, red] {x^2}; \addplot[domain=-0.5:0.5, thick, red] {-x^2}; \addlegendentry{$y=\pm x^2$} \end{axis} \end{tikzpicture} \end{document} Currently, I am getting: But I would like the curve to show like in the following image: What am I missing?
- Strange spacing on a matrixby Knudsen on December 13, 2025 at 6:46 pm
Why would the vertical spacing between the 2nd and 3rd lines in this matrix be larger than the others? \documentclass{report} \usepackage{amsmath} \begin{document} \[ \begin{pmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots&\vdots&\ddots&\vdots\\ 0 & 0 & \cdots & 1 \end{pmatrix} \] \end{document}
- How can I mimic Griffiths' quantum mechanics textbook (3rd edition)?by Lucas Cesena on December 13, 2025 at 4:06 pm
I'm using LaTex to write my physics bachelor thesis and I want it to look similar to one of my favourite undergraduate textbooks on physics: Griffith's Introduction to Quantum Mechanics, specifically the third edition of 2018. I've successfully mimicked the example/proof boxes and also the problem boxes using the tcolorbox package, but didn't manage to find out how to do the same chapter/section display and what font is being used. If anyone can help me on this I'd be extremely grateful! Here is one example page:
- Additive color mixing in set diagramsby Alma Arjuna on December 13, 2025 at 3:19 pm
I've made a pretty set diagram! I'm not happy with how the colors are interacting on the set intersections, though. Because of the order the sets are built, each one is visibly 'above' or 'below' each other, breaking the symmetry of the figure. Of course, this behavior is expected. Can we make so that the colors interact additively instead? I know I can go intersection-by-intersection changing the colors to whatever I want, but this seems very inefficient and I wouldn't know how to manually combine the colors anyway... Here is the code. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{calc} \tikzstyle{vertex}=[circle,fill=black,inner sep=2.2pt] \begin{document} \begin{tikzpicture}[scale=1] \coordinate (A) at (18:{sqrt(5)}); \coordinate (B) at (90:{sqrt(5)}); \coordinate (C) at (162:{sqrt(5)}); \coordinate (D) at (234:{sqrt(5)}); \coordinate (E) at (306:{sqrt(5)}); \def\set{ellipse (2.618cm and 0.382cm)} \fill[magenta, opacity=.36] ($(A)!0.5!(C)$) \set; \fill[cyan, opacity=.36, rotate=72] ($(B)!0.5!(D)$) \set; \fill[yellow, opacity=.36, rotate=144] ($(C)!0.5!(E)$) \set; \fill[violet, opacity=.36, rotate=216] ($(D)!0.5!(A)$) \set; \fill[green, opacity=.36, rotate=288] ($(E)!0.5!(B)$) \set; \node[vertex] at (A) {}; \node[vertex] at (B) {}; \node[vertex] at (C) {}; \node[vertex] at (D) {}; \node[vertex] at (E) {}; \coordinate[vertex] (F) at ($(A)!0.382!(C)$); \coordinate[vertex] (G) at ($(B)!0.382!(D)$); \coordinate[vertex] (H) at ($(C)!0.382!(E)$); \coordinate[vertex] (I) at ($(D)!0.382!(A)$); \coordinate[vertex] (J) at ($(E)!0.382!(B)$); \end{tikzpicture} \end{document}
- How to vertically centre cell content in an arrayby Will Kim on December 13, 2025 at 12:59 pm
How would you modify the following code so that the words "First shape", "Second shape", and "third shape" are vertically aligned? Thank you! \documentclass[11pt,twoside]{book} \usepackage[ paperwidth=7in, paperheight=10in, inner=0.75in, % inside margin (gutter) for binding outer=0.5in, % outside margin top=0.75in, % top margin bottom=0.75in % bottom margin ]{geometry} % % Packages \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb, amsfonts} % math symbols \usepackage{geometry} \usepackage{graphicx} % figures \usepackage{tikz} % drawings % Page layout % \usepackage{pgfplots} \usepackage{mathtools} \usepackage{cancel} \usepackage{pgfplots} \usepackage{array} \usepackage{amsmath} \usepackage{tikz} \begin{document} \textbf{23} A pattern of shapes is created with matchsticks.\\[0.15cm] \hspace*{6mm}The first three shapes are shown below.\\ \begin{center} $\begin{array}[b]{lcc} \text{First shape} & \quad & \begin{tikzpicture} %left \node[rotate around={+60:(-0.2,-0.5)}] (image) at (-0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[rotate around={+120:(-0.35,+0.15)}] (image) at (-0.35,+0.15) {\includegraphics[]{Stick.png}}; %center \node[] (image) at (0,0) {\includegraphics[]{Stick.png}}; %right \node[rotate around={-60:(0.2,-0.5)}] (image) at (0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[rotate around={-120:(0.35,+0.15)}] (image) at (0.35,+0.15) {\includegraphics[]{Stick.png}}; \end{tikzpicture} \\ \text{Second shape} & \quad & \begin{tikzpicture} %left \node[rotate around={+60:(-0.2,-0.5)}] (image) at (-0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[rotate around={+120:(-0.35,+0.15)}] (image) at (-0.35,+0.15) {\includegraphics[]{Stick.png}}; %center \node[] (image) at (0,0) {\includegraphics[]{Stick.png}}; %right \node[rotate around={-60:(0.2,-0.5)}] (image) at (0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[rotate around={-120:(0.35,+0.15)}] (image) at (0.35,+0.15) {\includegraphics[]{Stick.png}}; % \node[xshift=1.6cm] (image) at (0,0) {\includegraphics[]{Stick.png}}; %right \node[xshift=1.6cm,rotate around={-60:(0.2,-0.5)}] (image) at (0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[xshift=1.6cm,rotate around={-120:(0.35,+0.15)}] (image) at (0.35,+0.15) {\includegraphics[]{Stick.png}}; \end{tikzpicture} \\ \text{Third shape} & \quad & \begin{tikzpicture} %left \node[rotate around={+60:(-0.2,-0.5)}] (image) at (-0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[rotate around={+120:(-0.35,+0.15)}] (image) at (-0.35,+0.15) {\includegraphics[]{Stick.png}}; %center \node[] (image) at (0,0) {\includegraphics[]{Stick.png}}; %right \node[rotate around={-60:(0.2,-0.5)}] (image) at (0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[rotate around={-120:(0.35,+0.15)}] (image) at (0.35,+0.15) {\includegraphics[]{Stick.png}}; % \node[xshift=1.6cm] (image) at (0,0) {\includegraphics[]{Stick.png}}; %right \node[xshift=1.6cm,rotate around={-60:(0.2,-0.5)}] (image) at (0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[xshift=1.6cm,rotate around={-120:(0.35,+0.15)}] (image) at (0.35,+0.15) {\includegraphics[]{Stick.png}}; % \node[xshift=3.2cm] (image) at (0,0) {\includegraphics[]{Stick.png}}; %right \node[xshift=3.2cm,rotate around={-60:(0.2,-0.5)}] (image) at (0.2,-0.5) {\includegraphics[]{Stick.png}}; \node[xshift=3.2cm,rotate around={-120:(0.35,+0.15)}] (image) at (0.35,+0.15) {\includegraphics[]{Stick.png}}; \end{tikzpicture} \quad \end{array}$ \end{center} \text{}\\[-0.3cm] \\ \hspace*{6mm}Find an expression for the number of matchsticks used for the $n$th shape. \end{document}
- Using \par directly in enumitem's itemjoinby Erwann on December 13, 2025 at 3:10 am
I'm using enumitem to typeset paragraphs, whether contiguous or joined using \par. For this last case, itemjoin={\par} triggers an error, hence the shown workaround. Is there an inline solution (wild guess \exp_not:N did not work). *.tex \documentclass{article} \usepackage{enumitem} \usepackage{lipsum} \ExplSyntaxOn \cs_new:Npn \g__erw_par { \par } % workaround \newlist{my-list}{itemize*}{1} \setlist[my-list]{ label={}, % itemjoin={\par} itemjoin={\g__erw_par} % workaround } \ExplSyntaxOff \begin{document} \ExplSyntaxOn \begin{my-list}[after={\g__erw_par foo}] \item \lipsum[1][1] \item \lipsum[1][2] \end{my-list} \ExplSyntaxOff \lipsum[1][1-2] \end{document} Post Scriptum: the proposed workaround solves the compilation error but does not render as expected. The choice seems to between itemize or itemize*, but no crossover. terminal: Runaway argument? {label={},itemjoin={ ! Paragraph ended before \enit@setlist@i was complete. <to be read again> \par l.11 itemjoin={\par } ?
- Lettrine breaks wrapfigure and marginnoteby DanDucky on December 13, 2025 at 1:30 am
I'm trying to make a template which uses wrapfigure (for wrapped text), marginnote, and lettrine. I've gotten all of the first 2 to play nice together, but the problem has started at lettrine. Basically, when I use lettrine and marginnote together then wrapfigure breaks and stops placing its text in the correct place. If I remove the marginnote then wrapfigure works with lettrine. The marginnote itself remains unaffected when I use lettrine, it just breaks wrapfigure. I've tried recreating the lettrine effect with wrapfigure only but ran into similar issues. I've made a minimum reproduction of this below, thank you in advance. I'm using Tectonic. \documentclass{article} \usepackage[ letterpaper, % or letterpaper, etc. margin=3cm, footskip=1cm % space between bottom of text and baseline of footer ]{geometry} \usepackage{lettrine} \usepackage{wrapfig} \usepackage{marginnote} \usepackage{lipsum} \usepackage{marginnote} \newcommand{\colnote}[1]{% \marginnote{% \footnotesize% #1% }% \normalmarginpar% in my main code this is determined by a \whichcolumn } \newcommand{\wrappedtext}[1]{% % in my main code this is l/r depending on column \begin{wrapfigure}{l}{0.4\linewidth}% \textit{#1}% \end{wrapfigure}% } \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % when this is uncommented the whole thing breaks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %\lettrine{L}{orem} \lipsum[1][1-8] \wrappedtext{\lipsum[1][1-2]} \lipsum[1][11-15] \colnote{\lipsum[1][3-4]} \lipsum[2-3] \end{document}
- Top align display style formula in table cellby lela2011 on December 12, 2025 at 10:46 pm
I am currently working on a cheat sheet. It is composed of a table with three columns. The first one is a keyword, the second one either a text explanation or a formula and the third one is a variable definition. The following is a minimal working example \documentclass[a4paper, twocolumn, landscape]{article} \usepackage[margin = 7mm, headsep=3mm, includehead]{geometry} \usepackage[fleqn]{amsmath} \usepackage{amsfonts, amssymb, mathtools} \usepackage{bm} \usepackage{siunitx} \usepackage{braket} \newcommand{\dd}{\mathrm{d}} \newcommand{\pd}{\partial} \DeclareMathOperator{\ham}{\hat{H}} \DeclareMathOperator{\mom}{\hat{p}} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \DeclarePairedDelimiter{\norm}{\lVert}{\rVert} \makeatletter \let\oldabs\abs \def\abs{\@ifstar{\oldabs}{\oldabs*}} % \let\oldnorm\norm \def\norm{\@ifstar{\oldnorm}{\oldnorm*}} \makeatother \usepackage{tabularx} \usepackage{booktabs} \usepackage{array} \usepackage{makecell} \newcommand{\mc}[1]{\makecell{#1}} \renewcommand{\cellalign}{tl} \newcolumntype{L}{>{\raggedright\arraybackslash}p{0.2\linewidth}} \newcolumntype{F}{>{\raggedright\arraybackslash \abovedisplayskip=0pt \belowdisplayskip=0pt \abovedisplayshortskip=0pt \belowdisplayshortskip=0pt \mathindent=0pt \partopsep=0pt \topsep=0pt}p{0.5\linewidth}} \newcolumntype{E}{>{\raggedright\arraybackslash}X} \newenvironment{formtab}[1][1.2] { \renewcommand{\arraystretch}{#1} \fontsize{8}{8}\selectfont \tabularx{\linewidth}{@{} L F E @{}} } { \endtabularx } \begin{document} \subsubsection{Wavefunction - Discrete} \begin{formtab} discrete basis & set of discrete states $\{ \Psi_n \}$ with $\braket{\Psi_n | \Psi_m} = \delta_{nm}$ & \\ arbitrary state & \[ \ket{\Psi} = \sum_{n=1}^\infty a_n \ket{\Psi_n}, \quad a_n = \braket{\Psi_n | \Psi} \] & \\ probability & $P_\Psi(n) = \abs{a_n}^2 = \abs{\braket{\Psi_n | \Psi}}^2$ & \\ normalization & $\braket{\Psi | \Psi} = 1$ \end{formtab} \end{document} The table now looks like this I want the display style formula to sit flush with the top of the cell though. I have tried using $\displaystyle a^2+b^2=c^2$. This causes the keyword to be centered with the formula. Using \vspace(-.5cm) works partially but that would require me to manually find the correction which is not sensible if the entire document is made up of formulas. Do you have any ideas how this could be achieved?
- How to draw a complete graph $K_5$ with 5 edges with different colors and the vertices are not big filled circles?by Intuition on December 12, 2025 at 10:17 pm
I am trying to draw a complete graph $K_5$ with 5 edges with different colors and the vertices are not big filled circles? I found this here A complete graph on 5 vertices with coloured edges but I do not know how to have 5 edges with different colors and the vertices are not big filled circles, just small filled circles. Any hints will be greatly appreciated. I also do not want this one here How to draw the following graph in latex? , I want the edges themselves to be of different colors not shaded by different colors.
- How to draw a pattern within a path that features a visible decorated path and also invisible paths? OR How to visualize the ground?by Simon on December 12, 2025 at 6:13 pm
How does the following MWE need to be modified to only visualize the decorated path but not the remaining path and draw the top right-hand corner not rounded? \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \path[draw,pattern=north west lines] decorate[decoration={random steps,segment length=1,amplitude=.2},rounded corners=.2] {(-1,0) -- (0,0) -- (1,0)} -- (1,-.25) -- (-1,-.25) -- cycle; \end{tikzpicture} \end{document} Thanks in advance!
- Reduce spacing in TikZ state diagram with split nodesby mingabua on December 12, 2025 at 11:55 am
I have the following code to create a tikzpicture of a labelling algorithm. However, I am currently not satisfied with the way it looks right now. Every looks to big and to much spread out. How can I create a more condense but still clear version of it. For (1); the vertical space between the boxes should be smaller. (2) the box height should be decreased and (3) the text inside the box should be more condense. The font size could be decreased as well. This is my code: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{tikz} \usepackage{amsmath} \usetikzlibrary{positioning, arrows.meta, shapes.multipart, calc} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{figure}[htbp] \centering \begin{tikzpicture}[ scale=1, % --- STYLES --- node distance=2.5cm and 3cm, font=\sffamily\footnotesize, % Label Box labelnode/.style={ rectangle split, rectangle split parts=2, draw=black!80, rounded corners, fill=gray!5, align=center, inner sep=3pt, minimum width=2.1cm }, % Infeasible (MS Pruning) - Rot infeasible/.style={ labelnode, draw=red!80, fill=red!5, dashed }, % Dominated (History Dominance) - Lila dominated/.style={ labelnode, draw=violet!80, fill=violet!5, dashed }, % Optimal Path Node - Grün optimal/.style={ labelnode, draw=green!50!black, fill=green!10, line width=1pt }, % Edges worker/.style={-{Latex[length=3mm]}, blue!70!black, thick}, ai/.style={-{Latex[length=3mm]}, orange!80!black, thick}, optedge/.style={worker, line width=1.5pt, green!40!black}, prunededge/.style={-{Latex[length=3mm]}, red!70, dashed}, domedge/.style={-{Latex[length=3mm]}, violet!70, dashed} ] % --- ZEITACHSE --- % Verschiebung nach oben (y=7) und Skalierung x (Faktor 3.2) \draw[->, thick, gray] (0, 7) -- (10.5, 7) node[right] {Time $t$}; \foreach \x in {0,1,2,3} \node[gray] at (\x*3.2, 7.3) {$t=\x$}; % --- KNOTEN --- % t=0 \node[labelnode] (start) at (0,0) { \textbf{Start} \nodepart{second} $V=0$\\$\omega=0$ }; % t=1 % Worker \node[optimal] (t1_w) at (3.2, 2.0) { \textbf{W1} \nodepart{second} $V=3$\\$\omega=1.0$\\$h=[1]$ }; % AI \node[labelnode] (t1_a) at (3.2, -2.0) { \textbf{A1} \nodepart{second} $V=1$\\$\omega=0.3$\\$h=[0]$ }; % t=2 % PATH A: \node[optimal] (t2_ww) at (6.4, 3.8) { \textbf{W $\to$ W} \nodepart{second} $V=6$\\$\omega=2.0$\\$h=[1,1]$ }; % PATH B: \node[labelnode] (t2_aw) at (6.4, 0) { \textbf{AI $\to$ W} \nodepart{second} $V=4$\\$\omega=1.3$\\$\mathbf{h=[0,1]}$ }; % PATH C: \node[dominated] (t2_wa) at (6.4, -2.5) { \textbf{W $\to$ AI} \nodepart{second} \textit{Dominated}\\$V=4$\\$\omega=1.3$\\$\mathbf{h=[1,0]}$ }; % PATH D: \node[infeasible] (t2_aa) at (6.4, -4.5) { \textbf{AI $\to$ AI} \nodepart{second} \textit{Pruned}\\$h=[0,0]$ }; % PATH A+: W -> W -> W \node[optimal] (t3_www) at (9.6, 4.8) { \textbf{3 Workers} \nodepart{second} $V=9$\\$\omega=3.0$\\Target Met }; % --- Arcs --- % t0 -> t1 \draw[optedge] (start) -- (t1_w) node[midway, above, sloped] {W (+3)}; \draw[ai] (start) -- (t1_a) node[midway, below, sloped] {AI (+1)}; % t1 -> t2 \draw[optedge] (t1_w) -- (t2_ww) node[midway, above, sloped] {W (+3)}; \draw[ai] (t1_w) -- (t2_wa) node[midway, below, sloped, pos=0.3] {AI (+1)}; \draw[worker] (t1_a) -- (t2_aw) node[midway, above, sloped, pos=0.4] {W (+3)}; \draw[prunededge] (t1_a) -- (t2_aa) node[midway, below, sloped] {Violation}; % t2 -> t3 \draw[optedge] (t2_ww) -- (t3_www) node[midway, above, sloped] {W (+3)}; % --- DOMINANCE --- \draw[->, violet, thick] (t2_aw) -- (t2_wa) node[midway, right, align=left, font=\scriptsize, xshift=2mm] {\textbf{Dominance Check}}; % --- NOTES BEREICH UNTER DEM PLOT --- \node[align=left, text width=12cm, anchor=north west, font=\sffamily\small] at (-0.5, -5.5) { \textbf{Notes:}\\ }; \end{tikzpicture} \caption{Your caption here} \label{fig:your-label} \end{figure} \lipsum[2] \end{document}
- Simulating language-related OpenType font featuresby Apothikon on December 12, 2025 at 10:03 am
In LuaLaTeX, is it possible to use babel (or anything else) to simulate some language-related OpenType features not defined in the font? I give an example of what I mean: Writing in ecclesiastical latin requires to put an acute accent on some vowels. On my Italian keyboard I've only the character é, thus typing á, í, ó, ú is quite inefficient. I would like to tell LaTeX that, inside an ecclesiasticallatin environment, whenever I type à, ì, ò, ù, it must be rendered as á, í, ó, ú. Thanks in advance.
- What is the minimum set of commands to compile a plain tex file with UTF-8 Chinese characters to PDF?by merlin2011 on December 12, 2025 at 4:42 am
Consider the following minimum Tex example with Chinese characters: 你好 \bye I tried to compile it the traditional way, and it produces an blank document: tex Hello.tex dvipdf Hello.dvi I tried to compile it with xetex and get an error: sudo apt install texlive-xetex xetex Hello.tex This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023/Debian) (preloaded format=xetex) restricted \write18 enabled. kpathsea: Running mktexfmt xetex.fmt mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order): mktexfmt: /usr/share/texmf/web2c/fmtutil.cnf mktexfmt: /usr/share/texlive/texmf-dist/web2c/fmtutil.cnf mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes: mktexfmt: /home/hq6/.texlive2023/texmf-config/web2c/fmtutil.cnf mktexfmt [INFO]: writing formats under /home/hq6/.texlive2023/texmf-var/web2c mktexfmt [INFO]: Did not find entry for byfmt=xetex skipped mktexfmt [INFO]: not selected formats: 8 mktexfmt [INFO]: total formats: 8 mktexfmt [INFO]: exiting with status 0 I can't find the format file `xetex.fmt'! I tried running the command suggested in a different question and it completed successfully, but I still get the same error: sudo fmtutil-sys --all ... ... 50 preloaded fonts No pages of output. Transcript written on dviluatex.log. fmtutil [INFO]: log file copied to: /var/lib/texmf/web2c/luatex/dviluatex.log fmtutil [INFO]: /var/lib/texmf/web2c/luatex/dviluatex.fmt installed. fmtutil [INFO]: successfully rebuilt formats: 8 fmtutil [INFO]: total formats: 8 fmtutil [INFO]: exiting with status 0 How might I fix this error and compile the UTF-8 to PDF?
- Handwriting-style fonts [duplicate]by Latexfan on December 11, 2025 at 8:47 pm
how can I creat the text format like this picture. It is not "kalam" format. Can you please help me that it can be compiled with pdftex? This is french. I wish to write in norwegian Thank you
- Multipart rectangle errorby ozsu on December 11, 2025 at 8:28 pm
I am having a problem with a multipart rectangle. I give a MWE below. At \nodepart{twentyone} {\scriptsize 00000000010}% and \nodepart{twentytwo} {\scriptsize 00000000001}% it complains error: 45: Missing number, treated as zero. \nodepart{twentyone} { Any reason? Is there a max limit on the boxes? \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes.multipart} \begin{document} \begin{tikzpicture} \node[ rectangle split, rectangle split horizontal, rectangle split parts=22, draw, minimum height=1cm, align=center, rectangle split part fill={ % --- FIX: Added commas before the % comments --- green!50,green!50,green!50,green!50,green!50,green!50, % dict dates green!50,green!50,green!50,green!50,green!50, % (11 parts) yellow,yellow,yellow,yellow,yellow,yellow, % bitmaps yellow,yellow,yellow,yellow,yellow,yellow % (11 parts) } ] (recSt) {% % Dictionary (dates) \nodepart{one} {\scriptsize 2005-11-01}% \nodepart{two} {\scriptsize 1998-05-01}% \nodepart{three} {\scriptsize 2009-04-22}% \nodepart{four} {\scriptsize 1998-11-01}% \nodepart{five} {\scriptsize 2010-05-01}% \nodepart{six} {\scriptsize 2022-09-01}% \nodepart{seven} {\scriptsize 2021-03-18}% \nodepart{eight} {\scriptsize 2011-01-01}% \nodepart{nine} {\scriptsize 0216-07-01}% \nodepart{ten} {\scriptsize 2013-01-08}% \nodepart{eleven} {\scriptsize 2017-10-10}% % Bitmaps (one-hot) \nodepart{twelve} {\scriptsize 10000000000}% \nodepart{thirteen} {\scriptsize 01000000000}% \nodepart{fourteen} {\scriptsize 00100000000}% \nodepart{fifteen} {\scriptsize 00010000000}% \nodepart{sixteen} {\scriptsize 00001000000}% \nodepart{seventeen} {\scriptsize 00000100000}% \nodepart{eighteen} {\scriptsize 00000010000}% \nodepart{nineteen} {\scriptsize 00000001000}% \nodepart{twenty} {\scriptsize 00000000100}% \nodepart{twentyone} {\scriptsize 00000000010}% \nodepart{twentytwo} {\scriptsize 00000000001}% }; \end{tikzpicture} \end{document}