• How can I list or visualize all available anchors of a CircuitTikZ component?
    by internet on May 8, 2026 at 9:31 am

    I am using CircuitTikZ and often need to connect wires or labels to component anchors. However, it is not always easy to know which anchors are available for a specific component. For example, different components may provide anchors such as north, south, in, out, gate, collector, emitter, etc., and the available anchors vary depending on the component type. When building more complicated schematics, I frequently need to stop and search through the documentation to check anchor names. I was wondering whether there is a way to programmatically: List all available anchors of a given CircuitTikZ/TikZ shape/components, and/or Visualize those anchors directly on the rendered component. For example, something conceptually like: \showanchors{a component/shape} that would either print all anchor names and draw markers/labels on the component itself. So my question is: Is there a practical way to list all anchors associated with a TikZ/CircuitTikZ shape? My motivation is mainly usability and workflow efficiency. A tool like this would make it much easier to explore unfamiliar components and reduce the need to constantly check the manual, especially for beginners or occasional CircuitTikZ users. This is an example of visualizing the anchors to help wiring from CircuiTikz documentation. A possible MWE (clearly, the pin thing must be adjusted somehow to have a better distribution, and to take into account that labels can have spaces and strange characters, but well...). The task it to substitute the \allanchors definition with something automatic, see the comment above it. \documentclass[border=10pt]{standalone} \usepackage[T1]{fontenc} \usepackage[siunitx, RPvoltages]{circuitikz} \begin{document} \begin{tikzpicture}[every pin/.append style={text=red, inner sep=1pt, font=\tiny\ttfamily}] \node [npn](myshape) at (0,0) {}; % Example: this should be autofilled % Basically, for every shape named, say, "gizmo", the anchor "spot" % is a macro named pgf@anchor@gizmo@spot % --- so to do what you want, you should be able to find all % the macros with that pattern that exist % (and I do not know if this is possible in TeX in general, % maybe in LuaTeX...). \newcommand{\allanchors}{center,E,B,south} \foreach \anc in \allanchors { \node[circ, pin=45:\anc] at (myshape.\anc) {}; } \end{tikzpicture} \end{document}

  • Class memoir Warning: \addtodef is marked deprecated and will be removed in 2026, but \addtodef is not being used anywhere
    by marshmelou on May 7, 2026 at 10:20 am

    I am using the memoir class to write my thesis, and I found that this warning regarding \addtodef being deprecated is triggered whenever I load the natbib package. Below is a MWE: \documentclass{memoir} \usepackage{natbib} \begin{document} Hello \end{document} If I comment out \usepackage{natbib}, the warning goes away. Does anyone know the reason for that? Is this safe to ignore? I'm just worried that I'll carry on using this and then at some point in 2026 \addtodef will be removed and for some reason that will mess up my document. Just to clarify, I am using natbib over biblatex because I am already used to it and I found biblatex to be a nightmare to format it the way I would like it to be. For completion, the full warning message is: Class memoir Warning: \addtodef is marked deprecated and will be removed in 2026, use instead \patchcmd, \pretocmd or \apptocmd from the etoolbox package (which is autoloaded by the class) on input line 5.

  • Why is there no spacing around the plus sign?
    by John Sullivan on May 7, 2026 at 10:02 am

    Why is there nice spacing around the + inside the parentheses, but not around the one just after the parentheses? \documentclass{article} \begin{document} $$-\tau N = B'=-\theta'\bigl(\cos\theta\, U + \sin\theta\, V\bigl) + 0 T = -\theta' N$$ \end{document}

  • How can I automatically adapt LaTeX content to different minipage widths, including automatic line breaks in long display equations?
    by ljguo on May 7, 2026 at 7:04 am

    I am trying to typeset exercise/question content inside containers of different widths. For example, the same content may be placed inside a minipage of width 21cm, or inside a narrower minipage of width 10cm. The content may include normal text, images, tables, and display equations. My goal is that the layout should adapt automatically to the available width. In particular, long display equations should be broken automatically when the width becomes smaller. Here is a simplified example: \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} \usepackage{array} \usepackage{booktabs} \usepackage{mwe} \begin{document} \noindent \begin{minipage}{21cm} \textbf{Question 1.} A particle moves along a straight line. Its position at time \(t\) is given by the function \[ s(t)=3t^4-8t^3+6t^2-12t+5. \] The following diagram illustrates the motion of the particle: \[ \includegraphics[width=0.6\linewidth]{example-image} \] The table below gives some measured values: \[ \begin{array}{c|c|c|c|c} t & 0 & 1 & 2 & 3 \\ \hline s(t) & 5 & -6 & 9 & 86 \end{array} \] Find the velocity and acceleration of the particle at \(t=2\). Also simplify the following expression: \[ \frac{(x^2+2xy+y^2)(a^2-b^2)+(x-y)(a+b)^2} {\sqrt{x^4+2x^2y^2+y^4}+a^3b-ab^3+x^2a^2-y^2b^2} \] \end{minipage} \vspace{1cm} \noindent \begin{minipage}{10cm} \textbf{Question 1.} A particle moves along a straight line. Its position at time \(t\) is given by the function \[ s(t)=3t^4-8t^3+6t^2-12t+5. \] The following diagram illustrates the motion of the particle: \[ \includegraphics[width=0.6\linewidth]{example-image} \] The table below gives some measured values: \[ \begin{array}{c|c|c|c|c} t & 0 & 1 & 2 & 3 \\ \hline s(t) & 5 & -6 & 9 & 86 \end{array} \] Find the velocity and acceleration of the particle at \(t=2\). Also simplify the following expression: \[ \frac{(x^2+2xy+y^2)(a^2-b^2)+(x-y)(a+b)^2} {\sqrt{x^4+2x^2y^2+y^4}+a^3b-ab^3+x^2a^2-y^2b^2} \] \end{minipage} \end{document} In the wider minipage, the content looks acceptable. However, in the narrower minipage, the long display equation overflows the available width. What I would like is something like an “automatic responsive layout”: Text should wrap according to the current minipage width. Images should scale relative to the current width, for example using \linewidth. Tables should ideally fit or adapt to the available width. Long display equations should automatically break into multiple lines when necessary. I know that I can manually rewrite the long equation using environments such as align, aligned, multline, or split, for example: \begin{multline} \frac{(x^2+2xy+y^2)(a^2-b^2)+(x-y)(a+b)^2} {\sqrt{x^4+2x^2y^2+y^4}+a^3b-ab^3+x^2a^2-y^2b^2} \end{multline} But in my real use case, the LaTeX content is generated automatically, and the container width may vary. Therefore, I would prefer not to manually decide where every long formula should be broken. In my actual project, the LaTeX source is not written manually. It is generated from structured exercise data. The same exercise may be rendered in different layouts, such as a full-page layout, a two-column layout, or a card-like layout. Therefore, I am looking for a robust strategy rather than a one-off manual fix for a single equation. My questions are: Is there a recommended way in LaTeX to make mathematical content adapt automatically to different container widths? Can display equations be automatically line-broken depending on the current \linewidth? If full automatic line breaking is not possible, what is the usual robust approach for generating such content automatically? Are packages such as breqn, tabularx, adjustbox, or resizebox appropriate for this kind of problem? What is the best practice for this situation?

  • spacing in array environment
    by Stefan Müller on May 6, 2026 at 5:04 pm

    I have a macro for typesetting Attribute Value Matrices (AVMs). Sometimes I want to add a little bit of vertical space. My understanding is that I type \\[2mm] and then 2mm space is inserted. But this is not what happens. Sometimes I have to add 8mm or 10 or 12. It somehow seems to depend on what happened before. But why? And how does it work and is there anything I can do to get the desired behavior? \documentclass{scrartcl} \usepackage{etex} \usepackage{array} \newcommand{\nliste}[1]{% \mbox{$\langle$\upshape\normalfont#1$\rangle$}% } \newcommand{\eliste}{% \mbox{% $\left\langle\right\rangle$}% } \newcommand{\ms}[2][]{% \ifdim\lastskip=-1pt % flag value \mbox{}\\*[-.8\baselineskip]% \else \ifnum\lastpenalty=-10000 % other flag value \mbox{}\\*[-.8\baselineskip]% \fi \fi \mbox{% \delimiterfactor=1000 \delimitershortfall=0pt\tabcolsep=0pt% $\hspace{-2pt}\left[% \begin{tabular}{>{\upshape\scshape}l@{}>{\hspace*{5pt}\normalfont\itshape}l} \if\relax\detokenize{#1}\relax\else \multicolumn{2}{>{\normalfont\itshape}l}{#1}% \\% \fi% #2% \end{tabular}% \right]\hspace{-2pt}$% }% % \par\vspace{1mm}% \vspace{1mm}% } \newcommand{\ibox}[1]{{% \setlength{\fboxsep}{1.25pt}% \fbox{$\scriptstyle #1$}% }} \newcommand{\liste}[1]{% \mbox{% $% \left\langle\mbox{\upshape\normalfont#1}\right\rangle% $% }%\\[2pt]% } \newcommand{\ind}[1]{\mbox{$_{\ibox{#1}}$}} \begin{document} \ms{ \ldots & \ms{ cat & \ms{% head & verb \\ arg-st & \ibox{1} $\oplus$ \ibox{2} $\oplus$ \nliste{ V[\textit{inf}, \textsc{lex}+, \textsc{subj}~\ibox{1}, \textsc{comps}~\ibox{2}, \textsc{ltop} \ibox{3} ] } }\\ cont & \ms{ ltop & \ibox{4}\\ ind & \ibox{5} event } }\\ rels & \liste{ \ms[scheinen]{ lbl & \ibox{4}\\ arg0 & \ibox{5}\\ arg1 & \ibox{6}\\ } }\\[10mm] hcons & \liste{ \ms[qeq]{ harg & \ibox{6}\\ larg & \ibox{3}} } } \end{document}

  • Consistent scaling of Greek letters and operators when using mathptmx/Error messages with newtx
    by Dimitrios ANAGNOSTOU on May 6, 2026 at 4:14 pm

    EDIT I am using the mathptmx package to achieve a Times New Roman aesthetic. However, it seems to me that the Greek letters ($\lambda, \mu, \omega$) seem to lose their relative weight or scale inconsistently compared to the Latin constants. Is this an inherent limitation of the virtual fonts in mathptmx, and how can I force a more robust scaling for these mathematical elements? Working example: \documentclass{article} %\usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{mathptmx} % Times New Roman style \usepackage{amsmath,amssymb,amsthm} %------------------------------------------------------------- % Custom macros %------------------------------------------------------------- \newcommand{\cL}{c_{\mathrm{L}}} % longitudinal wave speed \newcommand{\cT}{c_{\mathrm{T}}} % shear wave speed \begin{document} (...) The material is assumed to be homogeneous, isotropic, linearly elastic, and lossless (non-dissipative), characterised by the real-valued Lam\'e constants $\lambda$ and $\mu$ (with $\mu > 0$ and $3\lambda + 2\mu > 0$) and mass density $\rho > 0$. The corresponding longitudinal and shear wave speeds are % \begin{equation} \cL = \sqrt{\frac{\lambda + 2\mu}{\rho}}, \qquad \cT = \sqrt{\frac{\mu}{\rho}}, \label{eq:wavespeeds} \end{equation} % with $\cL > \cT > 0$. The material obeys the generalised Hooke's law % \begin{equation} \sigma_{ij} = \lambda\,\delta_{ij}\,\varepsilon_{kk} + 2\mu\,\varepsilon_{ij}, \qquad \varepsilon_{ij} = \tfrac{1}{2}(U_{i,j} + U_{j,i}), \label{eq:hooke} \end{equation} % where $\delta_{ij}$ is the Kronecker delta and the usual summation convention over repeated indices is employed. Substituting \eqref{eq:hooke} into the equations of motion $\sigma_{ij,j} + \rho\,\partial_{tt} U_i = 0$ and using the time-harmonic ansatz, so that $\partial_{tt} \to -\omega^2$ and hence $\ddot{U}_i = -\omega^2 U_i$, yields the time-harmonic Navier equations: % \begin{equation} \mu\,\nabla^2 \mathbf{U} + (\lambda+\mu)\,\nabla(\nabla\cdot\mathbf{U}) + \rho\omega^2\,\mathbf{U} = \mathbf{0} \quad \text{in } \Omega, \label{eq:navier} \end{equation} % where $\nabla^2 = \partial^2/\partial x^2 + \partial^2/\partial y^2$ is the two-dimensional Laplacian. Equation~\eqref{eq:navier} is a system of two coupled second-order partial differential equations for $U_x$ and $U_y$. \end{document} When using the more recent \usepackage{newtx} I get error messages. LaTeX Error: Command \openbox already defined. amsthm.sty:426 Or name \end... illegal, see p.192 of the manual.name \@backslashchar \@qend ... illegal, see p.192 of the manual. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help\@err@ l.426 \vrule\hfil}} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. LaTeX Error: Command `\Bbbk' already defined. amssymb.sty:261 See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ->\errmessage LaTeX Error: Command `\string \Bbbk ' already defined. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help\@err@ l.261 \DeclareMathSymbol{\Bbbk} {\mathord}{AMSb}{"7C} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it. Afficher moins

  • Drawing a half-space figure (à la elasticity/elastodynamics books)
    by Dimitrios ANAGNOSTOU on May 6, 2026 at 11:46 am

    Extension of my question for half plane. I want to be able to draw figures like the following one (i.e. figures for the classic Boussinesq/Lamb problems). After some trial and error, inspired by the following answer in a recent question of mine I got something not bad. \documentclass{standalone} \usepackage{tikz} \usepackage{amsmath} \usetikzlibrary{decorations.pathmorphing, shadings, arrows.meta, calc} \tikzset{ potato/.style={ rounded corners=2pt, decorate, decoration={random steps, segment length=5mm, amplitude=3pt}, } } \begin{document} \begin{tikzpicture} \pgfmathsetseed{2345} \begin{scope} \clip (-4, -6) rectangle (4, 0); \draw[potato, top color=gray!15, bottom color=gray!50] (0,0) ellipse[x radius=3.2cm, y radius=3.2cm]; \end{scope} \fill[gray!10] (0,0) ellipse[x radius=3.2cm, y radius=0.9cm]; \draw[thick] (0,0) ellipse[x radius=3.2cm, y radius=0.9cm]; \draw[-{latex}, thick] (0,0) -- (0, -2.4) node[below] {$z$}; \draw[-{latex}, thick] (0,0) -- (3.8, 0) node[right] {$x$}; \draw[-{latex}, thick] (0,0) -- (-2.55, -0.93) node[below left] {$y$}; \filldraw[black] (0,0) circle (2pt) node[below left] {$O$}; \draw[-{Stealth}, very thick] (0, 2.0) -- (0, 0.05) node[right, yshift=1.5cm] {$P$}; \end{tikzpicture} \end{document} There are a couple of issues as shown in the figure. First why the white space below the figure and second it appears to me that the 'wiggy' curve does not fit correctly to the ellipse. Thanks for any improvements.

  • Shade (gray fill) a 'wiggy' half-plane
    by Dimitrios ANAGNOSTOU on May 5, 2026 at 5:42 pm

    Follow-up to my previous question. How to fill/shade the plotted area? % Source - https://tex.stackexchange.com/a/762539 % Posted by kabenyuk % Retrieved 2026-05-04, License - CC BY-SA 4.0 \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" \begin{scope} \clip (-3.5,-2.5) rectangle (3.5,0); \draw[thick] plot [domain=-3.3:3.3, samples=100, smooth] (\x, {0.2*\x*\x - 2 + 0.08*sin(200*\x)}); \end{scope} % Draw Horizontal Axis (x) \draw[->] (-3.5,0) -- (3.5,0) node[below right] {$x$}; % Draw Vertical Axis (y) \draw[->] (0,0.25) -- (0,-1.5) node[right] {$y$}; % Origin label \node[below left] at (0,0) {$0$}; %--- Material label --- \node at (-1.5,-1) {$\lambda,\,\mu,\,\rho$}; \end{tikzpicture} \end{document}

  • How to obtain two same sized block with pictures inside in a tikzposter?
    by JackRed on May 5, 2026 at 5:17 pm

    Using tikzposter, if I create 2 blocks in a column environment, and put inside of each the same picture, I obtain block of different size. I would like both blocks to have the same size, given they should have the same content. Minimal example: \documentclass[25pt,a1paper]{tikzposter} \begin{document} \begin{columns} \column{0.45} \block[]{AAA}{ \begin{tikzfigure}[] \includegraphics[width=0.8\colwidth]{Figure/2026-05-05_17-53.png} \end{tikzfigure} } \column{0.45} \block[]{AAA}{ \begin{tikzfigure}[] \includegraphics[width=0.8\colwidth]{Figure/2026-05-05_17-53.png} \end{tikzfigure} } \end{columns} \end{document} With the results below: I have tried to create more than two columns, and the behaviour was strange (this was done with 4 columns of size 0.22, and 2 pictures per block). The first block has a different size than the next four, and the the final three have again a different size.

  • Multiple bibliographies in OpTeX
    by Robert Alessi on May 5, 2026 at 12:43 pm

    In LateX, there are many ways to have the bibliography distributed into different sections depending on the nature of the references cited, eg. “Primary Sources” for ancient authors and “Secondary Sources” for modern authors. Examples follow. LaTeX Sample \begin{filecontents}{\jobname.bib} @Article{Dols1987, author = {Dols, Michael W.}, date = 1987, journaltitle = {Bulletin of the History of Medicine}, entrysubtype = {secondary}, langid = {english}, pages = {367--390}, title = {The Origins of the Islamic Hospital: Myth and Reality}, volume = 61, } @Inbook{endress1992, author = {Endress, Gerhard}, editor = {Fisher, Wolfdietrich}, location = {Wiesbaden}, entrysubtype = {secondary}, publisher = {Reichert}, booktitle = {Grundriß der arabischen Philologie}, date = 1992, langid = {german}, note = {Supplement}, pages = {3--152}, title = {Die Wissenschaftliche Literatur}, volume = 3, } @Mvbook{al-nadim, author = {{Ibn an-Nadīm}}, editor = {Flügel, Gustav}, location = {Leipzig}, entrysubtype = {primary}, date = {1871/1872}, entrysubtype = {primary}, shorthand = {{Ibn an-Nadīm}, \mkbibemph{{Fihrist}}}, title = {{Fihrist}}, volumes = 2, } @Book{al-qifti, author = {{Ibn al-Qifṭī}}, editor = {Lippert, Julius}, location = {Leipzig}, entrysubtype = {primary}, date = 1903, entrysubtype = {primary}, shorthand = {{al-Qifṭī}, \mkbibemph{{Taʾrīḫ}}}, title = {{Taʾrīḫ al-ḥukamāʾ}}, } \end{filecontents} \documentclass[a4paper,12pt]{article} \usepackage[style=oxnotes]{biblatex} \addbibresource{\jobname.bib} \begin{document} This file illustrates how such a field as \verb|entrysubtype| can be used to have the bibliography distributed into two different sections, namely ``primary sources'' for ancient authors and ``secondary sources'' for modern literature (commentaries, books, articles, chapters and the like). For example the two references that follow are taken from modern authors: one\footcite{Dols1987} and two.\footcite{endress1992} Whereas these other two are taken from ancient authors: one\footcite{al-nadim} and two.\footcite{al-qifti} \printbibliography[title={Primary Sources}, subtype=primary] \printbibliography[title={Secondary Sources}, subtype=secondary] \end{document} My question: how can the same be achieved with OpTeX? A way would be to use a dedicated BibTeX field as entrysubtype. Right now, OpTeX can do the sorting based on sortedby, but without inserting, of course, the headings. It would be great to have an option that would allow for multiple lists in OpTeX! OpTeX Sample @Article{Dols1987, author = {Dols, Michael W.}, year = 1987, journal = {Bulletin of the History of Medicine}, entrysubtype = {secondary}, sortedby = {02-secondary}, langid = {english}, pages = {367--390}, title = {The Origins of the Islamic Hospital: Myth and Reality}, volume = 61, } @Inbook{endress1992, author = {Endress, Gerhard}, editor = {Fisher, Wolfdietrich}, address = {Wiesbaden}, entrysubtype = {secondary}, sortedby = {02-secondary}, publisher = {Reichert}, booktitle = {Grundriß der arabischen Philologie}, year = 1992, langid = {german}, note = {Supplement}, pages = {3--152}, title = {Die Wissenschaftliche Literatur}, volume = 3, } @book{al-nadim, author = {{Ibn an-Nadīm}}, editor = {Flügel, Gustav}, address = {Leipzig}, entrysubtype = {primary}, sortedby = {01-primary}, year = {1871/1872}, entrysubtype = {primary}, title = {{Fihrist}}, volumes = 2, } @Book{al-qifti, author = {{Ibn al-Qifṭī}}, editor = {Lippert, Julius}, address = {Leipzig}, entrysubtype = {primary}, sortedby = {01-primary}, year = 1903, entrysubtype = {primary}, title = {{Taʾrīḫ al-ḥukamāʾ}}, } \nonumcitations \fontfam[NewCM] \verbchar| \nonum\sec \OpTeX/ sample With \LaTeX/, such a field as |entrysubtype| can be used to have the bibliography distributed into two different sections, namely ``primary sources'' for ancient authors and ``secondary sources'' for modern literature (commentaries, books, articles, chapters and the like). How would the same be achieved with \OpTeX/? For example the two references that follow are taken from modern authors: one\fnote{\rcite[Dols1987].} and two.\fnote{\rcite[endress1992].} Both must be printed {\em below} references taken from ancient authors. Whereas these other two are taken from ancient authors: one\fnote{\rcite[al-nadim].} and two.\fnote{\rcite[al-qifti].} Both must be printed {\em above} references taken from modern authors. In the list that follows, I managed to have the ancient authors printed first by using the |sortedby| field. This works, but there is no way to insert headings like {\bf Primary Sources} and {\bf Secondary Sources } as above in the \LaTeX/ example in the list of references. Besides, this is not the way |sortedby| is meant to be used. \nonum\sec References \usebib/s (simple) test-entrysubtype \bye

  • Lost references when including files with delayed exercise answers
    by DaftWullie on May 5, 2026 at 9:58 am

    I'm trying to use the exercise package to collect solutions and then print them later. This is mostly working, but if I have answers typeset in a separate file and included into a main file, any labels introduced within the answers of that separate file cannot be referenced. In case it's relevant, if I input the file instead of include it, the reference is correctly resolved. Here's a MWE. In the main file, we have \documentclass{article} \usepackage[lastexercise,answerdelayed]{exercise} \begin{document} \include{extra} \begin{Exercise} \Question This is a second question. \end{Exercise} \begin{Answer} \Question \begin{equation}\label{eq:test2} x^2 \end{equation} Have a look at (\ref{eq:test2}). \end{Answer} Answers go here \shipoutAnswer \end{document} A second file, extra.tex contains the following: \begin{Exercise} \Question This is a question. \end{Exercise} \begin{Answer} \Question \begin{equation}\label{eq:test} x^2 \end{equation} Have a look at (\ref{eq:test}) \end{Answer} So, we have 2 questions + answers that are essentially the same. The answers are both typeset after the "Answers go here" text. The reference to eq:test2 works, the reference to eq:test does not work. How can I fix this?

  • 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 issue
    by 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

  • 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

  • Assigning set lengths for intervals in LaTeX
    by 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 headers
    by 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?

  • Column alignment in a table
    by 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.

  • How to make error messages that count in luatexbase.module_XXX
    by 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, { })

  • TikZ mark line end with x
    by 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?

  • (Hopf fibration) I want to know how I can obtain the stereographic projection of a spherical circle in R4 to R3, based on a point on a 2sphere in R3
    by Jasper on May 3, 2026 at 10:43 am

    I want to draw the Hopf fibration. In the Hopf fibration, each point on a sphere is mapped to a 4D spherical circle. We can elliptically (Mobiusly) transform the points on the 2sphere to produce beautiful geometric transformations when we stereographically project the 3sphere into R3. I think I could get it if I already had the map from the point to the circle on the 3sphere in R4. So that's my question. I want to know how I can obtain the stereographic projection of a spherical circle in R4 to R3, based on a point on a 2sphere in R3. Here is an MWE of a sphere: % Source - https://tex.stackexchange.com/a/735942 % Posted by Jasper Habicht, modified by community. See post 'Timeline' for change history % Retrieved 2026-05-03, License - CC BY-SA 4.0 \documentclass[border=10pt]{standalone} \usepackage{tikz, tikz-3dplot} \begin{document} \def\myr{3} \tdplotsetmaincoords{65}{125} \begin{tikzpicture} \coordinate (O) (0,0); \draw[thick, ball color=cyan!50!blue, opacity=0.5, draw opacity=1] (O) circle[radius={\myr}]; \node[right] at (O) {$O$}; \begin{scope}[tdplot_main_coords, rotate=-10] \begin{scope}[canvas is xy plane at z=0] % Back half circle (dashed) \draw[dashed] (\tdplotmainphi:\myr) arc[start angle={\tdplotmainphi}, end angle={\tdplotmainphi+180}, radius={\myr}] coordinate (R); % Front half circle (solid) + BL \draw[thick] (\tdplotmainphi:\myr) arc[start angle={\tdplotmainphi}, end angle={\tdplotmainphi-180}, radius={\myr}] coordinate (L); \fill (O) circle[radius={2pt}]; \end{scope} \begin{scope}[canvas is xy plane at z={\myr+0.75}] \draw[-stealth] (\tdplotmainphi:0.5) arc[start angle={\tdplotmainphi}, end angle={\tdplotmainphi+300}, radius={0.5}]; \end{scope} \begin{scope}[canvas is xy plane at z={\myr}] \fill (0,0) circle[radius={2pt}]; \end{scope} \begin{scope}[canvas is xy plane at z={-\myr}] \fill (0,0) circle[radius={2pt}]; \end{scope} \begin{scope}[canvas is yz plane at x=0] \draw[dashed] (\tdplotmainphi:\myr) arc[start angle={\tdplotmainphi}, end angle={\tdplotmainphi+180}, radius={\myr}]; \draw[thick] (\tdplotmainphi:\myr) arc[start angle={\tdplotmainphi}, end angle={\tdplotmainphi-180}, radius={\myr}]; \end{scope} \begin{scope}[canvas is xz plane at y=0] \draw[dashed] (\tdplotmainphi:\myr) arc[start angle={\tdplotmainphi}, end angle={\tdplotmainphi+180}, radius={\myr}]; \draw[thick] (\tdplotmainphi:\myr) arc[start angle={\tdplotmainphi}, end angle={\tdplotmainphi-180}, radius={\myr}]; % Axis \draw[dashed] (0,{\myr}) -- (0,{-\myr}); \draw (0,{\myr}) -- (0,{\myr+1.25}) (0,{-\myr}) -- (0,{-\myr-1.25}); \end{scope} \end{scope} \draw (O) -- (R) node[pos=0.25, above] {$r$}; \end{tikzpicture} \end{document} https://philogb.github.io/page/hopf/# https://en.wikipedia.org/wiki/Hopf_fibration

  • How to plot a curved line a cross the thickness of the beams
    by 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

  • is there an easier way to draw a dotplot
    by 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.

  • How to add extrusion glow of irregular shape different from `shadow scale`?
    by Explorer on May 1, 2026 at 6:50 pm

    What I want to achieve is something like: Noted that the "glow" here is somewhat like a "shadow" path out of the border. However, I have tried blur shadow={shadow xshift=0pt,shadow yshift=0pt,shadow scale=1.05}: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{shadows.blur,spy} \begin{document} \begin{tikzpicture}[spy using outlines={circle, magnification=3, size=3cm}] \draw[fill=gray!25,draw,rounded corners,blur shadow={shadow xshift=0pt,shadow yshift=0pt,shadow scale=1.05}] (40:4) arc[start angle=40,end angle=140,radius=4] -- (140:2) arc[start angle=140,end angle=40,radius=2] -- cycle; \draw[fill=white] (0,2.75) -- ++(.5,-.25) -- (0,3.5) -- ++(-.5,-1) -- cycle; \spy[red] on (140:2) in node at (-2,-1); \spy[blue] on (40:2) in node at (+2,-1); \end{tikzpicture} \end{document} The shadow glow is not what I was after: Is that possible to provide the shadows for such ideal glow for irregular shape?

  • `Arc` operation not work together with `rounded corners` within \path?
    by Explorer on May 1, 2026 at 6:08 pm

    I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \draw[fill=gray!25,draw,rounded corners=8pt] (40:2) -- (40:4) arc[start angle=40,end angle=140,radius=4] (140:4) -- (140:2) arc[start angle=140,end angle=40,radius=2] (40:2) -- cycle; \end{tikzpicture} \end{document} which I think would get a rounded sector, but in fact: Any paraphase on this? Maybe related ?

  • Align Text in Header
    by jeroen2009 on May 1, 2026 at 2:49 pm

    In the following example I am getting an additional unwanted empty line in the header text and I am looking to get the header text in the right cell aligned left. Is there an easy way to achieve this? \documentclass[a4paper,12pt]{book} \usepackage[utf8]{inputenc} \usepackage[demo]{graphicx} \usepackage{array} \usepackage{lastpage} \usepackage{lipsum} \usepackage{fancyhdr} \usepackage[hmargin=20mm,top=3cm,headheight=65pt,footskip=10pt]{geometry} \usepackage{tgheros} \renewcommand*\familydefault{\sfdefault} \usepackage[T1]{fontenc} \pagestyle{fancy} \renewcommand{\headrulewidth}{0pt} \fancyhead[CE,CO,LE,LO,RE,RO]{} %% clear out all headers \fancyhead[C]{% \begin{tabular}{|m{3.0cm}|m{9.3cm}|m{3.2cm}|} \hline \raisebox{-.2\height}{\includegraphics[height=7mm]{logo.png}} & \centering \raisebox{-.2\height}{\fontsize{18}{18}\selectfont{\textbf{Operating Procedure}}} & \centering {\fontsize{6.5}{6.5}\selectfont{Doc. Ref.: abcdef\\ REV1 of \today\\ Page \thepage\ of \pageref{LastPage}}}\tabularnewline \hline \end{tabular}% } \fancyfoot[CE,CO,LE,LO,RE,RO]{} %% clear out all footers \begin{document} \chapter{Chapter title} \thispagestyle{fancy} \section{Section title} \lipsum[1-10] \end{document}```