Week
- pin to some point on an arrowby Zarko on December 10, 2025 at 1:52 pm
Please consider the following MWE: \documentclass[tikz,border=3mm]{standalone} %---------------------------------------------------------------% \begin{document} %---------------------------------------------------------------% \begin{tikzpicture}[every pin edge/.style={<-, red}] \draw[->] (0, 1) -- (3,1); \draw[->] (0,0) -- (3,0) coordinate [pos=0.25, pin=210:X] (aux); \end{tikzpicture} %---------------------------------------------------------------% \end{document} Why the arrow head at the second line is moved to the point of pin position?
- Citations with the changes packageby Antonio Sesto on December 10, 2025 at 10:24 am
I am using the packages changes for tracking updates to a shared .tex document, but I get errors caused by the \cite command. Consider this .tex file: \documentclass{article} \usepackage{cite} \usepackage{changes} \definechangesauthor[name=X, color=red]{X} \begin{document} \deleted[id=X]{This citation causes the error~\cite{a,b}} \begin{thebibliography}{100} \bibitem{a} Author A \textit{Title A}, 2000. \bibitem{b} Author B \textit{Title B}, 3000. \end{thebibliography} \end{document} It does not compile due to \cite{a,b}. The error is: \UL@stop ...alty \ifnum \lastkern =\thr@@ \egroup \egroup \ifdim \wd \UL@box... l.8 ...{This citation causes the error~\cite{a,b}} I've deleted a group-closing symbol because it seems to be spurious, as in `$x}$'. But perhaps the } is legitimate and you forgot something else, as in `\hbox{$x}'. In such cases the way to recover is to insert both the forgotten and the deleted material, e.g., by typing `I$}' I have tried some solutions found here and there: 1. Use the package ulem: \documentclass{article} \usepackage{cite} \usepackage[normalem]{ulem} \usepackage{changes} \setdeletedmarkup{\textcolor{red}{\sout{#1}}} \definechangesauthor[name=X, color=red]{X} \begin{document} \deleted[id=X]{This citation causes the error~\protect\cite{a,b}} \begin{thebibliography}{100} \bibitem{a} Author A \textit{Title A}, 2000. \bibitem{b} Author B \textit{Title B}, 3000. \end{thebibliography} \end{document} The error stays the same as before. The order of inclusion between changes and ulem has no influence on the error. 2. Protect the \cite command: Using this line: \deleted[id=X]{This citation causes the error~\protect\cite{a,b}} Nothing changes, same error. I have tried other random solutions without success. I was able to get rid of the error by: NOT including the package cite using ~\cite{a}~\cite{b} in place of ~\cite{a,b}: \documentclass{article} \usepackage{changes} \definechangesauthor[name=X, color=red]{X} \begin{document} \deleted[id=X]{This citation causes the error~\cite{a}~\cite{b}} \begin{thebibliography}{100} \bibitem{a} Author A \textit{Title A}, 2000. \bibitem{b} Author B \textit{Title B}, 3000. \end{thebibliography} \end{document} This code compiles with no errors. Clearly, there is no point in using changes if the old text must be modified. Is there a way to use changes when the source code contains \cite{a,b} or similar commands? Using natbib is not an option.
- nicematrix - Auto fill subblocksby projetmbc on December 10, 2025 at 9:16 am
I would like to factorize the code to avoid to manually type the a's, b's and m's. Is it possible? \documentclass{standalone} \usepackage{nicematrix} \usepackage[svgnames]{xcolor} \begin{document} $\begin{NiceArray}{ccccccccc}[cell-space-limits=2pt] &&&& & b_{11} & b_{12} & \Cdots & b_{1r} \\[5pt] &&&& & b_{21} & b_{22} & \Cdots & b_{2r} \\[5pt] &&&& & \Vdots & \Vdots && \Vdots \\[5pt] &&&& & b_{p1} & b_{p2} & \Cdots & b_{pr} \\%[5pt] \\%[5pt] a_{11} & a_{12} & \Cdots & a_{1p} & \hspace{20pt} & m_{11} & m_{12} & \Cdots & m_{1r} \\[5pt] a_{21} & a_{22} & \Cdots & a_{2p} & & m_{21} & m_{22} & \Cdots & m_{2r} \\[5pt] \Vdots & \Vdots && \Vdots & & \Vdots & \Vdots && \Vdots \\[5pt] a_{n1} & a_{n2} & \Cdots & a_{np} & & m_{n1} & m_{n2} & \Cdots & m_{nr} \\[5pt] \end{NiceArray}$ \end{document}
- How to create PDF/X with latexby user2609605 on December 10, 2025 at 4:36 am
I try to compile the following with lualatex, TeXLive 2025 current, {pdfmanagement-testphase}{2025-11-12}{0.96x} \DocumentMetadata{lang=en-US,pdfversion=2.0,pdfstandard=x-6n} ... but this yields ! Package pdf Error: The standard 'X-6N' is unknown and has been ignored Type <return> to continue. ... l.2 ...lang=en-US,pdfversion=2.0,pdfstandard=x-6n} In the documentation on documentdata-supportcode we read: Beside the A-standards it is also possible to use the values X-4, X-4p, X-5g, X-5n, X-5pg, X-6, X-6n, X-6p for a PDF/X and UA-1 and UA-2 for PDF/UA standard. UA-2 should only be used together with PDF 2.0. Note that UA-1,2 work fine for me. I tried out all PDF/X standards and found only a single one which worked for me: x-4. By the way, all standards are tied more or less to a specific PDF version, not only the UA ones. Am I missing anything?
- Gradients in TikZby karlh on December 10, 2025 at 3:53 am
Based on the documentation, I would expect the two rectangles generated by this code to look identical: \documentclass{article} \usepackage{tikz} \begin{document} \pgfdeclarehorizontalshading{myshadingA} {1cm}{rgb(0cm)=(1,0,0); color(2cm)=(green); color(4cm)=(blue)} \begin{tikzpicture} \pgfuseshading{myshadingA} \shade [shading=myshadingA] (-2,-1) rectangle (2,-3); \end{tikzpicture} \end{document} However, this is clearly not the case. What am I doing wrong and/or misinterpreting in the documentation?
- Unwanted extra space in biblatex's prenoteby bongbang on December 10, 2025 at 3:20 am
My straightforward implementation of the solution for referring to a biblatex citation note creates an unwanted extra space before the referenced citation as seen in the example below. How do I avoid that? \documentclass{article} \usepackage[style=verbose, ]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} Blah.\autocite{knuth:ct} Blah.\autocite[\protect\label{knuth-cite}][]{knuth:ct:a} Work cited in note~\ref{knuth-cite}. \end{document}
- Environment that conditionally collects its contentby campa on December 9, 2025 at 8:05 pm
Disclaimer: This is a bit a XY problem, or rather: I have a problem X and I have a solution Y which works but does not really make me happy. Background: I have an environment, say {foo}, which I use for school tests. In the environment I can have solutions, whose presence is controlled by a boolean \ifsolution. Sometimes I want to print the pupils' version: easy, set \solutionfalse. Sometimes I want to print my own version: also easy, use \solutiontrue. Sometimes, I want to have a pdf file which contains both versions, first without and and then with solution: also easy, just use the environ package or the b specifier to collect the content and print it twice. Problem: All three versions can be easily obtained by \NewDOcumentEnvironment{foo}{+b}{...}{...}. However, this breaks synctex, and that might be a bit annoying. My idea was therefore to define an environment that collects its argument only in the last case, when I need both versions. I've managed it like this: \documentclass{article} \newif\ifsolution \def\solution#1{\ifsolution#1\fi} \newtoks\mytoks \long\def\collectfoo#1\end#2{% \mytoks\expandafter{\the\mytoks#1}% \def\tempa{foo}% \def\tempb{#2}% \ifx\tempa\tempb \def\next{\end{foo}}% \else \def\next{\mytoks\expandafter{\the\mytoks\end{#2}}\collectfoo}% \fi \next } \newenvironment{foo}[1]{% \ifdefined\foox\errmessage{You cannot nest {foo}!}\else\let\foox\relax\fi \par \def\nextA{}% \def\nextB{}% \ifcase#1\relax\solutionfalse\or% 0 = without solution \solutiontrue\else% 1 = with solution \def\nextA{\mytoks{}\collectfoo}% else once with and once without \def\nextB{\solutionfalse\the\mytoks\par\solutiontrue\the\mytoks}\fi \nextA }{% \nextB \par } \begin{document} \begin{foo}{0} An environment to see if the scan works: \begin{itemize} \item bla \item bar \end{itemize} If I've done it right, there should be nothing here: \solution{foo bar baz} \end{foo} \vskip2ex\hrule\vskip2ex \begin{foo}{1} An environment to see if the scan works: \begin{itemize} \item bla \item bar \end{itemize} If I've done it right, there should be something here: \solution{foo bar baz} \end{foo} \vskip2ex\hrule\vskip2ex \begin{foo}{2} An environment to see if the scan works: \begin{itemize} \item bla \item bar \end{itemize} If I've done it right, this should appear twice, fist without and then with something here: \solution{foo bar baz} \end{foo} \end{document} The result is what I expect, but of course my way to collect the environment's content is very rough. (No environment stack like amsmath or environ.) The question is basically: can this be done better?
- drawing arc using intersection with triangleby troy on December 9, 2025 at 5:26 pm
I've been trying to adapt the answer https://tex.stackexchange.com/a/239471 to the drawing I've been attempting, but I'm getting a strange result. I want draw an arc that begins and ends where it intersects with a triangle and spanning the interior of the triangle. My attempt at this is below. What I'm getting is a small, almond-shaped loop near one of the intersections. \documentclass[tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{fillbetween} \usetikzlibrary{3d} \usetikzlibrary{calc} \usetikzlibrary{intersections} \usetikzlibrary{perspective} \begin{document} \begin{tikzpicture}[scale=1.25, font=\sffamily] \pgfmathsetmacro{\alphasma}{1.4} \coordinate (O) at (0,0,0); \node at (O) {O}; \begin{scope}[scale=4,purple,very thick] \coordinate (X) at (0,0,1); \coordinate (Y) at (1,0,0); \draw[->] (O) -- (Y) node[anchor=north east]{\Large Y}; \draw[->] (O) -- (X) node[anchor=south]{\Large X}; \end{scope} \begin{scope}[3d view={90}{0.1}] \begin{scope}[scale=5,orange] \begin{scope}[rotate around y=20,black] \begin{scope}[rotate around z=-10,cyan] \begin{scope}[ canvas is xy plane at z=0, very thick ] \path[name path=lambdaArc] (O) circle [x radius=.95,y radius=.45]; \draw[name path=O-X-Y,dashed] (O) -- ($(O)!2*\alphasma!(X)$) -- ($(O)!2*\alphasma!(Y)$) -- cycle; \draw[red,thin, intersection segments={of=lambdaArc and O-X-Y,sequence=L3}]; \draw[orange,dashed] (O) circle [x radius=.95,y radius=.45]; \end{scope} \end{scope} \end{scope} \end{scope} \end{scope} \end{tikzpicture} \end{document} This is part of a larger diagram I am making. Deleting the extraneous parts leaves some scopes and structure that look unnecessary, but I left them as-is.
- Strange output using AMSmath's \operatorname and fontsetupby msx on December 9, 2025 at 12:04 pm
I have the following document \documentclass{article} \usepackage{fontsetup} \usepackage{amsmath} \newcommand{\coordRng}{\operatorname{\Gamma}} \begin{document} \(\coordRng (X)\) \(\Gamma\) \end{document} and when built by LuaLatex it has the following output: and I get the warning: Missing character: There is no đ¤ (U+1D6E4) in font [NewCM10-Book.otf]:mode= Note that the Gamma that was supposed to be typeset by \coordRng is missing. Without the \operatorname command it typesets. If instead one does not use fontsetup, \coordRng also typesets fine.
- What is the proper way to demonstrate tagged PDFsby Namal on December 9, 2025 at 9:03 am
What is the best way to demonstrate a tagged PDF vs untagged. I don't mean a verification mark. I am looking for a, preferably Linux, screen reader that can read a tagged pdf and its formulas correctly.
- How to customize the quote environment?by Cham on December 9, 2025 at 1:32 am
I'm trying to customize the quote environment for a novel (citations at the beginning of each chapter), and I'm having troubles in setting custom vertical line spacing, horizontal line length, the left/right horizontal spacing (quote margins), and the space above and below the quotes. How can I add the following parameters to the squote macro defined in the code below? Also, take note that the epigraph macro will probably by erased because currently it's clashing with the centered chapter number. I need to control the quote's left and right margins (say 1 inch on both sides), or the left marging and line length. Also, I need to control the vertical line spacing inside the quotes (say constant one half spacing between each line or something else that would be elegant. Any expert suggestion on this, for small size text?). And the vertical space above and below the quote text should be adjusted for elegance with a constant spacing (I'll have to experiment to find the proper value. Any suggestion would be appreciated). I believe the vertical spacing between the chapter title and the quote is currently too large. And since I'm currently experimenting with the macros to find the best configuration and disposition, I may have to place the quotes on the right side of the page, below the chapter title, as what the epigraph is currently doing. All my previous experiments failed. Here's a MWE with my current settings to play with: \documentclass[11pt,twoside]{book} \usepackage[T1]{fontenc} \usepackage[tt=false]{libertinus} \usepackage[french]{babel} \usepackage[stretch=50]{microtype} \usepackage[letterpaper,left=1.25in,right=1in,top=0.5in,bottom=0.5in,includeheadfoot,headheight=15pt,showframe]{geometry} \raggedbottom %\onehalfspacing %\setstretch{1.25} \setlength{\parindent}{1.5em} \linespread{1.1} \usepackage{titlesec} \usepackage{graphicx} \usepackage[dvipsnames]{xcolor} \titleformat{\chapter}[display] {\normalfont\huge\bfseries\centering} {\chaptertitlename\ \thechapter}{20pt}{\Huge} \usepackage{epigraph} \renewcommand{\textflush}{flushleft} \setlength{\epigraphrule}{0pt} %\setlength{\epigraphwidth}{0.5\textwidth} \newcommand{\epig}[2]{\epigraphhead[60]{\epigraph{\itshape{#1}}{\itshape{#2}}}} % a macro that will probably be erased. % THIS MACRO TO BE EDITED AND ADJUSTED: \newenvironment{squote}{ \begin{quote}\itshape\small}{\end{quote}} \begin{document} \chapter{A Nice chapter title here} \epig{ Some very funny quote text from nobody, and here's another line of text just to make you smile, but really, this quote environment isn't satisfaying yet, because it's too close to the chapter title. }{} \begin{squote} This is one fancy line of text to show a pretty medium long quote line, \\ this is the next line quote text to say anything wildly funny. This is another useless text of line just to show how smart I'm not. \end{squote} Some dummy text to show the paragraph spacing below the quoted text above. Oh well, another line of dumb text, and yes maybe I should use the lorem ipsum package to add something wild in there. But nevermind, I don't need it! \end{document} Here's a preview of what this MWE is doing:
- One colored structure combining amsart, amsthm, mdframed and thmtoolsby Sebastiano on December 8, 2025 at 9:02 pm
I am working with the amsart class and I would like to define two new environments to create a sort of structured dialogue with que (question), ris (answer). I would have with this MWE: \documentclass[12pt]{amsart} \usepackage{amssymb} \usepackage[svgnames]{xcolor} \RequirePackage[framemethod=default]{mdframed} \usepackage{thmtools} \newmdenv[ skipabove=7pt, skipbelow=7pt, rightline=false, leftline=true, topline=false, bottomline=false, linecolor=Green, backgroundcolor=Green!10, innerleftmargin=5pt, innerrightmargin=5pt, innertopmargin=2pt, innerbottommargin=5pt, leftmargin=0cm, rightmargin=0cm, linewidth=2.5pt ]{rBox} \newmdenv[ skipabove=7pt, skipbelow=7pt, rightline=false, leftline=true, topline=false, bottomline=false, linecolor=blue, backgroundcolor=blue!10, innerleftmargin=5pt, innerrightmargin=5pt, innertopmargin=2pt, innerbottommargin=5pt, leftmargin=0cm, rightmargin=0cm, linewidth=2.5pt ]{bBox} \declaretheoremstyle[ headfont=\normalfont\sc, bodyfont=\normalfont, notefont=\normalfont, headpunct={.} ]{col} \declaretheorem[name=Quesito,style=col]{queT} \declaretheorem[name=Risposta,style=col]{risT} \newenvironment{que}{\begin{rBox}\begin{queT}}{\end{queT}\end{rBox}} \newenvironment{ris}{\begin{bBox}\begin{risT}}{\end{risT}\end{bBox}} \newtheorem{teor}{\sc Teorema} \newtheorem*{prop}{\sc Proposizione} \newtheorem{cor}{\sc Corollario} \newtheorem*{lemma}{\sc Lemma} \newtheorem*{blankit}{} \allowdisplaybreaks \pagenumbering{arabic} \theoremstyle{definition} \newtheorem{defin}{\sc Definizione} \newtheorem{definn}{Definizioni} \theoremstyle{remark} \newtheorem{Es}{\sc Esercizio} \newtheorem{Dm}[Es]{\sc Domanda} \newtheorem{esp}[Es]{\sc Esempio} \newtheorem{Prob}[Es]{\sc Problem} \begin{document} \begin{que} Il limite di una funzione a due variabili richiede che il valore della funzione si avvicini allo stesso numero lungo qualsiasi percorso che punti verso il punto considerato. Per questo, a differenza del caso a una variabile, è spesso necessario confrontare diversi cammini o usare stime per verificare lâunicitĂ del limite. \end{que} \begin{ris} Il limite di una funzione a due variabili esiste solo se la funzione tende allo stesso valore lungo tutti i possibili percorsi che si avvicinano al punto. \end{ris} \begin{defin} srhreheh \end{defin} \end{document} normal text only for the enviroments que and ris; for other enviroments the default \emph of amsthm; here I have not for definition a emph-style. Also the same color of the lateral bar for the text (green/blue).
- tikz-cd: Put brackets/parentheses around one column of diagram?by Peter LeFanu Lumsdaine on December 8, 2025 at 3:25 pm
I would like to put parentheses around one column of a tikz-cd diagram â something like the diagram in the example below, but with the second set of parens around just the left-hand vertical of the square, not the whole square as currently. I would like the diagram otherwise roughly unchanged from how it is without the parentheses, but itâs fine if they slightly affect the alignment/spacing, so long as they donât change the essential layout. MWE source \documentclass[a5paper]{article} \usepackage{tikz,tikz-cd} \usepackage{amssymb} \begin{document} \[ f^* \left( \begin{tikzcd}[baseline={([yshift=-axis_height]\tikzcdmatrixname)}] % vertical alignment adjusted as in https://tex.stackexchange.com/a/678935/ Z \ar[d,"g"] \\ X \end{tikzcd} \right) = \left( \begin{tikzcd}[baseline={([yshift=-axis_height]\tikzcdmatrixname)}] \bullet \ar[d] \ar[r] \ar[dr,phantom,"\lrcorner", very near start] & Z \ar[d,"g"] \\ Y \ar[r,"f"] & X \end{tikzcd} \right) \] \end{document} One approach I have tried, but did not get satisfactory: using various combinations of \phantom and \mathrlap around a copy of the diagram consisting of just the column in question, as in the following snippet. However, I couldnât get the horizontal alignment reasonable with any arrangement I tried. \mathrlap{\left( { \begin{tikzcd}[baseline={([yshift=-axis_height]\tikzcdmatrixname)}] \bullet \phantom{\mathclap{Z}} \ar[d] \\ Y \end{tikzcd} } \right)} \left( \begin{tikzcd}[baseline={([yshift=-axis_height]\tikzcdmatrixname)}] \bullet \ar[d] \ar[r] \ar[dr,phantom,"\lrcorner", very near start] & Z \ar[d,"g"] \\ Y \ar[r,"f"] & X \end{tikzcd} \right)
- How to avoid `\phantom{}` and empty groups in this array, while maintaining the same alignment?by tmc on December 8, 2025 at 2:44 pm
I'm working on creating a specific two-column table in \LaTeX. The second column, $f(n)$, contains expressions that are linear combinations of $\alpha$, $\beta$, and $\gamma$, but not all terms are present in every row. My goal is to achieve a consistent column alignment for the coefficients of $\alpha$, $\beta$, and $\gamma$ across all rows, with consistent spacing around the $+$ signs. The terms $\alpha$, $\beta$, $\gamma$ themselves should also align. To achieve this alignment, I currently rely heavily on \phantom{} and empty {} groups, which feels overly complicated. I suspect there is a much cleaner, more idiomatic approach that I am missing. Since I'm not very proficient, could you please critique my current approach and suggest a more robust method to achieve this specific alignment? Here is my current code snippet: \documentclass{article} \begin{document} \[ \begin{array}{@{}c|c@{}} n & f(n) \\ \hline 1 & \phantom{0}\alpha\phantom{{}+0\beta+0\gamma} \\ \hline 2 & 2\alpha+\phantom{0}\beta\phantom{{}+0\gamma} \\ 3 & 2\alpha\phantom{{}+0\beta}+\phantom{0}\gamma \\ \hline 4 & 4\alpha+3\beta\phantom{{}+0\gamma} \\ 5 & 4\alpha+2\beta+\phantom{0}\gamma \\ 6 & 4\alpha+\phantom{0}\beta+2\gamma \\ 7 & 4\alpha\phantom{{}+0\beta}+3\gamma \\ \hline 8 & 8\alpha+7\beta\phantom{{}+0\gamma} \\ 9 & 8\alpha+6\beta+\phantom{0}\gamma \end{array} \] \end{document}
- NewDocumentCommand with keyword arguments: how to prevent evaluation of keyword default values?by wmnorth on December 8, 2025 at 12:03 pm
Consider the following MWE: \documentclass{article} \DeclareKeys [ myKeys ]{ a .store = \whereA, b .store = \whereB, } \SetKeys [ myKeys ] { a = AAA, b = \pageref{#2}, } \NewDocumentCommand{\abref}{O{} m}{% \SetKeys [ myKeys ] {#1}% \whereA\ and \whereB% } \begin{document} \section{Some topic} Ref the other page \abref{newpage} % does NOT work \vspace{2em} Ref the other page \abref[b = \pageref{newpage}]{newpage} % works \newpage foobar \label{newpage} \end{document} It produces the following output: The problem lies in the fact the default value for parameter b, viz. \pageref{#2}, gets evaluated too early.(*) I have a workaround for this: use a placeholder instead (<pnum> shall we say), and replace it inside the command definition (requires xstring): \IfSubStr{\whereB}{<pnum>}% {\StrSubstitute{\whereB}{<pnum>}{\pageref{#2}}}% But my question is if there is some way to prevent that early evaluation, thus making the workaround redundant. I have tried, e.g., \noexpand and some such incantations, but with no luck. Thank you in advance for your help. (*) In fact it produces the following warning: LaTeX Warning: Reference `##2' on page 1 undefined on input line 24.
- How to layout the two-side notes using Latexby xuehao on December 8, 2025 at 4:49 am
The following is an example from an English book. I'm planning to rewrite it in latex. The layout is with an itemize of points in the middle, and with "CONNECTIONS" notes along the two sides. I tried to solve it using TikZ, but the vertical align is hard to control. \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture} \node[draw,text width=3.1cm] at (0cm,0) {CONNECTIONS Because \\ \vspace{\baselineskip} It \\ and \\ Though \\ Since ... not \\ only \\ but also \vspace{\baselineskip} }; \node[draw,text width=6.3cm] at (5.1cm,0) {\begin{center} POINTS \end{center} 1. Brazil needs to be developed. \\ 2. New city, Brasilia, built 600 miles, Rio. \\ 3. Designed Lucio Costa. \\ 4. Became capital 1960. \\ 5. Planned for modern living. \\ 6. People at first reluctant to go. \\ 7. 1960 - population increasing. \\ 8. Established as capital. }; \node[draw,text width=3.1cm] at (10.2cm,0) {CONNECTIONS \vspace{\baselineskip} which was built \\ and which \\ \vspace{\baselineskip} It \\ but \\ However, with the increase }; \end{tikzpicture} \end{center} \end{document} Anyone could give me any clever solution for this task?
- Drawing a sphere and ellipsoid togetherby Knudsen on December 8, 2025 at 4:00 am
I would like to draw a sphere, of radius 3, and an ellipsoid of semi-axis 2, 3 and 4 together. They intersect at two great circles on the sphere (marked in red). I started out with the sphere and the great circles: \documentclass[border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{3dtools}% https://github.com/marmotghost/tikz-3dtools \begin{document} \begin{tikzpicture}[3d/install view={phi=120,theta=70},line cap=butt, line join=round,declare function={R=3;},c/.style={circle,fill,inner sep=1pt}] \path (0,0,0) coordinate (O) ; \draw[blue,3d/screen coords] (O) circle[radius=R]; \shade[ball color=white,3d/screen coords,opacity=0.7] (O) circle[radius=R]; % \shade[ball color=blue!30,3d/screen coords,opacity=0.7,xscale=2,yscale=3,zscale=4] (O) circle[radius=1]; \path pic[blue]{3d/circle on sphere={R=R,C={(O)}}}; \path pic[red]{3d/circle on sphere={R=R, n={(0.592,0,-1)}}}; % plane x = sqrt{7/10) z \path pic[red]{3d/circle on sphere={R=R, n={(0.592,0,1)}}}; % plane x = sqrt{7/10) z \draw[3d/hidden] (0,0,0) -- (0,0,R) (O)--(R,0,0) (O)--(0,R,0) (O)--(0,-R,0); \draw[3d/visible, -stealth] (R,0,0) -- (R + 4,0,0) node[below]{$x$}; \draw[3d/visible, -stealth] (0,R,0) -- (0,R + 1,0) node[right]{$y$}; \draw[3d/visible, -stealth] (0,0,R) -- (0,0,R + 1.5) node[above]{$z$}; \end{tikzpicture} \end{document} and everything is right so far: but when I remove the comment on the line that I would expect to draw the ellipsoid \shade[ball color=blue!30,3d/screen coords,opacity=0.7,xscale=2,yscale=3,zscale=4] (O) circle[radius=1]; I get something that is far from what I expected, including the fact that the zscale is not understood. How can one add the intersecting elipsoide to this image?
- How to add a mirror like shadow effect to a title?by Cham on December 8, 2025 at 12:44 am
I would like to add a reversed gray shadow under a title to mimmic a mirror effect. How can we do that with standard pdflatex (the live tex distribution)? Currtently, the code below only add a dull projected shadow under the title. Is there a way to vertically reverse the shadow? Here's a MWE to edit and play with: \documentclass[11pt,twoside]{book} \usepackage[T1]{fontenc} \usepackage[tt=false]{libertinus} \usepackage[french]{babel} \usepackage[stretch=50]{microtype} \usepackage[letterpaper,left=1.25in,right=1in,top=0.5in,bottom=0.5in,includeheadfoot,headheight=15pt]{geometry} \usepackage[dvipsnames]{xcolor} \usepackage{shadowtext} \begin{document} \begin{titlepage} \shadowoffsetx{2.5pt} \shadowoffsety{3.5pt} \shadowcolor{gray!40} \centering \vspace*{\baselineskip} \vfill {\textcolor{black}{\fontsize{26}{0}\selectfont\sffamily\textbf{\shadowtext{DOCUMENT TITLE}}}} \\[2.5\baselineskip] \vfill {\textcolor{black}{\huge\sffamily Author}} \vfill \end{titlepage} Text \end{document}
- How to set font family in `minted` style to an arbitrary font?by yury10578 on December 6, 2025 at 8:36 pm
I'm trying to set up tcolorbox blocks using minted engine. I want to use a font of my choice in those, not the default monospaced one (or tt or helvetica, per minted manual). Let's say I want 'Code New Roman'. In the following MWE the commented out style-setting line works, but requires of me knowing that (internal?) format. The line without \exfont works but sets the document's default font for tcolorbox blocks. If the line with \exfont is set last and so is actually used in listings, listings do not compile. At the same time, this tex fragment works in the main body of document. Is it possible to make the line with \exfont work? Or do that auto-adjustment to a specific font in some other way? \documentclass{article} \usepackage{fontspec} \usepackage[all]{tcolorbox} \newfontfamily\exfont{Code New Roman} \newtcblisting{exprog}{ listing only, listing engine=minted,. % minted options={ fontfamily={CodeNewRoman(0)} }, % minted expects that sort of string minted options={ fontfamily={\exfont\csname f@family\endcsname} }, % doesn't work minted options={ fontfamily={\csname f@family\endcsname} }, % works but sets the default font for tcolorbox blocks } \begin{document} {\exfont\csname f@family\endcsname} % works \begin{exprog} ts( n : integer ) : function: double; \end{exprog} \end{document}
- Accented character type \e`by Sebastiano on December 6, 2025 at 6:02 pm
Sometimes I see the accented è written in LaTeX sources as a command like this: \`e I've always wondered the reason. On my laptop (a modern machine), I can type è directly using the keyboard, and the document compiles without any issues. Is the use of "`e" due to a specific keyboard layout (for example on Mac), or is it just a historical LaTeX convention?
- How to draw cone with infinitely many extremal raysby Fradns on December 6, 2025 at 10:21 am
Suppose we are working in the three-dimensional real vector space V. A cone is a subset C of V such that if an element v of V lies in C, then all of its nonnegative multiples also lie in C. I would like to draw, using TikZ, a cone that simulates infinitely many extremal rays, all accumulating toward a fixed one. A section of the cone should therefore look like a âpolygon with infinitely many sidesâ. For example, the cone here Tikz: cones with a wide base is a circular one. I would like mine to be "polyhedral" away from the accumulation ray. How would you do that?
- TikZ: Generate a pixelated (Minecraft-style) circle by filling unit grid squares [duplicate]by Jax on December 6, 2025 at 8:35 am
I'm trying to draw a pixelated (blocky) circle in TikZ where each filled 1Ă1 square corresponds exactly to an integer grid cell (think Minecraft blocks). Given a center and radius, I want a compact TikZ/PGF macro or clear algorithm that selects which unit squares to fill so the rasterized shape matches a standard discrete circle (midpoint/Bresenham or distance-threshold) while preserving octant symmetry and avoiding visual gaps or doubled squares on diagonals. What is a simple, robust method to compute the set of grid cells for a given (integer or real) radius, and how can that be implemented cleanly in TikZ? Short macro examples, notes on rounding/aliasing pitfalls, and advice on scaling to a fixed cell size would be especially useful. For a quick visual reference I compared expected output with a pixel-circle preview online (pixel-circle preview).
- \ifthenelse and moduloby Raffaele Santoro on December 6, 2025 at 4:07 am
I have a list of numbers from 1 to 12. I want to print the numbers 3,6,9 and 12 in purple, the others in blue. With my code: \documentclass{standalone} \usepackage{tikz,ifthen} \begin{document} \begin{tikzpicture} \foreach \i in {1,...,12}{ \ifthenelse {\i/3=int(\i/3)} {\draw[purple] (.75*\i,0) node () {\i};}{\draw[blue] (.75*\i,0) node () {\i};} } \end{tikzpicture} \end{document} I have errors and all numbers in blue. Why?
- What is the meaning of tagpdf Warning: Destination ... has no related structure.?by user2609605 on December 5, 2025 at 11:20 pm
What is the meaning of Package tagpdf Warning: Destination 'section*.2' has no related structure. (tagpdf) /Ref not updated. It appears to be caused by: \DocumentMetadata{lang=en-US,tagging=on,pdfversion=2.0,pdfstandard=a-4f,pdfstandard=UA-2} \documentclass[a4paper,12pt,USenglish]{book} \usepackage{fontspec} \usepackage{hyperref} \usepackage{unicode-math} \usepackage[toc, acronym]{glossaries} \newacronym{pdf}{PDF}{Portable Document Format} \makeglossaries \begin{document} \gls{pdf} \tableofcontents \printglossaries% \end{document} I compiled with lualatex and then once makeglossaries and again lualatex. Then the problem occurs in xxx.toc: \contentsline {chapter}{Acronyms}{5}{section*.2}% Here is the mysterious anonymous section. Now my question: how to avoid the warning from tagpdf? How to make latex write something different into the toc and what??
- Vertical text with multicolumn and tabularx looks weirdby domi on December 5, 2025 at 7:18 pm
I have the following snippet \documentclass{article} \usepackage{tabularx} \usepackage{rotating} \usepackage{multirow} \newcolumntype{C}{>{\centering\arraybackslash}X} \newcolumntype{V}{>{\centering\arraybackslash}m{1.5cm}} \newcommand{\verttext}[1]{\rotatebox{90}{\parbox{3cm}{\centering\textbf{#1}}}} \renewcommand{\arraystretch}{1.5} \begin{document} \begin{table}[h] \centering \begin{tabularx}{\textwidth}{V | V | C | C |} \multicolumn{2}{c}{} & \multicolumn{2}{c}{Ausmass des Interesses am Unternehmen} \\ \cline{3-4} \multicolumn{1}{c}{} & \multicolumn{1}{c|}{} & Gering & Hoch \\ \cline{2-4} \multirow{2}{*}{\verttext{Ausmass der Macht}} & \verttext{Hoch} & Zufrieden stellen & Key Players \\ \cline{2-4} & \verttext{Gering} & minimal betreuen & informieren \\ \cline{2-4} \end{tabularx} \end{table} \end{document} which looks like this: as you can see, the "Ausmass der Macht" isnt centered (its two cell high) and shouldn't be wrapped. The two cells (Hoch + Gering) are high enough so the text shouldn't be wrapped. I already found a kinda similar question here: Vertical Text using multirow in the Table though I have no clue how to resolve that issue. Thanks in advance đ
- Vertical alignment of equations inside tabularxby Andi Bauer on December 4, 2025 at 8:34 pm
I'm trying to put multiple numbered equations into one line to save space. One way to do this is to put the equations inside a tabularx table. However, when I try to put an equation environment inside a tabularx the vertical alignment is off: \documentclass{article} \usepackage{tabularx,amsmath} \begin{document} \begin{equation*} \begin{tabularx}{\textwidth}{m{0.4\textwidth}m{0.4\textwidth}} \begin{equation} \begin{pmatrix}1\\2\\3\end{pmatrix} \end{equation} & \begin{equation} x \end{equation} \end{tabularx} \end{equation*} \end{document} produces As you can see, the vertical alignment between the two labels (1) and (2) is slightly off. I've not been able to figure out what latex aligns in this case, it seems erratic to me. Changing the column type from m to p or b didn't fix the problem.
- TikZ word search diagram v2by yannis on December 4, 2025 at 7:16 pm
As a continuation of TikZ word search diagram here is the problem I'm facing. I did what Explorer suggested and it worked fine except that my rounded rectangles look like sausages or like Hieroglyphic cartouches because at their narrow ends they have lines on the secondary axis: Here is the code: \documentclass{article} \usepackage[cmyk]{xcolor} \definecolor{myPB}{cmyk}{0.85,0.75,0,0} \definecolor{myLB}{cmyk}{0.1,0.06,0,0} \usepackage{tikz} \usetikzlibrary{matrix,backgrounds} \newlength{\mydrawlinewidth} \setlength{\mydrawlinewidth}{1pt} \NewDocumentCommand{\markA}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5, line width=2pt,myPB,fill=myLB] ([xshift=5pt,yshift=-5pt]yannis-#2.north west) rectangle ([xshift=-5pt,yshift=5pt]yannis-#3.south east); } \NewDocumentCommand{\markB}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5,line width=2pt,myPB,fill=myLB] ([yshift=2pt]yannis-#2.north) -- ([xshift=2pt]yannis-#3.east) -- ([yshift=-2pt]yannis-#3.south) -- ([xshift=-2pt]yannis-#2.west) -- cycle; } \NewDocumentCommand{\markC}{ O{red} m m }{% \draw[rounded corners=6mm,opacity=.5,line width=2pt,myPB,fill=myLB] ([xshift=2pt]yannis-#2.east) -- ([yshift=-2pt]yannis-#3.south) -- ([xshift=-2pt]yannis-#3.west) -- ([yshift=2pt]yannis-#2.north) -- cycle; } \begin{document} \begin{tikzpicture} \matrix (yannis) [% matrix of nodes,% column sep=0mm,% row sep=0mm, nodes={ % draw, rectangle,anchor=center, line width=0.5pt, inner sep=2pt,outer sep=0pt, %font=\bfseries\huge, minimum size=1.1cm, } ] { S & G & A & Q & Q & T & C & E & F & R & E & P & Y & W & R \\ W & L & Q & E & L & B & A & R & A & P & M & O & C & E & L \\ Y & I & T & S & X & E & L & I & Y & A & H & U & W & R & A \\ B & K & E & E & Y & C & W & L & J & T & M & A & K & B & F \\ J & E & R & I & O & R & T & M & K & E & R & L & Q & E & T \\ P & N & P & L & S & B & R & W & H & D & U & U & E & H & E \\ E & E & R & R & E & W & V & S & S & M & L & N & K & E & R \\ H & S & E & E & H & T & A & P & H & Y & S & I & C & A & L \\ S & S & T & D & S & H & E & U & Q & V & L & V & R & Z & I \\ O & R & N & N & I & F & L & L & A & S & N & E & E & K & F \\ M & T & I & U & N & L & G & E & P & H & U & R & A & S & E \\ W & K & O & Q & U & P & U & H & A & M & G & S & T & M & I \\ A & F & A & R & P & J & M & S & L & R & O & E & E & H & C \\ B & X & H & C & A & I & H & S & A & M & S & C & D & F & G \\ I & P & R & O & P & H & E & T & S & N & S & I & F & X & Q \\ }; \begin{scope}[on background layer] \markA{1-6}{1-12} \markA{1-14}{6-14} \markC{1-15}{7-9} \markA{2-2}{9-2} \markA{2-4}{2-13} \markA{3-3}{11-3} \markA{3-4}{11-4} \markA{3-6}{3-12} \markA{3-15}{11-15} \markC{4-11}{9-6} \markA{6-5}{13-5} \markA{6-12}{13-12} \markA{7-1}{11-1} \markB{7-5}{14-12} \markA{8-8}{8-15} \markA{8-13}{14-13} \markB{10-7}{15-12} \markB{11-2}{15-6} \markA{14-3}{14-10} \markA{15-2}{15-9} \end{scope} \end{tikzpicture} \end{document} How can I fix this? @mickep I replaced the snippets by a complete minimal example.
- During (expl3) *-map_inline, get the index of the considered item without any auxiliary integerby Denis BitouzĂŠ on December 4, 2025 at 3:29 pm
In the following MCE, I apply to every item stored within the \l_tmpa_clist clist an inline function that displays this item preceded by its index (its position in the list). For this index, an auxiliary integer is manually incremented at each item considered: \documentclass{article} \begin{document} \ExplSyntaxOn \clist_set:Nn \l_tmpa_clist {Foo,Bar,Baz} The~ \verb|\l_tmpa_clist|~ list~ has,~ as: \begin{itemize} \clist_map_inline:Nn \l_tmpa_clist { \int_incr:N \l_tmpa_int \item element~ \# \int_use:N\l_tmpa_int :~ #1 } \end{itemize} \ExplSyntaxOff \end{document} My question, not restricted to clists' mapping, is as follows: during *-map_inline, is it possible to access to the index of the considered item without the need to resort an auxiliary integer?
- Diagonal Arrows Under an Equationby Lucy on December 4, 2025 at 10:13 am
I need to put diagonal arrows under an equation (the red ones in the picture). I tried using \swarrow \qquad \searrow, but they are not positioned where I need them. I would prefer not to use tikzmark. Is there another way to achieve this? Thanks for your help. \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[czech]{babel} \usepackage[T1]{fontenc} \usepackage{pgfplots} \usepackage{multicol,array,tabularx,xcolor,enumitem} \usepackage{amsmath,amsfonts,amssymb,mathrsfs} \pagestyle{empty} % % % % \definecolor{modra}{cmyk}{1,0,0,0} %%%%DEFINCIE%%%%%BARVY \definecolor{cerna}{cmyk}{0,0,0,1} \definecolor{bila}{cmyk}{0,0,0,0} % %\color{modra} % \begin{document} \begin{align*} S & = \rho \cdot \dfrac{a + b +c}{2} & S & = \dfrac{a \cdot b}{2} \\ \rho \cdot \dfrac{a + b +c}{2} & = \dfrac{a \cdot b}{2} \qquad | \cdot 2 & & \\ 18 (a +b+ c ) & = a \cdot b & a & = b \\ 18 (a + a + c ) & = a \cdot a & c^2 & = a^2 + b^2 \\ 18 (2a + c ) & = a^2 & c^2 & = a^2 + a^2 = 2a^2 \\ 36 a + 18 c & = a^2 & c & = \sqrt{2a^2} = a \sqrt{2} \\ 36 a + 18 a \sqrt{2} & = a^2 & & \\ a^2 - 36 a - 18 a \sqrt{2} & = 0 & & \\ a \left( a - 36 - 18 \sqrt{2} \right) & = 0 & & \\ \Large \swarrow \qquad \searrow \end{align*} % % \end{document}
- Is that possible to tweak the related location and scale in the nested integral formula?by Explorer on December 4, 2025 at 10:02 am
My previous question's actual case is as below: In this YouTube link, it introduced a following nested integral question: Or the simpler the SAME one: The most important patterns, here, is described as below, the Recursive Formula: Now I have the following code: \documentclass[border=5pt]{standalone} \usepackage{amsmath} \usepackage{fourier} \usepackage{cmupint} \usepackage{fixdif} \parindent=0pt % \DeclareMathOperator{\myint}{\int\nolimits} \DeclareRobustCommand{\myint}{\int\nolimits} \newcommand{\basicint}{\myint_0^1xdx} \newcommand{\basicintt}{\myint_{\basicint}^{\basicint}xdx} % https://tex.stackexchange.com/a/5192/322482 \makeatletter \newcommand{\raisemath}[1]{\mathpalette{\raisem@th{#1}}} \newcommand{\raisem@th}[3]{\raisebox{#1}{$#2#3$}} \makeatother \newcommand{\originintunit}{% \displaystyle\myint_{ \textstyle\myint^{0}_{\basicintt} }^{ \textstyle\myint_{1}^{\basicintt} } }% \newcommand{\intunit}[2]{% \myint_{ \myint^{0}_{\myint_{#1}^{\basicint}xdx} }^{ \myint_{1}^{\myint_{\basicint}^{#2}xdx} } } \ExplSyntaxOn % \cs_generate_variant:Nn \tl_use:N {V} \tl_new:N \l_explorer_base_tl \tl_new:N \l_explorer_tmp_tl \tl_new:N \l_explorer_script_tl \tl_new:N \g_explorer_tmp_tl \cs_new_protected:Npn \typeset_integral_recursive:Nn #1#2 { % #1:tl to store % #2:depth \group_begin: \tl_set_eq:NN \l_explorer_tmp_tl #1 \int_compare:nNnTF { #2 } = { 1 } { \tl_put_right:Ne \l_explorer_tmp_tl { \intunit{\basicint}{\basicint} } } { \tl_clear:N \l_explorer_script_tl \typeset_integral_recursive:Nn \l_explorer_script_tl { \int_eval:n { #2 - 1 } } \tl_put_right:Ne \l_explorer_tmp_tl { \intunit{\l_explorer_script_tl}{\l_explorer_script_tl} } } \tl_put_right:Nn \l_explorer_tmp_tl { xdx } \tl_gset_eq:NN \g_explorer_tmp_tl \l_explorer_tmp_tl \group_end: \tl_set_eq:NN #1 \g_explorer_tmp_tl } % \typeset_integral_recursive:Nn \l_explorer_base_tl { 4 } \NewDocumentCommand{\explorerint}{ m }{ \begingroup \typeset_integral_recursive:Nn \l_explorer_base_tl { #1 } $\l_explorer_base_tl$ \endgroup } \ExplSyntaxOff \begin{document} \explorerint{3} \end{document} But it gives the following, with no tweak of the location of subscript and superscript. I don't think in this case, l3coffin could handle better than just recursion with l3tl, but it's not easy for me, now, to tweak the sub/superscript's position, and the \int's scale, to make the final result looks more like an \int "tower". Any suggestions or perspectives would be welcome! And IMO, this question, deserved my bountyđ. I would start one in three days.