Hot
- My (\xdef) definitions are expanding to blanks. I'm not sure whyby Jasper on December 14, 2025 at 10:11 pm
I am trying to make an algorithm to do my homework for me. I am having trouble with some csname definitions being blank when I call them. I tried making a more minimal example, but I could not reproduce the error. The empty parenthesis at the end should be the (red) expansion of 2.0. \documentclass[letterpaper]{article} \usepackage{tikz} \pgfmathsetmacro{\m}{7} \pgfmathsetmacro{\b}{2} \pgfmathsetmacro{\lettersInAlphabet}{26} \begin{document} Euclidean-Bezoution algorithm: \foreach[count=\countdooku from 1] \i in {1,...,9} { \ifnum\i=1 \pgfmathsetmacro{\remainder}{mod(\lettersInAlphabet,\m)} \pgfmathsetmacro{\coefficient}{(\lettersInAlphabet-\remainder)/\m} \lettersInAlphabet=\coefficient(\m)+\remainder\par \pgfmathparse{-floor(\lettersInAlphabet/\m)} \color{red}{\remainder=(1)(\lettersInAlphabet)+(\pgfmathresult)(\m)}\par % this isn't being stored correctly \expandafter\xdef\csname str\i\endcsname{(1)(\lettersInAlphabet)+(\pgfmathresult)(\m)} \global\let\remainder\remainder \global\let\coefficient\coefficient \global\let\lettersInAlphabet\lettersInAlphabet \else \pgfmathsetmacro{\lettersInAlphabet}{\m} \pgfmathsetmacro{\m}{\remainder} \pgfmathsetmacro{\remainder}{mod(\lettersInAlphabet,\m)} \pgfmathsetmacro{\coefficient}{(\lettersInAlphabet-\remainder)/\m} \pgfmathsetmacro{\coefficienttwo}{-floor(\lettersInAlphabet/\m)} \lettersInAlphabet=\coefficient(\m)+\remainder\par \pgfmathparse{\remainder == 0} \ifnum\pgfmathresult=1 \breakforeach \else \color{red}{\remainder=(1)(\lettersInAlphabet)+(\coefficienttwo)(\m)}\par \pgfmathsetmacro{\j}{\i-1} % and neither is this \expandafter\xdef\csname str\i\endcsname{(1)(\lettersInAlphabet)+(\coefficienttwo)(\csname str\j\endcsname)} \global\let\remainder\remainder \global\let\coefficient\coefficient \global\let\lettersInAlphabet\lettersInAlphabet \global\let\m\m \global\let\coefficienttwo\coefficienttwo \fi \fi \global\let\countdooku\countdooku } \color{blue}{\countdooku} 1=(\remainder)(\lettersInAlphabet)+(\coefficienttwo)(\m)\par \foreach \i in {\countdooku,...,1} { \pgfmathparse{\i==3.0} \ifnum\pgfmathresult=1 \breakforeach \else 1=(\remainder)(\lettersInAlphabet)+(\coefficienttwo)(\expandafter\csname str\i\endcsname)\par \fi } \end{document}
- Undefined control sequences in figureversions.sty and libertine.sty after Miktex updateby Eros Jones on December 14, 2025 at 8:45 pm
After foolishly updating Miktex nothing works anymore. I use pdflatex with Miktex --- ReportDate: 2025-12-14 20:41:09 CurrentVersion: 25.4 SetupDate: 2025-12-14 12:30:00 SetupVersion: 24.1 Configuration: Regular OS: Windows 10.0.19045 SharedSetup: no LinkTargetDirectory: C:\Users\...\AppData\Local\Programs\MiKTeX\miktex\bin\x64 PathOkay: yes) --- and Texstudio on Windows 10 Education. Here's an MWE: \documentclass{article} \usepackage[LGR,T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{libertine} \begin{document} Hello world \end{document} This is what I'm getting as soon as I include the line \usepackage{libertine} (without that line compilation works as expected): The first issue mentioned in the logfile is a warning about the first line in figureversions.sty, which is \NeedsTeXFormat{LaTeX2e}[2024-11-01] (not a real problem, I assume), followed by various errors regarding undefined control sequences in figureversions.sty and also libertine.sty, and ending with the complaint that \begin{document} is an undefined control sequence as well. Logfile: This is pdfTeX, Version 3.141592653-2.6-1.40.27 (MiKTeX 25.4) (preloaded format=pdflatex 2025.12.14) 14 DEC 2025 22:06 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **./test.tex (test.tex LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2024-01-04> (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls Document Class: article 2023/05/17 v1.4n Standard LaTeX document class (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo File: size10.clo 2023/05/17 v1.4n Standard LaTeX file (size option) ) \c@part=\count187 \c@section=\count188 \c@subsection=\count189 \c@subsubsection=\count190 \c@paragraph=\count191 \c@subparagraph=\count192 \c@figure=\count193 \c@table=\count194 \abovecaptionskip=\skip48 \belowcaptionskip=\skip49 \bibindent=\dimen140 ) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/base\fontenc.sty Package: fontenc 2021/04/29 v2.0v Standard LaTeX package (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/greek-fontenc\lgrenc.def File: lgrenc.def 2023-09-12 2.5 LGR Greek font encoding definitions Now handling font encoding LGR ... ... processing UTF-8 mapping file for font encoding LGR (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/greek-inputenc\lgrenc.df u File: lgrenc.dfu 2023-03-21 1.9 UTF-8 support for Greek defining Unicode char U+00A8 (decimal 168) defining Unicode char U+00AB (decimal 171) defining Unicode char U+00AF (decimal 175) [...] defining Unicode char U+20AC (decimal 8364) defining Unicode char U+2126 (decimal 8486) defining Unicode char U+10144 (decimal 65860) defining Unicode char U+10145 (decimal 65861) defining Unicode char U+10146 (decimal 65862) defining Unicode char U+10147 (decimal 65863) ) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/greek-fontenc\greek-font enc.def File: greek-fontenc.def 2023-09-12 2.5 Common Greek font encoding definitions ))) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/base\inputenc.sty Package: inputenc 2021/02/14 v1.3d Input encoding file \inpenc@prehook=\toks17 \inpenc@posthook=\toks18 ) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/libertine\libertine.sty Package: libertine 2024/04/23 (Bob Tennent) Supports Libertine and Biolinum fon ts for all LaTeX engines. (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/generic/iftex\ifxetex.sty Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead. (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty Package: iftex 2022/02/03 v1.0f TeX engine tests )) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/generic/iftex\ifluatex.sty Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead. ) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/xkeyval\xkeyval.sty Package: xkeyval 2022/06/16 v2.9 package option processing (HA) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/generic/xkeyval\xkeyval.tex (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/generic/xkeyval\xkvutils.tex \XKV@toks=\toks19 \XKV@tempa@toks=\toks20 (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/generic/xkeyval\keyval.tex)) \XKV@depth=\count195 File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) )) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/base\textcomp.sty Package: textcomp 2020/02/02 v2.0n Standard LaTeX package ) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/base\fontenc.sty Package: fontenc 2021/04/29 v2.0v Standard LaTeX package ) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/fontaxes\fontaxes.sty Package: fontaxes 2025-05-24 v2.0.1 Font selection axes (deprecated) (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/figureversions\figurever sions.sty LaTeX Warning: You have requested release `2024-11-01' of LaTeX, but only release `2023-11-01' is available. Package: figureversions 2025-04-29 v1.0.1 Figure versions ! Undefined control sequence. <argument> \prop_gput_if_not_in:NnV \g__figureversions_figurestyles_proporti... l.435 ...figureversions_text_str { OsF } { TOsF } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.435 ...figureversions_text_str { OsF } { TOsF } You're in trouble here. Try typing <return> to proceed. If that doesn't work, type X <return> to quit. ! Undefined control sequence. <argument> \prop_gput_if_not_in:NnV \g__figureversions_figurestyles_tabular_... l.435 ...figureversions_text_str { OsF } { TOsF } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Undefined control sequence. <argument> \prop_gput_if_not_in:NnV \g__figureversions_figurestyles_proporti... l.436 ..._figureversions_lining_str { LF } { TLF } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Undefined control sequence. <argument> \prop_gput_if_not_in:NnV \g__figureversions_figurestyles_tabular_... l.436 ..._figureversions_lining_str { LF } { TLF } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Undefined control sequence. \figureversions_new_figureversion:nn ...ot_in:Nnn \g__figureversions_figurev... l.437 ..._figureversion:nn { text } { \txfigures } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. Package figureversions Warning: Ignoring unknown figure style `text' on line (figureversions) 437 ! Undefined control sequence. \figureversions_new_figureversion:nn ...ot_in:Nnn \g__figureversions_figurev... l.438 ...w_figureversion:nn { osf } { \txfigures } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. Package figureversions Warning: Ignoring unknown figure style `text' on line (figureversions) 438 ! Undefined control sequence. \figureversions_new_figureversion:nn ...ot_in:Nnn \g__figureversions_figurev... l.439 ...igureversion:nn { lining } { \lnfigures } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. Package figureversions Warning: Ignoring unknown figure style `lining' on line (figureversions) 439 ! Undefined control sequence. \figureversions_new_figureversion:nn ...ot_in:Nnn \g__figureversions_figurev... l.440 ...ew_figureversion:nn { lf } { \lnfigures } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. Package figureversions Warning: Ignoring unknown figure style `lining' on line (figureversions) 440 ! Undefined control sequence. \figureversions_new_figureversion:nn ...ot_in:Nnn \g__figureversions_figurev... l.442 { \tbfigures \tabularmath } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. LaTeX Font Info: Trying to load font information for T1+cmr-TLF on input lin e 442. No file T1cmr-TLF.fd. LaTeX Font Info: Trying to load font information for T1+cmr-TOsF on input li ne 442. No file T1cmr-TOsF.fd. LaTeX Font Info: Trying to load font information for T1+cmr-LF on input line 442. No file T1cmr-LF.fd. LaTeX Font Info: Trying to load font information for T1+cmr-OsF on input lin e 442. No file T1cmr-OsF.fd. LaTeX Font Info: Trying to load font information for T1+cmrx on input line 4 42. No file T1cmrx.fd. ! LaTeX Error: Math version `tabular' is not defined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.442 { \tbfigures \tabularmath } Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. ! Undefined control sequence. \figureversions_new_figureversion:nn ...ot_in:Nnn \g__figureversions_figurev... l.444 { \tbfigures \tabularmath } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! LaTeX Error: Math version `tabular' is not defined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.444 { \tbfigures \tabularmath } Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. ! Undefined control sequence. \figureversions_new_figureversion:nn ...ot_in:Nnn \g__figureversions_figurev... l.446 { \prfigures \proportionalmath } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. LaTeX Font Info: External font `cmex10' loaded for size (Font) <7> on input line 446. LaTeX Font Info: External font `cmex10' loaded for size (Font) <5> on input line 446. ! Undefined control sequence. \figureversions_new_figureversion:nn ...ot_in:Nnn \g__figureversions_figurev... l.448 { \prfigures \proportionalmath } The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. )) Overfull \hbox (10.47241pt too wide) in paragraph at lines 435--285 []\T1/cmr/m/n/10 textOsFtextTOsFliningLFliningTLFtextosflininglftabulartabpropo rtionalprop [] ! Undefined control sequence. <argument> \prop_gput_if_not_in:NnV \g__figureversions_figurestyles_proporti... l.460 ...n{figures}{{superior}{proportional}}{Sup} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.460 ...n{figures}{{superior}{proportional}}{Sup} You're in trouble here. Try typing <return> to proceed. If that doesn't work, type X <return> to quit. ! Undefined control sequence. <argument> \prop_gput_if_not_in:NnV \g__figureversions_figurestyles_tabular_... l.461 ...eption{figures}{{superior}{tabular}}{Sup} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. LaTeX Info: Redefining \oldstylenums on input line 485. (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/libertine\LinLibertine_I .tex)) LaTeX Font Info: Trying to load font information for T1+LinuxLibertineT-TLF on input line 7. (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/libertine\t1linuxliberti net-tlf.fd File: T1LinuxLibertineT-TLF.fd 2017/03/20 (autoinst) Font definitions for T1/Li nuxLibertineT-TLF. ) LaTeX Font Info: Font shape `T1/LinuxLibertineT-TLF/m/n' will be (Font) scaled to size 10.0pt on input line 7. (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-pdft ex.def File: l3backend-pdftex.def 2024-01-04 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count196 \l__pdf_internal_box=\box51 ) (test.aux) \openout1 = `test.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7. LaTeX Font Info: ... okay on input line 7. LaTeX Font Info: Checking defaults for LGR/cmr/m/n on input line 7. LaTeX Font Info: Trying to load font information for LGR+cmr on input line 7 . (C:\Users\...\AppData\Local\Programs\MiKTeX\tex/latex/cbfonts-fd\lgrcmr.fd File: lgrcmr.fd 2017/07/29 v1.2 Greek European Computer Regular ) LaTeX Font Info: ... okay on input line 7. \c@mv@tabular=\count197 \c@mv@boldtabular=\count198 ! Undefined control sequence. \__hook begindocument ...}{bold}\IfPackageLoadedT {fontspec}{\bool_gset_true... l.7 \begin{document} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Undefined control sequence. \__hook begindocument ..._bool }\IfPackageLoadedT {hyperref}{\pdfstringdefDi... l.7 \begin{document} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Undefined control sequence. \__hook begindocument ...stringdefDisableCommands {\cs_set_eq:NN \figurevers... l.7 \begin{document} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. [1 {C:/Users/.../AppData/Local/MiKTeX/fonts/map/pdftex/pdftex.map}{C:/Users/.../ AppData/Local/Programs/MiKTeX/fonts/enc/dvips/libertine/lbtn_76gpa5.enc}] (test.aux) *********** LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2024-01-04> *********** ) Here is how much of TeX's memory you used: 3228 strings out of 474478 61461 string characters out of 5744041 1924542 words of memory out of 5000000 25529 multiletter control sequences out of 15000+600000 564095 words of font info for 39 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 73i,5n,91p,461b,119s stack positions out of 10000i,1000n,20000p,200000b,200000s <C:\Users\...\AppData\Local\MiKTeX\fonts/pk/ljfour/jknappen/ec/dpi600\ecrm1 000.pk><C:/Users/.../AppData/Local/Programs/MiKTeX/fonts/type1/public/libertin e/LinLibertineT.pfb> Output written on test.pdf (1 page, 86548 bytes). PDF statistics: 36 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 500000) 1 words of extra memory for PDF output out of 10000 (max. 10000000) The errors in figureversions.sty happen at lines 435-448, starting with the line \figureversions_new_figurestyle:Vnn \c__figureversions_text_str { OsF } { TOsF }. The errors in libertine.sty come at lines 460-461: \fa@naming@exception{figures}{{superior}{proportional}}{Sup} and \fa@naming@exception{figures}{{superior}{tabular}}{Sup}. They also partially appear as text in the compilation result (see above). Background: I have a 250-page dissertation in the works (with Libertine and Biolinum as main fonts, and with loads of maths), everything was fine until yesterday when I opened the Miktex console and fell for its suggestion to update. The Miktex installation before the update was from 2023. I've tried System Restore several times (no success), reinstalling Miktex several times (no success). The dissertation does not compile anymore, at all. Not sure whether the font problem is the only one, but considering that even Hello world does not compile, it's probably a good place to start. I'm happy about any suggestions!
- Vertical line in matrix using LaTeXby Oliver Braunsberger on December 14, 2025 at 8:26 pm
I tried making a vertical line in a matrix and I found two workarounds: \documentclass{article} \usepackage{amsmath} \makeatletter \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{% \hskip -\arraycolsep \let\@ifnextchar\new@ifnextchar \array{#1}} \makeatother \begin{document} \[ \begin{bmatrix}[cccc|c] 1 & 0 & 3 & -1 & 0 \\ 0 & 1 & 1 & -1 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ \end{bmatrix} \] \[ \left( \begin{array}{cccc|c} 1 & 0 & 3 & -1 & 0 \\ 0 & 1 & 1 & -1 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ \end{array} \right) \] \end{document} But I wanted to use this on the following matrix: \begin{pmatrix} -2 & 2 & -1 \\ 2 & -3 & 1 \\ 2& -1 & 1 \end{pmatrix} Also with zeros at the end of every line. But having a negative in very column doesn't seem to work.
- How to horizontally center a left aligned quotation text on the page?by Cham on December 14, 2025 at 5:57 pm
I'm looking for a simple solution (without adding a new package, if possible) to horizontally center a quotation on the page. Here's a MWE to show my issue: \RequirePackage[l2tabu,orthodox]{nag} \documentclass[11pt,twoside]{report} \usepackage[T1]{fontenc} \usepackage[tt=false]{libertinus} \usepackage[french]{babel} \usepackage[stretch=50]{microtype} \usepackage[letterpaper,left=1.25in,right=1in,top=0.5in,bottom=0.5in,includeheadfoot,headheight=15pt,showframe]{geometry} \begin{document} Some introduction text to see the vertical spacing : { \addtolength\leftmargini{1in} \begin{quotation} \itshape Some quote line here \par A funny line \par Another funky line of cynic text \par Let shave your face \par Burma-Shave \end{quotation} } Some text line here to show up the vertical space. \end{document} Here's a preview of what this code is doing: As you can currently see, the quotation isn't centered. Is there a simple way in centering the block of text on the page? And I don't understand the "i" in the command leftmargini. What is this?
- Writing a LaTeX class for rendering line breaks as they were typed in source codeby Reckew on December 14, 2025 at 5:43 pm
Context I would like to write a LaTeX class for notes taking that renders the closest possible to the text arrangement of the source code. Question As a step towards this goal, I would like to create a class that renders line breaks the same way they were typed in the source .tex file. Such a class would not only make a source document render a line break between two seperate lines, it would more exactly render the exact number of line breaks that separate two separate lines. Besides this, I would like to keep the possibility of using macros (and their expansion behaviours) in my document, thus the use of the environment verbatim and alike does not seem to be a solution. Also, the ideal is that the class isn't likely to enter in conflict with other packages, for instance by redefining macros such as \par of which most packages are dependant. Finally, I would like not having to write any explicit instruction related to this purpose in the source document, i.e. the .cls file should carry the entire responsibility of the well-functioning of this features. As an example, the goal class would have the two following behaviours : Behaviour 1 Source code \documentclass{my-notesclass} \begin{document} First line Second line Third line \end{document} Result Behaviour 2 Source code \documentclass{my-notesclass} \begin{document} First line Second line Third line Fourth line \end{document} Result Findings First behaviour The first behaviour can be achieved by using the command \obeylines as such : \begin{document} \obeylines First line Second Line Third line \end{document} But there is still the question of using carefully the command \AtBeginDocument in combination to \obeylines in the .cls file (i.e. \AtBeginDocument{\obeylines}), in a way that avoids conflicts with other packages that could also make use of \AtBeginDocument. Those conflicts ; besides being theoretically suspectable because of \obeylines's work with changing catcodes, which I don't know much about to be honest ; effectively happen when calling \usepackage{mdframed} after \documentclass{my-notesclass} in the .tex source file. However, calling \usepackage{mdframed} or \RequirePackage{mdframed} in the my-notesclass.cls class file itself doesn't produce errors dues to conflicts, and even impedes such errors to be produced when now calling \usepackage{mdframed} after \documentclass{my-notesclass} in the .tex source file, for a reason that I suspect to be that since the package mdframed has already been one time (in the my-notesclass.cls class file) its second call (after \documentclass{my-notesclass} in the .tex source file, where it is problematic) is ignored. I therefore think that a potential solution to this conflict problem is finding a way to force \AtBeginDocument{\obeylines} to operate after every other invoked package, which I haven't searched thouroughly how to do yet (besides just not using the \usepackage statements that appear to be problematic in the .tex source file) so any suggestion on this point would be really appreciated. Second behaviour However, the second behaviour is the one that seems to be the real challenge, I haven't been able to come with a functional solution at all, not even when accepting to make compromises. Conclusion Any suggestion on either first or second behaviour' solutions would be truly appreciated, and I stay available to provide any additionnal information related to my request. P.S. I am open to using LuaTeX if helpful.
- How to make all \cite{} commands superscript with biblatex + chem-angew?by taiwan12 on December 14, 2025 at 4:18 pm
I am using biblatex with the chem-angew style for my chemistry thesis. I want all my in-text citations to appear as superscripts automatically. main.tex \documentclass[11pt]{report} \usepackage{geometry} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{hyperref} \usepackage{csquotes} \usepackage[backend=biber,style=chem-angew]{biblatex} \let\oldcite\cite \renewcommand{\cite}[1]{\textsuperscript{\oldcite{#1}}} \addbibresource{bibliography.bib} \begin{document} Here is some text\cite{Smith2020}. \printbibliography \end{document} bibliography.bib @article{Smith2020, author = {John Smith and Jane Doe}, title = {A Study on Random Chemical Reactions}, journal = {Journal of Imaginary Chemistry}, year = {2020}, volume = {42}, number = {7}, pages = {123--130}, doi = {10.1000/jic.2020.12345} } This works, but it feels like a hack. My question: Is there a cleaner or more “proper” way to make all \cite{} commands automatically appear as superscripts while still using biblatex with the chem-angew style? I would like a solution that is compatible with biber and doesn’t involve manually wrapping every \cite{} in \textsuperscript{}.
- 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. Added same day: Here’s a diff between LuaLaTeX / Latin Modern and pdflatex / Computer Modern, almost only the dot on the ”i” and the shift of the “a” are different, the other letters shifted in the diff above was just that was more condensed with LuaLaTeX / ”AMS OpenType” as I had mentioned but forgot about again.
- 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.
- Enabling latexmk -c feature in vscodeby mlg on December 14, 2025 at 9:40 am
I'm using VSCode with LaTeX Workshop (which includes latexmk) and I don't want all the auxiliary files. Normally I would just run latexmk with the -c flag, but I don't know how to do this in VSCode. Is there an easy way to do this?
- 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.
- 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 } ?
- 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 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}