Hot
- TikZ: Projecting letter with a cm-matrix onto a 3D rectangular areaby cis on March 6, 2026 at 2:44 pm
I'm drawing a 3D rectangle (which should be a plane, represented by the letter "H"). At the top left corner, at 'C', I want to project a $H$ in mathematical font onto the plane. I've used a cm matrix for this. The position is correct, but I've noticed that the serifs of the 'H' are parallel, despite using $H$, so it doesn't look like mathematical font. What do I need to do? \documentclass[margin=5pt, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[ x={(-4.85mm,-4.85mm)}, y={(10mm,0mm)}, z={(0,10mm)}, font=\footnotesize, ] %\coordinate[label=below:$O$](O) at (0,0,0); \coordinate[label=right:A](A) at (0,2,0); \coordinate[label=B](B) at (0,2,2); \coordinate[label={[anchor=south west, inner sep=1pt]{C $H$ (as it should be)}}](C) at (-2.5,-1.5,2); \coordinate[label=left:D](D) at (-2.5,-1.5,0); \draw[] (A) -- (B) -- (C) -- (D) --cycle; \path let \p1 = ($(B)-(C)$), \p2 = ($(C)-(D)$), \n{len1} = {veclen(\x1,\y1)}, \n{len2} = {veclen(\x2,\y2)}, \n1 = {\x1/\n{len1}}, \n2 = {\y1/\n{len1}}, \n3 = {\x2/\n{len2}}, \n4 = {\y2/\n{len2}} in node[cm={\n1, \n2, \n3, \n4, (C)}, anchor=north west, inner sep=1pt, %transform shape, % no effect ]{H $H$ \mbox{$H$}}; % CoSy \begin{scope}[-latex, thick, shift={(0,-2,2)}] \foreach \P/\s/\Pos in {(1,0,0)/x/above, (0,1,0)/y/right, (0,0,1)/z/right} \draw[] (0,0,0) -- \P node[\Pos, pos=0.9,inner sep=3pt]{$\s$}; \end{scope} \end{tikzpicture} \end{document}
- Section and subsection indentationby charuanl on March 6, 2026 at 1:43 pm
I need to indent paragraphs after a section and a subsection as shown below. Here's my code : \documentclass[a4paper,14pt,twoside,openright]{extbook} \usepackage[top=1in,left=1in,bottom=1in,right=1in]{geometry} \titleformat{\chapter}[display] {\normalfont\bfseries\color{Blue!75}} {\filleft% \begin{tikzpicture} \node[ outer sep=0pt, text width=2.5cm, minimum height=3cm, fill=Blue!75, text centered, inner sep=0pt, font=\color{white}\fontsize{80}{90}\selectfont, ] (num) {\thechapter}; \node[ rotate=90, anchor=south, font=\color{black}\Large ] at ([xshift=-5pt]num.west) {\chaptertitlename}; \end{tikzpicture}% } {10pt} {\titlerule[2pt]\vskip2pt\titlerule\LARGE} \titlespacing*{\chapter}{0pt}{0pt}{10pt} \usepackage{parskip} \makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Configuration \def\sectionindent{13mm} \def\subsectionindent{16mm} \def\subsubsectionindent{14mm} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Some derived quantities % (you should manually update these) \def\subsectiontotalindent{22mm} % = \sectionindent + \subsectionindent \def\subsubsectiontotalindent{36mm} % = \sectionindent + \subsectionindent + \subsubsectionindent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The following code is adapted from some sample code by % Vincent Zoonekynd, made available at the following website: % http://zoonek.free.fr/LaTeX/LaTeX_samples_section/0.html %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Redefining \section and \section* \def\section{\@ifstar\unnumberedsection\numberedsection} \def\numberedsection{\@ifnextchar[%] \numberedsectionwithtwoarguments\numberedsectionwithoneargument} \def\unnumberedsection{\@ifnextchar[%] \unnumberedsectionwithtwoarguments\unnumberedsectionwithoneargument} \def\numberedsectionwithoneargument#1{\numberedsectionwithtwoarguments[#1]{#1}} \def\unnumberedsectionwithoneargument#1{\unnumberedsectionwithtwoarguments[#1]{#1}} \def\numberedsectionwithtwoarguments[#1]#2{% \ifhmode\par\fi \removelastskip \vskip 0ex\goodbreak \refstepcounter{section}% \noindent \begingroup \leavevmode\normalsize\bfseries\raggedright \rlap{\thesection}% \hspace{\sectionindent}% #2 \par \endgroup \vskip 0ex\nobreak \addcontentsline{toc}{section}{% \protect\numberline{\thesection}% #1}% \leftskip=\sectionindent\relax% \justifying } \def\unnumberedsectionwithtwoarguments[#1]#2{% \ifhmode\par\fi \removelastskip \vskip 0ex\goodbreak % \refstepcounter{section}% \noindent \begingroup \leavevmode\normalsize\bfseries\raggedright %\rlap{\thesection}% \hspace{\sectionindent}% #2 \par \endgroup \vskip 0ex\nobreak \addcontentsline{toc}{section}{% % \protect\numberline{\thesection}% #1}% \leftskip=0pt \parindent=1.5em \justifying } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Redefining \subsection and \subsection* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\subsection{\@ifstar\unnumberedsubsection\numberedsubsection} \def\numberedsubsection{\@ifnextchar[%] \numberedsubsectionwithtwoarguments\numberedsubsectionwithoneargument} \def\unnumberedsubsection{\@ifnextchar[%] \unnumberedsubsectionwithtwoarguments\unnumberedsubsectionwithoneargument} \def\numberedsubsectionwithoneargument#1{\numberedsubsectionwithtwoarguments[#1]{#1}} \def\unnumberedsubsectionwithoneargument#1{\unnumberedsubsectionwithtwoarguments[#1]{#1}} \def\numberedsubsectionwithtwoarguments[#1]#2{% \ifhmode\par\fi \removelastskip \vskip 0ex\goodbreak \refstepcounter{subsection}% \noindent \begingroup \leavevmode\normalsize\bfseries\raggedright \hspace{\sectionindent}% \rlap{\thesubsection}% \hspace{\subsectionindent}% #2 \par \endgroup \vskip 0ex\nobreak \addcontentsline{toc}{subsection}{% \protect\numberline{\thesubsection}% #1}% \parindent=1.5em \justifying } \def\unnumberedsubsectionwithtwoarguments[#1]#2{% \ifhmode\par\fi \removelastskip \vskip 3ex\goodbreak % \refstepcounter{subsection}% \noindent \begingroup \leavevmode\normalsize\bfseries\raggedright \hspace{\sectionindent}% %\rlap{\thesubsection}% \hspace{\subsectionindent}% #2 \par \endgroup \vskip 2ex\nobreak \addcontentsline{toc}{subsection}{% % \protect\numberline{\thesubsection}% #1}% \parindent=1.5em \justifying } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Redefining \subsubsection and \subsubsection* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\subsubsection{\@ifstar\unnumberedsubsubsection\numberedsubsubsection} \def\numberedsubsubsection{\@ifnextchar[%] \numberedsubsubsectionwithtwoarguments\numberedsubsubsectionwithoneargument} \def\unnumberedsubsubsection{\@ifnextchar[%] \unnumberedsubsubsectionwithtwoarguments\unnumberedsubsubsectionwithoneargument} \def\numberedsubsubsectionwithoneargument#1{\numberedsubsubsectionwithtwoarguments[#1]{#1}} \def\unnumberedsubsubsectionwithoneargument#1{\unnumberedsubsubsectionwithtwoarguments[#1]{#1}} \def\numberedsubsubsectionwithtwoarguments[#1]#2{% \ifhmode\par\fi \removelastskip \vskip 3ex\goodbreak \refstepcounter{subsubsection}% \noindent \begingroup \leavevmode\normalsize\bfseries\raggedright \hspace{\subsectiontotalindent}% \rlap{\thesubsubsection}% \hspace{\subsubsectionindent}% #2 \par \endgroup \vskip 2ex\nobreak \addcontentsline{toc}{subsubsection}{% \protect\numberline{\thesubsubsection}% #1}% \leftskip=\subsubsectiontotalindent\relax% } \def\unnumberedsubsubsectionwithtwoarguments[#1]#2{% \ifhmode\par\fi \removelastskip \vskip 3ex\goodbreak % \refstepcounter{subsubsection}% \noindent \begingroup \leavevmode\normalsize\bfseries\raggedright \hspace{\subsectiontotalindent}% %\rlap{\thesubsubsection}% \hspace{\subsubsectionindent}% #2 \par \endgroup \vskip 2ex\nobreak \addcontentsline{toc}{subsubsection}{% % \protect\numberline{\thesubsubsection}% #1}% \leftskip=\subsubsectiontotalindent\relax% } \makeatother \parindent=0pt \usepackage{lipsum} \begin{document} \chapter{A Chapter} \lipsum[2] \section{A Section} \lipsum[2] \subsection{A Subsection} \lipsum[2] \end{document} and this is the result:
- Ignore case sensitivity in Indexby GowriSaro on March 6, 2026 at 10:29 am
I'm using: \documentclass{book} \usepackage{makeidx} \makeindex \begin{document} Test\index{Test} \newpage test\index{test} \end{document} after running makeindex, output generated as: \begin{theindex} \item Test, 1 \item test, 2 \end{theindex} Is this possible to ignore the case sensitivity and generate the output as \item Test 1, 2?
- What would be the expl3 equivalent of \setbox0... + (Lua) box[0]by Denis Bitouzé on March 6, 2026 at 10:01 am
This question is a followup of a previous question of mine that David kindly answered with the following example: \documentclass{article} \usepackage{csquotes} \def\test#1{% \setbox0\hbox{#1}% \usebox{0}% \directlua{ local nn=0 for n in node.traverse_glyph(tex.box[0].head) do nn=n.char end if nn==8221 then tex.print("\string~yes") else tex.print("\string~no") end }} \begin{document} \begin{enumerate} \item \test{“Foo”} \item \test{\enquote{Bar}} \item \test{xyz} \end{enumerate} \ExplSyntaxOff \end{document} I'd like to expl3-ify this MCE and here is the first step which works nicely: \begin{filecontents*}[overwrite]{myfile.lua} function closing_double_quote(glyph) local nn=0 for n in node.traverse_glyph(glyph) do nn=n.char end if nn==8221 then tex.print("yes") else tex.print("~no") end end \end{filecontents*} \documentclass{article} \usepackage{csquotes} \ExplSyntaxOn \lua_now:n{ require('myfile') } \cs_new_protected:Nn \__mymodule_closing_double_quote:n { \setbox0\hbox{#1} \usebox{0} : \c_space_tl \lua_now:n{ tex.write(closing_double_quote(tex.box[0].head)) } } \begin{document} \begin{enumerate} \item \__mymodule_closing_double_quote:n {“Foo”} \item \__mymodule_closing_double_quote:n {\enquote{Bar}} \item \__mymodule_closing_double_quote:n {xyz} \end{enumerate} \end{document} What remains is: \setbox0\hbox{#1} \usebox{0} that could be expl3-ified as follows: \hbox_set:Nn \l_tmpa_box { #1 } \box_use:N \l_tmpa_box But what would be the equivalent of box[0] in the Lua code: tex.write(closing_double_quote(tex.box[0].head))
- How to set the vertical space between subtables?by CarLaTeX on March 6, 2026 at 8:51 am
Is it possible to set the vertical space between two subtables as in Table 2 in the following MWE, but using something more "automatic" than setting a \vspace manually? \documentclass{book} \usepackage{subcaption} \subcaptionsetup[table]{position=top} \begin{document} \begin{table}[ht]\centering \caption{Table caption} \begin{subtable}{\linewidth}\centering \caption{First subtable caption} \begin{tabular}{cc} \hline a & b \\ c & d \\ \hline \end{tabular} \end{subtable} \begin{subtable}{\linewidth}\centering \caption{Second subtable caption} \begin{tabular}{cc} \hline e & f \\ g & h \\ \hline \end{tabular} \end{subtable} \end{table} \begin{table}[ht]\centering \caption{Table caption} \begin{subtable}{\linewidth}\centering \caption{First subtable caption} \begin{tabular}{cc} \hline a & b \\ c & d \\ \hline \end{tabular} \end{subtable}\vspace{10pt} \begin{subtable}{\linewidth}\centering \caption{Second subtable caption} \begin{tabular}{cc} \hline e & f \\ g & h \\ \hline \end{tabular} \end{subtable} \end{table} \end{document} Maybe this is a trivial question, but I found only the \vspace (or similar) answers.
- How to get to the integer value of \currentlistentrynumber in a custom alternative in a TOC list?by Gary on March 6, 2026 at 5:11 am
I'm trying to use \definelistalternative to alter the way a part is displayed in the Table of Contents. That appears to be working but I'm having trouble with the conversion of the \currentlistentrynumber to the text provided in the \defineconversion[Parts] line in this example. I know that the \convertnumber{Parts}{...} works because it is used in the first chapter using hard-coded integers and it returns First, Second, or Third. But the \convertnumber{Parts}{\currentlistentrynumber} throws an error (strangely at the numberalign=flushright under the chapter level of setuplist); and I assume that is because \currentlistentrynumber is not treated as its integer value. I tried passing it to a custom command \ConvertPartNbr declared in this example, but the error is the same. How can I get to the value of \currentlistentrynumber in order to convert it? It is under \startsetups [PartsTOCsu], at line %{Part \convertnumber{Parts}{\currentlistentrynumber}{.}}% currently commented out. Thank you. \setupcombinedlist[content][list={part,chapter},] \setuplist[chapter][ alternative=c, stopper={.}, distance=5mm, numberalign=flushright, numbercommand={\sc}, style={\setupinterlinespace[2.5ex]\sc} ] \setuplist[part][ alternative=PartsTOC, ] % \defineconversion[en-us][Parts][First,Second,Third] \defineconversion[Parts][First,Second,Third,] \definelistalternative [PartsTOC] [renderingsetup=PartsTOCsu] % \currentlistentrylocation % \namedstructureheadlocation{chapter} % \currentlistentrynumber % \currentlistentrytitle % \currentlistentrypagenumber \startsetups [PartsTOCsu]% \framed [frame=off, width={\textwidth}, offset=none, toffset=10mm, align=center]{% \setuplocalinterlinespace[5ex] {Part \ConvertPartNbr{Parts}{3}}\\ %{Part \convertnumber{Parts}{\currentlistentrynumber}{.}}% {Part {\currentlistentrynumber}{.}}\\ {\sc\currentlistentrytitle}{.} \blank[0mm]\blackrule[width=32mm,height=0.6ex+0.6pt,depth=-0.6ex+0.6pt]\blank[5mm]% } \stopsetups \define[2]\ConvertPartNbr{% \convertnumber{#1}{#2}{.} } \starttext \startfrontmatter \completecontent[criterium=all] \stopfrontmatter \startbodymatter \startpart[list={Title of Part One}] \startchapter[title={Part One, Chapter One}] Paragraph\\ Part \convertnumber{Parts}{1}\\ Part \convertnumber{Parts}{2}\\ Part \convertnumber{Parts}{3} \stopchapter \startchapter[title={Part One, Chapter Two}] Paragraph \stopchapter \stoppart \startpart[list={Title of Part Two}] \startchapter[title={Part Two, Chapter One}] Paragraph \stopchapter \startchapter[title={Part Two, Chapter Two}] Paragraph \stopchapter \stoppart \stopbodymatter \stoptext
- \not\supseteq with kpfontsby Jinwen on March 6, 2026 at 4:21 am
With kpfonts, \not\supseteq becomes \supsetneq, which is not desirable: Expected result should look like: This appears to be a bug, because \not\subseteq looks fine. However, before the package gets fixed, is there any temporary way to fix this behavior? \documentclass{article} % \usepackage{kpfonts} % \usepackage{unicode-math} \usepackage{kpfonts-otf} \begin{document} \( \not\supseteq \) \end{document}
- Trying to align two different logos using adjustbox, but failedby user516076 on March 6, 2026 at 2:11 am
I tried this solution, but it gives me this result: I wish to have those logos have the same height like this: MWE: \documentclass[12pt,a4paper]{article} \usepackage[a4paper,margin=2cm]{geometry} \usepackage{graphicx} \usepackage{tikz} \usepackage{enumitem} \usepackage{setspace} \usepackage[export]{adjustbox} \pagestyle{empty} \begin{document} %==================== LOGOS ==================== \begin{tabular}{@{}p{0.5\textwidth}@{}p{0.5\textwidth}@{}} \includegraphics[height=2.2cm,valign=t]{newarrohmah.png} & \hfill \includegraphics[height=4cm,valign=t]{cambridge.png} \end{tabular} \vspace{0.4cm} \textbf{Cambridge IGCSE\texttrademark} Teacher : Mr. Shandy \vspace{0.6cm} %==================== CANDIDATE BOX ==================== \begin{tikzpicture} % Candidate name \node[anchor=west] at (0,0) {\small CANDIDATE}; \node[anchor=west] at (0,-0.5) {\small NAME}; \draw (3,-0.7) rectangle (16,-0.1); % Centre number boxes \node[anchor=west] at (0,-2) {\small CENTRE}; \node[anchor=west] at (0,-2.5) {\small NUMBER}; \foreach \x in {3,4,5,6,7} \draw (\x,-2.7) rectangle (\x+1,-2.0); % Candidate number boxes \node[anchor=west] at (9,-2) {\small CANDIDATE}; \node[anchor=west] at (9,-2.5) {\small NUMBER}; \foreach \x in {12,13,14,15} \draw (\x,-2.7) rectangle (\x+1,-2.0); \end{tikzpicture} \vspace{0.8cm} %==================== PAPER HEADER ==================== \begin{tabular}{p{0.7\textwidth}p{0.3\textwidth}} \textbf{MATHEMATICS} Paper 1 Non-calculator & \raggedleft 0862/01 October 2025 1 hour 20 minutes \end{tabular} \vspace{0.4cm} \hrule \vspace{0.4cm} You must answer on the question paper. You will need: HB pencil or (black/dark blue) pen, and/or eraser \vspace{0.6cm} %==================== INSTRUCTIONS ==================== \textbf{INSTRUCTIONS} \begin{itemize}[leftmargin=1.5em, itemsep=2pt] \item Answer \textbf{all} questions. \item Use a black or dark blue pen. You may use an HB pencil for any diagrams or graphs. \item Write your name, centre number and candidate number in the boxes at the top of the page. \item Write your answer to each question in the space provided. \item Do \textbf{not} use an erasable pen or correction fluid. \item Do \textbf{not} write on any bar codes. \item You are not allowed to use a calculator. \item You may use tracing paper. \item You must show all necessary working clearly. \item Give non-exact numerical answers correct to 3 significant figures, or 1 decimal place for angles in degrees, unless a different level of accuracy is specified in the question. \item For $\pi$, use either your calculator value or 3.142. \end{itemize} \vspace{0.5cm} %==================== INFORMATION ==================== \textbf{INFORMATION} \begin{itemize}[leftmargin=1.5em] \item The total mark for this paper is 86. \item The number of marks for each question or part question is shown in brackets [ ]. \end{itemize} \vfill \hrule \vspace{0.2cm} \begin{center} This document has \textbf{10 pages} \end{center} \vspace{0.3cm} \begin{tabular}{p{0.5\textwidth}p{0.5\textwidth}} {\small © Arrohmah Bogor 2025} & \raggedleft {\small [Turn Over]} \end{tabular} \end{document} Currently, my paper looks like this: Could someone help me please? If it's done, it might look like both logos will look bigger. So pleasae tell me how to resize it, also. T.I.A. This is the folder that containes the files.
- \zcref[full]{mythm} to print "Section n Theorem x"by PHL on March 6, 2026 at 1:28 am
I have a document with many theorems/propositions whose numbering is reseted at every section. I use \zcref for referencing the theorems and would like to have an option to use the section as a prefix. The aim is that the following code produces "See theorem 1, or theorem 2 or maybe section 1 theorem 1" \documentclass{article} \usepackage{zref-clever} \newtheorem{theorem}{Theorem} \counterwithin*{theorem}{section} \begin{document} % \section{First} % \begin{theorem}\label{bla} Bla \end{theorem} % \begin{theorem}\label{blo} Blo \end{theorem} % % \section{Second} \begin{theorem}\label{blu} Blu \end{theorem} See \zcref{bla}, or \zcref{blo} or maybe \zcref[full]{blu} \end{document} The above code might be far from optimal (in particular the \counterwithin*) and I am open to any suggestions to change it in order to attain the desired result.
- pgfplots rotation around axisby bbujeya on March 5, 2026 at 11:24 pm
I'm trying to plot a 2D graph and have the students find the volume of solid of revolution. I can use pgfplots to do the bulk of it, but my question is: how do I show the arrows on the axis to demonstrate that we need to rotate around the x or y axes? \documentclass[tikz]{standalone} \usepackage{tikz} \usepackage{tkz-euclide} \usepackage{pgfplots}\pgfplotsset{compat=1.18} \usepackage{siunitx}\usepgfplotslibrary{fillbetween,statistics} \usetikzlibrary{calc,positioning,arrows.meta,patterns,patterns.meta,intersections,shapes.geometric,decorations,shapes.callouts,decorations.pathmorphing,decorations.pathreplacing}\usepackage{amssymb} \begin{document} \begin{tikzpicture} \begin{axis} [width=0.8\linewidth, xmin=-0.5,xmax=16, ymin=-0.2,ymax=5, axis lines=center,axis on top, xlabel=$x$,ylabel=$y$, xticklabels=\empty,yticklabels=\empty] \addplot[name path=cubic,thick,black,samples=50,smooth,domain=-0.5:16]{sqrt(x+1)}; \addplot[name path=line,thick,black,samples=50,smooth,domain=-0.5:16]{4}; \addplot[darkgray,opacity=0.5] fill between[of=cubic and line,soft clip={domain=0:15}]; \end{axis} \end{tikzpicture} \end{document} Thanks for your help/suggestions.
- Fadings beyond the edge of the scopeby karlh on March 5, 2026 at 10:51 pm
As a follow-up to a previous question, how can I prevent TikZ from cutting off the edge of the path if the edge of the object goes beyond the edge of the fading pattern? Here is a minimal working example: \documentclass{article} \usepackage[svgnames]{xcolor} \usepackage{tikz} \usetikzlibrary{fadings} \begin{document} \begin{tikzpicture} \begin{scope} \path [scope fading=east] (1,1) rectangle (3,3); \draw [FireBrick,very thick] (0,0) rectangle (2,2); \end{scope} \draw [dotted] (1,1) rectangle (3,3); \begin{scope}[yshift=-4cm] \path [scope fading=east] (1,1) rectangle (3,3); \draw [Gray,very thick] (-1,-1) rectangle (2,2); \end{scope} \draw [yshift=-4cm,dotted] (1,1) rectangle (3,3); \begin{scope}[yshift=-4cm,xshift=5cm] \path [scope fading=east] (1,-1) rectangle (3,3); \draw [Gray,very thick] (-1,-1) rectangle (2,2); \end{scope} \draw [Gray,very thick,yshift=-4cm,xshift=5cm] (0,2) -- (-1,2) -- (-1,-1) -- (0,-1); \end{tikzpicture} \end{document} which produces, in XPDF, Note that the red one works fine, because the edge of the fading (which extends about 25% beyond the edge of the object) is still 100% transparent there, but the gray one does not work because it extends past the edge of the fading. It should look like the one on the lower right, at least on the left-hand side of the square. Note that it would also be an issue for fadings that don't fade all the way out going off the right of the fading, or for very large radial fadings that fade to transparent well before the edge of the object being faded. If the paths were filled, I could simply fill the left part of the pattern with the solid color and clip without having to re-draw it, but if it's just a draw shading, part of it gets cut off and I don't know how to get it back short of drawing it again. Note: some PDF viewers (including my usual ones, Evince and Papers), do not display any of these images correctly, because they don't handle faded drawn paths correctly. This is a viewer problem, but XPDF seems to better.
- aligned inside inline math in a tasks cell: is this correct?by Oregon Math Tutor on March 5, 2026 at 8:29 pm
I am building a reusable worksheet framework using the tasks package to lay out multi-step math problems in two columns. Each cell contains a multi-line step-by-step simplification, with the final answer highlighted using \colorbox{yellow}. The MWE compiles and produces the correct visual output — problems are top-aligned within each cell, steps are left-aligned on the = sign, and the final answer is highlighted. My specific questions are: Is $\begin{aligned}[t]...\end{aligned}$ — i.e., aligned hosted inside inline math delimiters — inside a tasks cell an acceptable and stable pattern, or does it carry risks (spacing, engine compatibility, package interaction) that I should be aware of? The [t] option anchors the top of the aligned block to the text baseline, which is essential for correct column alignment in this layout. If the pattern in question 1 is not recommended, is there an alternative that preserves this exact top-alignment behavior inside a tasks cell? Is $...$ or \(...\) the more appropriate delimiter for this specific nesting context, where aligned lives inside the delimiter and \colorbox re-enters math mode inside the last line? I am aware the $ vs \(...\) debate has been discussed generally on TSE, but I am asking specifically whether the nesting context here — \colorbox re-entering math mode inside aligned inside inline math inside a tasks cell — changes the answer. This partial screenshot shows the output: Thanks very much for your assistance! mwe: \documentclass[12pt]{article} \usepackage{mathtools} \usepackage{tasks} \usepackage{xcolor} \settasks{ label-width = 22pt, item-indent = 2.5em, label = (\arabic*), after-item-skip = 2em } \begin{document} \textbf{Simplify.} \begin{tasks}(2) \task $\begin{aligned}[t] & \sqrt{27} \\[1em] & = \sqrt{9}\sqrt{3} \\[1em] & \colorbox{yellow}{$= \mathbf{3\sqrt{3}}$} \end{aligned}$ \task $\begin{aligned}[t] & 3\sqrt{48} \\[1em] & = 3\sqrt{16}\sqrt{3} \\[1em] & = (3)(4)\sqrt{3} \\[1em] & \colorbox{yellow}{$= \mathbf{12\sqrt{3}}$} \end{aligned}$ \end{tasks} \end{document}
- Why LaTeX3 underscore comparison adds a spaceby R. N on March 5, 2026 at 8:10 pm
I would like to create a command that could contain 2 groups of optional arguments which can be given in any order. For example, one group can be to deal with key-value and the other can be to deal with embellishments. These 2 groups are independent so I want to be able to feed the command with one or the other or both in any order. To do so, I created a LaTeX3 command to check if the optional argument is an embellishment, if yes then I apply it, else I give to the key-value part. If there is a better way to do, I will be pleased to know it. But my question is when I apply this process, and especially when I deal with underscores. I know they are treated differently, but I don't why the test if the argument contains an underscore seems to add a space, which should not happen in LaTeX3. Here is a MWE: \documentclass{article} \usepackage{amsmath, mathtools} \ExplSyntaxOn \keys_define:nn { RN / mathFunc }{ optA .code:n = {Acaptured}, unknown .code:n = { \bool_gset_false:N \l_RN_keysCaptured OUPS }, } \tl_new:N \l_RN_tmpa_tl \cs_new:Nn \RN_if_embellishment:nTF { \tl_if_blank:nTF {#1}{ #3 }{ \tl_if_in:nnTF {#1} {^} { #2 }{ % \tl_if_in:nnTF {#1} {_} {#2}{#3} % not working for cases 1, 5 and 8 \tl_set:Nn \l_RN_tmpa_tl {\char_generate:n {`\_}} \tl_if_in:VnTF \l_RN_tmpa_tl {#1}{#2}{#3} % not working for case 5 % \tl_if_in:nVTF {#1} \l_RN_tmpa_tl {#2}{#3} % not working for cases 5 and 8 } } } \NewDocumentCommand{\myinteg}{oom}{ \group_begin: \int%\limits \IfNoValueF { #1 }{ \RN_if_embellishment:nTF { #1 }{ % embellishment so no keys just apply them #1 }{ % deal with other keys \keys_set:nn { RN / mathFunc } { #1 } } } \IfNoValueF { #2 }{ \RN_if_embellishment:nTF { #2 }{ % embellishment so no keys just apply them #2 }{ % deal wiht other keys \keys_set:nn { RN / mathFunc } { #2 } } } #3 \group_end: } \ExplSyntaxOff \begin{document} \begin{align} 1: \myinteg[optA][_{b}]{f} = \int Acaptured_b f \\ 2: \myinteg[^{c}_{b}]{f} = \int_{b}^{c} f \\ 3: \myinteg[_{b}^{c}]{f} = \int_{b}^{c} f \\ 4: \myinteg[^{c}]{f} = \int^{c} f \\ 5: \myinteg[_{b}]{f} \neq \int_{b} f \\ 6: \myinteg[optA]{f} = \int Acaptured f \\ 7: \myinteg{f} = \int f \\ 8: \myinteg[ffes]{f} = \int OUPS f \end{align} \end{document} As you can see with the case 5 the manual expression is different from the output of the command. How can I fix this ?
- \DocumentMetadata and custom enumitem keysby Gargantuar on March 5, 2026 at 5:15 pm
I have used enumitem to customise enumerate lists in the past. For example, %\DocumentMetadata{} \documentclass{article} \usepackage{enumitem} \newtheorem{theorem}{Theorem} \setlist[enumerate]{wide} \makeatletter \SetEnumitemKey{noind}{before*={ \AddToHookNext{cmd/@item/before}{\addtolength{\itemindent}{-\parindent}} \AddToHookNext{cmd/@item/after}{\addtolength{\itemindent}{\parindent}} }} \makeatother \begin{document} \begin{theorem} \begin{enumerate} \item a \item b \end{enumerate} \end{theorem} \begin{theorem} \begin{enumerate}[noind] \item a \item b \end{enumerate} \end{theorem} \end{document} allowed me to pass the noind key to remove indentation of the first \item if the theorem starts with an enumerate list (this style is found, e.g., in the SGA/EGA books by Grothendieck, here with (i), (ii), etc.). However, the new \DocumentMetadata code introduces blocks to modernise the trivlist constructions. With \DocumentMetadata enabled, I get a similar error as in the linked post: ./test.tex:27: Package block Error: Some keys specified on the enumerate environment are (block) unknown. For immediate help type H <return>. ... l.27 \item a The following keys are unknown and their values are ignored: noind Perhaps a misspelling or the current template instance uses special keys. Note that the noind key is not about global customisation, but local indentation. Although blocks now do the reasonable thing of starting the list on a new line inside a theorem, my style actually wants to avoid that (:. Is there a way to define custom keys, which influence the indentation of the first \item?
- tabularray, how to adjust space between table lastfootby Zarko on March 5, 2026 at 3:53 pm
In the following (not so minimal) MWE \documentclass[border={1mm 3mm}, 11pt]{standalone} %---------------------------------------------------------------% \usepackage[aboveskip=0.5ex, belowskip=0.5ex, format=plain, font = {stretch=0.84, scriptsize}, labelfont = bf, labelsep = colon, singlelinecheck = off]{caption} \usepackage{tabularray} \SetTblrStyle{note}{\tiny} \SetTblrStyle{remark}{\tiny} \usepackage{tblr-extras} \UseTblrLibrary{booktabs, caption, siunitx} \sisetup{range-units = single, range-phrase = {/} } %---------------------------------------------------------------% \begin{document} \begin{talltblr}[ caption = {Specifikacije razredov lastnosti večrodovnih optičnih vlaken.}, label = {tab:kabli-4}, note{*} = {EMB (Effective Modal Bandwidth) je mera kapacitete večrodovnih vlaken. Pove, koliko podatkov lahko prenesemo na dani razdalji. Maksimalni EMB je pri $\lambda=\qty{850}{\micro\metre}$.}, remark{Opomba} = {Razredi kakovosti določajo tudi barvo plaščev optičnih vlaken. Ujemajo se z barvami vrstic v tabeli.} ]{colsep = 3pt, colspec = {@{} *{5}{Q[c]} Q[c, si={table-format=5.0}] Q[c, si={table-format=3.0}] Q[c] @{}}, cells = {font=\scriptsize\linespread{0.84}\selectfont}, cell{1}{1-3,8} = {r=2}{}, cell{1}{4,6} = {c=2}{}, rowsep = 0pt, row{1,2} = {guard} } \toprule {oznaka\\ razreda} & {TIA\\standard} & {premer\\ jedro/plašč} & slabljenje (db/km), & & EMB\TblrNote{*} (MHz$\cdot$km), & & vir \\ \cmidrule[lr]{4-5} \cmidrule[lr]{6-8} & & & \qty{850}{nm} & \qty{1300}{nm} & \qty{850}{nm} & \qty{1300}{nm} & \\ \bottomrule %---------------- \end{talltblr} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{document} I like to reduce vertical space between table and (bottom rule) and table note remark. How to do this?
- Prevent `babel` from interfering with Lua code?by Denis Bitouzé on March 5, 2026 at 3:15 pm
The following MCE works as expected. \documentclass{article} % \usepackage{babel} % \shorthandoff*{~} \begin{document} \directlua{ local n=0 if n~=42 then tex.print("Foo") else tex.print("Bar") end } \end{document} However, if babel is loaded, the ~= operator in the Lua code causes the compilation to fail: [\directlua]:1: 'then' expected near '\'. l.7 } ? It does work if ~= is replaced by == so I suspected the babel shorthands and, indeed, \shorthandoff*{~} did the trick. But I'm not sure this is completely safe so is there a way to prevent babel from interfering with Lua code?
- aerospace test questions [closed]by destine-lee destine-lee on March 5, 2026 at 3:13 pm
\begin{array}{|c|} \hline \begin{minipage}{0.45\textwidth} \begin{center} \begin{tikzpicture}[scale=0.7] \draw (0,0) circle (1.5cm); \draw[thick, blue] (-1.5,0) -- (1.5,0); \fill[brown] (0,-1.5) arc (-90:-270:1.5cm and 0.6cm) -- cycle; \fill[blue] (0,1.5) arc (90:270:1.5cm and 0.6cm) -- cycle; \draw[yellow, very thick] (-0.3,0) -- (0.3,0); \draw[yellow, very thick] (0,-0.1) -- (0,0.1); \node at (0,0.6) {$10^\circ$}; \draw[yellow, very thick] (-0.1,0.6) -- (0.1,0.6); \node at (0,1.2) {$20^\circ$}; \draw[yellow, very thick] (-0.1,1.2) -- (0.1,1.2); \draw[<->, very thick] (2, -0.2) -- (2, 0.2); \node at (2.5, 0) {Bank}; \end{tikzpicture} \end{center} \end{minipage} \\ \hline \text{Attitude Indicator} \\ \hline \end{array}
- tabularx: parbox in multicolumn with height, which is an integer multiple of a table rowby cis on March 5, 2026 at 2:46 pm
I want to insert a multicolumn into a tabularx, with a breakable textbox that has a height of exactly n table rows (i.e., n \baselineskips), where n is an integer multiple. So I used a parbox; and placed an fcolorbox (without spaces) around it to illustrate the dimensions. Why does here a gap occur, and how do I eliminate the gap? PS: To clarify, it's important (for the background work) that the box has a height of exactly n (e.g. n=6) \baselineskip, without gap that makes an extra height (in opposite to an optical correction). MWE: \documentclass[paper=a5]{scrarticle} \usepackage[ margin=12mm, showframe=false, ]{geometry} \usepackage{tabularx} \usepackage{tikz} \begin{document} \section{Table with Titlebox} \pgfmathtruncatemacro\TitleRows{6} \pgfmathsetlengthmacro\Titleheight{\TitleRows*\baselineskip} \newcommand\MyTitle{% \begingroup \setlength{\fboxsep}{0pt}% \setlength{\fboxrule}{\arrayrulewidth}% \fcolorbox{red}{yellow!22}{% fcolorbox for better view \parbox[t][\Titleheight][t]{\dimexpr\hsize-2\fboxrule\relax}{% Breakable titlebox, which should have an heigth from exactly \TitleRows \verb+\baselineskip+s. }% }% \endgroup} %\noindent\MyTitle %\mytablefont \noindent % Verhindert Einzug der gesamten Tabelle \begin{tabularx}{\textwidth}{|X|c|c|} \hline Column 1 & Column 2 & Column 3 \\ \hline \multicolumn{3}{|@{} p{\dimexpr\textwidth-2\arrayrulewidth} @{}|}{% \MyTitle } \\ \hline A & B & C \\ \hline \end{tabularx} \end{document}
- Using marginnote with landscapeby richard on March 5, 2026 at 1:58 pm
A manuscript I am typesetting to be published includes a long, wide table that I think would be best formatted as a multi-page longtable environment inside a landscape environment. The printed book will use \marginnote to give the manuscript page number. This works fine, except on the landscape page where the \marginnote overlaps the text. Here is a MWE showing the problem (which manifests without the longtable): \documentclass[a4paper,oneside]{book} \usepackage{marginnote} \usepackage{pdflscape} \usepackage{lipsum} \newcommand\pg{\marginnote{\textbf{Page}}} \begin{document} \pg \lipsum[1] \lipsum[2][1-4] \pg \lipsum[2][5-] \begin{landscape} \pg \lipsum[3] \end{landscape} \end{document} Is there any way to make a \marginnote work inside a landscape environment? The marginnote manual says: The marginnote package needs to know the real width of the text area to find the right margin. While some environments (e.g., of the framed package) change \textwidth, marginnote defines its own text width macro. If you change the text area after \begin{document} you should add \edef\marginnotetextwidth{\the\textwidth} after changing the text area. You may want to do this globally using \xdef instead of \edef. Most users will never need to change \marginnotetextwidth. I've tried adding this line (both with \edef and with \xdef) inside the landscape environment, but it makes no difference. Setting it to \the\linewidth shifts the \marginnote somewhat to the right, but it still overlaps the text. Hardcoding a \marginnotetextwidth of about 332mm inside the landscape environment broadly works in this test example, but I don't understand why, as this is substantially larger than the dimensions of the A4 paper (210mm × 297mm). In cases it matters, I'm using xelatex, but it also happens with pdflatex.
- zref-clever as drop-in replacement for cleverefby Gargantuar on March 5, 2026 at 11:51 am
I'm trying to define a drop-in replacement for cleveref by using zref-clever. There are, however, issues with amsmath's multiple parsing of equation environments and its redefinitions of \label. The MWE \documentclass{article} \usepackage{amsmath} \usepackage{zref-clever} \newcommand{\cref}{\zcref} \newcommand{\Cref}{\zcref[S]} \newcommand{\crefname}[3]{\zcRefTypeSetup{#1}{name-sg=#2, name-pl=#3}} \makeatletter \NewCommandCopy{\my@label}{\label} \RenewDocumentCommand{\label}{om}{\IfValueT{#1}{\zcsetup{reftype=#1}}\my@label{#2}} \makeatother \crefname{eqn}{my eqn}{my eqns} \begin{document} \begin{equation} \label[eqn]{myeqn} \end{equation} \zcref{myeqn} \end{document} gives the following error: ./test.tex:20: Use of \df@label doesn't match its definition. \endmathdisplay@a ... \ltx@label \@xp {\df@label } \fi \fi \ifnum \dspbrk@lvl... l.20 \end{equation} If you say, e.g., `\def\a1{...}', then you must always put `1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. I also tried to append the optional argument, i.e., \label{myeqn}[eqn], but the [eqn] isn't picked up by \label. Any help is greatly appreciated.
- Will MikTex support Apple Aarch64?by Georgie Orman on March 5, 2026 at 10:17 am
I'm currently using MikTeX on my M2 Mac and this past month, a notification has popped-up stating that Apple deprecating support for x86-64 apps on MacOS. Now, from what I understand, MikTeX still does not provide a precompliled binary of MikTeX for Apple aarch64, but is there a timeline for this to be rectified?
- Tikz error on a not-so-old file (once working)by user126154 on March 5, 2026 at 9:00 am
I have an old latex file that in 2019 was perfectly ok. Today (in 2026) I try to compile the source and I get an error ERROR: Package tikz Error: Cannot parse this coordinate. The point in the file where it seems to be an error (according to emacs) is the following scope environment: \foreach\a in{(-30.5,4),(-13,9),(-16.5,-7.5),(34,0),(53,0),(72,0)} { \begin{scope}[shift={\a}] \draw (0,0) to[out=30, in=150] (4,0); \draw (-1,.5) to[out=-30, in=-150] (5,.5); \end{scope} } The weird thing is that file was completely fine and compiling some years ago! I isolated the problem creating a test file \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach\a in{(10,2), (5,-3)} { \begin{scope}[shift={\a}] \draw (0,0) to (2,2); \end{scope} } \end{tikzpicture} \end{document} and I get the same error. So, my question is What's wrong now, and how I can fix it in the current version of tikz?
- Padded page number with hyperrefby Myvh on March 5, 2026 at 8:09 am
My goal is to have zero-padded page numbers in the footer and in the table of contents. I use the code from this answer. However, it breaks with the hyperref package, only when the total page number has one digit, with the following error: test.tex: error: 86: Use of \??? doesn't match its definition. \newpage. I know that the padding is not needed in this case, but I would like the code to be more robust and also to understand why it breaks in that case. Here is a minimal working example. You can comment out/in \manypages to toggle between the code that breaks or not. \documentclass{article} \usepackage{lastpage} \usepackage{fancyhdr} \usepackage{hyperref} \hypersetup{ colorlinks = true, allcolors = blue } % From https://tex.stackexchange.com/a/730655/228589 \ExplSyntaxOn \NewDocumentCommand{\paddedcounter}{m} { \AtBeginDocument { \cs_if_exist:cF {maxdigits#1} { \cs_gset:cpn {maxdigits#1} {8} } } \AtEndDocument { \iow_now:ce {@mainaux} { \token_to_str:N \maxdigits{#1}{\fp_eval:n{logb(\value{#1}+0.1)+1}} } } \cs_gset:cpn {the#1} { \padded{#1} } } \NewDocumentCommand{\maxdigits}{mm} { \cs_gset:cpn {maxdigits#1}{#2} } \NewExpandableDocumentCommand{\padded}{m} { \prg_replicate:nn { \use:c { maxdigits#1 } - \tl_count:e { \arabic{#1} } } { 0 } \arabic{#1} } \ExplSyntaxOff \paddedcounter{page} \pagestyle{fancy} \fancyhead{} \renewcommand{\headrulewidth}{0pt} \fancyfoot[C]{\thepage\ / \pageref*{LastPage}} \newcommand{\manypages} { \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage \section{Some section} \newpage } \begin{document} \thispagestyle{fancy} \begin{center} {\Huge Some title} \end{center} \tableofcontents \newpage \manypages \end{document}
- An error with `tlmgr update --all` with TL2026?by Explorer on March 5, 2026 at 6:45 am
I was not sure whether the case related to this post (fixed seemly in the comment) and the discussion. I run the tlmgr update --self and tlmgr update --all, here below is the terminal output (full version pastebin): tlmgr update --all tlmgr.pl: package repository https://mirrors.bfsu.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable) =============================================================================== tlmgr itself needs to be updated. Please do this via either tlmgr update --self or by getting the latest updater for Unix-ish systems: https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh and/or Windows systems: https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.exe Then continue with other updates as usual. =============================================================================== tlmgr.pl: An error has occurred. See above messages. Exiting. tlmgr update --self tlmgr.pl: package repository https://mirrors.sjtug.sjtu.edu.cn/ctan/systems/texlive/tlnet (not verified: gpg unavailable) tlmgr.pl: saving backups to C:/texlive/2026/tlpkg/backups tlmgr.pl: Preparing TeX Live infrastructure update... tlmgr.pl: warning: backup option not implemented for infrastructure update on Windows; continuing anyway. DO NOT CLOSE THIS WINDOW! TeX Live infrastructure update in progress ... Detailed command logging to "C:\texlive\2026\temp\update-self.log" self update: texlive.infra (77655 -> 78218) texlive.infra.windows (77627 -> 77973) tlperl.windows (74256 -> 77975) Infrastructure update finished successfully. You may now close this window. tlmgr update --all tlmgr.pl: package repository https://mirrors.nju.edu.cn/CTAN/systems/texlive/tlnet (not verified: gpg unavailable) tlmgr.pl: saving backups to C:/texlive/2026/tlpkg/backups [ 1/355] auto-remove: sourceserifpro ... done [ 2/355] auto-remove: sourcesanspro ... done [ 3/355, ??:??/??:??] update: acronym [334k] (73491 -> 78101) ... done [ 4/355, 00:02/55:34] update: adforn [573k] (77682 -> 78142) ... done ... ignore some lines [291/355, 10:08/11:53] update: texlive-scripts [563k] (77932 -> 78266) ... TeXLive::TLUtils::check_file_and_remove: checksums differ for C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\JpoWEm3BT3/texlive-scripts.tar.xz: TeXLive::TLUtils::check_file_and_remove: tlchecksum=a26fa38b9c0d14d23480370eff6d315fb619c59a1132efd3c8e6ce745665327fcf5cfa47ecf9ed0477122a5066f62329d2396b471d6d3fee195b5876c0c63b80, arg=72fe99d15ea55e6a91936fea0ee4f7449fdbb98982292393728d03359ffa6f03a42c6a7db45511e0fb5aed1fe6aa854889bf86c5289d7e061e5f52cc282ae612 TeXLive::TLUtils::check_file_and_remove: backtrace: -> C:/texlive/2026/tlpkg/TeXLive/TLUtils.pm:2773: TeXLive::TLUtils::check_file_and_remove -> C:/texlive/2026/tlpkg/TeXLive/TLPDB.pm:1989: TeXLive::TLUtils::unpack -> C:/texlive/2026/tlpkg/TeXLive/TLPDB.pm:1806: TeXLive::TLPDB::_install_data -> C:/texlive/2026/tlpkg/TeXLive/TLPDB.pm:1722: TeXLive::TLPDB::not_virtual_install_package -> C:\texlive\2026\texmf-dist\scripts\texlive\tlmgr.pl:3499: TeXLive::TLPDB::install_package -> C:\texlive\2026\texmf-dist\scripts\texlive\tlmgr.pl:812: main::action_update -> C:\texlive\2026\texmf-dist\scripts\texlive\tlmgr.pl:718: main::execute_action -> C:\texlive\2026\texmf-dist\scripts\texlive\tlmgr.pl:376: main::main TeXLive::TLUtils::check_file_and_remove: removing C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\JpoWEm3BT3/texlive-scripts.tar.xz, but saving copy in C:\Users\Kasmir\AppData\Local\Temp\iZ5Ey6CKT1 TLPDB::_install_data: downloading did not succeed (check_file_and_remove failed) for https://mirrors.nju.edu.cn/CTAN/systems/texlive/tlnet/archive/texlive-scripts.tar.xz tlmgr.pl: Installation of new version of texlive-scripts failed, trying to unwind. tlmgr.pl: Restoring old package state succeeded. done [292/355, 10:09/11:54] update: texlive-scripts-extra.windows [5k] (77627 -> 77973) ... done ... ingore some lines [355/355, 11:50/11:50] update: collection-latexextra [8k] (77812 -> 78263) ... done tlmgr.pl: action update returned an error; continuing. running mktexlsr ... done running mktexlsr. running updmap-sys ... done running updmap-sys. regenerating language.dat regenerating language.def regenerating language.dat.lua regenerating fmtutil.cnf in C:/texlive/2026/texmf-dist running fmtutil-sys --byengine hitex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex running fmtutil-sys --byengine euptex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex running fmtutil-sys --byengine luahbtex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex running fmtutil-sys --byengine tex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex running fmtutil-sys --byengine xetex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex running fmtutil-sys --byengine aleph --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph running fmtutil-sys --byengine pdftex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph pdftex.fmt/pdftex mex.fmt/pdftex pdfcsplain.fmt/pdftex utf8mex.fmt/pdftex xmltex.fmt/pdftex pdfmex.fmt/pdftex pdflatex-dev.fmt/pdftex pdfxmltex.fmt/pdftex jadetex.fmt/pdftex pdfjadetex.fmt/pdftex cont-en.fmt/pdftex texsis.fmt/pdftex mllatex.fmt/pdftex etex.fmt/pdftex pdfetex.fmt/pdftex latex-dev.fmt/pdftex amstex.fmt/pdftex latex.fmt/pdftex pdflatex.fmt/pdftex eplain.fmt/pdftex csplain.fmt/pdftex mptopdf.fmt/pdftex mltex.fmt/pdftex running fmtutil-sys --byengine luatex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph pdftex.fmt/pdftex mex.fmt/pdftex pdfcsplain.fmt/pdftex utf8mex.fmt/pdftex xmltex.fmt/pdftex pdfmex.fmt/pdftex pdflatex-dev.fmt/pdftex pdfxmltex.fmt/pdftex jadetex.fmt/pdftex pdfjadetex.fmt/pdftex cont-en.fmt/pdftex texsis.fmt/pdftex mllatex.fmt/pdftex etex.fmt/pdftex pdfetex.fmt/pdftex latex-dev.fmt/pdftex amstex.fmt/pdftex latex.fmt/pdftex pdflatex.fmt/pdftex eplain.fmt/pdftex csplain.fmt/pdftex mptopdf.fmt/pdftex mltex.fmt/pdftex luatex.fmt/luatex dvilualatex.fmt/luatex dvilualatex-dev.fmt/luatex dviluatex.fmt/luatex luacsplain.fmt/luatex pdfcsplain.fmt/luatex running fmtutil-sys --byengine luajithbtex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph pdftex.fmt/pdftex mex.fmt/pdftex pdfcsplain.fmt/pdftex utf8mex.fmt/pdftex xmltex.fmt/pdftex pdfmex.fmt/pdftex pdflatex-dev.fmt/pdftex pdfxmltex.fmt/pdftex jadetex.fmt/pdftex pdfjadetex.fmt/pdftex cont-en.fmt/pdftex texsis.fmt/pdftex mllatex.fmt/pdftex etex.fmt/pdftex pdfetex.fmt/pdftex latex-dev.fmt/pdftex amstex.fmt/pdftex latex.fmt/pdftex pdflatex.fmt/pdftex eplain.fmt/pdftex csplain.fmt/pdftex mptopdf.fmt/pdftex mltex.fmt/pdftex luatex.fmt/luatex dvilualatex.fmt/luatex dvilualatex-dev.fmt/luatex dviluatex.fmt/luatex luacsplain.fmt/luatex pdfcsplain.fmt/luatex luajithbtex.fmt/luajithbtex running fmtutil-sys --byengine luajittex --no-error-if-no-format --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph pdftex.fmt/pdftex mex.fmt/pdftex pdfcsplain.fmt/pdftex utf8mex.fmt/pdftex xmltex.fmt/pdftex pdfmex.fmt/pdftex pdflatex-dev.fmt/pdftex pdfxmltex.fmt/pdftex jadetex.fmt/pdftex pdfjadetex.fmt/pdftex cont-en.fmt/pdftex texsis.fmt/pdftex mllatex.fmt/pdftex etex.fmt/pdftex pdfetex.fmt/pdftex latex-dev.fmt/pdftex amstex.fmt/pdftex latex.fmt/pdftex pdflatex.fmt/pdftex eplain.fmt/pdftex csplain.fmt/pdftex mptopdf.fmt/pdftex mltex.fmt/pdftex luatex.fmt/luatex dvilualatex.fmt/luatex dvilualatex-dev.fmt/luatex dviluatex.fmt/luatex luacsplain.fmt/luatex pdfcsplain.fmt/luatex luajithbtex.fmt/luajithbtex luajittex.fmt/luajittex running fmtutil-sys --byfmt mf --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph pdftex.fmt/pdftex mex.fmt/pdftex pdfcsplain.fmt/pdftex utf8mex.fmt/pdftex xmltex.fmt/pdftex pdfmex.fmt/pdftex pdflatex-dev.fmt/pdftex pdfxmltex.fmt/pdftex jadetex.fmt/pdftex pdfjadetex.fmt/pdftex cont-en.fmt/pdftex texsis.fmt/pdftex mllatex.fmt/pdftex etex.fmt/pdftex pdfetex.fmt/pdftex latex-dev.fmt/pdftex amstex.fmt/pdftex latex.fmt/pdftex pdflatex.fmt/pdftex eplain.fmt/pdftex csplain.fmt/pdftex mptopdf.fmt/pdftex mltex.fmt/pdftex luatex.fmt/luatex dvilualatex.fmt/luatex dvilualatex-dev.fmt/luatex dviluatex.fmt/luatex luacsplain.fmt/luatex pdfcsplain.fmt/luatex luajithbtex.fmt/luajithbtex luajittex.fmt/luajittex mf.fmt/mf-nowin running fmtutil-sys --byhyphen "language.dat" --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph pdftex.fmt/pdftex mex.fmt/pdftex pdfcsplain.fmt/pdftex utf8mex.fmt/pdftex xmltex.fmt/pdftex pdfmex.fmt/pdftex pdflatex-dev.fmt/pdftex pdfxmltex.fmt/pdftex jadetex.fmt/pdftex pdfjadetex.fmt/pdftex cont-en.fmt/pdftex texsis.fmt/pdftex mllatex.fmt/pdftex etex.fmt/pdftex pdfetex.fmt/pdftex latex-dev.fmt/pdftex amstex.fmt/pdftex latex.fmt/pdftex pdflatex.fmt/pdftex eplain.fmt/pdftex csplain.fmt/pdftex mptopdf.fmt/pdftex mltex.fmt/pdftex luatex.fmt/luatex dvilualatex.fmt/luatex dvilualatex-dev.fmt/luatex dviluatex.fmt/luatex luacsplain.fmt/luatex pdfcsplain.fmt/luatex luajithbtex.fmt/luajithbtex luajittex.fmt/luajittex mf.fmt/mf-nowin pdflatex-dev.fmt/pdftex latex-dev.fmt/pdftex uplatex.fmt/euptex lualatex.fmt/luahbtex platex.fmt/euptex latex.fmt/pdftex pdfxmltex.fmt/pdftex platex-dev.fmt/euptex dvilualatex-dev.fmt/luatex uplatex-dev.fmt/euptex xelatex.fmt/xetex pdfjadetex.fmt/pdftex lualatex-dev.fmt/luahbtex eplain.fmt/pdftex xelatex-dev.fmt/xetex pdflatex.fmt/pdftex jadetex.fmt/pdftex mllatex.fmt/pdftex dvilualatex.fmt/luatex xmltex.fmt/pdftex running fmtutil-sys --byhyphen "language.def" --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph pdftex.fmt/pdftex mex.fmt/pdftex pdfcsplain.fmt/pdftex utf8mex.fmt/pdftex xmltex.fmt/pdftex pdfmex.fmt/pdftex pdflatex-dev.fmt/pdftex pdfxmltex.fmt/pdftex jadetex.fmt/pdftex pdfjadetex.fmt/pdftex cont-en.fmt/pdftex texsis.fmt/pdftex mllatex.fmt/pdftex etex.fmt/pdftex pdfetex.fmt/pdftex latex-dev.fmt/pdftex amstex.fmt/pdftex latex.fmt/pdftex pdflatex.fmt/pdftex eplain.fmt/pdftex csplain.fmt/pdftex mptopdf.fmt/pdftex mltex.fmt/pdftex luatex.fmt/luatex dvilualatex.fmt/luatex dvilualatex-dev.fmt/luatex dviluatex.fmt/luatex luacsplain.fmt/luatex pdfcsplain.fmt/luatex luajithbtex.fmt/luajithbtex luajittex.fmt/luajittex mf.fmt/mf-nowin pdflatex-dev.fmt/pdftex latex-dev.fmt/pdftex uplatex.fmt/euptex lualatex.fmt/luahbtex platex.fmt/euptex latex.fmt/pdftex pdfxmltex.fmt/pdftex platex-dev.fmt/euptex dvilualatex-dev.fmt/luatex uplatex-dev.fmt/euptex xelatex.fmt/xetex pdfjadetex.fmt/pdftex lualatex-dev.fmt/luahbtex eplain.fmt/pdftex xelatex-dev.fmt/xetex pdflatex.fmt/pdftex jadetex.fmt/pdftex mllatex.fmt/pdftex dvilualatex.fmt/luatex xmltex.fmt/pdftex euptex.fmt/euptex hitex.fmt/hitex xetex.fmt/xetex luajittex.fmt/luajittex luatex.fmt/luatex pdftex.fmt/pdftex luajithbtex.fmt/luajithbtex luahbtex.fmt/luahbtex dviluatex.fmt/luatex etex.fmt/pdftex eptex.fmt/euptex pdfetex.fmt/pdftex running fmtutil-sys --byhyphen "language.dat.lua" --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=C:\Users\Kasmir\AppData\Local\Temp\cOKvu61Iai\J2FWOF8Vby ... OK: hitex.fmt/hitex euptex.fmt/euptex platex-dev.fmt/euptex uptex.fmt/euptex uplatex.fmt/euptex ptex.fmt/euptex platex.fmt/euptex uplatex-dev.fmt/euptex eptex.fmt/euptex luahbtex.fmt/luahbtex lualatex-dev.fmt/luahbtex lualatex.fmt/luahbtex optex.fmt/luahbtex tex.fmt/tex lollipop.fmt/tex xetex.fmt/xetex xelatex-dev.fmt/xetex pdfcsplain.fmt/xetex cont-en.fmt/xetex xelatex.fmt/xetex aleph.fmt/aleph pdftex.fmt/pdftex mex.fmt/pdftex pdfcsplain.fmt/pdftex utf8mex.fmt/pdftex xmltex.fmt/pdftex pdfmex.fmt/pdftex pdflatex-dev.fmt/pdftex pdfxmltex.fmt/pdftex jadetex.fmt/pdftex pdfjadetex.fmt/pdftex cont-en.fmt/pdftex texsis.fmt/pdftex mllatex.fmt/pdftex etex.fmt/pdftex pdfetex.fmt/pdftex latex-dev.fmt/pdftex amstex.fmt/pdftex latex.fmt/pdftex pdflatex.fmt/pdftex eplain.fmt/pdftex csplain.fmt/pdftex mptopdf.fmt/pdftex mltex.fmt/pdftex luatex.fmt/luatex dvilualatex.fmt/luatex dvilualatex-dev.fmt/luatex dviluatex.fmt/luatex luacsplain.fmt/luatex pdfcsplain.fmt/luatex luajithbtex.fmt/luajithbtex luajittex.fmt/luajittex mf.fmt/mf-nowin pdflatex-dev.fmt/pdftex latex-dev.fmt/pdftex uplatex.fmt/euptex lualatex.fmt/luahbtex platex.fmt/euptex latex.fmt/pdftex pdfxmltex.fmt/pdftex platex-dev.fmt/euptex dvilualatex-dev.fmt/luatex uplatex-dev.fmt/euptex xelatex.fmt/xetex pdfjadetex.fmt/pdftex lualatex-dev.fmt/luahbtex eplain.fmt/pdftex xelatex-dev.fmt/xetex pdflatex.fmt/pdftex jadetex.fmt/pdftex mllatex.fmt/pdftex dvilualatex.fmt/luatex xmltex.fmt/pdftex euptex.fmt/euptex hitex.fmt/hitex xetex.fmt/xetex luajittex.fmt/luajittex luatex.fmt/luatex pdftex.fmt/pdftex luajithbtex.fmt/luajithbtex luahbtex.fmt/luahbtex dviluatex.fmt/luatex etex.fmt/pdftex eptex.fmt/euptex pdfetex.fmt/pdftex setting up ConTeXt caches: running mtxrun --generate ...done done running mtxrun --generate. running mtxrun --luatex --generate ...done done running mtxrun --luatex --generate. tlmgr.pl: package log updated: C:/texlive/2026/texmf-var/web2c/tlmgr.log tlmgr.pl: command log updated: C:/texlive/2026/texmf-var/web2c/tlmgr-commands.log tlmgr.pl: An error has occurred. See above messages. Exiting. At the end, it complained that : tlmgr.pl: An error has occurred. See above messages. Exiting. And I found that: tlmgr.pl: action update returned an error; continuing. I wonder what happened with my machine, and how to fix this?
- Fadings and shadings with shifted origins for strokes in TikZby karlh on March 4, 2026 at 11:59 pm
I have been working with fadings a lot recently, and I encountered a fading in Inkscape that I'm having trouble translating to an equivalent TikZ implementation. The situation is a faded stroke for which the fading boundaries do not coincide with the outline of the shape, and the "center" of the fading is not the center of the object. I have worked out a method that works for filled paths, such as: \begin{tikzpicture} \path [fill=orange,path fading=fade right] (0,0) rectangle (2,2); \draw [very thin,->] (0,1) -- (2,1); \begin{scope} \clip (0,-3) rectangle (2,-1); \fill [orange] (-1,-4) rectangle (1.02,0); \path [fill=orange,path fading=fade right] (1,-3) rectangle (2.5,0); \end{scope} \draw [overlay,very thin,->] (1,-2) -- (3,-2); \end{tikzpicture} where the arrow indicates the start and end points of the shading (equivalent to what you would see with Inkscape's node tool). Similarly, the shading can be rotated with a similar shift in origin like so: \begin{tikzpicture} \path [fill=orange,path fading=fade right,fading angle=30] (0,0) rectangle (2,2); \draw [very thin,->] (0.133974,0.5) -- ++(30:2); \begin{scope} \clip (0,-3) rectangle (2,-1); \begin{scope}[transform canvas={rotate around={30:(1,-2)}}] \fill [orange] (-3,-4) rectangle (1.02,0); \path [fill=orange,path fading=fade right] (1,-4) rectangle (2,0); \end{scope} \end{scope} \draw [overlay,very thin,->] (1,-2) -- ++(30:2); \end{tikzpicture} This works fine for filled regions that are to be shaded or faded. However, the same trick—filling a larger object and then clipping—will not work with strokes that are to be shaded or faded. Is there a way to tell TikZ that the origin of the shading should be different than the bounding box of the object? It would also be desirable for the resulting line to be solid even if it goes off the "edge" of the square that defines the fading. I have also had trouble with faded strokes (without origin translation) not appearing in the PDF, but from a post I found while researching this, the issue is a PDF viewer issue (i.e., Evince and Papers display faded strokes incorrectly, but they show up correctly in MuPDF, say); if there is a way to avoid that problem, great, but otherwise I will chalk that up to "not a TikZ problem." The result should look something like this: Here's the whole thing, with headers: \documentclass{article} \usepackage{tikz} \usetikzlibrary{fadings} \tikzfading[name=fade right,left color=transparent!0,right color=transparent] \begin{document} I have been working with fadings a lot recently, and I encountered a fading in Inkscape that I'm having trouble translating to an equivalent Ti*k*Z implementation. The situation is a faded *stroke* for which the fading boundaries do not coincide with the outline of the shape. I have worked out a method that works for *filled* paths, such as: \begin{center} \begin{tikzpicture} \path [fill=orange,path fading=fade right] (0,0) rectangle (2,2); \draw [very thin,->] (0,1) -- (2,1); \begin{scope} \clip (0,-3) rectangle (2,-1); \fill [orange] (-1,-4) rectangle (1.02,0); \path [fill=orange,path fading=fade right] (1,-3) rectangle (2.5,0); \end{scope} \draw [overlay,very thin,->] (1,-2) -- (3,-2); \end{tikzpicture} \end{center} where the arrow indicates the start and end points of the shading (equivalent to what you would see with Inkscape's node tool). Similarly, the shading can be *rotated* with a similar shift in origin like so: \begin{center} \begin{tikzpicture} \path [fill=orange,path fading=fade right,fading angle=30] (0,0) rectangle (2,2); \draw [very thin,->] (0.133974,0.5) -- ++(30:2); \begin{scope} \clip (0,-3) rectangle (2,-1); \begin{scope}[transform canvas={rotate around={30:(1,-2)}}] \fill [orange] (-3,-4) rectangle (1.02,0); \path [fill=orange,path fading=fade right] (1,-4) rectangle (2,0); \end{scope} \end{scope} \draw [overlay,very thin,->] (1,-2) -- ++(30:2); \end{tikzpicture} \end{center} \end{document}
- Two books in a single document, how to get a TOC for the second book only?by Gary on March 4, 2026 at 9:50 pm
I'm trying to combine two books into a single document, having in the first front matter a full TOC and in the second front matter a TOC of only the second book. (I thought I read this somewhere but cannot locate where, or I'm mistaken and it applied only to a TOC under some document level rather than two sets of front matter. I found the context garden section of project structures under the TOC but don't understand how that works for document levels rather than components.) Is this possible or must the document structure be changed somehow to denote a grouping of a front matter and its body matter? In the second example below, I tried defining a section block for a book level and placed each pair of front matter and body matter within one, but still haven't figured out how to get the second table of contents for that book only; and it generates an unwanted empty page at the book level before the front matter. Perhaps the first question is, What is the proper way to combined two books like this into a single document?, and the second, How to get the second TOC of the second book only? Thank you. \starttext \startfrontmatter[page=yes] \completecontent[criterium=all] \startchapter[title={Preface Book 1},list={Preface Book 1}] Preface Front matter 1. \stopchapter \stopfrontmatter \startbodymatter[page=yes] \startchapter[title={Book 1 Chapter 1},list={Book 1 Chapter 1}] Body matter 2 Chapter 1. \stopchapter \startchapter[title={Book 1 Chapter 2},list={Book 1 Chapter 2}] Body matter 2 Chapter 2. \stopchapter \stopbodymatter \startfrontmatter[page=right] \completecontent[criterium=chapter] \startchapter[title={Preface Book 2},list={Preface Book 2}] Preface Front matter 2. \stopchapter \stopfrontmatter \startbodymatter[page=yes] \startchapter[title={Book 2 Chapter 1},list={Book 2 Chapter 1}] Body matter 2 Chapter 1. \stopchapter \startchapter[title={Book 2 Chapter 2},list={Book 2 Chapter 2}] Body matter 2 Chapter 2. \stopchapter \stopbodymatter \stoptext Second attempt \definesectionblock[Bookmatter][Bookmatter][page=no] \definehead[Book][part][ header=empty, footer=empty, number=no, ] \setupcombinedlist[content][list={Book,chapter},alternative=c,] \starttext \startBookmatter \startBook[list={Book 1}] \startfrontmatter[page=yes] \completecontent[criterium=all] \startchapter[title={Preface Book 1},list={Preface Book 1}] Preface Front matter 1. \stopchapter \stopfrontmatter \startbodymatter[page=yes] \startchapter[title={Book 1 Chapter 1},list={Book 1 Chapter 1}] Body matter 2 Chapter 1. \stopchapter \startchapter[title={Book 1 Chapter 2},list={Book 1 Chapter 2}] Body matter 2 Chapter 2. \stopchapter \stopbodymatter \stopBook \stopBookmatter \startBookmatter \startBook[title={Book 2},list={Book 2}] \startfrontmatter[page=right] \completecontent[criterium=chapter] \startchapter[title={Preface Book 2},list={Preface Book 2}] Preface Front matter 2. \stopchapter \stopfrontmatter \startbodymatter[page=yes] \startchapter[title={Book 2 Chapter 1},list={Book 2 Chapter 1}] Body matter 2 Chapter 1. \stopchapter \startchapter[title={Book 2 Chapter 2},list={Book 2 Chapter 2}] Body matter 2 Chapter 2. \stopchapter \stopbodymatter \stopBook \stopBookmatter \stoptext
- `\textwidth` not long enoughby user145836 on March 4, 2026 at 6:45 pm
Simple \maketitle and section modifications \usepackage{titling} \setlength{\fboxsep}{0em} \setlength{\fboxrule}{2pt} \renewcommand{\maketitle}{ \fbox{ \begin{minipage}{\textwidth} \centering \par\vskip1em\noindent {\LARGE\bf\sc \thetitle} \par\vskip0.5em\noindent {\large\sc \theauthor} \par\vskip1em\noindent \end{minipage} }} \usepackage{titlesec} \titleformat{\section}[block]{\scshape\large}{}{0em}{}[\hrule width \textwidth] do not align (on the right). It seems that \textwith is not wide enough. The same goes when using \titlerule. Why?
- Drawing a tank consisting of a cylinder topped with a hemisphere of the same radiusby Dimitrios ANAGNOSTOU on March 4, 2026 at 2:25 pm
I’m working on a visualization to accompany a math problem: "A water tank consists of a cylindrical part with radius r and height h, topped with a hemispherical dome. The tank must be built to hold 600 m³ when full. (...)" After a lot of searching and experimenting, here is my current TikZ attempt: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{shapes.geometric} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \node (a) [cylinder, shape border rotate=90, draw, minimum height=15mm, minimum width=7.5mm] {}; \draw [<->] ([xshift=5pt]a.before bottom) -- ([xshift=5pt]a.after top) node [midway, right] {$h$}; \draw [<->] ([yshift=-5pt]a.bottom) -- ([yshift=-5pt]a.bottom -| a.before bottom) node [midway, below] {$r$}; % Define origin \coordinate (O) at (a.center); % Define h and r \def\h{15mm} \def\r{3.75mm} % Move to center (0,h/2,0) \coordinate (C) at ($(O)+(0,\h/2)$); % Hemicircle (upper half) \draw (C) ++(-\r,0) arc (180:0:\r); %% Coordinate system (centered at node center) %\draw[-latex, dashed] (a.center) -- ++(1.8,0) node[right] {$x$}; %\draw[-latex, dashed] (a.center) -- ++(0,1.8) node[above] {$y$}; %\draw[-latex, dashed] (a.center) -- ++(-1.2,-1.2) node[below left] {$z$}; % %\node[left] at (O) {$O$}; \end{tikzpicture} \end{document} My questions: How can I make the back part of the hemisphere (as indicated by the red arrow above) a dashed curve, like a true 3D effect? Is it possible to add some shading or filling to better suggest depth, without complicating my code?
- Luatex - Coloring Harakaby Mario Fischer on March 4, 2026 at 6:08 am
I want to colour the harakat (diacritics) of a text in Pashto. I use Luatex, and I want to switch this function on and off. It should look like I tried this code: \documentclass{article} \usepackage{fontspec} \usepackage{xcolor} \usepackage{luacolor} \usepackage[bidi=basic]{babel} % Setup Arabic language \babelprovide[import, main]{arabic} % THE FIX: Use Renderer=Node instead of Harfbuzz \babelfont{rm}[Renderer=Node]{Amiri} % 1. The Lua Script \directlua{ harakat_attr_val = nil local luacolor_attr = luatexbase.attributes['luacolor'] local function color_harakat(head) if not harakat_attr_val then return head end for item in node.traverse_id(node.id("glyph"), head) do local char = item.char -- Unicode range for Arabic harakat (0x064B to 0x065F) -- and the superscript Alef (0x0670) if (char >= 0x064B and char <= 0x065F) or char == 0x0670 then node.set_attribute(item, luacolor_attr, harakat_attr_val) end end return head end % Add the filter so it runs before the font shaper luatexbase.add_to_callback("pre_linebreak_filter", color_harakat, "color_harakat") } % 2. Custom command to safely set the Harakat color \makeatletter \newcommand{\setHarakatColor}[1]{% \begingroup \color{#1}% \directlua{ harakat_attr_val = tex.attribute[luatexbase.attributes['luacolor']] }% \endgroup } \makeatother \begin{document} \begin{center} \Huge % Tell LuaTeX to color all following harakat Red \setHarakatColor{red} بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ \vspace{1cm} % Switch to blue! \setHarakatColor{blue} بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ \end{center} \end{document} But it is not coloring. What might be the problem, or is there an easy option in Luatex?
- TikZ: How to add a node where a path gets clippedby Edoardo Serra on March 3, 2026 at 3:07 pm
I am designing a square (or “squarish” actually) map protractor in TikZ. So far, I have managed to draw the degree ticks along the four sides by clipping radial lines between two closed paths using the even odd rule like I saw in this answer. The ticks are generated in a \foreach loop. To avoid drawing long ticks on top of short ones, I separated them into two loops using a conditional test. I am not sure whether this separation is actually necessary for correct SVG export/printing, but that is how I implemented it. Below is a MWE: \documentclass[tikz]{standalone} %,convert={outfile=\main.svg} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{intersections, pgfplots.fillbetween} \pgfdeclarelayer{pre main} \pgfdeclarelayer{main} \pgfsetlayers{pre main, main} \usetikzlibrary{shapes} \begin{document} %all of this is needed to easily clip between two closed paths using even odd rule \makeatletter \def\@appendnamedsoftpath#1{% \pgfsyssoftpath@getcurrentpath\@temppatha \expandafter\let\expandafter\@temppathb\csname tikz@intersect@path@name@#1\endcsname \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\@temppatha\expandafter\expandafter\expandafter{\expandafter\@temppatha\@temppathb}% \pgfsyssoftpath@setcurrentpath\@temppatha } \def\@appendnamedpathforactions#1{% \pgfsyssoftpath@getcurrentpath\@temppatha \expandafter\let\expandafter\@temppathb\csname tikz@intersect@path@name@#1\endcsname \expandafter\def\expandafter\@temppatha\expandafter{\csname @temppatha\expandafter\endcsname\@temppathb}% \let\tikz@actions@path\@temppatha } \tikzset{ use path for main/.code={% \tikz@addmode{% \expandafter\pgfsyssoftpath@setcurrentpath\csname tikz@intersect@path@name@#1\endcsname }% }, append path for main/.code={% \tikz@addmode{% \@appendnamedsoftpath{#1}% }% }, use path for actions/.code={% \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\expandafter\let\expandafter\tikz@actions@path\csname tikz@intersect@path@name@#1\endcsname}% }, append path for actions/.code={% \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions \@appendnamedpathforactions{#1}}% }, use path/.style={% use path for main=#1, use path for actions=#1, }, append path/.style={% append path for main=#1, append path for actions=#1 } } \makeatother \begin{tikzpicture} \pgfmathsetmacro\bigside{7} \pgfmathsetmacro\smallsidedelta{0.5} %cuts \draw[rounded corners=12pt, name path=outside] (0,0) rectangle (\bigside,\bigside); \draw[dotted, rounded corners=12pt, name path=inside] (\smallsidedelta,\smallsidedelta) rectangle (\bigside-\smallsidedelta,\bigside-\smallsidedelta); %remove before cutting or printign. Just as reference grid %backside print \tikzfillbetween[of=inside and outside] {white}; %print on transparent plastic so this is needed for better readability %frontside print \pgfmathsetmacro\degreesmallticksize{0.2} \pgfmathsetmacro\degreemidticksize{0.35} \pgfmathsetmacro\outerradius{sqrt(2*\bigside/2*\bigside/2)} \path[rounded corners=12pt, name path=degrees short] (\degreesmallticksize,\degreesmallticksize) rectangle (\bigside-\degreesmallticksize,\bigside-\degreesmallticksize); \path[rounded corners=12pt, name path=degrees mid] (\degreemidticksize,\degreemidticksize) rectangle (\bigside-\degreemidticksize,\bigside-\degreemidticksize); \begin{scope} [even odd rule] %small ticks \clip[use path=outside, append path=degrees short]; \foreach \deg in {0, ..., 359} { \pgfmathsetmacro\degmod{mod(\deg,5)} \pgfmathtruncatemacro{\itest}{ifthenelse(\degmod==0,1,0)} \ifnum\itest=0 \draw[thin] (\bigside/2,\bigside/2) -- ({\bigside/2+\outerradius*cos(\deg)},{\bigside/2+\outerradius*sin(\deg)}); \fi } \end{scope} %had to add a second scope and for loop since the clipped area is different \begin{scope} [even odd rule] %mid ticks \clip[use path=outside, append path=degrees mid]; \foreach \deg in {0, ..., 359} { \pgfmathsetmacro\degmod{mod(\deg,5)} \pgfmathtruncatemacro{\itest}{ifthenelse(\degmod==0,1,0)} \ifnum\itest=1 \draw[thick] (\bigside/2,\bigside/2) -- ({\bigside/2+\outerradius*cos(\deg)},{\bigside/2+\outerradius*sin(\deg)}); \fi } \end{scope} \end{tikzpicture} \end{document} And the output is the following: I would now like to add a label at the inner end of each thick (5°) tick, displaying the corresponding degree value (0–355), like this: Now a few nuances: The numbers must always face towards the inside, with the exception, if possible, of the bottom row of numbers from 135° to 225°. When numbers get big, they don't have enough space to fit unless the labels become too small to read (actual printing size of the protractor will be something like 7x7 or 8x8cm). So they need to be shifted in such a way that they fit. 355 in the provided image is a clear example of what I mean. I can consider shifting them radially as well, but they need to stay to the outside of the dotted line, which I can make a little smaller. I really don't know where to start and didn't manage to find anything online. Thank you for your time!