Hot
- Why does -- cycle not work in this CircuiTikz example?by internet on May 5, 2026 at 8:43 am
I am trying to draw a simple closed loop using circuitikz. I noticed that using -- cycle does not work here (as shown in the figure on the right). Here is a minimal example: \documentclass[border=10pt]{standalone} \usepackage[american]{circuitikzgit} \begin{document} \begin{circuitikz}[line width=2pt] \draw (0,0) to[isource] (0,3) -- (2,3) to[R] (2,0) -- (0,0); \end{circuitikz} \begin{circuitikz}[line width=2pt] \draw (0,0) to[isource] (0,3) -- (2,3) to[R] (2,0) -- cycle; \end{circuitikz} \end{document} Note that I used a thick line width only to make the issue more visible with manually closing the loop. Why does -- cycle not work properly here, and what is the correct way to fix this?
- Font cminch with German umlauts – ÄÖÜ?by Hans Ginzel on May 5, 2026 at 7:48 am
Is there a version of the original display Computer Modern font cminch extended with German umlauts – letters with diaeresis – ÄÖÜ? I have found csinch and plinch fonts with Czech and Polish letters but still missing umlauts. Or which alternatives do you suggest for notice plate?
- Mysterious LuaLaTeX Math kerning issueby Ooooscar on May 5, 2026 at 2:29 am
So I'm compiling with lualatex, using fontspec with unicode-math. It seems that both NewComputerModernMath and LatinModernMath produce a kerning issue with the letter "T". Just build $(T)$ or $\bigl( T \bigr)$ - or see the screenshot below. With the help from AI, I currently have a totally MYSTERIOUS result: for math inside \[ \], the patch only works for sized parentheses (e.g. T \bigr)), but not the plain ones; for math inside \begin{aligned*} \end{aligned*}, the patch only works for plain parentheses, but not the sized ones. Any help for a fix is appreciated - I mean, at least it's a fun puzzle, not trivially solved by an AI 🙂 MWE Code: \documentclass{article} \usepackage[no-math]{fontspec} \usepackage{mathtools} \usepackage{unicode-math} \AtBeginDocument{\directlua{ local glyph_id = node.id("glyph") local kern_id = node.id("kern") local hlist_id = node.id("hlist") local invocation = 0 luatexbase.add_to_callback("post_mlist_to_hlist_filter", function(head) invocation = invocation + 1 local inv = invocation for n in node.traverse(head) do if n.id == glyph_id and (n.char == 0x54 or n.char == 0x1D447) then local k = n.next if k then if k.id == kern_id then local after = k.next if after and after.id == glyph_id and (after.char == 0x29 or after.char == 0x28) then texio.write_nl("[" .. inv .. "] removing plain kern") head = node.remove(head, k) node.free(k) end elseif k.id == hlist_id and k.subtype == 2 then texio.write_nl("[" .. inv .. "] inserting big kern") local new_k = node.new(kern_id, 1) new_k.kern = 113643 head = node.insert_after(head, n, new_k) end end end end return head end, "fix_T_parens") }} \begin{document} \[ (T) \bigl(T\bigr) \Bigl(T\Bigr) \biggl(T\biggr) \Biggl(T\Biggr) \] \begin{align*} (T) \bigl(T\bigr) \Bigl(T\Bigr) \biggl(T\biggr) \Biggl(T\Biggr) \end{align*} \end{document} Also see these questions for some context: LuaLaTeX ignores kerning pairs among math glyphs, Kerning with Lualatex
- How to show (python) code chunk in ltx-talk?by Polly Nomial on May 5, 2026 at 1:36 am
I am trying to include some blocks of code in a ltx-talk slide. The code below uses listings as an example that works for me if I use Beamer, but now I get the errors shown below. How can I show some python code in ltx-talk? (If a solution using listings is not possible, I would be fine even with something like a verbatim block.) \DocumentMetadata{lang = en, tagging = on} \documentclass{ltx-talk} \usepackage{listings} \begin{document} \begin{frame}{Important talking point} \begin{lstlisting}[language=python] print('Help, World!') \end{lstlisting} \end{frame} \end{document} pdflatex run 1...error Errors: mwe.tex:13: Extra }, or forgotten \endgroup mwe.tex:13: LaTeX Error: \begin{lstlisting} on input line 13 ended by \end{frame} mwe.tex:13: Missing } inserted mwe.tex:13: Paragraph ended before \lst@next was complete mwe.tex:15: LaTeX Error: \begin{frame} on input line 7 ended by \end{document} mwe.tex:15: You can't use `\end' in internal vertical mode
- Last bar unusual offset in musixtexby ABV on May 5, 2026 at 12:51 am
Last bar unusual offset in musixtex. The basic code is as follow: \documentclass[% border={-35pt -13pt 170pt -5pt},% left bottom right top varwidth]{standalone} % ========== PAQUETES ========== \usepackage{tikz} \usetikzlibrary{quotes} \usetikzlibrary{shapes} \usetikzlibrary{fit,positioning} \usetikzlibrary{arrows.meta} \usetikzlibrary{decorations} \usepackage{amsmath} \usepackage{xcolor} \usetikzlibrary{calc} \usepackage{musicography} \usepackage{musixtex} \input musixlyr \xdefinecolor{red-undar}{RGB}{179,35,79} \begin{document} \begin{music} \font\B=phvb8t at 8pt \font\A=phvb8t at 10pt \setsongraise{1}{-0.05cm} \generalsignature{1} \setsongraise{2}{-0.05cm} % ========== CONFIGURACIÓN GLOBAL ========== \staffbotmarg3\Interligne \font\B=phvb8t at 8pt \font\A=phvb8t at 10pt \parindent15mm \instrumentnumber{2} \setstaffs1{1} \setstaffs2{1} \setclef1{6} \setclef2{3} \songtop{2} \songbottom{1} \nobarnumbers \interstaff{7} \hsize=18cm % ========== SISTEMA 1 ========== \setlyrics{cifradoA2}{I/G IV {\hspace{0.4cm}IIm6} V/D {\hspace{0.5cm}V6/G} IV} \setlyrics{cifradoA1}{8 3 B 3 B 6 NP 3 6 3 NP 6 8 2 3} \startpiece% %\A\assignlyrics1{cifradoA1}% \A\assignlyrics2{cifradoA2}% \Notes\meterfrac44\qsk\hp\sk&\meterfrac44\qsk\wh{U}\en\bar% \Notes\sk\sk&\wh{S}\en\bar% \Notes\sk\sk&\wh{V}\en\bar% \Notes\sk\sk&\sh{Q}\wh{Q}\en\bar% \Notes\sk\sk&\wh{R}\en\bar% \Notes\sk\sk&\wh{S}\en% %\nolyr \lyricsoff% \endpiece% \vspace{-0.5cm} % ========== SISTEMA 2 ========== \parindent15mm \setlyrics{cifradoB2}{IV6 V6 I IV6 V I} \setlyrics{cifradoB1}{6 B 6 3 5 3 6 3 NP 6 8 5 NP 3 5 1} \startpiece% %\A\assignlyrics1{cifradoB1}% \A\assignlyrics2{cifradoB2}% \NOtes\meterfrac44\sk\sk&\meterfrac44\qsk\wh{Q}\en\bar% \Notes\sk\sk&\wh{O}\en\bar% \Notes\sk\sk&\wh{P}\en\bar% \Notes\sk\sk&\wh{Q}\en\bar% \Notes\sk\sk&\wh{O}\en\bar% \Notes\sk\sk&\wh{N}\en\setdoubleBAR% %\nolyr \lyricsoff% \endpiece% \end{music} \end{document} The current output is as follow:
- I am trying to create my first custom package. I am not understanding how LaTeX parses arguments?by Brion on May 4, 2026 at 11:19 pm
I am using a MiKTex Windows distribution of LaTeX and trying to create a custom package. I am unclear how Latex parses arguments and expl3 makes absolutely no sense to me! For now, what I would like to accomplish is a routine the passes arguments to a .sty file and for the file to do basic error checking and print the values passed to it for confirmation. Thanks for any assistance! I am trying to learn and improve. Here is a MWE of what i have so far % test function using custom package called mypackage.sty located in same folder as .tex file % I am using a MiKTeX for Windows distribution. I have been unsuccessful locating .sty files anywhere else ! % % What I am trying to accomplish is to create some functions in a custom package with optional arguments and % error handling i.e. non-existent function or value out of range % % i am able to sucessfuly compile my functions in a standalone .tex file, but unable to create a package % with arguments and do not no how latex parses arguements % % This is my MWE: % % project1.tex \documentclass{article} \usepackage[draft]{MyPackage} % Just checking to see if I cans successfully pass an argument at package call \usepackage{lipsum} \newcommand{\mycolor}{black} \newcommand{\mylocation}{(0,0)} % (x,y) for cartesian coordinates or (r:Angle) for polar coordinates \newcommand{\myshow}{T} % a boolean value T or F \newcommand{\argfour}{} % mandatory vale that error handling should catch and display appropriate % message "required argument not present" or "argument out of range" \begin{document} \lipsum[1][1-2]\\ \myfunctA[\mycolor,\mylocation,\myshow] % optional arguments, location can be (x,y) or (r:Angle) \myfunctB{\argfour} % mandatory argunt that error handler flags as out off range \myfunctC % non-existent funtion that error handling routine should flag and print error msg. \end{document} The .sty file looks like this: % This is my custom package MWE % It dosn't perform any functions right now, but I would like it to perform basic error handling % and print the agruments and values pased to it. do these routines care what order optional arguments % are passed to them? how do you refer to the individedual arguments passes? % Currently, this code just handles a parameter passed at the "usepackage[]{MyPackage}" level. [draft or final] \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{MyPackage}[2026/05/03 My Custom Package] \RequirePackage{xcolor-2022-06-12} \newif\if@draft \DeclareOption{draft}{\@drafttrue} \DeclareOption{final}{\@draftfalse} \ProcessOptions\relax \if@draft \newcommand{\myfunctA}[1]{\textcolor{yellow}{\textbf{\Huge SORRY! FEATURE Under Construction}}} \else \newcommand{\functB}[1]{\textcolor{red}{\textbf{\Huge HTTP 404! Command Not Found}}} \fi
- miktex2.9 cannot load mathalpha packageby alexander sax on May 4, 2026 at 10:24 pm
I wanted to load mathalpha with miktex2.9 using \usepackage[scr=boondox,cal=esstix]{mathalpha} I got Unfortunately, the package mathalpha could not be installed. Please check the log file: ...\MiKTeX\2.9\miktex\log\pdflatex.log There I found 2026-05-05 00:00:52,153+0200 FATAL pdflatex - MiKTeX encountered an internal error. 2026-05-05 00:00:52,153+0200 FATAL pdflatex - Info: ="" 2026-05-05 00:00:52,153+0200 FATAL pdflatex - Source: Libraries\MiKTeX\PackageManager\RestRemoteService.cpp 2026-05-05 00:00:52,153+0200 FATAL pdflatex - Line: 245
- TeXStudio unable to find custom document classby Gauss on May 4, 2026 at 2:58 pm
I have a .tex of a paper I am writing, and it must be done in the journal's custom .cls. They even provide a sample folder, with a "Sample.tex" using their custom ".cls". Even though they are in the same folder, however, TeXStudio keeps throwing an error stating that the .cls file cannot be found. Based on the log when I hover over the document class (which TeXStudio flags in green), it seems like it is searching the base document classes, instead of looking in the same folder. Even when I use the complete file path instead of just the name of the file, it still throws an error. Something similar is happening with the ".eps" which represent the image files. What can I do to make it so TeXStudio properly searches the file in the correct directory (namely, the one containing the .tex)? Thanks in advance!
- Assigning set lengths for intervals in LaTeXby Nico on May 4, 2026 at 2:53 pm
For one of my statistics projects I need to calculate some confidence intervals. I put them all in a table, but it bothers me that the square brackets are not lining up. Is there a way to make it so that all of them line up at the beginning and at the end? I added a MWE and a picture. \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{graphicx} \usepackage{booktabs} \usepackage{float} \usepackage[margin=2.5cm]{geometry} \begin{document} \begin{table}[h] \centering \begin{tabular}{lccc} \toprule Variable & Confidence interval mean & Confidence interval median & Confidence interval variance \\ \midrule BMI & $[27.31,29.02]$ & $[26.52,28.06]$ & $[37.53,54.90]$ \\ WHR & $[0.86,0.88]$ & $[0.86,0.89]$ & $[0.004,0.006]$ \\ MAP & $[99.06,102.86]$ & $[97.33,101.33]$ & $[183.93,282.34]$\\ CHR & $[4.08,4.45]$ & $[3.70,4.25]$ & $[1.71,2.61]$ \\ Age & $[42.19,46.09]$ & $[40.00,45.00]$ & $[206.73,287.33]$ \\ Stab\_glu & $[89.34,95.99]$ & $[85.00,89.00]$ & $[283.18,1405.86]$ \\ Glyhb & $[4.69,4.87]$ & $[4.62,4.79]$ & $[0.43,0.64]$ \\ \bottomrule \end{tabular} \caption{Confidence intervals for diabetic negative data} \label{tab:CI diabetic negative} \end{table} \end{document}
- Make uppercase for french-babel part name (as "Première partie") in headersby valentin on May 4, 2026 at 2:00 pm
A question similar to Capitalize French part name. What I wish : I would like the headers to be written uppercase : on even pages : CHAPITRE X. TITLE OF THE CHAPTER on odd pages : PREMIÈRE PARTIE. TITLE OF THE PART What I tried : I used the fancyhdr package and here is a minimal working example : \documentclass[twoside]{book} \usepackage[french]{babel} \usepackage[T1]{fontenc} \usepackage{fancyhdr} \usepackage{lipsum} % Defining command \parttitle \newcommand*\parttitle{} \let\origpart\part \renewcommand*{\part}[2][]{% \ifx\\#1\\% argument optionnel absent ? \origpart{#2}% \renewcommand*\parttitle{#2}% \else \origpart[#1]{#2}% \renewcommand*\parttitle{#1}% \fi } % Defining command \chaptertitle \newcommand*\chaptertitle{} \let\origchapter\chapter \renewcommand*{\chapter}[2][]{% \ifx\\#1\\% argument optionnel absent ? \origchapter{#2}% \renewcommand*\chaptertitle{#2}% \else \origchapter[#1]{#2}% \renewcommand*\chaptertitle{#1}% \fi } %Defining right and left marks \renewcommand{\leftmark}{\MakeUppercase{\chaptername \ \thechapter. \ \chaptertitle}} \renewcommand{\rightmark}{\MakeUppercase{\partname. \ \parttitle}} % Defining header style \pagestyle{fancy} \fancyfoot{} \fancyfoot[C]{\thepage} \fancyhead{} \fancyhead[RO]{\emph{\rightmark}} \fancyhead[LE]{\emph{\leftmark}} \begin{document} \part{Titre de la partie} \chapter{Titre du chapitre} \lipsum[1-10] \end{document} Doing this yields the correct result for even pages (btw it matches the default setting of fancyhdr) : Yet, on odd pages, the part title is written uppercase but not the partname : I would like the "Première partie" to be written uppercase. What I understand so far : With babel in French, part names are by default written as "Première partie", "Deuxième partie", etc. (and not as "Partie 1", "Partie 2", etc.). The doc of the babel french package explains (p.38-39) : \StartBabelCommands*{french}{captions}[unicode, fontenc=TU EU1 EU2, charset=utf8] \SetString{\partnameord}{partie} \SetString{\partfirst}{Première} \SetString{\partsecond}{Deuxième} When PartNameFull=true (default), \part{} is printed in French as “Première partie’’ instead of “Partie I’’. As logic is prohibited inside \SetString, let’s hide the test about PartNameFull in \FB@partname. \SetStringLoop{ordinal#1}{% \frenchpartfirst,\frenchpartsecond,Troisième,Quatrième,% Cinquième,Sixième,Septième,Huitième,Neuvième,Dixième,Onzième,% Douzième,Treizième,Quatorzième,Quinzième,Seizième,% Dix-septième,Dix-huitième,Dix-neuvième,Vingtième} \AfterBabelCommands{% \NewDocumentCommand\FB@emptypart{}{\def\thepart{\unskip}}% \NewDocumentCommand\FB@partname{}{% \ifFBPartNameFull \csname ordinal\romannumeral\value{part}\endcsname\space \partnameord\FB@emptypart \else Partie% \fi}% } \SetString{\partname}{\FB@partname} \EndBabelCommands When setting the babel in another language, the part is expressed as "Parte 1", "Part 1", "Teil 1" and not as "Première partie" as in french-babel. As well, when setting PartNameFull = false, the part is written in French as "Partie 1". In those cases, the command \MakeUppercase{\partname} works well and I get the part name uppercase as wanted. For instance in English : So I guess the issue is in the composition of the part name when PartNameFull = true, but I couldn't figure where the problem is and how to solve it.
- Draw a half-plane figure (à la elasticity/solid mechanics books)by Dimitrios ANAGNOSTOU on May 4, 2026 at 9:21 am
How can one create a figure like the following? Here is my attempt. I use the plot function with a combination of a parabola (for the general shape) and a sine wave (to create the "wiggles"). \documentclass[tikz,border=10pt]{standalone} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[>=latex] % Draw the wavy boundary % We use a parabola-like base: 0.2*x^2 - 2 % We add a small sine component for the "roughness" \draw[thick] plot [domain=-3.2:3.2, samples=100, smooth] (\x, {0.2*\x*\x - 2 + 0.08*sin(600*\x)}); % Draw Horizontal Axis (x, u) \draw[->] (-3.5,0) -- (3.5,0) node[below right] {$x, u$}; % Draw Vertical Axis (y, v) \draw[->] (0,-2.5) -- (0,0.8) node[right] {$y, v$}; % Origin label \node[below left] at (0,0) {$0$}; \end{tikzpicture} \end{document} My problem is that the boundary appears too 'wavy'. Also there is a small unecessary part above the x-axis. Any ideas to improve the figure?
- Arrows for FOIL method [duplicate]by Nate on May 4, 2026 at 4:50 am
What is the best way of coding arrows from one letter to another to demonstrate the FOIL method? (This example was made in Word)
- Single-author bibliography with items grouped by year and with a heading for each yearby Stewart Ethier on May 4, 2026 at 2:55 am
I want to create a bibliography of works by a single author. Items will be listed chronologically and numbered, say 1--115, with brackets around the numbers as in the thebibliography environment. But each item from 2010, for example, will be listed under the heading 2010 (centered, same font size as the bibliography itself). In case I'm not being clear, here is an example, which I hope is not pay-walled. How can I best accomplish this?
- How to suppress .bst file separating page numbers in thousands with a comma?by Redshoe on May 4, 2026 at 1:27 am
I am using agu08 bst (https://github.com/pinga-lab/magnetization-rock-sample/blob/master/manuscript/agu08.bst), and this bib style is separating 4 digit page numbers in thousands with a comma (see line 45-46 in the agu08.bst file). I would like to suppress this function, and I have no clue where in the agu08.bst file to edit. This comma separation is a problem because articles by AGU (American Geophysical Union) formats their article numbers as the following example: e2025MS005258. So, in my bibliography I would get the page numbers as e2025MS005,258 because the agu08.bst is separating any numbers that has more than 3 digits for the page entry with commas. Thanks. minimal working example main tex file \documentclass[12pt]{report} \usepackage[letterpaper,left=1in,right=1in,bottom=1in,top=1in]{geometry} \usepackage[T1]{fontenc} \usepackage[authoryear]{natbib} \begin{document} \cite{beucler2020} (\citealp{beucler2020}). \bibliography{thesis} \bibliographystyle{agu08} \end{document} thesis.bib file @article{beucler2020, title={{Quantifying convective aggregation using the tropical moist margin's length}}, author={Beucler, Tom and Leutwyler, David and Windmiller, Julia M}, journal={Journal of Advances in Modeling Earth Systems}, volume={12}, number={10}, pages={e2020MS002092}, year={2020}, publisher={Wiley Online Library} }
- Column alignment in a tableby N. Hunt on May 3, 2026 at 11:16 pm
From the following tex, \documentclass[a4paper,14pt]{extarticle} \usepackage[a4paper,left=0.75in,top=0.25in,bottom=0.25in,landscape]{geometry} \usepackage{fontspec} \usepackage{polyglossia} \setmainfont[Ligatures=TeX]{Gentium} \usepackage[Latin,Greek]{ucharclasses} \usepackage{multicol} \usepackage{booktabs} \usepackage{multirow} \setromanfont{Gentium-Regular} \setmainlanguage{greek} \setotherlanguage{english} \setlength{\tabcolsep}{10pt} \setlength{\parindent}{0pt} \begin{document} \thispagestyle{empty} \begin{table}[!ht] \renewcommand{\arraystretch}{1.25} \begin{tabular}{l c l} \multicolumn{3}{c}{\textsc{First Declension}}\\ \multicolumn{1}{c}{\textsc{Masc.}} & & \multicolumn{1}{c}{\textsc{Fem.}} \\ xxx, xxxx & & xxx, xxx, x \\ xxx, [xxx] & & xxx, xxxx \\ x, x & & x, x \\ xxx, xxxx & & xxx, xxx, xxxx \\ xxx, xxx, x & & xxx, xxx, x \\ \multicolumn{3}{c}{x} \\ \multicolumn{3}{c}{xxx} \\ \multicolumn{3}{c}{xxx} \\ \multicolumn{3}{c}{xxx, [xxxx]} \\ \multicolumn{3}{c}{xxx, [xxx, xxxx, xxxx, xxx, xxxx]} \\ \multicolumn{3}{c}{xxxx} \\ \end{tabular} \end{table} \end{document} I get this output: I would like to know how to get the right-hand column, specifically, the top 5 rows of the right-hand column, moved to the right, to give a better appearance of the bottom 6 rows being centered.
- Migrate pdflatex/OT1(CM) with METAFONT/modes.mf *beautifully* to lualatex(LM)?by Alain Stalder on May 3, 2026 at 6:26 pm
Context With the original TeX/LaTeX and also with pdflatex you could make fonts heavier depending on output device via METAFONT. This, and that most printers would “bleed” more than typically today, imply that the Computer Modern fonts that are used in these setups by default (if OT1 font encoding) are generally designed “too thin” (in fact, they had to be for METAFONT to do its thing), their outlines are thinner than what would have been desired as final output… This has never been changed in subsequent successors to the original Computer Modern fonts over decades (except partially recently in the New Computer Modern Roman book font at the limited set of sizes it supports compared to Latin Modern). If you are not using METAFONT to make fonts heavier, then the results with lualatex using Latin Modern by default are very similar, and you can stop reading here. If, however, you miss the unique beauty of Computer Modern, but have to migrate to lualatex (for accessible tagged pdfs or any other features), here is first a concrete example as the question and then an answer by me. It took me half a year to find something reasonably useful that did not involve changing TeX-related source code or TeX fonts, a process that included several questions here (thanks for all the answers!) and also recently quite a few sessions with Google's Gemini AI, who proved to be very helpful in the end due to its broad knowhow and openness to share that. Concrete Example I am using pdflatex with OT1 font encoding which implies that it uses the Computer Modern (CM) font family by default, in my case I am specifically using Computer Modern Sans (plus is implicitly using some symbol fonts from Computer Modern). My basic setup is that I added the following mode to modes.mf (which is the same as the standard lexmarkr with just the blacker value slightly changed): mode_def xphi = mode_param (pixels_per_inch, 1200); mode_param (blacker, 1.9); % only difference to 'lexmarkr' (2 there) mode_param (fillin, 0); mode_param (o_correction, 1); mode_common_setup_; enddef; And in my latex sources I am using these settings: % !TEX TS-program = pdflatex \pdfpkresolution=1200 \pdfpkmode={xphi} \pdfmapfile{} \textwidth=85.5mm % OT1 is the default unless you are creating a tagged pdf % (which is not well supported on pdflatex anyway) %\usepackage[OT1]{fontenc} Actually, I use two text widths, one for rendered images on my website (the one above) and a larger one for US Letter sized articles. For completeness: I am rendering the images with GraphicsMagick (similar to ImageMagick, but outperformed it in my use cases): gm convert -density 600 "$NAME.pdf" \ -flatten -trim -blur 2.6 -resize 50% +repage -density 72 \ -strip -quality 50% $NAME.jpg For the full source code of my website see https://github.com/exactphilosophy-net/exactphilosophy.net (and there maybe first the source/def*.tex files). And this is a sample result, the look and feel I want to achieve also with lualatex… I will answer what I managed to do in a sec, but, of course, better solutions are always welcome—now and later!
- How do I convert it to PDF? [closed]by Emilio Enriquez Cari on May 3, 2026 at 3:37 pm
\documentclass[11pt, a4paper]{article} % --- UNIVERSAL PREAMBLE BLOCK --- \usepackage[a4paper, top=2.5cm, bottom=2.5cm, left=2cm, right=2cm]{geometry} \usepackage{fontspec} \usepackage[spanish, bidi=basic, provide=*]{babel} \babelprovide[import, onchar=ids fonts]{spanish} \babelprovide[import, onchar=ids fonts]{english} % Set default font to Sans Serif (Noto Sans) for a modern look \babelfont{rm}{Noto Sans} \usepackage{enumitem} \setlist[itemize]{label=--} % --- END UNIVERSAL PREAMBLE BLOCK --- \usepackage{xcolor} \definecolor{michelinred}{RGB}{218, 41, 28} \usepackage{titlesec} \usepackage{tcolorbox} % Personalización de títulos \titleformat{\section}{\color{michelinred}\normalfont\Large\bfseries}{\thesection}{1em}{} \titleformat{\subsection}{\color{black}\normalfont\large\bfseries}{\thesubsection}{1em}{} \title{ \vspace{-2cm} \color{michelinred}\Huge \textbf{La Guía Michelin} \\ \large \textit{El máximo galardón de la gastronomía mundial} } \author{Dossier Informativo} \date{\today} \begin{document} \maketitle \begin{tcolorbox}[colback=michelinred!5!white,colframe=michelinred,title=Introducción] La Guía Michelin es mucho más que una lista de restaurantes; es un referente histórico que ha definido la excelencia culinaria durante más de un siglo. Lo que comenzó como una estrategia de marketing para vender neumáticos se convirtió en la "Biblia" de los gourmets. \end{tcolorbox} \section{Historia: De Neumáticos a Estrellas} Fundada en 1900 por los hermanos \textbf{André y Édouard Michelin} en Francia, la guía nació con un propósito práctico: proporcionar información útil a los pocos automovilistas de la época (mapas, mecánicos y gasolineras). \begin{itemize} \item \textbf{1900-1920:} Gratuita y centrada en servicios mecánicos. \item \textbf{1926:} Comienza la adjudicación de "Estrellas de buena mesa". \item \textbf{1931:} Se establece la jerarquía actual de una, dos y tres estrellas. \end{itemize} \section{El Significado de las Estrellas} La escala de Michelin se basa en la experiencia del viaje: \begin{description} \item[\color{michelinred}★] \textbf{Una Estrella:} Una cocina de gran finura. Compensar hacer un alto en el camino. \item[\color{michelinred}★★] \textbf{Dos Estrellas:} Una cocina excepcional. Merece la pena desviarse. \item[\color{michelinred}★★★] \textbf{Tres Estrellas:} Una cocina única. Justifica el viaje por sí solo. \end{description} \section{Los 5 Criterios de Evaluación} Los inspectores de Michelin son estrictamente anónimos y evalúan exclusivamente la comida basándose en: \begin{enumerate} \item \textbf{Calidad de los productos:} Frescura y selección de la materia prima. \item \textbf{Dominio de la técnica:} Puntos de cocción y texturas. \item \textbf{Armonía de sabores:} El equilibrio en el paladar. \item \textbf{Personalidad del Chef:} La huella creativa en el plato. \item \textbf{Regularidad:} Que la experiencia sea excelente en cada visita. \end{enumerate} \section{Otros Reconocimientos} \begin{itemize} \item \textbf{Bib Gourmand:} Reconoce la mejor relación calidad-precio (comida de alta calidad a precios moderados). \item \textbf{Estrella Verde:} Introducida en 2020 para premiar la sostenibilidad y el respeto al medio ambiente. \end{itemize} \section{Figuras Legendarias} \begin{table}[h] \centering \begin{tabular}{ll} \hline \textbf{Chef} & \textbf{Hito principal} \\ \hline Joël Robuchon & El chef con más estrellas de la historia (32 en total). \\ Alain Ducasse & Famoso por ostentar 3 estrellas en múltiples ciudades. \\ Paul Bocuse & Mantuvo las 3 estrellas por más de 50 años ininterrumpidos. \\ \hline \end{tabular} \end{table} \begin{figure}[htbp] \centering \framebox{\parbox{0.8\textwidth}{\centering \vspace{2cm} \textbf{Espacio para Infografía} \\ \small\textit{Aquí se sugiere incluir un mapa de calor con los países más premiados: Francia, Japón e Italia.} \vspace{2cm} }} \caption{Distribución global de la excelencia Michelin.} \end{figure} \end{document}
- How to make error messages that count in luatexbase.module_XXXby Jasper on May 3, 2026 at 2:09 pm
I have a Lua based package. I want to make error messages that count. I can make obvious ones which are dependent on common sense, such as type checking in some places, but I want to know what broader considerations I should make before going in with error reporting. \documentclass{article} \ExplSyntaxOn \lua_load_module:n { main } \NewDocumentCommand { \myfunction } {} { \__jasper_myfunction: } \ExplSyntaxOff \begin{document} \myfunction \end{document} local function register_tex_cmd(name, func, args, protected) name = "__jasper_" .. name .. ":" .. ("n"):rep(#args) local scanners = {} for _, arg in ipairs(args) do scanners[#scanners+1] = token['scan_' .. arg] end local scanning_func = function() local values = {} for _, scanner in ipairs(scanners) do values[#values+1] = scanner() end func(table.unpack(values)) end local index = luatexbase.new_luafunction(name) lua.get_functions_table()[index] = scanning_func if protected then token.set_lua(name, index, "protected") else token.set_lua(name, index) end end local myfunction = function() luatexbase.module_info('mypackage', "For your information") end register_tex_cmd("myfunction", function() myfunction() end, { })
- Is it possible to embed a slider-controlled interactive TikZ graph inside a PDF?by Abdellah Kahlaoui on May 3, 2026 at 11:30 am
I am currently writing a report on the Traveling Salesman Problem (TSP), and I would like to include an interactive visualization directly in my final PDF. My goal is to have a slider (or a set of buttons) that allows the reader to change the number of vertices $n$ (e.g., from 3 to 6). When the slider is moved, I want the PDF to dynamically update: A TikZ drawing of a complete graph $K_n$. A text node displaying the calculated number of edges: $|E| = \frac{n(n-1)}{2}$. I have looked into packages like animate, media9, and the possibility of embedding JavaScript via insdljs, but I am unsure which approach is the most modern, robust, and compatible with standard PDF readers (like Adobe Acrobat or web-based viewers). Here is a static Minimum Working Example (MWE) of the graph I am trying to make dynamic: \documentclass{article} \usepackage{tikz} \begin{document} % I want 'n' to be controlled by a slider in the PDF \def\n{5} \begin{center} \begin{tikzpicture}[scale=0.8] % Draw edges \foreach \i in {1,...,\n} { \foreach \j in {1,...,\n} { \ifnum\i<\j \draw[blue!40, line width=0.5pt] ({90+(\i-1)*360/\n}:1.5cm) -- ({90+(\j-1)*360/\n}:1.5cm); \fi } } % Draw vertices \foreach \i in {1,...,\n} { \node[circle, fill=blue, draw=white, inner sep=2pt, label={[font=\tiny, color=blue]{90+(\i-1)*360/\n}:$v_{\i}$}] at ({90+(\i-1)*360/\n}:1.5cm) {}; } \end{tikzpicture} \vspace{0.5cm} % I want this text to update when the slider moves Number of vertices: $n = \n$ \\ Number of edges: $|E| = \pgfmathparse{\n*(\n-1)/2}\pgfmathprintnumber{\pgfmathresult}$ \end{center} \end{document} Is there a pure LaTeX/TikZ way (perhaps with animate) to step through these values using interactive buttons?
- TikZ mark line end with xby Viesturs on May 3, 2026 at 11:26 am
The task is to draw a line with an end marker x: The code \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \draw (0,0)--(2,3) node[pos=1] {$\times$}; \end{tikzpicture} \end{document} produces the output How to draw an end marker x that is rotated relative to the line?
- Identifying and reproducing fonts in a book [duplicate]by Daniele Avitabile on May 3, 2026 at 9:15 am
I'm trying to reproduce the look and feel of this book https://www.cambridge.org/core/books/classical-numerical-analysis/5C54FEBDB5C638756691E04BD4C7D2D0 of which I report here a small screenshot It seems to me that the authors are using fonts similar to computer modern roman sans serif. I would like to ask what are, in your opinion, the fonts used here, and what is the quickest way to load them up globally, for a book I'm editing.
- How to plot a curved line a cross the thickness of the beamsby Tldi You on May 3, 2026 at 7:36 am
Deformed and undeformed configurations of the beam Hello everyone, I am trying to reproduce this image using LaTeX TikZ. I have written the code below, but I am encountering difficulties when drawing the curved line through the thickness (the yellow line). Any suggestions would be greatly appreciated. \documentclass[tikz,border=5mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta, decorations.pathmorphing, positioning, calc} \begin{document} \begin{tikzpicture}[>=Stealth, scale=1.5] % Styles \tikzset{ zigzag/.style={decoration={zigzag, segment length=2mm, amplitude=1mm}, decorate}, break/.style={decoration={zigzag, segment length=4mm, amplitude=2mm}, decorate}, dot/.style={circle, fill=black, inner sep=1.2pt}, hollowdot/.style={circle, draw=black, fill=white, inner sep=1.2pt} } % --- Undeformed Beam (Top Part) --- \begin{scope}[shift={(0,2.5)}] % Beam edges \draw (-1.5, 0.4) -- (2, 0.4); \draw (-1.5, -0.4) -- (2, -0.4); \draw [zigzag] (-1.5, -0.4) -- (-1.5, 0.4); \draw [zigzag] (2, -0.4) -- (2, 0.4); % Neutral axis \draw [dotted, thick] (-1.5, 0) -- (2.5, 0) node[right] {$x, u$}; \draw [->] (2.3, 0) -- (2.7, 0); % Center vertical line and z-axis indicator \draw (0, 0.4) -- (0, -0.4); \node [hollowdot] at (0,0) {}; \draw [->] (0.2, 0) -- (0.2, -0.3); \node [right, font=\small] at (0.2, -0.15) {$z$}; % Left coordinate system and x-dimension \draw (-2.8, 0) -- (-2.3, 0); \draw [break] (-2.3, 0) -- (-1.9, 0); \draw (-1.9, 0) -- (-1.5, 0); \draw (-2.8, 0) -- (-2.8, -0.8) node[below, font=\small] {$z, w$}; \draw [->] (-2.8, -0.6) -- (-2.8, -1); \draw [->] (-2.8, -0.6) -- (0, -0.6); \node [fill=white, inner sep=1pt, font=\small] at (-1.4, -0.6) {$x$}; % Vertical reference line extending down \draw [thin, gray!60] (0, -0.4) -- (0, -3.5); \end{scope} % --- Deformed Beam (Bottom Part) --- \begin{scope}[shift={(0,1)}] % Curved beam boundaries \draw (-1.5, 0.4) to[bend right=15] (2, 0.4); \draw (-1.5, -0.4) to[bend right=15] (2, -0.4); \draw [zigzag] (-1.5, -0.4) -- (-1.5, 0.4); \draw [zigzag] (2, -0.4) -- (2, 0.4); \draw [dashed] (-1.8, 0) to[bend right=15] (2.3, 0); % Reference point (u0, w0) on the neutral axis \coordinate (P0) at (0.8, -0.30); \node [hollowdot] at (P0) {}; \node [below right, xshift=50pt, yshift=-20pt, font=\small] (L0) {$(u_0, w_0)$}; \draw [->, shorten >=2pt] (L0.west) -- (P0); % Vertical dashed reference line through P0 %\draw [red,dashed] ($(P0) + (0, 1.2)$) -- ($(P0) + (0, -0.5)$); \draw [red,dashed] (P0) -- ($(P0) + (115:1.0)$); % Deformed cross-section line \draw [yellow,thick] ($(P0) + (-0.3, 0.6)$) to[bend left=25] ($(P0) + (0.1, -0.6)$); % Point (u, w) on the cross-section \coordinate (P) at ($(P0) + (-0.01, -0.25)$); \node [dot] at (P) {}; \node [left, xshift=-2pt, yshift=2pt, font=\small] at (P) {$(u, w)$}; % Rotation angles at the top % Angle phi_x (rotation of the cross-section) \draw [->] ($(P0) + (0, 0.8)$) arc (90:115:0.8); \node [left, font=\small] at ($(P0) + (105:0.9)$) {$\phi_x$}; % Angle -dw0/dx (rotation of the normal) \draw [->] ($(P0) + (0, 0.8)$) arc (95:90:0.8); \node [right, xshift=6pt, font=\small] at ($(P0) + (80:0.8)$) {$-\frac{\partial w_0}{\partial x}$}; \draw [green,dashed] (P0) -- ($(P0) + (90:1.2)$); % Slope angle at the neutral axis \draw [blue,dashed] (P0) -- ($(P0) + (1.5, 0)$); \draw [yellow,dashed] ($(P0) + (-0.5, -0.1)$) -- ($(P0) + (1.3, 0.20)$); % tangent line \draw [->] ($(P0) + (1.4, 0)$) arc (0:10:1.2); \node [right, font=\small] at ($(P0) + (5:1.4)$) {$-\frac{\partial w_0}{\partial x}$}; \end{scope} \end{tikzpicture} \end{document}
- Can you help me identify this font [duplicate]by Name Redacted on May 3, 2026 at 1:18 am
Fonts I've tried the following to no avail: Libertinus Math Latin Modern Math STIX Two Math New Computer Modern Math Asana Math TeX Gyre Termes Math TeX Gyre Pagella Math TeX Gyre Schola Math
- XCharter and \hwithstroke (U+0127)by karlh on May 2, 2026 at 10:00 pm
I upgraded from TeXLIVE 2023 to TeXLIVE 2026 recently (along with Fedora 43 to 44), and I could have sworn that the following used to work: \documentclass{article} \usepackage{fontspec} \setmainfont[Ligatures=TeX]{XCharter} \begin{document}\noindent Għajnsielem\\ OR\\ G\hwithstroke ajnsielem \end{document} Now, when I run this with lualatex, I get six errors like this: Missing character: There is no ħ (U+0127) in font [XCharter-Roman.otf]:mode=node;script=latn;language=dflt;+tlig;! and the missing character is a box. (n.b., Għajnsielem is a municipality in Malta, but I picked it primarily because I knew it had that character in it.) I suspect I have a font file missing or something that didn't survive the upgrade, but I wanted to make sure it is something with my operating system's packaging of XCharter or other font packages before I chase this down a rabbit hole. I thought I at least got a character there, not a box, in the past, and I don't remember there being a warning message or error, either, from the old version.
- Personalized bar with dot in a Curriculum Vitae europassby Sebastiano on May 2, 2026 at 7:23 pm
I would like to create in my Europass document \documentclass[italian,a4paper]{europasscv} \usepackage[italian]{babel} \usepackage[most]{tcolorbox} \DeclareRobustCommand\ebseries{\fontseries{eb}\selectfont} \DeclareTextFontCommand{\texteb}{\ebseries} \definecolor{marine}{HTML}{214493} \ecvname{Cristiano Euro} \newtcolorbox{mybox}{ enhanced, boxrule=0pt,frame hidden, borderline west={3pt}{-10pt}{marine}, colback=white, sharp corners } \begin{document} \begin{europasscv} \sffamily \ecvpersonalinfo{} \ecvbigitem{Posizione ricoperta}{ingegnere} \ecvsection{ingegnere} \ecvtitle{2011 – in corso}{C-Med} \ecvitem{}{\begin{mybox} Buyer con 4 anni di esperienza nel settore strategico degli acquisti, focalizzata sull’ottimizzazione delle condizioni di acquisto di C-Med. Ho accelerato gli approvvigionamenti del 65\% in 18 mesi, collaborando con il responsabile produzione per una Go-To-Market Strategy più rapida. Sono dotato di ottime capacità organizzative e di negoziazione.\end{mybox} } \end{europasscv} \end{document} something like this, i.e. inserting a vertical line with tcolorbox (or other solution) that has the same length as the text inside. My MWE does not respect the indications of the image. I thank you for any solution.
- is there an easier way to draw a dotplotby Arne Timperman on May 2, 2026 at 7:23 am
I want to draw this dotplot: The only way I could think of is: \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \usepackage{statistics} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \begin{axis}[ width=12cm, height=5cm, ymin=0, ymax=20, xmin=0, xmax=1.3, axis y line=left, axis x line=bottom, ytick=\empty, xlabel={$x$}, tick style={draw=none} ] % Dotplot (voorbeelddata) \addplot[ only marks, mark=*, mark size=2.5pt, green!70!black ] coordinates { % linkerzijde (0.35,1) (0.40,1) (0.45,1) (0.40,2) (0.45,2) (0.50,2) (0.45,3) (0.50,3) (0.55,3) (0.50,4) (0.55,4) (0.60,4) % midden (hoogste stapel) (0.60,1) (0.65,1) (0.70,1) (0.75,1) (0.60,2) (0.65,2) (0.70,2) (0.75,2) (0.60,3) (0.65,3) (0.70,3) (0.75,3) (0.65,4) (0.70,4) (0.65,5) (0.70,5) (0.65,6) (0.65,7) % rechterzijde (0.80,1) (0.85,1) (0.80,2) (0.85,2) (0.85,3) }; \end{axis} \end{tikzpicture} \end{document} Resulting in this not very satisfying result: Any suggestions?
- What's wrong with this fancy title page?by Cham on May 1, 2026 at 11:42 pm
I'm playing with a book cover (a novel) with the title separated on three lines. The first part is left aligned to the page, the middle part is centered, and the last part is (should be) right aligned. Currently, my title page is almost right, but I'm experiencing an horizontal glitch that I don't understand. Here's the MWE code that shows the issue. What is wrong with it? \documentclass[11pt,twoside]{book} \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]{geometry} % Option showframe pour montrer les bordures. \raggedbottom \hyphenpenalty=2000 \exhyphenpenalty=2000 \usepackage{titlesec} \usepackage{graphicx} \usepackage[dvipsnames]{xcolor} \usepackage{float} \usepackage[titles]{tocloft} \usepackage[dvipsnames]{xcolor} \usepackage{transparent} \usepackage{tikz} \usetikzlibrary{calc} \titleformat{\chapter}[display] {\normalfont\huge\bfseries\centering} {\chaptertitlename\ \thechapter}{20pt}{\Huge} \begin{document} \frontmatter \begin{titlepage} \definecolor{lightbrown}{RGB}{177, 149, 93} \definecolor{darkred1}{RGB}{60, 25, 0} \pagecolor{darkred1} \begin{tikzpicture}[remember picture, overlay] \draw[line width = 1in,color = white] ($(current page.north west) + (0.25in,0.25in)$) rectangle ($(current page.south east) + (0.25in,-0.25in)$); \draw[line width = 0.25pt,color = black] ($(current page.north west) + (0.75in,-0.25in)$) rectangle ($(current page.south east) + (-0.25in,0.25in)$); \draw[line width = 1pt,color = white] ($(current page.north west) + (1in,-0.5in)$) rectangle ($(current page.south east) + (-0.5in,0.5in)$); \end{tikzpicture} \centering {\textcolor{lightbrown}{\Huge\sffamily Author's name}} \vfill \raggedright {\textcolor{lightbrown}{\fontsize{58}{0}\selectfont\sffamily\textbf{{WOORLDS}}}} \\[2.5\baselineskip] \centering {\textcolor{lightbrown}{\fontsize{48}{0}\selectfont\sffamily\textbf{{of}}}} \\[2.5\baselineskip] \raggedleft {\textcolor{lightbrown}{\fontsize{58}{0}\selectfont\sffamily\textbf{{WOORMS}}}} \\[2\baselineskip] \vfill \centering \vfill \vfill \vfill {\textcolor{brown}{\Large\selectfont\sffamily Copyright Notice}} \end{titlepage} \pagecolor{white} \end{document} Also, the middle part should be well centered, horizontally AND vertically between the first and last part of the title. I'm not sure the code is properly done. Any advice on this would be greatly appreciated. Here's a preview of what this code is doing (don't mind about the weird title. This is just for the the MWE): As you could see on the picture, the last part of the title ("WOORMS") have more space to its right that the left of the fist part ("WOORLDS"). Also, I'm not sure that the middle part ("of") is well centered, vertically and horizontally.
- Create a simple emoji language for babelby David Purton on May 1, 2026 at 2:42 am
I have my doubts about the wisdom of this… But with LuaLaTeX, babel is really great at switching between fonts and languages automatically without mark up. And the settings for the language can by included in an ini file. I wondered about using this feature in a document that is already multilinugual and uses babel so I can just insert emojis wherever without thinking. This following MWE works, but I was wondering: Is this really a good idea? Is there a better way? Can the set up be done wihtout a separate babel-emoji.ini file? MWE %! TeX Program = lualatex \documentclass{article} \begin{filecontents}[overwrite]{babel-emoji.ini} [identification] charset = utf8 script.name = emoji [characters] ranges = 1F300..1F9FF 2600..26FF 2700..27BF \end{filecontents} \usepackage[english]{babel} \babelprovide[import=emoji, onchar=fonts]{emoji} \babelfont[emoji]{rm}{Noto Color Emoji} \begin{document} A \texttt{babel} integrated emoji: 😀 \end{document}
- Borromean Knot Brunnian linkby Julio Michael Stern on April 30, 2026 at 10:18 pm
I am trying to use TiKZ to draw a Borromean knot with 3 Wasp figures. I am getting the wrong superpositions. A single wasp is produced by the following code. Can someone help me to write a TiKZ code for this Brunnian entanglement with 12 crossings. Wasp: \documentclass[border=5mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} % Estilos para o anel do mosaico \tikzset{ vespa ring/.style={ draw=red, line width=11pt, line join=round }, white stripe/.style={ draw=white, line width=2pt, % Removida a opacidade para evitar manchas line join=round } } % Macro final da "Cintura de Vespa" com cabeça circular e elevada \newcommand{\vespawaist}{ (0.8, 0) % Cintura direita .. controls (0.8, 1.0) and (2.0, 1.8) .. (1.5, 2.4) % Ombro .. controls (1.0, 3.0) and (-1.0, 3.0) .. (-1.5, 2.4) % Topo elevado .. controls (-2.0, 1.8) and (-0.8, 1.0) .. (-0.8, 0) % Cintura esquerda .. controls (-0.8, -1.0) and (-2.0, -1.8) .. (-1.5, -2.4) % Ombro inferior .. controls (-1.0, -3.0) and (1.0, -3.0) .. (1.5, -2.4) % Base elevada .. controls (2.0, -1.8) and (0.8, -1.0) .. (0.8, 0) % Fecha -- cycle } % Desenho em camadas para garantir o branco puro \draw[vespa ring] \vespawaist; \draw[white stripe] \vespawaist; \end{tikzpicture} \end{document}
- What is the proper way of implementing specific formatting requirements?by Simon on April 29, 2026 at 7:14 pm
I want to implement given formatting requirements, however, I feel overwhelmed by the number of parameters and their dependencies, and, thus, I don't know which to begin with, as I feel like all of them need to be considered simultaniously. Furthermore, there are even more formatting requirements to fulfill, yet, the following should be the most essential ones, which is why I want to implement these first and condensed them in a table: I use the KOMA-script class scrreprt and would have used the parskip=full- option to seperate paragraphs from each other. If there is any info missing, please tell me and I'll provide it. And if some requirement seems odd, please also let me know. Thanks in advance! EDIT - This MWE should cover all eventualities: \LoadClass[a4paper,parskip=full-]{scrreprt} \RequirePackage[top=3.5cm,bottom=2.5cm,left=3cm,right=3cm]{geometry} \begin{document} \chapter{Chapter Chapter Chapter Chapter Chapter} \section{Section Section Section Section Section Section Section Section} \subsection{Subsection Subsection Subsection Subsection Subsection Subsection Subsection} \subsubsection{Subsubsection Subsubsection Subsubsection Subsubsection Subsubsection Subsubsection} Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph \subsubsection{Subsubsection} Paragraph \subsection{Subsection} Paragraph \section{Section} Paragraph \end{document} EDIT 2 - Update This here shows how \onehalfspacing works: \LoadClass[a4paper,fontsize=12pt]{scrreprt}%try 10pt/11pt/12pt (or any other font size) \RequirePackage{setspace}%provides \setstretch{} \makeatletter \newcommand{\myonehalfspacing}{\normalsize\setstretch{\fpeval{1.5 * \f@size / \f@baselineskip}}} \makeatother %\myonehalfspacing \makeatletter \newcommand{\reportformattingtobecheckedfor}[1]{#1 When implementing \texttt{\string#1}, the reciprocal of the ratio of normal fontsize corresponding \f@size pt, but called 1\@ptsize pt, to its updated baselineskip of \the\baselineskip, defaulting \f@baselineskip, is \fpeval{\baselineskip / \f@size}.\hrule} \makeatother \begin{document} \hrule \reportformattingtobecheckedfor{\onehalfspacing} \reportformattingtobecheckedfor{\myonehalfspacing} \end{document} With this info, the updated MWE looks as follows: After the initial \LoadClass[a4paper,fontsize=12pt,parskip=full-]{scrreprt} \RequirePackage[top=2cm,bottom=2cm,left=3cm,right=3cm]{geometry}%changed to fit one page to exclude page break effects \RequirePackage[T1]{fontenc} \RequirePackage{setspace}%provides \setstretch{} , you could - for 1.5x-linespacing and formatted section headings - continue the preamble with \makeatletter \newcommand{\ratioofnormaltooneandhalfspacing}{} \AtBeginDocument{ \begingroup \normalsize \xdef\ratioofnormaltooneandhalfspacing{\fpeval{\f@size pt/\f@baselineskip*1.5}} \endgroup \myonehalfspacing%has to be called here to work, other than %\onehalfspacing %that can be called anywhere (don't know why here) --> toggle first % in this line on/off to compare, no need to % previous line } \newcommand{\myonehalfspacing}{\setstretch{\ratioofnormaltooneandhalfspacing}} \newcommand{\relativeonehalfspacingtoabsolute}[1]{\fpeval{#1/\ratioofnormaltooneandhalfspacing}}%would have wanted to wrap the fraction with round(...,0) to get the nearest int, doesn't give expected result (don't know why) \makeatother \RedeclareSectionCommand[ font=\normalfont\fontsize{20}{\relativeonehalfspacingtoabsolute{25}}\bfseries, beforeskip=42pt, afterskip=24pt ]{chapter} \RedeclareSectionCommand[ font=\normalfont\fontsize{16}{\relativeonehalfspacingtoabsolute{20}}\bfseries, beforeskip=28pt, afterskip=14pt ]{section} \RedeclareSectionCommand[ font=\normalfont\fontsize{14}{\relativeonehalfspacingtoabsolute{18}}\bfseries, beforeskip=20pt, afterskip=12pt ]{subsection} \RedeclareSectionCommand[ font=\normalfont\fontsize{12}{\relativeonehalfspacingtoabsolute{18}}\itshape, beforeskip=18pt, afterskip=12pt ]{subsubsection} or instead of this just write \makeatletter \newcommand{\myonehalfspacing}{\normalsize\setstretch{\fpeval{1.5 * \f@size / \f@baselineskip}}} \makeatother \myonehalfspacing %\onehalfspacing \addtokomafont{disposition}{\setstretch{1}} \RedeclareSectionCommand[ font=\normalfont\fontsize{20}{25}\bfseries, beforeskip=42pt, afterskip=24pt ]{chapter} \RedeclareSectionCommand[ font=\normalfont\fontsize{16}{20}\bfseries, beforeskip=28pt, afterskip=14pt ]{section} \RedeclareSectionCommand[ font=\normalfont\fontsize{14}{18}\bfseries, beforeskip=20pt, afterskip=12pt ]{subsection} \RedeclareSectionCommand[ font=\normalfont\fontsize{12}{18}\itshape, beforeskip=18pt, afterskip=12pt ]{subsubsection} , either way, you end the preamble with %from https://texwelt.de/fragen/21544/koma-script-abstande-bei-uberschriften-exakt-einstellen-welche-werte-sind-notwendig (not EN, but DE): \RequirePackage{xpatch} \makeatletter \At@startsection{\addtolength{\@tempskipa}{-\parskip}} % Jetzt folgt ein übler Hack ohne Garantie, dass der auch zukünftig noch funktionieren wird! \xpatchcmd{\@xsect}{\vskip\@tempskipa}{\vskip\dimexpr\@tempskipa-\parskip\relax}{}{} \makeatother % to eliminate the added vertical spacing that parskip effects, and with \makeatletter \newcommand{\reportcurrentformatting}{$\rightarrow\frac{\strip@pt\baselineskip\mathrm{pt}}{\f@size\mathrm{pt}}=\fpeval{\baselineskip / \f@size}$}%for debugging \makeatother for debugging, completed by \begin{document} \chapter{Chapter Chapter Chapter Chapter Chapter \reportcurrentformatting} \hrule \section{Section Section Section Section Section Section Section \reportcurrentformatting} \hrule \subsection{Subsection Subsection Subsection Subsection Subsection \reportcurrentformatting} \hrule \subsubsection{Subsubsection Subsubsection Subsubsection Subsubsection Subsubsection Subsubsection \reportcurrentformatting} \hrule Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph \reportcurrentformatting \hrule \hrule Paragraph \reportcurrentformatting \hrule \subsubsection{Subsubsection \reportcurrentformatting} \hrule Paragraph \reportcurrentformatting \hrule \subsection{Subsection \reportcurrentformatting} \hrule Paragraph \reportcurrentformatting \hrule \section{Section \reportcurrentformatting} \hrule Paragraph \reportcurrentformatting \hrule \chapter{Chapter \reportcurrentformatting} \hrule Paragraph \reportcurrentformatting \hrule \end{document} . The MWE's output looks like this (1st page cropped): At this point, the two only remaining areas where I need help are: Does the code that should eliminate the added vertical spacing around the section headings which parskip effects look correct and effective? Is there a way to check the respective sizes of beforeskip and afterskip? In theory, they should be correct as they were set manually, yet, when I compare the font size of chapter and the line spacing of section (they should be the same) measured with a ruler on a monitor (I know ... but it aint stupid if it works) they are not the same, or am I misunderstanding their theoritical (not code) definition here? If these (bonus) questions justify a new post, please let me know. Just thought they benefit from the overall context of the original question and are still somewhat linked to it. Thanks once again!