Hot
- how to embed a domain curve in a parametric surface using luaby Jasper on April 23, 2026 at 12:07 pm
Here's what I'm thinking. Let's take a rectangular parameter domain, and embed a curve in it. Then, let's break it apart into triangles, and keep the subpaths inside each triangle, relative to it's affine coordinate system. Then, after partitioning and occlusion sorting, we can draw each triangle, and then it's embedded path(s). This technique would make the following diagram more beautiful. I'm open to alternative approaches too, as I'm aware that it's possible in other ways (see Howard Anton's calculus). I believe this should be achievable in TeX, using Lua. Look how improperly occluded the following diagram is in this regard: Notice: I wrote this package \documentclass[tikz,border=1cm]{standalone} \usepackage{lua-tikz3dtools} % https://github.com/Pseudonym321/TikZ-Animations/tree/master1/TikZ/lua-tikz3dtools \begin{document} \begin{tikzpicture} \setobject[ name = view, object = {Matrix.zyzrotation3(pi/2, pi/3, pi/6)} ] \appendlight[ v = {return Vector:new{1, 1, 1, 1}} ] \foreach \i in {0,1} { \appendsurface[ ustart = 0, ustop = tau, vstart = -tau, vstop = tau, usamples = 30, vsamples = 10, v = {return Vector:new{cos(u), sin(u), v, 1}:multiply(Matrix.zyzrotation3(0,\i*pi/2,0))}, transformation = {view}, fill options = {fill = white!50!ltdtbrightness} ] \appendcurve[ ustart = 0, ustop = tau, usamples = 100, transformation = view, v = {return Vector:new{cos(3*u), sin(3*u), 2*u - tau, 1}:multiply(Matrix.zyzrotation3(0,\i*pi/2,0))}, draw options = { line join = round, line cap = round, line width = 2pt, draw = red } ]} \displaysimplices \end{tikzpicture} \end{document}
- Footnotes in longtblr with rows generated by macroby mw2015 on April 23, 2026 at 10:56 am
I used longtblr tables from tabularray package. Rows are generated using a macro mentioned in expand option in outer specifications of the table. I would like to use footnotes in such table. Notes from tabularray package (note option and \TblrNote command) are not adequate bacause: inside the macro generating the row it is unknown note's number, note options should be placed inside outer specification part, so they cannot be generated by the macro. Therefore I would like to use footnotes, described in Tabularray with footnotes. There is example code: \documentclass[a4paper]{article} \usepackage[margin=2cm]{geometry} \usepackage{tabularray} \UseTblrLibrary{counter} \UseTblrLibrary{functional} \makeatletter \IgnoreSpacesOn \tlNew \gFootNoteTl \intNew \gFootNoteInt \prgNewFunction \footNote {m} { \tlPutRight \gFootNoteTl { \stepcounter{footnote} \footnotetext{#1} } \prgReturn {\footnotemark{}} } \AddToHook{env/longtblr/before}{ \intSetEq \gFootNoteInt \c@footnote \tlClear \gFootNoteTl } \AddToHook{env/longtblr/after}{ \intSetEq \c@footnote \gFootNoteInt \tlUse \gFootNoteTl } \IgnoreSpacesOff \makeatother \usepackage{ipsum} \newcommand{\tablerow}[2]{#1 & #2 \\} \begin{document} \ipsum<Type=sent>[1-4]\footnote{Note before table} \begin{longtblr}[ caption=Long table, evaluate=\footNote, expand=\tablerow, ]{ colspec={lX}, width=\linewidth,row{1}={font=\bf} } Item & Description \\ item 1\footNote{First note from table body} & \ipsum[1] \\ item 2\footNote{Second note from table body} & \ipsum[2] \\ item 3 & \ipsum<Type=sent>[3] \\ \tablerow{item 4\footNote{First note from macro}}{\ipsum[4]} \tablerow{item 5\footNote{Second note from macro}}{\ipsum[5]} \end{longtblr} \ipsum<Type=sent>[1-5]\footnote{Note after table} \end{document} Result is as follows: Unfortunately, this solution works fine when footnote is placed directly in table body (footnotes with text First note from table body and Second note from table body) but not together with macro generating rows (footnotes with text First note from macro and Second note from macro), which are shown multiple times. I tryed to fix the problem using approach described in The footnote text is repeated several times at the bottom of the page, but after definition of function \footNote as follows \prgNewFunction \footNote {m} { \IfBooleanF { \lTblrMeasuringBool } { \tlPutRight \gFootNoteTl { \stepcounter{footnote} \footnotetext{#1} } \prgReturn {\footnotemark{}} } } the results are also wrong.
- package ebproof, left label usageby Jasper on April 23, 2026 at 10:46 am
I am trying to typeset the forall introduction rule using ebproof, as suggested here: https://tex.stackexchange.com/a/762165/319072. I am reading the manual, but the left label key is not producing the expected result. I am getting this: and what I expect is this (credit Constructivism in Mathematics): \documentclass[letterpaper]{article} \usepackage{microtype} \usepackage{mathtools} \usepackage{unicode-math} \usepackage{ebproof} \begin{document} \[ \begin{prooftree} \hypo[left label=\forall I]{\overset{D_1}{A}} \infer1{\forall yA[x/y]} \end{prooftree} \] \end{document}
- I want to set up the schematic of a modus ponens deduction which uses elimination and implicationby Jasper on April 23, 2026 at 6:48 am
I want to set up the schematic of a modus ponens deduction which uses elimination and implication. I don't think I can get \frac to behave for this Source: Constructivism in Mathematics by A. S. Troelstra and D. van Dalen. \documentclass[letterpaper]{article} \usepackage{microtype} \usepackage{mathtools} \usepackage{unicode-math} \title{Quack} \author{Jasper} \date{\today} \begin{document} \[ \frac{B\to C\ \frac{A\to B\ A}{B}\to E} {C}\to E \] \end{document}
- calculating tangent vectors with partial derivativesby Jasper on April 23, 2026 at 1:57 am
I wanted to try calculating some tangent vectors for a picture, just for fun. This requires taking partial derivatives. It will be some time before I can automate partial derivatives algebraically for illustrations, even though it is a long term goal of mine. In the meantime, I want to see how people would suggest I approximate them. \documentclass[tikz,border=3.14mm]{standalone} \usepackage[3d]{luadraw}%https://github.com/pfradin/luadraw \begin{document} \begin{luadraw}{name=tangent} local g = graph3d:new{viewdir={30,60}, window={-4,4,-3,7}, size={12,12}, bbox=false} local f = function(u, v) return M( 3*math.cos(u)+math.cos(u)*math.sin(v), 3*math.sin(u)+math.sin(u)*math.sin(v), u+math.cos(v)) end -- local dfdu = ??? -- local dfdv = ??? local S = surface(f, 0, 2*math.pi, 0, 2*math.pi) g:Dfacet(S, {mode=mShadedOnly,color="blue"}) g:Show() \end{luadraw} \end{document}
- Hyperref footnote and label in math modelby Darsen on April 23, 2026 at 12:27 am
For relevance, I am using hyperref and footnotebackref in my preamble. I'm trying to use \label and \footnotemark both in the same equation, but I rightfully get an error message saying that there are multiple \label's in the environment. Is there a workaround for this? Tbh, I'm not very proficient with LaTeX but I can (to a degree) tweak already-existing code for my personal use. Any help will be appreciated! I think this is a general issue with footnotemark and label, but in case my preamble is the problem: \documentclass[]{article} \usepackage[margin=2.5cm]{geometry} \usepackage[english]{babel} \usepackage{amssymb} \usepackage{mathtools} \usepackage{amsthm} \usepackage{fnpct}% fix multiple footnotes separator \usepackage[colorlinks=true]{hyperref}% hyperlinks to footnotes \hypersetup{allcolors=blue} \usepackage{footnotebackref} \makeatletter \LetLtxMacro{\BHFN@Old@footnotemark}{\@footnotemark} \renewcommand*{\@footnotemark}{% \refstepcounter{BackrefHyperFootnoteCounter}% \xdef\BackrefFootnoteTag{bhfn:\theBackrefHyperFootnoteCounter}% \label{\BackrefFootnoteTag}% \BHFN@Old@footnotemark } \makeatother \makeatletter \renewcommand\@makefntext[1]{% \renewcommand\@makefnmark{% \mbox{{\normalfont% \hyperref[\BackrefFootnoteTag]{\@thefnmark}}}.}% \BHFN@OldMakefntext{#1}}% \makeatother
- Separate cases for real part and imaginary partby Tom Huntington on April 22, 2026 at 11:38 pm
I am trying to recreate I want it working in github markdown, but github markdown doesn't support this trick Missing or unrecognized delimiter for \right \left. aaaa \right\} Edit Github requires you to use \lbrace and \rbrace \left. aaaa \right\rbrace
- Help matching a Garamond math fontby Jean Dubois on April 22, 2026 at 10:17 pm
I am trying to match the style of a document (a French math exam, see the first image below). While I have identified the main text font as EB Garamond, I am struggling to reproduce the mathematical rendering (my current attempt is the second image). I am interested in knowing the name of the math font used in the document, as I do not think Garamond-Math is used (the symbols are different). I have also noticed that the original uses ligatures for internal "s" characters in italic (for example, "question" on the second line or "descente" on the third one), which I haven't been able to replicate. The reference (original): My current attempt (using EB Garamond and Garamond-Math): My code (I downloaded EB Garamond and Garamond-Math in the font folder), intended to work with XeLaTeX. \documentclass{article} \usepackage[fontsize=13pt]{scrextend} \usepackage[a4paper, margin=3.5cm]{geometry} \usepackage[french]{babel} \usepackage{fontspec} \setmainfont{EBGaramond}[ Path=./font/, Extension=.otf, UprightFont=*12-Regular, ItalicFont=*12-Italic, RawFeature={ +cv06, % narrow guillemets +calt, % Contextual alternates +clig, % Final s +liga, % f+letter, and Q, j in italic +dlig, % T+h +lnum % Numbers }, ItalicFeatures={ RawFeature={ +hlig, % st, ct, sp, sk +lnum % Numbers } } ] \usepackage[math-style=ISO, bold-style=ISO]{unicode-math} \setmathfont{Garamond-Math.otf}[Path=./font/,StylisticSet={ 1, % \mathbb 2, % \partial 9 % \tilde }] \begin{document} \frenchspacing \noindent\textit{Cette partie porte sur les fonctions convexes dont les gradients sont lipschitziens, établit le théorème de Baillon-Haddad à la question 21), lequel permet enfin d’étudier la convergence de la descente de gradient en l’interprétant comme une itération de Krasnoselskii-Mann.} \medskip Soit $f: \mathbb R^{n} \longrightarrow \mathbb R$ une fonction de classe $\mathscr C^{1}$. On note $\nabla f : \mathbb R^{n} \longrightarrow \mathbb R^{n}$ la fonction gradient qui a $x \in \mathbb R^{n}$ associe le vecteur $$ \nabla f (x) = \begin{pmatrix} \frac{\partial f}{\partial x_{i}}(x) \end{pmatrix}_{1 \leqslant i \leqslant n}. $$ \end{document} The full document is available here. Thank you for your help!
- Known unicode-math backwards compatibility issuesby wsmith on April 22, 2026 at 8:04 pm
I was wondering what common backwards-compatibility issues I should have on my radar when is comes to loading unicode-math? As the package's CTAN page says itself: "[w]hile backwards compatibility is strived for, there are some differences between the legacy mathematical definitions in latex and amsmath, and the Unicode mathematics definitions." I am currently writing a (thesis) template and insist on the user using modern features of latex such as unicode-math; however, I have found in practice that users will paste their existing (perhaps poorly archaically written) code into this template, and it will either not compile or will not look as expected. I would like to put together a list of things to look out for, since I am certainly missing some myself. I will start with a few simple examples which I have seen myself. Both are issues that have appeared previously in this forum many years ago; however, I think it would be of some use to have these compiled together in a centralized location. If there is already some reference of this sort, please let me know.
- Q: LaTeX / psnup / psbook to generate a small lookup bookletby Christof Bodner on April 22, 2026 at 2:40 pm
I am using LaTeX since decades, but now I am facing a request, I cannot answer out-of-the-box. I would have to dive into the psnup/booklet stuff in order to fulfill it. I thought, I'll ask the experts in order to speed up things. (AI does NOT help in this case - as usual ;-)) What's the problem? (similar but not the same as How to automatically output page order to print 8 pages of a booklet on a single sheet of Letter paper?) I have a PDF generated with XeLaTeX and would like to make hand-outs in a very compact format. The target is to cut an A4 page (landscape) in 4 pieces (columns) and put the parts together like a booklet. So I get an A7 sized small book with the shrinked A4 pages on it and I can read through the booklet by flipping over. This is a really handy format! As I also need a lot of these hand-outs, maybe it's possible to have all 4 columns the same, so cutting and puttiong together is much simpler. Basically it's the same as in "booklet", but resulting in a 4x smaller booklet. Any ideas how to do this? As I said, I tried it by myself with psbook and psnup, but did not get the correct output, the page numbers were not correct. Many thanks in advance for any hints! Ch.
- LaTeX: How do I read in a UTF-8 text file replacing formfeeds with \newpage?by hackerb9 on April 22, 2026 at 12:44 pm
I have text files which I'd like to show in a paraphrased, not-quite-verbatim way. The most important transformation needed is replacing the formfeed character with \newpage. I tried several packages (fancyvrb, verbatim, minted) and listings nearly worked as it allowed me to specify \lstset{formfeed={\newpage}}. I especially appreciated the ability of listings to easily transform the text with simple styling. For example, I was able to display words in [square brackets] with \strong and words in <angle brackets> with \emph. However, the documentation for listings neglected to mention that it is unsuitable for modern work as its handling of Unicode characters is buggy, placing them on the wrong lines. I've seen various workarounds but they seem to require that one knows in advance which Unicode characters are going to be in the file. Is there a package which lets me read in a file, automatically perform basic transformations (like search and replace of formfeed), and display the result in a verbatim-esque environment? Edit: Add example text file. Note there is an invisible formfeed (^L) embedded in the following text, causing it to cover two pages. QUICK REFERENCE ▒ ▄▄▒ ▒▒▒ ▄▄▒ ▒ ▒ ▄▄▒ ▄▄▒ ▄ ▒ ▒ ▒ ▒ ▒▒▒ ▒▒▒ ▄▄▒ ▒ ▒▄▄ ▒ ▄▄▒ ▄ ▒ ▒ ▒ ▒▄▄▄▒▄▄▄▒▄▄▄▒▄▄▄▒▄▄▄▒▄▄▄▒▄▒▄▒▄▄▄▒ CLEUSEAU TEXT QUICK REFERENCE Moving ------ ←.......Move left one char SHIFT←..Move to start of word (left) CTRL_A CTRL←...Move to end of line (left) CTRL_Q BASIC INSPECTOR QUICK REFERENCE Editing ------- .RENUM <range>[TO<num>][STEP<num>]... Renumber range of lines. .MOVE <range>[TO<num>][STEP<num>]... Move the range of lines. Output desired:
- Vertical Space in a Beamer Presentationby jeroen2009 on April 22, 2026 at 11:11 am
In a beamer presentation, in order to start the upper bullet point at the top of each page and not at the vertical center of the page, I use the t option as shown below. How can I achieve to start the upper bullet point at each page for example 1 inch from the top and not entirely at the top margin \documentclass[t]{beamer}
- How can I use \input to move tabularx row content to separate files?by cowgoesmoo on April 22, 2026 at 10:26 am
I have a working project with a main file (100-main.tex), that uses \input to pull in a file containing a version history chapter (102-versionhist.tex). I have the following code in 102-versionhist.tex: \chapter{Version history} \newcommand{\revision}[7]{ #1 & #2 & #3 & #4 & #5 & #6 & #7\\ } \newcommand{\change}[3]{ #1 & #2 & #3\\ } { \centering \begin{tabularx}{\linewidth}{ l % Revision. l % Status. l % Date. l % Prepared. l % Checked. l % Approved. >{\raggedright\arraybackslash}X % Comments. } \toprule \thead{Rev.} & \thead{Status} & \thead{Date} & \thead{P} & \thead{C} & \thead{A} & \thead{Comments} \\ \midrule \revision{TEST}{TEST}{TEST}{T}{T}{T}{TEST} \bottomrule \end{tabularx} } \vspace{2em} { \centering \begin{tabularx}{\linewidth}{ r % Revision. r % Change ref. >{\raggedright\arraybackslash}X % Change summary. } \toprule \thead{Rev} & \thead{Change ref.} & \thead{Change summary} \\ \midrule \change{TEST}{T01}{TEST} \bottomrule \end{tabularx} } This compiles fine (LuaLaTeX). What I would like to do is move \revision{TEST}{TEST}{TEST}{T}{T}{T}{TEST} and \change{TEST}{T01}{TEST} to separate files, so that 102-versionhist.text becomes static (using git for version control). If I move the revisions and changes to separate .tex files and try to replace them with e.g. \input{revisions.tex} and \input{changes.tex} it won't compile. What am I doing wrong? I've managed to troubleshoot things a little bit. The console output complains of Misplaced \noalign. \bottomrule ->\noalign.... and if I remove the \bottomrule from the table then it compiles, but the first column of the second row that comes in via \input has a space on the front of it. I think this is potentially what is breaking it. There is no visible space at the front of the revisions.tex file in my editor (TeXworks). Edit: I tried changing the revisions.tex file to be: \revision{TEST}{TEST}{TEST}{T}{T}{T}{TEST1 external file} \revision{TEST}{TEST}{TEST}{T}{T}{T}{TEST2 external file} and the compiled output (without \bottomrule) changes to: which confirms there's a space being added at the start of what \input brings in. The behaviour remains the same though; won't compile if \bottomrule is in the table. Edit2: Updating revisions.tex to be: \ignorespaces \revision{TEST}{TEST}{TEST}{T}{T}{T}{TEST1 external file} \revision{TEST}{TEST}{TEST}{T}{T}{T}{TEST2 external file} fixes the issue of leading space on what comes in to the table, but it still won't compile if \bottomrule is in place.
- Font style in first few pages of books by De Gruyter [duplicate]by Maths Rahul on April 22, 2026 at 4:57 am
The new file in Overleaf comes with \documentclass{article} \usepackage{graphicx} % Required for inserting images ... \begin{document} .... \end{document} In the output, it shows general old styled roman fonts. While reading a book by De Gruyter, I noticed that their font style is different than the books by Springer, Dover, Ametican Mathematical Society etc. I wanted to get the possible font-styles appearing in the modern books published by De Gruyter. I am sharing the link which shows first 3-4 pages (only these fonts I an interested in). I was not able to search them properly anywehre. Q. Can anyone please tell how do I make note in all such fonts in the book?
- Append command to all superscripts and subscriptsby MarcRdC on April 22, 2026 at 12:33 am
I am using LuaHBTeX (TeX Live 2026) and would like to automatically append a command (say \mycmd, for example a sequence of characters) to all mathematical superscripts and subscripts, without making ^ and _ active — and without using some custom commands to write the said superscripts and subscripts. Could some lua code achieve that? Unlike gsub, it should also apply when symbols ^ and _ are not directly used in the body of the document. For instance, in math mode, a_{b}, a_{b^{c}} and \mytest, where \mytest is defined as a^{b}, should be respectively replaced with a_{b\mycmd}, a_{b^{c\mycmd}\mycmd} and a^{b\mycmd}. \documentclass{article} \def\mycmd{!} \def\mytest{a^{b}} \begin{document} % \verb+\( a_{b} \quad a_{b^{c}} \quad \mytest \)+ should give \( a_{b!} \quad a_{b^{c!}!} \quad a^{b!} \). \verb+\verb!a_b a^b!+ should give \texttt{a\_b a\textasciicircum b}. % \end{document}
- Aligning text within a table cell so that it is centered horizontally and verticallyby NotMyRealName on April 21, 2026 at 11:20 pm
I have been googling for a while and have seen quite a few posts on this, but none of them seem to work. I would like to horizontally and vertically align the below table so that the text appears in the center of the column and the center of the row. I tried this with [b]{|c|}, hoping that this would align the text to the bottom (I also attempted this with [c]{|c|} and got no change. The reason that I use the m/p/b parameters is because I also need the columns to be a set width, I even made sure to include the array package. I had hoped that the b parameter would align the text to the bottom, and the m would align it to the middle, but again, none of them change anything. \documentclass[]{subfiles} \usepackage{array} \begin{document} \begin{table} \begin{center} \begin{tabular}{|m{2.1cm}|m{1.9cm}|m{1.9cm}|b{1.9cm}|m{1.9cm}|p{1.9cm}|b{1.9cm}|} \hline & \multicolumn{2}{c|}{Initial volume ($V_i$)} & \multicolumn{2}{c|}{Final volume ($V_f$)} & \multicolumn{2}{c|}{$\Delta V=V_{object}$} \\[20pt] \hline & [ml] or [cm$^3$] & [m$^3$] & [ml] or [cm$^3$] & [m$^3$] & [ml] or [cm$^3$] & [m$^3$] \\[20pt] \hline Lab Partner 1 & & & & & & \\[20pt] \hline Lab Partner 2 & & & & & & \\[20pt] \hline Lab Partner 3 & & & & & & \\[20pt] \hline & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{l|}{$\Delta V_{average}=$} \\[20pt] \hline \end{tabular} \end{center} \end{table} \end{document} Here is the output of the above (you'll notice that the m/b/p parameters all give the exact same result). How can I adjust this code to force the text to be both horizontally and vertically center aligned while maintaining the column widths?
- Aligning TikZ grids between tcolorbox overlays and page backgroundby Christopher Madec on April 21, 2026 at 9:13 pm
I am working on a layout where I draw a grid in two different contexts: Inside tcolorbox environments (using an overlay) In the page margin using \AddToShipoutPicture Here is a minimal example: \documentclass[11pt,a4paper,svgnames]{book} \RequirePackage[top=2cm, bottom=2cm, left=3.9cm, right=1cm]{geometry} \usepackage[most]{tcolorbox} \newcommand{\myoverlay}{ \begin{tcbclipinterior}%[remember picture,overlay] \draw[%shift=(current page.north west), step=0.524cm,white!70!gray,very thin] (interior.north west) grid (interior.south east); \end{tcbclipinterior} } \newtcolorbox{Box4}[1][ bicolor, colback=white!05,grow to left by=2.5cm,colbacklower=black, boxrule=0.5pt,overlay=\myoverlay]{#1} \newtcolorbox{Box4bis}[1][ bicolor,colback=white,colbacklower=black, grow to left by=0cm,grow to right by=0cm, boxrule=0pt, overlay=\myoverlay] {#1} \usepackage{lipsum} \usepackage[]{eso-pic} \begin{document} \AddToShipoutPicture{% \begin{tikzpicture} \draw[shift=(current page.north west),step=5.24mm, lightgray, very thin, opacity=0.5] ([xshift=0cm,yshift=0cm]current page.south west) grid ([xshift=3.7cm,yshift=0cm]current page.north west); \draw[black, very thick, opacity=0.3] ([xshift=3.7cm]current page.south west) -- ([xshift=3.7cm]current page.north west); \end{tikzpicture}% } \begin{Box4bis} \lipsum[1] \end{Box4bis} \begin{Box4} \lipsum[2] \end{Box4} \lipsum[3] \begin{Box4} \lipsum[4] \end{Box4} \begin{Box4bis} \lipsum[5] \end{Box4bis} \end{document} The code gives this: Goal I would like the grids drawn: inside the tcolorbox environments in the page margin (via shipout) to be perfectly aligned, so that the grid appears continuous across the whole page. What I have tried Using current page coordinates inside the tcolorbox overlay Adding remember picture, overlay and current page.north page and retrieve absolute positions (see tikz: How can I find the value of `current page.north west`?) Trying to manually shift grids to match visually (impossible) However, I could not find a reliable way to make both grids share the same reference system.
- Drawing card rows by using JeuxCartesby ryuk on April 21, 2026 at 9:10 pm
Good evening, I've drawn 52 cards using the "JeuxCartes" package. I'd like to arrange the cards in 4 rows (one row per suit), but I can't. Could someone please help me? I would also like to introduce a little bit of space horizontally and vertically between one card and another. Thank you very much. \documentclass{standalone} \usepackage{amsmath,amssymb} \usepackage{pgfplots} \usepackage{JeuxCartes} \usepackage{eurosym} \begin{document} \\ \AffCartesJeu[Hauteur=2,StyleJeu=v3]{AT § 2T § 3T § 4T § 5T § 6T § 7T § 8T § 9T § 10T § VT § DT § RT} \\ \\ \\ \AffCartesJeu[Hauteur=2,StyleJeu=v3]{AK § 2K § 3K § 4K § 5K § 6K § 7K § 8K § 9K § 10K § VK § DK § RK} \\ \\ \\ \AffCartesJeu[Hauteur=2,StyleJeu=v1]{AC § 2C § 3C § 4C § 5C § 6C § 7C § 8C § 9C § 10C § VC § DC § RC} \\ \\ \\ \AffCartesJeu[Hauteur=2,StyleJeu=v2]{AP § 2P § 3P § 4P § 5P § 6P § 7P § 8P § 9P § 10P § VP § DP § RP} \\ \\ \end{document}
- Propagating type of math expression in a macroby kaba on April 21, 2026 at 6:18 pm
Is it possible to propagate the type of a math expression in a macro after modifications? By the type I mean \mathrel, \mathord and friends. Consider this example: \documentclass[a4paper, 12pt]{article} \usepackage{amssymb} \usepackage{amsmath} % All orders \NewDocumentCommand{\orders}{}{\mathfrak{o}} % Order (symbol form) \NewDocumentCommand{\order}{}{\mathord{\leq}} % Order (relation form) \NewDocumentCommand{\orderleq}{}{\mathrel{\leq}} % Strict form of an order (symbol form) \NewDocumentCommand{\strictly}{m}{\mathord{#1!}} % Strict form of an order (relation form) \NewDocumentCommand{\strictlyr}{m}{\mathrel{#1!}} \begin{document} The strict form an order $\order \in \orders$ is $\strictly{\order} \in \orders$ defined by \begin{equation} x \strictlyr{\orderleq} y \iff x \orderleq y \land y \not\orderleq x. \end{equation} \end{document} In this example, I want to add an exclamation mark after the \leq symbol. I sometimes need this symbol in \mathord type, and usually in the \mathrel type, so I have two corresponding macros \order and \orderleq. To add an exclamation, I have two macros \strictly and \strictlyr, which correspond to \mathord and \mathrel, respectively, and which set the type afterwards. This provides me with correct spacing: I wish I could have just one macro \strictly that would work in both cases.
- How can I place a table inside a footer, and keep the footer space "automatic"?by Alessandro Bertulli on April 21, 2026 at 3:59 pm
I am trying to reproduce an enterprise template with LuaLaTeX and LaTeX3, and I need to place in the footer of the document a table like this: I loaded in my .cls file the package geometry with no options (here a MWE converted into a standalone tex): \documentclass{report} \usepackage[a4paper]{geometry} \usepackage{tabularray} \usepackage{fancyhdr} \usepackage{xcolor} \usepackage{lastpage} % To get the total number of pages \usepackage{lipsum} \fancypagestyle{custom}{ \fancyhf{} \fancyfoot[C]{ \begin{tblr}{ width = \textwidth, cells = {gray!50}, baseline = t, colspec = {lXlXlX}, hspan = minimal, row{Z[2]} = {white}, } written by: & \TeX{} community & approved by: & Managers & review: & v0.1 \\ unit: & Lua\LaTeX{} department & issue date: & \today & page: & \thepage/\pageref{LastPage} \\ & & & & & \\ privacy note: & \SetCell[c=5]{l} Double licensed, \LaTeX{} license and GFDL \\ \end{tblr} \begin{flushright} {Document model 001-A} \end{flushright} } } \pagestyle{custom} \begin{document} \lipsum[1-16] \end{document} Now, I want to set a length for the space above and below the table, while still automatically calculate the height of the table. In other words, I'd like to specify "I want 1cm above the table and 1.5cm below it", and let LuaLaTeX find out how much space to reserve, knowing the content of the table (which is going to be dynamic, let's say by placing another \lipsum where there are the privacy notes). My problem is, I don't know how to tweak geometry and/or fancyhdr and/or tabularray. Changing the geometry parameter footskip "pushes" the table below, but it doesn't change the space above, and consequently the space reserved in total for the footer Setting the geometry parameter bottom sets an absolute value for the footer, completely ignoring the content of the table Setting the tblr parameter baseline to t (top) helped, but again it didn't changed the space reserved in the page I can get the effect I want by tweaking with footskip and bottom, but it is a manual measure, that needs to be retweaked every time the content of the table is changed. How can I make the footer height calculation automatic, much like it is done when no options are passed to geometry? Extra: does using LuaLaTeX / LaTeX3 help us here? Thanks.
- Strange bracket matching problem in exam class with the use of `\half` commandby S. Venkataraman on April 21, 2026 at 9:43 am
I get a strange error message when I use \half command in exam class. Here is a MWE. \documentclass{exam} \begin{document} \begin{questions} \question \begin{parts} \part \(\left[\half\left(A+A^*\right)\right]^*=\half\) % \part \(\left[\frac{1}{2}\left(A+A^*\right)\right]^*=\frac{1}{2}\) \end{parts} \end{questions} \end{document} In the present state, it gives this error message: ! Missing \right. inserted. <inserted text> \right . l.6 \part \(\left[\half \left(A+A^*\right)\right]^*=\half\) I've inserted something that you may have forgotten. (See the <inserted text> above.) With luck, this will get me unwedged. But if you really didn't forget anything, try typing `2' now; then my insertion and my current dilemma will both disappear. However, if I remove the comment from the second line and comment out the first line, it compiles successfully. My lualatex information is: This is LuaHBTeX, Version 1.22.0 (TeX Live 2025) (format=lualatex 2025.6.12) 21 APR 2026 15:09 What could be the problem?
- Number shows up in worldflagby Erwann on April 21, 2026 at 5:21 am
autoWorldFlag applies a scale factor to \f@size; I guess the dimension is poorly specified for the number .88 to show up in the output for \Huge. How then should it be set? \documentclass{article} \usepackage{worldflags} \usepackage{xparse} \ExplSyntaxOn % helper dimension \dim_new:N \l__flag_length_dim \makeatletter \NewDocumentCommand{\autoWorldFlag}{m} { \dim_set:Nn \l_tmpa_dim { 0.9pt * \f@size } \worldflag[ length = \dim_use:N\l_tmpa_dim , width = 0pt ]{#1} } \makeatother \ExplSyntaxOff \begin{document} \normalsize Document bilingue \autoWorldFlag{FR} \bigskip \large Document bilingue \autoWorldFlag{FR} \bigskip \Huge Document bilingue \autoWorldFlag{FR} \end{document}
- How to optimize page space and event display in LaTeX with the Chronos timeline package?by Vincent on April 21, 2026 at 3:39 am
I'm using the Chronos package to create a timeline with many events close together (e.g., 1937-1938). The text overlaps and it wastes too much space. How can I: Make the timeline more compact (reduce vertical/horizontal gaps)? Prevent text overlap and control text wrapping? Adjust spacing for dense event periods? For the following: \documentclass{article} \usepackage[margin=0.5cm,showframe]{geometry} \usepackage{chronos} \usepackage{xcolor} \begin{document} \noindent \begin{chronos}[ dates={1931}:{1946}, step minor year=2, step major year=10, timeline height=5pt, timeline width=\textwidth, timeline years=above, timeline era margin=50pt, ] \foreach \n/\d/\pos/\y in { Event 1/1931-9-18/above/yshift=2em, Event 2/1934-10/below/yshift=-2em, Event 3/1936-12-12/above/yshift=2em, Event 4/1937-7-7/below/yshift=-2em, Event 5/1937-8/above/yshift=4em, Event 6/1937-9/below/yshift=-6em, Event 7/1937-9/above/yshift=6em, Event 8/1937-12-13/above/yshift=8em, Event 9/1938-3/below/yshift=-10em, Event 10/1938-6/above/yshift=12em, Event 11/1940-8/below/yshift=-2em, Event 12/1941-12/above/yshift=2em, Event 13/1945-4/below/yshift=-2em, Event 14/1945-9-2/above/yshift=2em } \chronosevent{ name=\n, date=\d, place \pos=true, \y }; \end{chronos} \end{document} Produces: In a format analogous to the one depicted below:
- Plot a domain in 3D with TikZ for a triple integralby Sebastiano on April 20, 2026 at 9:59 pm
I have to solve this triple integral ∭ x y|z|³/(1+ (x²+y²)⁴) dx dy dz, with a domain T={(x, y, z) ∈ ℝ³: x ≤ 0, y ≥ 0, z² ≤ x²+y² ≤ 1}. Plotting with DESMOS 3D I see this: Actually I am not able to visualise this domain in my mind. It should be a cylinder enclosed by a double-sloped cone, but I can’t quite get the x ≤ 0, y ≥ 0 parameters right. I’ve created something but I would like my drawing (or a new one) to be intuitive with TikZ3D so that I can correctly draw this integral. My MWE: \documentclass[12pt]{article} \usepackage{tikz} \usepackage{tikz-3dplot} \tdplotsetmaincoords{60}{130} \begin{document} \begin{tikzpicture}[tdplot_main_coords, scale=3] % assi \draw[->] (0,0,0) -- (1.3,0,0) node[right]{$x$}; \draw[->] (0,0,0) -- (0,1.3,0) node[left]{$y$}; \draw[->] (0,0,0) -- (0,0,1.3) node[above]{$z$}; \foreach \t in {0,1,...,359}{ \pgfmathsetmacro{\ct}{cos(\t)} \pgfmathsetmacro{\st}{sin(\t)} \draw[blue!60, opacity=0.75] (0,0,0) -- plot[domain=0:1, samples=40] ({\x*\ct},{\x*\st},{\x}); \draw[red!60, opacity=0.75] (0,0,0) -- plot[domain=0:1, samples=40] ({\x*\ct},{\x*\st},{-\x}); } \draw[thick] plot[domain=0:360, samples=200] ({cos(\x)},{sin(\x)},1); \draw[thick] plot[domain=0:360, samples=200] ({cos(\x)},{sin(\x)},-1); \end{tikzpicture} \end{document}
- expl3 e vs x function variantsby karlh on April 20, 2026 at 8:06 pm
In the LaTeX3 kernel documentation (interface3), it used to state, "The e specifier is in many respects identical to x, but with a very different implementation. Functions which feature an e-type argument may be expandable. The drawback is that e is extremely slow (often more than 200 times slower) in older engines, more precisely in non-LuaTeX engines older than 2019." I say "used to" because the current version changed the wording somewhat: "The e specifier is in many respects identical to x, but uses [the] \expanded primitive. [The] parameter character (usually #) in the argument need not be doubled. Functions which feature an e-type argument may be expandable." My question: other than the argument being allowed to be expandable in the e-form, is there a reason to prefer e over x or vice-versa, or do they do essentially the same thing? In particular, some functions (e.g., \iow_now:Nn) had x-variants in TeXLIVE 2023 but have e-variants now (the implication being that e is preferred, I would guess?), and I am wondering whether it makes any difference in terms of backward or forward compatibility of code I might write in the future.
- Why my tikz draws a wrong diagram in snake lemma?by H.ANT on April 20, 2026 at 1:43 pm
I used q.uiver.app to draw tikz-cd diagrams. The package is \RequirePackage{tikz-cd} \usetikzlibrary{calc} \usetikzlibrary{decorations.pathmorphing} \tikzset{curve/.style={settings={#1},to path={(\tikztostart) .. controls ($(\tikztostart)!\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$) and ($(\tikztostart)!1-\pv{pos}!(\tikztotarget)!\pv{height}!270:(\tikztotarget)$) .. (\tikztotarget)\tikztonodes}}, settings/.code={\tikzset{quiver/.cd,#1} \def\pv##1{\pgfkeysvalueof{/tikz/quiver/##1}}}, quiver/.cd,pos/.initial=0.35,height/.initial=0} \tikzset{tail reversed/.code={\pgfsetarrowsstart{tikzcd to}}} \tikzset{2tail/.code={\pgfsetarrowsstart{Implies[reversed]}}} \tikzset{2tail reversed/.code={\pgfsetarrowsstart{Implies}}} \tikzset{no body/.style={/tikz/dash pattern=on 0 off 1mm}} but my code in Snake Lemma \documentclass{article} \usepackage{amsmath,quiver} \DeclareMathOperator\coker{coker} \begin{document} \[ \begin{tikzcd} & {\ker\alpha} & {\ker\beta} & {\ker\gamma} & \\ & A & B & C & 0 \\ 0 & {A'} & {B'} & {C'} \\ & {\coker\alpha} & {\coker\beta} & {\coker\gamma} \arrow[from=1-2, to=1-3] \arrow[from=1-2, to=2-2] \arrow[from=1-3, to=1-4] \arrow[from=1-3, to=2-3] \arrow[from=1-4, to=2-4] \arrow[from=2-2, to=2-3] \arrow[from=2-2, to=3-2] \arrow[from=2-3, to=2-4] \arrow[from=2-3, to=3-3] \arrow[from=2-4, to=2-5] \arrow[from=2-4, to=3-4, ""{coordinate, name=P1}] \arrow[from=3-1, to=3-2] \arrow[from=3-2, to=3-3] \arrow[from=3-2, to=4-2] \arrow[from=3-3, to=3-4] \arrow[from=3-3, to=4-3] \arrow[from=3-4, to=4-4] \arrow[from=4-2, to=4-3] \arrow[from=4-3, to=4-4] \arrow["\delta" description, dashed, from=1-4, to=4-2, crossing over, rounded corners, to path={(\tikztostart) -- ([xshift=2ex]\tikztostart.east) |- (P1) [midway]\tikztonodes -| ([xshift=-2ex]\tikztotarget.west) -- (\tikztotarget)}] \end{tikzcd} \] \end{document} draw a wrong picture, like this: How can I change the package or my LaTeX code to make my diagram correct? More specifically, I want to know how I adjust the parameters in [midway]\tikztonodes, and what proportion of the arrow this parameter corresponds to? Because I thought "midway" meant the middle of the entire dashed arrow, but it seems that's not the case.
- Eforms signature field not working because of JavaScriptby UniCoder1966 on April 20, 2026 at 11:29 am
I'm creating a LaTeX pdf document that uses JavaScript and is supposed to be signable with a digital id. However, when I want to add the signature using Adobe Acrobat, I get the following warning: "This document contains embedded functions. [...] To ensure long-term compatibility, we recommend requesting a version without embedded actions from the document author." Once I add the signature, it warns me: "This document contains elements that may affect its appearance. Please review it before proceeding." Reviewing it tells me that "Rich Content" can't be surpressed and the error codes 1000, 1001, 1002, 1008, 1012, 1014 and 2013. I'm compiling with LuaLaTeX. MWE: \documentclass[ a4paper, fontsize=10pt headsepline=0.4pt ]{scrartcl} \usepackage[ unicode, colorlinks=true, pdfencoding=auto, pdftitle={PDF Document}, pdfauthor={User}, pdfpagemode=UseNone, pdfstartview=FitH, pagebackref, pdfhighlight={/N}, pdftoolbar=false, linkcolor=black ]{hyperref} \usepackage{eforms} \begin{document} \newcommand{\textfield}[5]{ \edef\Titel{#2} \TextField[name=#1, width=#3, charsize=10pt, height=1em, format = { var f = this.getField('#1'); f.textFont = 'ArialMT';}, #4]{}#5 } \newcommand{\textfieldnew}[5]{% \edef\Titel{#2}% \TextField[name=#1, width=#3, charsize=10pt, height=1em, format = { var f = this.getField('#1'); f.textFont = 'ArialMT';}, #4]{}% #5% } \textfieldnew{GER}{}{7.5cm}{default={German}, onblur={this.getField('EN').value = event.value;}}{} \textfieldnew{EN}{}{7.5cm}{default={English}, onblur={this.getField('GER').value = event.value;}}{} \sigField{Signature1}{7.5cm}{1.2cm} \end{document}
- add a grid background only inside a tabular columnby Christopher Madec on April 19, 2026 at 5:19 pm
I am trying to create a worksheet layout in LaTeX where one column of a table contains a writing area with a grid (like squared paper), while the other column contains several questions (Here is an example with just one question). \documentclass{article} \usepackage{array} \usepackage{xcolor} \usepackage{geometry} % \usepackage{arydshln} \usepackage{lipsum} \geometry{a4paper, left=0.35in, right=-0.1in, top=0.6in, bottom=0.4in} \definecolor{burgundy}{HTML}{8B2252} \usepackage{scrlayer-scrpage} \usepackage{tikz} \newcommand*\Circled[1]{\tikz[baseline=(char.base)]{\textcolor{burgundy}{\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}} \usepackage{tikzducks} \usetikzlibrary{calc} \newcommand{\pageframe}{% \begin{tikzpicture}[remember picture, overlay] \fill [burgundy!80!white] (current page.north west) rectangle (current page.south east); \fill [white, rounded corners=1cm] ($(current page.north west)+(0.5cm,-1cm)$) rectangle ($(current page.south east)+(-0.5cm,1cm)$); \node [align=center] at ($(current page.north)+(0,-0.6cm)$) {$\color{white}\mathrm{Chapitre \ 2 - Diffusion \ thermique}$}; \node [align=center] at ($(current page.south)+(0,1.9cm)$) {\centering\begin{tikzpicture}[scale=0.5] \shuffleducks \duck[\randomhead,\randomaccessories, /tikz/nodes={scale/.evaluated={\value{page}>99?0.4:0.6},font=\bfseries}, signpost=\scalebox{1.6}{ \parbox{6cm}{\hspace{-0.4em}\color{black} \centering\thepage}}, signback =white] \end{tikzpicture}}; %%% Background grid \draw[step=5mm, gray!30, very thin] ($(current page.north west)+(7cm,-1.5cm)$) grid ($(current page.south east)+(-1cm,5cm)$); \end{tikzpicture} } \cehead[\pageframe]{\pageframe} \cohead[\pageframe]{\pageframe} \pagestyle{scrheadings} % Another try \usepackage{makecell} \newcommand{\gridcell}[1][4cm]{% \begin{tikzpicture} \draw[step=5mm, gray!40, very thin] (0,-0.2) grid (\linewidth, #1); \end{tikzpicture}% } \begin{document} \renewcommand{\arraystretch}{6} \begin{tabular}{>{\centering\raggedright}m{0.25\textwidth}||>{\centering\arraybackslash}m{0.60\textwidth}} \Circled{1} \'Enoncer le théorème de Green-Ostrograski & \\ \hline \end{tabular} \end{document} Goal I would like the second column of the table to contain a grid background (like graph paper) so that students can write their answers. I want to find the best way to create a grid (squared background) that is confined to a specific table column, and that does not overflow outside the table. What I tried so far Using a page-wide background grid, but it overflows outside the table and does not align with the table structure \draw[step=5mm, gray!30, very thin] ($(current page.north west)+(7cm,-1.5cm)$) grid ($(current page.south east)+(-1cm,5cm)$); \end{tikzpicture} The code looks like this: Drawing a grid with TikZ inside a cell → does not scale correctly with row height \newcommand{\gridcell}[1][4cm]{% \begin{tikzpicture} \draw[step=5mm, gray!40, very thin] (0,-0.2) grid (\linewidth, #1); \end{tikzpicture}% }
- How do I properly space this quantified expression?by Jasper on April 19, 2026 at 8:08 am
I want to learn to typeset logical statements properly. Specifically, I am interested in horizontal spacing. These symbols look way too close together. Also, are there potentially better symbols I could be using? I know it took me years before I learned \lvert. \documentclass[letterpaper]{book} \usepackage{microtype} \usepackage{mathtools} \usepackage{unicode-math} \begin{document} How do I horizontally space this properly? \[ \forall\varepsilon>0 \exists n\in\mathbb{N} \mid \frac{1}{n}<\varepsilon \] \end{document}
- Box alignment issueby Erwann on April 19, 2026 at 3:14 am
This is an attempt at LaTeX3-fying this solution addressing a margin-note issue. It fails to align the baselines (the box seems titled down). Any suggestion to remedy this? \documentclass{article} \usepackage[showframe]{geometry} \usepackage{lipsum} \ExplSyntaxOn \cs_new_protected:Nn \erw_content_width_set:n { \dim_set:Nn \hsize { #1 } } \cs_new_protected:Nn \erw_parbox_top:Nnn { \vbox_set_top:Nn #1 { \erw_content_width_set:n { #2 } #3 } } \ExplSyntaxOff \begin{document} \ExplSyntaxOn \erw_parbox_top:Nnn \l_tmpa_box { 1in } { \begin{flushleft} \lipsum[1][1] \end{flushleft} } % \box_frame:Nnn\l_tmpa_box{1pt}{1pt} % \smash-like \box_set_ht:Nn \l_tmpa_box { 0pt } \box_set_dp:Nn \l_tmpa_box { 0pt } \box_move_left:nn{ 1in } {% \box_use:N\l_tmpa_box } \lipsum[2][1-4] \ExplSyntaxOff \end{document} Subsidiary question: optionally frame the box. Addendum: \def\@iiparbox#1[#2]{% \@ifnextchar[%] {\@iiiparbox{#1}{#2}}% {\@iiiparbox{#1}{#2}[#1]}} \long\def\@iiiparbox#1#2[#3]#4#5{% \leavevmode \@pboxswfalse \setlength\@tempdima{#4}% width \@begin@tempboxa\vbox{% \hsize\@tempdima \@parboxrestore #5\@@par }% \ifx\relax#2\else \setlength\@tempdimb{#2}% \edef\@parboxto{to\the\@tempdimb}% \fi \if#1b\vbox \else\if#1t\vtop \else\ifmmode\vcenter \else\@pboxswtrue $\vcenter \fi\fi\fi \@parboxto{% \let\hss\vss \let\unhbox\unvbox \expandafter\ifx\csname bm@#3\endcsname\relax \bm@c \@latex@warning{Unexpected alignment #3}% \else \csname bm@#3\endcsname \fi }% }