Week
- "Two-layer" compilation from a single source?by Randall on April 8, 2026 at 1:47 pm
N.B.: I don't know if there is a technical term for what I'm trying to describe, so I just made up "two-layer" as a proxy. I have a set of course notes that have become popular among a group of colleagues. There is a desire to have an "instructor's version" with various instructional tips and hints for solutions. OK, fine, I have all that already in various files. As I've begun writing the instructor's version, it's become clear that having two separate source files (one for student, one for instructor) is supremely annoying. Any edits I want to make to the student content must then also be copied over to the instructor file. My desire is to have one source file, but two ways to compile. One would compile the whole works, creating the instructor's version. A second would skip all the instructor addenda, leading to the the student's version. This way, edits to the body and exposition need be made only once, not twice. I have to believe this is possible. I thought about creating an instructor's environment like a newtheorem to segregate out the instructor's content, but then I don't know how to toggle on or off the inclusion of those lines (and this is probably not the smart solution, anyway). Is there a way to create two versions of a document from a single file?
- Space after mdenv and AddtoHook commandby Olivier Ramaré on April 8, 2026 at 12:51 pm
A strange space appears in the code below after the first \end{thmN}. The next line is slightly indented. I have a solution, see the code, by adding a "%" after \end{thmN}, but I would like my user not to have to care about that. Many thanks for you lights! Best, Olivier \documentclass{article} \usepackage{mdframed} \newcounter{mythmcnt} \setcounter{mythmcnt}{0} \newmdenv{ispecialthm} \newenvironment{thmenvN}[2][]{\refstepcounter{mythmcnt}% \begin{ispecialthm}[frametitle={#2\ \themythmcnt}]}{\end{ispecialthm}} \newenvironment{thmN}[1][]{\begin{thmenvN}[#1]{Theorem}}{\end{thmenvN}} \AddToHook{env/thmN/after}{\noindent} \begin{document} \begin{thmN} This is the first theorem. \end{thmN} we are the champions we are the champions we are the champions we are the champions we are the champions \begin{thmN} This is the first theorem. \end{thmN}% we are the champions we are the champions we are the champions we are the champions we are the champions \end{document}
- Improvements to code used for a special headingby yannisl on April 8, 2026 at 11:51 am
The following code snippet draws a box in box for a heading. I would like some help to improve the code so that only the top right corner of the bottom box is rounded. Most of the values are currently hardcoded, as this forms part of a larger code that calls the macro \tikzspecial defines keys that are passed as options. The height of the blue top box should be 3cm, I seem to be about a couple of mm out, any help with that I would also appreciate. \documentclass[10pt,twoside]{book} \usepackage[bottom=2cm,top=2cm, left=3cm, right=4cm,showframe]{geometry} \usepackage{tikz} \usepackage{kantlipsum} \ExplSyntaxOn \makeatletter \NewDocumentCommand{\tikzspecial}{s O +m}{ %% First band \begin{tikzpicture}[remember~picture,overlay,inner~sep=0pt,outer~sep=0pt] \draw[draw=none,fill=cyan,outer~sep=0pt,inner~sep=0pt, xshift={-2cm},yshift=-\dimexpr3cm+10pt] (current~page.north~west) rectangle (\paperwidth,2.5cm); \end{tikzpicture} %% Second band with rounded corners \begin{tikzpicture}[remember~picture,overlay] \node~at~(current~page.north~west)~[yshift=-\dimexpr3cm+5.4pt,xshift=-10pt,%.3 klls corners on left anchor=south~west,inner~sep=10pt, outer~sep=0,white,fill=black, draw=none,rounded~corners=10pt,align=left, text~width=\textwidth]{\leftskip10pt \large \sffamily\LARGE\bfseries \IfBooleanTF{#1}{}{\thechapter.\space} #3\par }; \end{tikzpicture} \vspace*{4\baselineskip} \par \@afterindentfalse \@afterheading } \makeatother \ExplSyntaxOff \begin{document} \parindent=2em % simulate chapter \stepcounter{chapter} \tikzspecial*{Some Special Layout\\ Format} \kant[1-9] \end{document}
- Thickness and color of vertical line symbolsby J.-E. Pin on April 8, 2026 at 9:33 am
This is a follow up to this question, which asks for delimiters with thicker lines. I would like to add the option to choose the color of these delimiters, as in the following example \documentclass[]{amsart} \usepackage{color} \begin{document} \newcommand{\Red}[1]{\textcolor{red}{#1}} \newcommand{\mynorm}[1]{\Red{\lvert} #1 \Red{\rvert}} $\mynorm{v}$ \end{document} which produces this: Thus my question is how to add this color parameter to egreg's answer to the linked question. I tried to do it myself, with no success so far.
- How Can I Speed Up LaTeX startup times? [closed]by ivo Welch on April 8, 2026 at 12:39 am
I have been experimenting with an essentially empty tex file to see how long it takes pdflatex just to get started. On one of the fastest 2026 machines around, an Apple M4, here is what I get: Baseline (just \documentclass): 1.4s biblatex: +1.9s (the single biggest offender) microtype: +0.6s tikz: +0.6s hyperref: +0.5s All heavy packages combined: 4.8s total (3.4s of package overhead) I am now wondering whether I should regress to the older Bibtex (or Natbib??) and dump biblatex. More generally, I understand that there are formats that can replace the entire article class. Alas, what I really would like is a format that can replace just a set of style files --- or better yet, a way to "cache" a whole set of my standard style files that I am always including. Is this possible? Any ideas how to keep my beloved pidflatex output and have it move faster? pointers appreciated. /iaw
- Section heading number periods and no hanging indent (sockets, plugs, templates... oh my!)by Alexander Perlis on April 7, 2026 at 9:12 pm
A style guide demands: heading numbers end in a period; headings titles do not hang off the number. Example of desired output: In the past I could accomplish this by modifying \@seccntformat and \@hangfrom: \documentclass{article} \makeatletter \def\@seccntformat#1{\csname the#1\endcsname.\enskip} \def\@hangfrom#1{\noindent#1} \makeatother \begin{document} \section{My section title with an extremely long title spanning multiple lines} \subsection{My subsection title with an extremely long title spanning multiple lines} \end{document} But in TeX Live 2026 with \DocumentMetadata{tagging=on}, the hanging indent reappears! I believe the tagging code enables the socket sec/title/hang whose default plug does not call \@hangfrom. I could mimic the kernel plug with my own variant and assign it to the socket: % Put the following inside the `\makeatletter`/`\makeatother` block. \ExplSyntaxOn \cs_new_protected:Npn \__tag_set_title_NOHANG:nNnn #1 #2 #3 #4 %#1 level, %#2 boolean: nonumber? (will be later \l__head_nonumber_bool) %#3 formated number /hang space %#4 title { \protected@edef\l__tag_sec_tmpa_tl {#4} \tagstructbegin{tag=\UseStructureName{sec/#1/title},title-o={\l__tag_sec_tmpa_tl}} \cs_if_exist_use:N \__tag_gincr_para_begin_int: \bool_if:NF #2 { \tagstructbegin{tag=\UseStructureName{sec/#1/number}} } \setbox\@tempboxa\hbox{{#3}} \bool_set_false:N \l__tag_para_bool %\hangindent \wd\@tempboxa\noindent %%% <-- REMOVED \noindent %%% <-- INSERTED \bool_set_true:N \l__tag_para_bool \bool_if:NTF #2 { \box\@tempboxa } { \tagmcbegin{} \tag_mc_reset_box:N\@tempboxa \box\@tempboxa \tagmcend \tagstructend } \tagmcbegin{} } \NewTaggingSocketPlug{sec/title/hang}{myoverlay} { \__tag_set_title_NOHANG:nNnn #1 } \AssignTaggingSocketPlug{sec/title/hang}{myoverlay} \ExplSyntaxOff This feels fragile. Is there a better approach? Now the plot thickens. I am actually trying to use TeX Live 2026 lualatex-dev to benefit from a bug fix. But in lualatex-dev with \DocumentMetadata (with or without tagging=on), it seems \@seccntformat is no longer called, thus there is no longer a period after the section number. I believe lualatex-dev is bringing templates into play (in the file latex-lab-testphase-sec-template.sty). I am new to templates. How do I adjust the templates to put a period after the number? And do templates then perhaps also provide a less fragile way to eliminate \hangindent so I no longer need to replace \__tag_set_title_hang (earlier part of this post)?
- 3d Tikz Graph highlighting a specific interp line and axis problemby FishDrowned on April 7, 2026 at 2:43 pm
I'm currently trying to graphically represent Feynman's technique. Specifically, I have the function rad(atan(sqrt(2-x*x)))/(1+x*x) which is being parametrized as rad(atan(t*sqrt(2-x*x)))/(1+x*x). I managed to create the graph for the function, \documentclass{standalone} \usepackage{tikz,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = center, axis on top, view={50}{30}, xlabel={$x$}, ylabel={$t$}, zlabel={}, xmin=-2, xmax=2, ymin=-2, ymax=2, zmin=-2, zmax=2, tick label style={font=\tiny} ] \addplot3[ surf, shader=faceted interp, faceted color=black!60, opacity=0.85, samples=22, samples y=18, domain=-1.4:1.4, domain y=-2:2, ] {rad(atan(y*sqrt(2-x*x)))/(1+x*x)}; \end{axis} \end{tikzpicture} \end{document} But I'm having trouble figuring out how to a) highlight the specific line along the function that represents rad(atan(sqrt(2-x*x)))/(1+x*x) and b) getting the axis lines to be above and below the 3d surface when the surface is above and below.
- Difference between \def\R{{\mathbb{R}}} and \def\R{\mathbb{R}}by X3nius on April 7, 2026 at 2:14 pm
I don't understand what the difference is between \def\R{{\mathbb{R}}} and \def\R{\mathbb{R}} When compiling \R (in math mode, obviously), I get ℝ in both cases and it doesn't show an error.
- How to plot y = x^{2/3} + 0.8 cos(kx) √(3-x²) in LaTeX TikZby hola on April 7, 2026 at 1:45 pm
I would like to plot the following function in LaTeX using TikZ or pgfplots: \[ y = x^{2/3} + 0.8 \cdot \cos(kx) \cdot \sqrt{3 - x^2} \] The domain is \( - \sqrt{3} \leq x \leq \sqrt{3} \). I need to create a nice graph where: The curve looks smooth I can easily change the value of \( k \) (number of oscillations) The modulated amplitude (the \( \sqrt{3-x^2} \) part) is clearly visible I have tried basic \addplot but I have problems with the fractional power \( x^{2/3} \) and with making the cosine oscillation look good. MWE (Minimal Working Example): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot {x^(2/3)}; % this part works, but adding the rest is difficult \end{axis} \end{tikzpicture} \end{document} pgfplots tikz-pgf plot functions graphics
- list of all packages included in a collection and remove particular packagesby vrgovinda on April 7, 2026 at 10:14 am
My wonderful TeX friends. I need to downsize my TeXLive installation. I would like to see a list of packages that are part of a collection and remove those packages which I don't need. What I have tried doing: tlmgr list --only-installed > installed_texlive_packages.txt I tried to uninstall a package only to get an error: tlmgr remove xstacks tlmgr: saving backups to /usr/local/texlive/2025/tlpkg/backups tlmgr: not removing xstacks, needed by collection-latexextra tlmgr: no packages removed. tlmgr: action remove returned an error; continuing. tlmgr: An error has occurred. See above messages. Exiting. But there are certain packages in collection-latexextra that I use. I want to remove only those packages which I don't use or don't need. Thanks.
- How are uppercase Greek letters handled in T1?by Grzegorz Brzęczyszczykiewicz on April 7, 2026 at 7:01 am
Does it auto-switch to OT1 internally, or is there another encoding specifically for these "missing" letters? I'm specifically talking about these specific letters: and not to the entire Greek alphabet. The reason why I'm asking about them is that these letters are included in OT1, but I don't see them anywhere in the definition of T1.
- Why can't I use \AddToHook{shipout/background} in conjunction with \@starttoc/\tableofcontents?by Elayson Abreu on April 7, 2026 at 12:22 am
When I use \AddToHook{shipout/background} in conjunction with @starttoc, the content appears in first page, but not the following ones. Why? MWE: \documentclass{article} \makeatletter \AddToHook{shipout/background}{\lower .5\paperwidth \vtop{XYZ\@starttoc{toc}}} \makeatother \begin{document} \addcontentsline{toc}{section}{ABCDEFG} \addcontentsline{toc}{section}{HIJKLMN} \null\newpage\null \end{document} In the image below, XYZ appears on both pages, but @starttoc only appears on the first one. UPDATE I'll post a more complete example of what I'd like to do, following John Kormylo's response. I would like hyperlinks to work when hyperref is loaded. Unfortunately, they're not working here. \documentclass{article} \usepackage{lipsum} \usepackage[colorlinks]{hyperref} \usepackage[showframe,top=2cm]{geometry} \def\sec#1{\par\leavevmode\addcontentsline{dates}{sec}{#1}} \makeatletter \def\l@sec#1#2{#1\par\medskip} \def\structure{\@starttoc{dates}} \makeatother \AddToHook{shipout/background}{\lower\dimexpr2cm+\topskip \vtop{\usebox\structbox}} \AtBeginDocument{ \newbox\structbox \setbox\structbox=\vtop{\structure} } \begin{document} \sec{01/01/2026} \lipsum[1] \newpage \sec{02/01/2026} \lipsum[1] \sec{03/01/2026} \lipsum[1] \end{document}
- Problem with cross-references in the Tufte class in MacTeX2026by Alejandro Munoz Ossa on April 6, 2026 at 9:31 pm
I’m writing a book using the tufte class and compiling with LuaLaTeX. I recently updated to MacTeX 2026 and noticed that the class no longer works properly, especially with cross-references. So I decided to reinstall MacTeX 2025 to make sure it worked correctly in that version. Something changed in the update and is causing an error with these references. Using MacTeX2026, the first example I’m showing you is \documentclass[]{tufte-book} \usepackage{graphicx} \begin{document} \chapter{Capítulo 1} La figura \ref{figexample} es \begin{figure} \includegraphics[width=\linewidth]{example-image-a}\label{figexample}\caption{text} \end{figure} La figura en margen es \ref{figexamplem} \begin{marginfigure} \includegraphics[width=\linewidth]{example-image-b}\label{figexamplem}\caption{text} \end{marginfigure} \end{document} which produces this result As you can see, Figure 1 is referenced correctly, but the figure in the margin is not. Now see what happens if I load the mathtools and/or amsmath packages \documentclass[]{tufte-book} \usepackage{graphicx} \usepackage{mathtools} \usepackage{amsmath} \begin{document} \chapter{Capítulo 1} La figura \ref{figexample} es \begin{figure} \includegraphics[width=\linewidth]{example-image-a}\label{figexample}\caption{text} \end{figure} La figura en margen es \ref{figexamplem} \begin{marginfigure} \includegraphics[width=\linewidth]{example-image-b}\label{figexamplem}\caption{text} \end{marginfigure} \end{document} which produces this result Thus, neither of the two figures is properly cited. While doing some research, I found that there is a new version of the tufte class called xtufte, so I decided to test it, and the result is the same—there are no correct cross-references. \documentclass[]{xtufte-book} \begin{document} \chapter{Capítulo 1} La figura \ref{figexample} es \begin{figure} \includegraphics[width=\linewidth]{example-image-a}\label{figexample}\caption{text} \end{figure} La figura en margen es \ref{figexamplem} \begin{marginfigure} \includegraphics[width=\linewidth]{example-image-b}\label{figexamplem}\caption{text} \end{marginfigure} \end{document}
- How to draw an orientation link with tikzpictureby DLIN on April 6, 2026 at 5:14 pm
I want to draw the above picture in the book Lecture on the topology of 3-manifold. So far, I can only draw the Hopf link: \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{knots} \begin{document} \begin{tikzpicture} \begin{knot}[flip crossing={2}] \strand (1.5,0) circle (1.0); \strand (2.5,0) circle (1.0); \end{knot} \end{tikzpicture} \end{document} Q: I do not know what kind of command I should use to draw the above picture.
- Creating a repeated text watermark gone wrongby user516076 on April 6, 2026 at 2:14 am
the current document of mine has a messy watermark Code: \documentclass[12pt]{article} \usepackage[a4paper,margin=2.5cm]{geometry} \usepackage{lipsum} \usepackage{tikz} \usepackage{background} \usepackage[T1]{fontenc} \usepackage{cabin} \newcommand{\watermarkHsep}{4em} \newcommand{\watermarkVsep}{3ex} \newcommand*\watermarktext[1]{% \leavevmode\hbox to 2\textwidth{% \leaders\vbox to 2\textheight{% \leaders\hbox{#1\hspace{\watermarkHsep}}\vfil% \vspace{\watermarkVsep}% }\hfil% }% } \backgroundsetup{ scale=1, angle=0, opacity=1, contents={% \tikz[remember picture, overlay] \node [black, opacity=0.1, rotate=45, scale=4.0] at (current page.center) {\watermarktext{% {\cabinfamily\bfseries Arrohmah IIBS}% }};% } } \begin{document} \section*{Sample Document} \lipsum[1-12] \end{document} it has this output: Notice that it doesn't read the Cabin font and bfseries to bold I wish to have something similar to this one, smaller font, nicer and neater:
- How to place some notes in one staff and others in the otherby iago on April 6, 2026 at 12:14 am
I am trying with MusixTEX \begin{music} \parindent10mm \instrumentnumber{1} \setstaffs1{2} \setclef1{6000} \nobarnumbers \startextract \notes \cchar{-15}{$C3$}\qu {'C} \en \notes \cchar{30}{T} \empty \en \notes \cchar{-15}{$D3$}\qu {'D} \en \notes \cchar{30}{T} \empty \en \notes \cchar{-15}{$E3$}\qu {'E} \en \notes \cchar{30}{T} \empty \en \notes \cchar{-15}{$F3$}\qu {'F} \en \notes \cchar{30}{T} \empty \en \notes \cchar{-15}{$G3$}\qu {'G} \en \notes \cchar{-5}{$C4$}\qu c \en \notes \cchar{30}{T} \empty \en \notes \cchar{-5}{$D4$}\qu d \en \notes \cchar{30}{T} \empty \en \notes \cchar{-5}{$E4$}\qu e \en \notes \cchar{30}{T} \empty \en \notes \cchar{-5}{$F4$}\qu f \en \notes \cchar{30}{T} \empty \en \notes \cchar{-5}{$G4$}\qu g \en \notes \cchar{30}{T} \empty \en \notes \cchar{-5}{$A4$}\qu {'a} \en \notes \cchar{30}{T} \empty \en \notes \cchar{-5}{$B4$}\qu {'b} \en \notes \cchar{30}{S} \empty \en \notes \cchar{-5}{$C5$}\qu {'c} \en \notes \cchar{30}{T} \empty \en \notes \cchar{-5}{$D5$}\qu {'d} \en \notes \cchar{30}{T} \empty \en \notes \cchar{-5}{$E5$}\qu {'e} \en \notes \cchar{30}{S} \empty \en \notes \cchar{-5}{$F5$}\qu {'f} \en \zendextract \end{music} I'd like two staves with bass and treble clefs, notes C3 to G3 in bass clef staff, notes D4 to F5 in treble clef staff and separate in such a way that C4 is in the middle and at the suitable distance of the two staves (so, as belonging to treble and bass clefs staves simultaneously). However, before the C4 possitioning, I am having multiple issues. This code shows the notes with respect to the bass clef staff, wrong with resect to the treble staff. If I introduce a \nextstaff in the middle, then the output fails completely. May you help me? Thanks!
- Diagrams in LaTeXby Ripsad on April 5, 2026 at 6:47 pm
I am trying to tex a diagram. I use overleaf with the tikz-cd package. I am currently wrinting by Bachelor thesis and am using a LeTeX template of my university (TUM). Without this template everything worrks just fine but using this template the diagram does not compile. The problem seems to be that LaTeX interpretes the lable of the arrows as the color parameter. It seems to be a conflict with the pgfkeys and the xcolors package. The error message is the following Package pgfkeys Error: I do not know the key '/tikz/"f"'' and I am going to ignore it. Perhaps you misspelled it. Package xcolor Error: Undefined color `"g\circ f"'. Package pgfkeys Error: I do not know the key '/tikz/"g"'' and I am going to ignore it. Perhaps you misspelled it. My code is: \documentclass{report} \usepackage{tikz-cd} \usepackage[german]{babel} \begin{document} \begin{tikzcd} x \arrow[rr, "f"', ] \arrow[rrrr, "g\circ f", bend left] & & y \arrow[rr, "g"', ] & & z \end{tikzcd} \end{document} According to tikzcd.yichuanshen this code is correct and also works perfectly in a plain document without the TUM-template. Does anyone here have an idea of why this problem occurs and how I might fix it?
- Arranging nodes to have a nice circle shapeby user516076 on April 5, 2026 at 1:42 am
I need your help to make the label, i.e. the numbers to be arranged circular nicely and spot-on (not estimating and guessing using rectangle coordinate, which is very difficult). i'm thinking of polar coordinate, but how to implement it so that it can be positioned exactly in the middle of each part? You see, I used manual and it looks ugly and messy... \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=1.2, every node/.style={font=\Large}] % Radii \def\R{3} \def\r{1.75} % Outer circle (black) \draw[black, line width=1.2pt] (0,0) circle (\R); % Inner circle (cyan) \draw[cyan!70!black, line width=1.2pt] (0,0) circle (\r); % Straight dividing lines (green) \draw[green!60!black, line width=1.2pt] (-\R,0) -- (\R,0); \draw[green!60!black, line width=1.2pt] ({\R*cos(60)},{\R*sin(60)}) -- ({\R*cos(240)},{\R*sin(240)}); \draw[green!60!black, line width=1.2pt] ({\R*cos(120)},{\R*sin(120)}) -- ({\R*cos(300)},{\R*sin(300)}); % Outer ring numbers (red) % Top sector \node[red] at (-0.55, 2.35) {3}; \node[red] at ( 0.55, 2.35) {5}; % Upper-right sector \node[red] at (1.90, 1.65) {4}; \node[red] at (2.30, 0.65) {7}; % Lower-right sector \node[red] at (2.35,-0.65) {0}; \node[red] at (1.90,-1.65) {6}; % Bottom sector \node[red] at (-0.55,-2.35) {2}; \node[red] at ( 0.55,-2.35) {10}; % Lower-left sector \node[red] at (-1.90,-0.65) {4}; \node[red] at (-2.30,-1.65) {1}; % Upper-left sector \node[red] at (-2.30, 0.65) {8}; \node[red] at (-1.90, 1.65) {7}; % Inner circle numbers (red) \node[red] at ( 0.00, 0.95) {?}; \node[red] at ( 1.05, 0.25) {5}; \node[red] at ( 1.00,-0.65) {15}; \node[red] at ( 0.00,-1.10) {8}; \node[red] at (-0.95,-0.60) {11}; \node[red] at (-1.05, 0.25) {6}; \end{tikzpicture} \end{document} At least, I wish to have something similar to this:
- Writing Arabic text inside IEEE Access Latex documentby None on April 4, 2026 at 6:44 pm
I need to write an Arabic text/sentences inside an English document using IEEE Access template. This is my minimal code: \documentclass{ieeeaccess} \usepackage{arabtex} \usepackage{utf8} \setcode{utf8} \newcommand{\artext}[1]{\bgroup\beginR\fontencoding{LAE}\selectfont #1\endR\egroup} \usepackage{graphicx} \begin{document} text ... \<العربية> \EOD \end{document} I used pdfLatex in overleaf. When I run the above script I get this error: LaTeX Error: Loading a class or package in a group. ./myfile.tex, 15 How to solve the issue? please note that I edited the access.cls and changed the \def\year to \def\Year becuase before this change I got this error: Argument of \year has an extra }. /usr/local/texlive/2025/texmf-dist/tex/latex/arabtex/acmd.sty, 189 EDIT I tried the following script. It is almost working excpet the following issues (which I think are solvable) in the Arabic font: (1) It starts from Left-to-Right while it should start from Right-to-Left. (2) the letters are not connected (if you search fro Arabic text you will see what I mean). \documentclass{ieeeaccess} \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} % --- Arabic Support for pdfLaTeX --- \usepackage[LAE,T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[arabic,english]{babel} % --- FIX: Redefine section numbering to prevent \c@chapter error --- \makeatletter \renewcommand{\thesection}{\arabic{section}} \renewcommand{\thesubsection}{\thesection.\arabic{subsection}} \makeatother \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \begin{document} \history{Date of publication xxxx 00, 0000, date of current version xxxx 00, 0000.} \doi{10.1109/ACCESS.2017.DOI} \title{Preparation of Papers for IEEE ACCESS} \author{\uppercase{First A. Author}\authorrefmark{1}} \address[1]{Department of Physics, Colorado State University, Fort Collins, CO 80523 USA} \begin{abstract} This is the abstract in English. \end{abstract} \titlepgskip=-15pt \maketitle \section{Introduction} This is English text. Here is some Arabic text: \foreignlanguage{arabic}{مرحباً بكم في مجلة إي إي إي.} \section{Methodology} You can also use the \texttt{otherlanguage} environment for longer blocks: \begin{otherlanguage}{arabic} هذا نص طويل باللغة العربية داخل القالب. \end{otherlanguage} \section{Conclusion} The section numbers should now appear correctly without errors. \EOD \end{document} This is the output (the read text is for additional comments).
- How to draw an SVG using paths in Tikz picture?by Mika Ike on April 4, 2026 at 2:50 pm
How to draw the same image than an SVG using paths in TikZ? The target is get the same TikZ image than the Splatter (fontmfizz) but I can´t. 1.- The TikZ image obtained is vertical flipped, and 2.- Some little parts are not in the expected place \documentclass[12pt]{exam} \usepackage[galician,showseconds=false,showzone=false]{datetime2} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} % OpenType version of Palladio/Palatino \setmathfont{TeX Gyre Pagella Math} %\newfontfamily\oldenglish{Old English Text MT} \usepackage{tikz} \usetikzlibrary{svg.path} \begin{document} lorem ipsum kasdjkj dsd ds f sd f ds f ds f ds fsd fa dsf asdf ds f sdaf asdf asdf sad f sad fsdafs \smash{\raisebox{-6em}{\tikz{\draw[fill=violet!82,draw=yellow,rotate=0,yscale=-1,scale=0.5] svg { m28.235,20.103c-0.59539,0.23753-1.8493,0.04972-3.957-0.856-3.599-1.49-5.895-3.36-8.416-5.035-2.486-1.668-5.365-3.379-6.7284-5.1931-1.1392-1.6464,1.9884-2.4412,6.0064-1.3811,5.2395,1.3773,8.2717,4.8177,10.576,6.7541,0.87281,0.70463,4.3397,5.0474,2.5194,5.7114z m68.523,76.118c0.14409,0,3.8782,4.9434,4.668,6.282,1.0249,1.6981,4.8501,5.8809,2.6222,7.6669-1.4722,1.1618-2.7105-0.52059-3.7164-1.519-1.0766-1.0705-6.3033-12.296-3.5737-12.43z m29.958,76.255c0.11396,0.03513,0.21137,0.09847,0.30037,0.156,2.5843,1.3991-2.9327,10.618-3.5239,12.686-0.78314,2.6414-4.5676,5.3907-6.3669,1.611-1.5082-3.2142,8.0274-14.751,9.5905-14.453z M23.999,26.112c-3.483-0.418-7.164-2.025-10.217-3.856-3.701-2.249-2.859-5.579-8.0652-4.417-5.0472,1.1313-1.8324,5.4324,0.86046,7.1001,4.6884,2.8745,3.918,1.2779,8.8904,3.6589,2.4074,1.146,4.1677,2.7235,5.3368,4.8239,0.52724,0.97038-2.1169,3.2264-3.8704,1.6642-1.8034-1.6066-5.538,0.77956-5.5322,2.0477,0.0052,1.1273-0.10624,3.6251,4.5829,4.1545,3.4805,0.39298,4.5667,4.4943,2.9491,5.1787-4.7047,1.9945-11.583-0.28724-15.714,2.7056-1.9751,1.4435-3.1972,4.5997-0.21206,5.8065,3.8945,1.5922,9.8389-3.0121,14.117-2.2379,10.591,1.9348,1.3002,8.8326-0.69399,11.17-5.5488,6.566,5.7667,7.0227,9.7142,5.7719,5.3871-1.6959,7.5148-6.0259,12.746-4.3582,2.3503,0.75948,1.6706,4.7191,1.5265,6.2539-0.16448,1.9055-0.88085,3.7365-0.84415,5.6578,0,0.89244-0.02175,1.6959,1.0752,2.0395,1.2057,0.38763,2.4618-0.67046,3.6294-0.13522,1.1867,0.53637,1.2723,2.1601,1.4708,3.1123,0.48528,2.5455,0.47033,5.3152,0,7.8607-0.37382,2.0688-1.6353,4.2121-1.4178,6.3406,0.26779,2.8734,4.7074,3.1416,6.5711,0.96794,1.1147-1.2812,1.3675-3.5889,1.1323-5.1068-1.759-7.3243-4.9031-21.573,4.6707-25.994,6.7695-3.1416,5.5312,1.653,7.6327,4.5253,1.8854,2.5613,3.5384,3.2914,3.9149,0.43383,0.35751-2.6356-0.96921-6.0138-1.0956-8.7239-0.08972-2.0542,2.0825-3.1416,4.112-3.8413,5.1356-1.7421,11.565-1.2812,16.199,1.2361,3.6458,1.9787,2.4508,2.0763,6.8333,3.1028,3.8252,0.89357,5.2567-1.579,4.4125-5.3471-4.7665-4.6397-6.6118-1.286-12.808-2.7002-4.0742-0.92398-2.4716-3.8985,1.2471-3.2842,1.5838,0.26164,2.276-1.9024,1.7552-3.3095-1.2467-3.3687-0.17052-6.8773,2.9243-9.0974,1.6149-1.1618,2.2943-2.6495,2.6178-4.5245,0.37654-1.9956-0.2118-4.4225-2.7973-3.9909-3.0177,0.52059-4.3825,4.1535-7.0958,5.1361-2.9987,1.0716-5.6032-1.1595-5.6752-3.7208-0.08836-2.7855,2.3177-5.2713,2.7296-7.9959,0.79114-5.2994-7.7578-2.932-11.636-4.5095-6.2516-2.5613-1.6916-3.8621,0.32018-7.2122,1.0956-1.7871,3.1238-5.0763,1.4015-7.0257-1.4926-1.7128-3.8456-1.0874-5.2987,0.32678-2.4251,2.3382-1.9031,5.8662-2.3897,8.7396-0.68103,4.1681-1.3791,4.785-6.3896,6.6904-3.431,1.2936-8.3708,0.60848-10.955-1.7139-2.1586-1.9798-1.9411-5.1361-4.2208-6.9671-4.4151-3.5732-6.8633,2.6503-7.9032,5.3592-1.6883,4.5129-3.4269,9.0675-10.542,8.2044z m84.472,20.141c-0.46364-0.09395-0.4995-0.80523,0.24684-2.441,1.1978-2.7514,3.2175-5.1922,4.92-7.5908,1.7001-2.3768,3.3668-4.9643,5.5286-6.9391,1.9848-1.7473,3.8013-0.91559,3.2896,1.7053-0.66016,3.4141-4.6558,7.3623-6.7652,9.8565-0.75958,0.92329-5.8873,5.7427-7.2198,5.409z m88.466,72.472c-0.3968,0.1723-1.2325,0.03606-2.6372-0.62094-2.3986-1.0812-3.9291-2.4373-5.6092-3.6528-1.6568-1.2099-3.5752-2.4508-4.4841-3.7668-0.75927-1.1943,1.3255-1.7708,4.0031-1.0018,3.4919,0.99907,5.5128,3.4947,7.0483,4.8993,0.58169,0.51113,2.8922,3.6613,1.6791,4.143z M51.882,7.3591c-0.426-0.0546-0.892-0.3354-1.307-0.9496-0.743-1.0353-0.642-1.9171-0.767-2.7944-0.113-0.8689-0.383-1.8219,0.118-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79567,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z m50.199,46.064c-0.42596-0.05463-0.89232-0.33545-1.3068-0.94963-0.74288-1.0353-0.64204-1.9171-0.76702-2.7944-0.11349-0.8689-0.38317-1.8219,0.11743-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79566,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z };}}} askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj askdlfhjsdajkf hjasdkh fjksdah jkh jkh jk hjk hlkj \vspace{3em} \begin{tikzpicture} \draw[fill=orange,draw=cyan] svg{ m28.235,20.103c-0.59539,0.23753-1.8493,0.04972-3.957-0.856-3.599-1.49-5.895-3.36-8.416-5.035-2.486-1.668-5.365-3.379-6.7284-5.1931-1.1392-1.6464,1.9884-2.4412,6.0064-1.3811,5.2395,1.3773,8.2717,4.8177,10.576,6.7541,0.87281,0.70463,4.3397,5.0474,2.5194,5.7114z m68.523,76.118c0.14409,0,3.8782,4.9434,4.668,6.282,1.0249,1.6981,4.8501,5.8809,2.6222,7.6669-1.4722,1.1618-2.7105-0.52059-3.7164-1.519-1.0766-1.0705-6.3033-12.296-3.5737-12.43z m29.958,76.255c0.11396,0.03513,0.21137,0.09847,0.30037,0.156,2.5843,1.3991-2.9327,10.618-3.5239,12.686-0.78314,2.6414-4.5676,5.3907-6.3669,1.611-1.5082-3.2142,8.0274-14.751,9.5905-14.453z M23.999,26.112c-3.483-0.418-7.164-2.025-10.217-3.856-3.701-2.249-2.859-5.579-8.0652-4.417-5.0472,1.1313-1.8324,5.4324,0.86046,7.1001,4.6884,2.8745,3.918,1.2779,8.8904,3.6589,2.4074,1.146,4.1677,2.7235,5.3368,4.8239,0.52724,0.97038-2.1169,3.2264-3.8704,1.6642-1.8034-1.6066-5.538,0.77956-5.5322,2.0477,0.0052,1.1273-0.10624,3.6251,4.5829,4.1545,3.4805,0.39298,4.5667,4.4943,2.9491,5.1787-4.7047,1.9945-11.583-0.28724-15.714,2.7056-1.9751,1.4435-3.1972,4.5997-0.21206,5.8065,3.8945,1.5922,9.8389-3.0121,14.117-2.2379,10.591,1.9348,1.3002,8.8326-0.69399,11.17-5.5488,6.566,5.7667,7.0227,9.7142,5.7719,5.3871-1.6959,7.5148-6.0259,12.746-4.3582,2.3503,0.75948,1.6706,4.7191,1.5265,6.2539-0.16448,1.9055-0.88085,3.7365-0.84415,5.6578,0,0.89244-0.02175,1.6959,1.0752,2.0395,1.2057,0.38763,2.4618-0.67046,3.6294-0.13522,1.1867,0.53637,1.2723,2.1601,1.4708,3.1123,0.48528,2.5455,0.47033,5.3152,0,7.8607-0.37382,2.0688-1.6353,4.2121-1.4178,6.3406,0.26779,2.8734,4.7074,3.1416,6.5711,0.96794,1.1147-1.2812,1.3675-3.5889,1.1323-5.1068-1.759-7.3243-4.9031-21.573,4.6707-25.994,6.7695-3.1416,5.5312,1.653,7.6327,4.5253,1.8854,2.5613,3.5384,3.2914,3.9149,0.43383,0.35751-2.6356-0.96921-6.0138-1.0956-8.7239-0.08972-2.0542,2.0825-3.1416,4.112-3.8413,5.1356-1.7421,11.565-1.2812,16.199,1.2361,3.6458,1.9787,2.4508,2.0763,6.8333,3.1028,3.8252,0.89357,5.2567-1.579,4.4125-5.3471-4.7665-4.6397-6.6118-1.286-12.808-2.7002-4.0742-0.92398-2.4716-3.8985,1.2471-3.2842,1.5838,0.26164,2.276-1.9024,1.7552-3.3095-1.2467-3.3687-0.17052-6.8773,2.9243-9.0974,1.6149-1.1618,2.2943-2.6495,2.6178-4.5245,0.37654-1.9956-0.2118-4.4225-2.7973-3.9909-3.0177,0.52059-4.3825,4.1535-7.0958,5.1361-2.9987,1.0716-5.6032-1.1595-5.6752-3.7208-0.08836-2.7855,2.3177-5.2713,2.7296-7.9959,0.79114-5.2994-7.7578-2.932-11.636-4.5095-6.2516-2.5613-1.6916-3.8621,0.32018-7.2122,1.0956-1.7871,3.1238-5.0763,1.4015-7.0257-1.4926-1.7128-3.8456-1.0874-5.2987,0.32678-2.4251,2.3382-1.9031,5.8662-2.3897,8.7396-0.68103,4.1681-1.3791,4.785-6.3896,6.6904-3.431,1.2936-8.3708,0.60848-10.955-1.7139-2.1586-1.9798-1.9411-5.1361-4.2208-6.9671-4.4151-3.5732-6.8633,2.6503-7.9032,5.3592-1.6883,4.5129-3.4269,9.0675-10.542,8.2044z m84.472,20.141c-0.46364-0.09395-0.4995-0.80523,0.24684-2.441,1.1978-2.7514,3.2175-5.1922,4.92-7.5908,1.7001-2.3768,3.3668-4.9643,5.5286-6.9391,1.9848-1.7473,3.8013-0.91559,3.2896,1.7053-0.66016,3.4141-4.6558,7.3623-6.7652,9.8565-0.75958,0.92329-5.8873,5.7427-7.2198,5.409z m88.466,72.472c-0.3968,0.1723-1.2325,0.03606-2.6372-0.62094-2.3986-1.0812-3.9291-2.4373-5.6092-3.6528-1.6568-1.2099-3.5752-2.4508-4.4841-3.7668-0.75927-1.1943,1.3255-1.7708,4.0031-1.0018,3.4919,0.99907,5.5128,3.4947,7.0483,4.8993,0.58169,0.51113,2.8922,3.6613,1.6791,4.143z M51.882,7.3591c-0.426-0.0546-0.892-0.3354-1.307-0.9496-0.743-1.0353-0.642-1.9171-0.767-2.7944-0.113-0.8689-0.383-1.8219,0.118-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79567,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z m50.199,46.064c-0.42596-0.05463-0.89232-0.33545-1.3068-0.94963-0.74288-1.0353-0.64204-1.9171-0.76702-2.7944-0.11349-0.8689-0.38317-1.8219,0.11743-2.5152,0.50011-0.61071,2.4544-0.21454,3.6617,0.79566,1.5778,1.3162,0.83608,2.7148,0.69686,3.6142-0.03464,0.33374-1.1388,2.0314-2.4021,1.8494z }; \end{tikzpicture} \end{document} In addition(optional/secondary): Opt1.- is posible use directly the .svg file in the \draw[fill=violet] svg { .... } Opt2.- Is possible use the SVG option transform="matrix(1,0,0,-1,0,0)" in Tikz path?
- Picking marbles probability courseby Arne Timperman on April 4, 2026 at 1:21 pm
For my probability course, I want to create the following figure with marbles. EDIT: red purple means, it could be red or purble I could create this in Tikz, placing each marble separately, but that does not seem like the correct method to me. AI returned the following (incorrect code). \documentclass[10pt,a4paper,svgnames,openleft,explicit]{book} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{center} \begin{tikzpicture} % Parameters \def\r{0.35} % radius \def\dx{1.0} % x distance \def\dy{1.0} % y distance % --- BOVENSTE 4 RIJEN: rood/paars half --- \foreach \row in {0,1,2,3}{ \foreach \col in {0,...,7}{ % paars rechts \fill[purple] (\col*\dx, -\row*\dy) arc[start angle=-45, end angle=135, radius=\r] -- (\col*\dx, -\row*\dy) -- cycle; % rood links \fill[red] (\col*\dx, -\row*\dy) arc[start angle=135, end angle=315, radius=\r] -- (\col*\dx, -\row*\dy) -- cycle; } } % --- ONDERSTE 4 RIJEN: geel --- \foreach \row in {4,5,6,7}{ \foreach \col in {0,...,7}{ \fill[yellow] (\col*\dx, -\row*\dy) circle (\r); } } % --- ACCOLADE + tekst --- \draw[line width=1pt] (8.5, -0.3) -- (8.5, -3.7) decorate[decoration={brace, amplitude=8pt}]{(8.5,-3.7) -- (8.5,-0.3)}; \node[right] at (8.7, -2) {geen 6 gele}; \end{tikzpicture} \end{center} \end{document} Resulting in this figure Any suggestions?
- How to add safer mechanism to prevent `\property_ref:nn` from getting NaN value?by Explorer on April 4, 2026 at 9:32 am
This is the follow-up question of Jasper Habicht's excellent solution with ltproperties: % Source - https://tex.stackexchange.com/a/761258 % Posted by Jasper Habicht, modified by community. See post 'Timeline' for change history % Retrieved 2026-04-04, License - CC BY-SA 4.0 \documentclass[12pt,oneside,openany]{book} \usepackage{libertine} \usepackage{lipsum} \usepackage{tikz} \usetikzlibrary{matrix} \pagestyle{empty} \usepackage[showframe]{geometry} \ExplSyntaxOn \tl_new:N \l_explorer_matrix_content_tl \property_new:nnnn { last-chapter } { now } { 1 } { \arabic{chapter} } \hook_gput_code:nnn { enddocument } { . } { \property_record:nn { explorer/matrix } { last-chapter } } \hook_gput_code:nnn { shipout/background } { . } { \int_step_inline:nn { \property_ref:nn { explorer/matrix } { last-chapter } } { \int_compare:nNnT {#1} = { \thechapter} { \tl_put_right:Nn \l_explorer_matrix_content_tl { |[fill=magenta]| } } \tl_put_right:Nn \l_explorer_matrix_content_tl { #1 \\ } } \begin{tikzpicture}[ overlay, remember~picture, ] \matrix[ anchor=east, matrix~of~nodes, nodes={ draw, align=center, fill=cyan, minimum~size=1.2cm, font={\sffamily\bfseries\Huge} }, row~sep=.75cm, column~sep=0mm, inner~sep=0pt ] (m) at (current~page.east){ \l_explorer_matrix_content_tl }; \end{tikzpicture} } \ExplSyntaxOff \begin{document} % \chapter{First Chapter} % without chapter \lipsum[1-10] \end{document} Noted that with the code above, I removed the \chapter{First Chapter} with comment, now: In my FIRST pdflatex compilation, everything go smoothly. In my SECOND pdflatex comlpilation, it raised: (c:/texlive/2026/texmf-dist/tex/latex/base/atbegshi-ltx.sty) Missing character: There is no ; in font nullfont! ! Missing } inserted. <inserted text> } l.49 I guess that is because the \property_ref:nn { explorer/matrix } { last-chapter } get missing value. And that is not quite user-friendly: If user just compile with only one pdflatex or latexmk -pdf, and it works; But if user compile twice, that error is confusing. I wonder whether we could add some safe mechanism, if no \chapter is needed, could we switch off the shipout/background hook, avoid the annoying error?
- Fix large spacing when using align with casesby Your neighbor Todorovich on April 4, 2026 at 6:06 am
I have a simple piece of code: \begin{align} \nabla_x L(x, \mu) = \nabla f(x) + A^\top \mu & = 0\\ Ax & = b \end{align} which generates However if I put a cases around it \begin{align} \begin{cases} \nabla_x L(x, \mu) = \nabla f(x) + A^\top \mu & = 0\\ Ax & = b \end{cases} \end{align} then a very large white space appears What gives? And is there a fix to this?
- pgf-PeriodicTable: Adjust font alignment (and color scheme)by cis on April 3, 2026 at 6:37 pm
First of all: I've noticed that the search for pgf-PeriodicTable isn't currently yielding any significant results. I've created a new tag and hope to vitalize this wonderful package with this post; and I look forward to seeing many more great PTEs in the future. I want to create a very simple periodic table, similar to the one you find with a Google search (see image below); ideally, it should also use this color scheme for the text and background. I'm having a few problems with pgf-PeriodicTable: · How do I ensure that Z (in a slightly larger font) is perfectly left-aligned? · And that Ar is perfectly right-aligned? Since I am not very familiar with the package, suggestions for improvement of a general nature are welcome. My current approach: \documentclass[paper=a5]{scrarticle} \usepackage[margin=5mm, showframe=true, ]{geometry} \usepackage[en]{pgf-PeriodicTable} \begin{document} \pgfPTbuildcell(6,3)% [(1;1-2;Z), (1;2.5-3;Ar),% not sure but I set this (2-4;1-3;CS),(5-6;1-3;name) %,(4.75;1-3;radio)% do not know where to place best yet ] \pgfPTpreviewcell[1.8] \noindent\pgfPT[ % Common =========================== show title=false, show legend=false,% true does not work cell width=7.25mm, cell height=7.25mm, %back color scheme=Wikipedia, % Z =============================== Z font=\tiny\bfseries, Z backcolor=none, Z color=black, % Ar =============================== Ar font=\fontsize{4}{4}\selectfont, Ar precision=1, % names ============================ capitalize element names=true,% please! name font=\fontsize{3.5}{4}\selectfont, ] \end{document}
- Nicely organized graph representing Feynmanby FishDrowned on April 3, 2026 at 1:26 pm
I don't quite understand why the first node is no longer pointing toward $C_0$. How can I move $C_0$ to be on the far right side, still level with the first node (kind of looking like a trapezoid) while still connected to the first node? \documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs} \begin{document} \begin{center} \scalebox{1.2}{ \tikz \graph [grow right sep]{ x1 [as =$\displaystyle \int_a^b{f(x)dx}$] -> {x2[as=$C_0$, red], x3[as=$F(t)$] -> x4[as=$F^\prime(t)$] -> x5[as=$\displaystyle \int{F^\prime(t)dt}$] -> x6[as=$C(t) + C_{1}$, red]->x2}; }; } \end{center} \end{document} This is what it currently looks like: This is the intended result (essentially, ignore the terrible drawing lol): Any help or a push toward some sort of useful resource is much appreciated.
- Position labels Venn diagramby Arne Timperman on April 3, 2026 at 8:31 am
How can I place labels (A and B) on the outside in the venndiagram package \documentclass[10pt,a4paper,svgnames,openleft,explicit]{book} \usepackage{venndiagram} \begin{document} \begin{center} \begin{venndiagram2sets}[showframe=false] \fillA \fillB \node at (1,2) {a}; \node at (1.5,1) {b}; \node at (1.8,2) {c}; \node at (2.5,1.4) {d}; \node at (2.5,1.8) {e}; \node at (3.5,1.3) {f}; \node at (3.7,1.8) {g}; \end{venndiagram2sets} \end{center} \end{document}
- How to correctly write \hom_{k\text{-alg}}?by Gargantuar on April 2, 2026 at 3:17 pm
How do I write \hom_{k\text{-alg}} correctly? Semantically, this is incorrect since -alg is not text, so it shouldn't be in the normal text font but in math font. Using \mathrm however is also wrong as the - sign will become a minus sign, which has wrong spacing. What is the best way to write this? If possible, I want to avoid stuff like \mathchardef\hyph="2D and use \hyph instead of - (this is meant for a beginners course). Edit: As there is a lot of debate and confusion, here an MWE (with the "correct" command in one of my commands). \documentclass{article} \usepackage{newtxtext} \usepackage{amsmath} \newcommand{\alg}[1]{\mathord{#1\!\operatorname{-alg}}} \begin{document} \[ \hom_{k\text{-alg}}, \hom_{k\mathrm{-alg}}, \hom_{\alg{k}} \] \end{document}
- Equation numbers with multiple alignmentsby lenskihe on April 2, 2026 at 3:11 pm
I would like to typeset an equation with two alignment points, but also have an equation number on each line. What I am aiming for should look like this: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} a &= \text{Something very very long} \\ &\begin{aligned} {}\leq b\Bigl(&ccc \\ &+d \\ &+e \Bigr) \end{aligned} \end{align} \end{document} However, the inner aligned environment produces only a single equation number, whereas I would like one number per line. I tried to solve this is using alignat. \documentclass{article} \usepackage{amsmath} \usepackage{mathtools} \begin{document} \begin{alignat}{3} a &= \mathrlap{\text{Something very very long}} \\ &\leq b\Bigl(&&ccc \\ &&& +d \\ &&& +e\Bigr) \end{alignat} \end{document} This gives me multiple equation numbers, but using \mathrlap causes the whole expression to become visually misaligned (no longer centered properly). My two tries are shown below. Is there a way to achieve what I am looking for?
- Good packages for maintaining multiple document versions, with simple interface like `tagging` and `optional`?by Peter LeFanu Lumsdaine on April 2, 2026 at 12:31 pm
This is a package-recommendation question: What good, modern packages exist for maintaining a document with multiple versions? This is something I find myself needing constantly, for many purposes (e.g. versions in different page geometries for printing/screenreading; versions with different styles for preprint/journal versions of an article…) One option is to define conditionals like “\newif\ifsmallscreen” at the start, and manage the conditional logic by hand. A cleaner approach is provided by the rather similar packages optional and tagging: you load them at the start of the preamble with your named options/tags e.g. \usepackage[smallscreen]{optional}, and they allow conditing on thses with an interface like \opt{smallscreen}{\geometry{a5paper}}. However, both these packages have some pretty basic limitations (e.g. optional only lets you conditionally include code based on options, not exclude it; and tagging’s conditionals don’t work inside command definitions), and are also unmaintained. So for more complex versioning I end up rolling my own solution — but I miss the very clean interface provided by these packages. Are there any modern, slightly wider-featured alternatives to these packages — offering a quick (ideally one-liner) interface for specifying tags/version options at the start of a document, and then offering a robust and flexible interface for conditionals depending on these? I’ve looked through CTAN’s conditional-compilation category, but haven’t found anything suitable — multiaudience and renditions have similar aims, but offer no improvement on optional and tagging, as far as I can see.
- exam class: How to create a solution space that automatically spans multiple pages?by Dimitrios ANAGNOSTOU on April 2, 2026 at 9:04 am
I am using the exam class to create tests and would like to provide students with a solution area that can span multiple pages if needed. The built-in environments such as solutionbox, \fillwithlines, or \makeemptybox work well for fixed-height spaces, but they do not naturally extend across page breaks (or I failed to do so...). What I would like is: a solution environment or command, that provides a large writable area, and automatically continues onto the next page(s) if necessary (e.g., like a long answer space). Here is a minimal example: \documentclass{exam} \usepackage{hyperref, graphicx} \begin{document} \begin{questions} \question[3] In no more than one paragraph, explain why the earth is round. \begin{solutionbox}{1in} The solution \end{solutionbox} \question[10] Long question requiring more space. % Desired: a solution space that can span multiple pages \begin{solution} % large writable area for students \end{solution} \end{questions} \end{document} I tried using solution, but I am not sure how to turn it into a multi-page writable area for students (not just for typeset solutions). What is the best way (within the exam class or with additional packages) to create a solution space for students that can automatically split across multiple pages?