• polyglossia and \AtBeginDocument
    by Antonis on May 1, 2026 at 6:32 am

    When polyglossia is loaded it seems that \AtBeginDocument fails to do its work. The following code \documentclass[12pt]{article} \usepackage{fontsetup} \usepackage{polyglossia} \setmainlanguage{english} \setotherlanguage{greek} \AtBeginDocument{\addfontfeatures{StylisticSet=6,StylisticSet=7}} \begin{document} θυμήθηκα \addfontfeatures{StylisticSet=6,StylisticSet=7} θυμήθηκα \end{document} produces So the \AtBeginDocument did not work (the thetas must be different as in the second line). Now if you comment out the lines of polyglossia, things work as expected, that is both lines produce the same output as in the second line of the picture above. What is wrong with the above code or with polyglossia?

  • Create a simple emoji language for babel
    by David Purton on May 1, 2026 at 2:42 am

    I have my doubts about the wisdom of this… But with LuaLaTeX, babel is really great at switching between fonts and languages automatically without mark up. And the settings for the language can by included in an ini file. I wondered about using this feature in a document that is already multilinugual and uses babel so I can just insert emojis wherever without thinking. This following MWE works, but I was wondering: Is this really a good idea? Is there a better way? Can the set up be done wihtout a separate babel-emoji.ini file? MWE %! TeX Program = lualatex \documentclass{article} \begin{filecontents}[overwrite]{babel-emoji.ini} [identification] charset = utf8 script.name = emoji [characters] ranges = 1F300..1F9FF 2600..26FF 2700..27BF \end{filecontents} \usepackage[english]{babel} \babelprovide[import=emoji, onchar=fonts]{emoji} \babelfont[emoji]{rm}{Noto Color Emoji} \begin{document} A \texttt{babel} integrated emoji: 😀 \end{document}

  • Borromean Knot Brunnian link
    by Julio Michael Stern on April 30, 2026 at 10:18 pm

    I am trying to use TiKZ to draw a Borromean knot with 3 Wasp figures. I am getting the wrong superpositions. A single wasp is produced by the following code. Can someone help me to write a TiKZ code for this Brunnian entanglement with 12 crossings. Wasp: \documentclass[border=5mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} % Estilos para o anel do mosaico \tikzset{ vespa ring/.style={ draw=red, line width=11pt, line join=round }, white stripe/.style={ draw=white, line width=2pt, % Removida a opacidade para evitar manchas line join=round } } % Macro final da "Cintura de Vespa" com cabeça circular e elevada \newcommand{\vespawaist}{ (0.8, 0) % Cintura direita .. controls (0.8, 1.0) and (2.0, 1.8) .. (1.5, 2.4) % Ombro .. controls (1.0, 3.0) and (-1.0, 3.0) .. (-1.5, 2.4) % Topo elevado .. controls (-2.0, 1.8) and (-0.8, 1.0) .. (-0.8, 0) % Cintura esquerda .. controls (-0.8, -1.0) and (-2.0, -1.8) .. (-1.5, -2.4) % Ombro inferior .. controls (-1.0, -3.0) and (1.0, -3.0) .. (1.5, -2.4) % Base elevada .. controls (2.0, -1.8) and (0.8, -1.0) .. (0.8, 0) % Fecha -- cycle } % Desenho em camadas para garantir o branco puro \draw[vespa ring] \vespawaist; \draw[white stripe] \vespawaist; \end{tikzpicture} \end{document}

  • ⟨before-code⟩ in \titleformat of package titlesec
    by Akira on April 30, 2026 at 9:50 pm

    I have a tex file \documentclass{article} \usepackage{xcolor} \usepackage{titlesec} \setlength{\parindent}{0pt} \definecolor{myblue}{HTML}{2B7CD3} \newlength{\spaceA} \setlength{\spaceA}{5pt} \newlength{\spaceB} \setlength{\spaceB}{30pt} \newlength{\spaceC} \setlength{\spaceC}{5pt} \titleformat {\section}{ \vspace{\spaceA} \bfseries \raggedright \large \color{myblue} % header section }{}{0em}{\vspace{\spaceB}}[\color{myblue} {\titlerule[1pt]} \vspace{\spaceC}] \begin{document} We have something. \section{Some title here} We have something. \begin{tabular*}{\textwidth}[t]{@{}l@{\extracolsep{\fill}}r} aa & bb \\ % top row of resume entry bb & dd \\ % second row of resume entry \end{tabular*} \end{document} According to the documentation of titlesec, {\vspace{\spaceB}} corresponds to the ⟨before-code⟩ is the code preceding the title body. It seems from the PDF that \vspace{\spaceB} affects the space after the title body where I assume that the title body is Some title here. Could you elaborate on my confusion?

  • Accsupp and kerning
    by Grzegorz Brzęczyszczykiewicz on April 30, 2026 at 9:15 pm

    I defined a command: \newcommand{\hexacc}[2]{% \BeginAccSupp{method=hex,unicode,ActualText=#2}% #1% \EndAccSupp{}% } How to make it so that when I put \hexacc{A}{1000}\hexacc{V}{2137} (this is just an example), it respects the original kerning while still having a distinct A and V part I can copy separately so that I can later reuse my custom \hexacc{A}{1000} as, say, \customA and the same for other letters, and have \customA\customV respect the original kerning of AV? The A and V example was just an example, I want it to work for any letter

  • slur not working with colored notes
    by ABV on April 30, 2026 at 8:25 pm

    Slur command is not working with colored notes. The basic code is as follow: \documentclass[% border={3pt 3pt 3pt 0pt},% left bottom right top varwidth]{standalone} % ========== PAQUETES ========== \usepackage{tikz} \usetikzlibrary{quotes} \usetikzlibrary{shapes} \usetikzlibrary{fit,positioning} \usetikzlibrary{arrows.meta} \usetikzlibrary{decorations} \usepackage{amsmath}% \usepackage{musicography}% \usepackage{musixtex}% \input musixlyr% \usepackage{xcolor}% \xdefinecolor{red-undar}{RGB}{179,35,79} \begin{document}% \begin{music}% \resetlyrics% \font\A=phvb8t at 10pt% %\font\B=phvb8t at 8pt% \setlyrics{cifradoA}{10 3 2 3 {\hspace{-0.25cm}6} 8}% \setsongraise1{-1.5mm}% \staffbotmarg3\Interligne% \setclef1\treble% \nobarnumbers% \nostartrule% \startextract% % AQUI EMPIEZOOO \NOTes\zhl{M}\wh{h}\qsk\islurd2f\hl{f}\en\bar% \NOTes{\color{black}\zw{^g}}{\color{blue}\wh{g}}%\normalcolor\color{black} \tslur2f\zhl{f}{{\color{blue}\loffset{0}{\nh f}}}\normalcolor\hl{e}\zcharnote{10}{\small\A\textcolor{blue}{\hspace*{-33mm}2da}}\en\setdoubleBAR% \endextract% % AQUI TERMINO \end{music}% \end{document}% The current output is as follow: The desired output should be:

  • Apply transformation xslant to node shape but not text
    by Paul on April 30, 2026 at 6:11 pm

    I want to create a multi part parallelogram input block for a flowchart. There is no multi part trapezium shape that exist so for now I used a standard rectangular multi part shape with the xslant option to make it look like a parallelogram. I defined a style that I can easily reuse. The problem is that the text is also slanted, and if possible I would like it normal. Is there a way to apply xslant only to the shape and not to the text ? I tried creating a second node only for the text but the problem is that the paralellogram doesn't resize properly to fit the text. My MWE : \documentclass[class=article]{standalone} \usepackage[]{xcolor} \usepackage{tikz} \usetikzlibrary{shapes} \tikzstyle{io} = [rectangle split, rectangle split parts=2, xslant=0.4, draw, rectangle split part fill={blue!50,blue!20}, text centered, minimum width=4.25cm, minimum height=2cm] \begin{document} \begin{tikzpicture} \draw (0,0) node[io,name = ,align = center]{Parameters\nodepart{two} $\alpha$, $\eta$}; \end{tikzpicture} \end{document} Thanks for your help.

  • Use "plot" inside a \draw path in tikz
    by flawr on April 30, 2026 at 5:36 pm

    Is there a way to continue a path we draw using \draw with a plot, just as we do for instance also with arc or similar commands? In the example below I have a straight line, but I'd like the plot to append directly to that line, as indicated by the red dots. I can of course do that e.g. with plot[shift={(1,1)},...], but that means that I have to repeat that second coordinate in the path, which makes it again more cumbersome to use if we want to change something later (and the second straight line segment then points to the original endpoint without the shift). So this is more a question about "ergonomically" using this plot command inside other paths. E.g., I also like using the ++ syntax to precisely extend a path a certain distance horizontally, without having to repeat the previous y-coordinate, and I was wondering whether there is something similar we can do with the plot command inside such a path. \documentclass{standalone} \usepackage{tikz} \usepackage{xcolor} \usepackage{pgfplots} \pgfplotsset{compat=1.17} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[domain=0:4] \draw[black!10!white, dashed] (0, 0) grid (4, 2); \draw (0, 1) -- (1, 1) node[left] {} plot[domain=0:1, samples=100] function{sin(6.3*x)} node[right] {} -- ++(1, 0); \end{tikzpicture} \end{document}

  • Reformatting from 8 1/2 X 11 to 6 X 9
    by David Promislow on April 30, 2026 at 3:56 pm

    I have written a book in LaTeX and have now been asked to change the size from 8 1/2 X 11 to 6 X 9. Following the answer to a similar question asked on this exchange previously, I inserted the following at the beginning: \documentclass[12pt]{book} \usepackage{geometry} \geometry{ paperwidth=6in,paperheight=9in, left=0.875in,right=0.5in, top=0.75in,bottom=1.0in, twoside } This results in a complete distortion where the bottom and right sides of all the pages are cut off. What should I be doing?

  • Horizontally centering a tikz node on a page
    by Sambo on April 30, 2026 at 3:30 pm

    My question is essentially the same as this question, but I'm asking again because the answer provided is not very resilient. In particular, it doesn't work for the kind of diagram I want. I want to use Tikz to draw a diagram with lots of nodes and arrows; essentially, a flowchart. The diagram should start with a single node which is centered on the page (in the MWE below, this is the "Hello there" box). If I try to just use the \centering command, the whole picture gets centered, which is not what I want. The answer I linked above suggests using the \useasboundingbox command. However, this doesn't seem to do what I want. Here is my minimal working example: \documentclass[a4paper, 11pt]{article} \usepackage{tikz} \begin{document} This is a line of text which has been written with no purpose other than to help illustrate how the figure below appears on a page. \begin{figure}[ht] \centering \begin{tikzpicture}[rect/.style={rectangle, draw=black, thin}] \node[rect] (box1) at (0,0) {Hello there}; % Location 1 \node[rect] (box2) at (5,-1) {Hi}; % Location 2 \end{tikzpicture} \end{figure} This is a line of text which has been written with no purpose other than to help illustrate how the figure above appears on a page. \end{document} The linked answer suggests using the command \useasboundingbox (box1.south east) rectangle (box1.north west);. If I put this command at location 2, then the bounding box includes both boxes "Hello there" and "Hi", and the box "Hello there" is not centered (see below). If I put this command at location 1, then the bounding box only includes the "Hello there" box; this centers it the way I want, but then the box "Hi" ends up overlapping with the text below (see below). How can I make the "Hello there" box be centered on the page?

  • footnotes in ExPex skip numbers
    by renoh on April 30, 2026 at 9:46 am

    This is similar to the question asked here: Skipped footnote numbers in math mode The problem I'm facing is that in ExPex environment, the footnotes skip numbers, e.g., 2, 4, 6... Is there a way to work around this, or any follow-up to the post above, since it's been 9 years. Edit: Another similar post is How put footnotes in an ExPeX gloss line In this post, the issue was that the footnote in expex environment did not appear. My issue is that the footnotes do appear (using \footnotemark and \footnotetext), but the numbering is wrong, i.e., 2, 4, 6... Each footnote seems to be counted twice, but I cannot find any fix for this. I'm using xelatex. MWE is as follows: \documentclass[12pt]{article} \usepackage{fontspec} \setmainfont{texgyretermes-regular.otf} \usepackage{expex} \begin{document} \ex \begingl \gla test test.\footnotemark// \glb gloss gloss// \glft `translation'// \endgl \xe \footnotetext{first footnote} \ex \begingl \gla second test test.\footnotemark// \glb gloss gloss gloss// \glft `translation'// \endgl \xe \footnotetext{second footnote} \end{document} Thank you for you help.

  • @ and ä characters cannot be rendered with LuaTeX and Cantarell font [closed]
    by Fabian on April 30, 2026 at 5:58 am

    I am on the latest OpenSUSE Tumbleweed with Texlive, LuaTeX, Komascript, and the Cantarell font. This is my MWE: \documentclass[]{scrreprt} \usepackage{fontspec} \setmainfont{Cantarell} \setsansfont{Cantarell} \begin{document} @ ä ö ü ì è ê \end{document} and I build with latexmk -file-line-error -interaction=nonstopmode -synctex=1 -output-format=pdf -output-directory=/out -lualatex main.tex This is the result I get: Other fonts work fine and Cantarell works fine in LibreOffice Writer. NotoSans in Latex: Cantarell in LibreOffice Writer: Do you have an idea what is happening there and how I might solve it?

  • Draw simple figures: l3draw vs PGF performances
    by PHL on April 30, 2026 at 3:08 am

    I have some lua code that generates coordinates of many triangles/quadrilaterals I then want to draw/fill. See this answer about Penrose tilings for a concrete example. The drawing is actually done in TikZ via the luadraw package, but I am wondering if I can make the code faster by replacing TikZ with l3draw. Rewriting my actual code to remove TikZ and luadraw dependences (and use l3draw or any other drawing tool) is not a complex task, but will ask me some time due to my limited programming skills. So I would prefer to know in advance if this is a good idea or not. Apart possibly performance, is there any other reasons to use l3draw over pgf for this kind of task? Edit: I am not using TikZ/pgf for the rest of the document. Suggesting to use another environment (as picture) is a valid answer.

  • Chemfig to context
    by Fabio Lima on April 30, 2026 at 1:07 am

    The version of the Chemfig manual and package released around 2010 appears to function correctly within ConTeXt. However, more recent versions (e.g., 2025) no longer seem to be compatible, and attempts to use them result in errors or non-functional code. As an alternative, the ppchTeX module provides useful tools for chemical structures in ConTeXt. Nevertheless, it has notable limitations, particularly in representing organic reaction mechanisms, where features such as curved arrows and detailed electron flow are essential. In contrast, Chemfig offers more comprehensive support for these use cases, especially due to its robust arrow and mechanism-drawing capabilities. Given this, I would like to ask whether there are any plans, ongoing efforts, or recommended approaches to enable compatibility between Chemfig and ConTeXt MKIV. Alternatively, is there any guidance on adapting Chemfig for use within ConTeXt, or extending ppchTeX to better support reaction mechanisms?

  • Incompatibility between PyLuaTeX and luadraw?
    by mathmandan on April 29, 2026 at 8:25 pm

    Consider this MWE: \documentclass{article} %\usepackage{luadraw} % Un-comment this line to get an error \usepackage[executable=python]{pyluatex} % May need to substitute: % \usepackage[executable=python3]{pyluatex} % \usepackage[executable=python.exe]{pyluatex} % (Or whatever works on your system) \begin{document} ok \end{document} The above compiles fine for me (using LuaLaTeX, with the --shell-escape option, from a TeXLive distribution in Windows 11 Enterprise). I get a document showing the text "ok" (without the quotes), as expected. However, if I uncomment the usepackage{luadraw} line, then I get an error: This is LuaHBTeX, Version 1.24.0 (TeX Live 2026) system commands enabled. (./test100.tex LaTeX2e <2025-11-01> L3 programming layer <2026-03-20> (c:/texlive/2026/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (c:/texlive/2026/texmf-dist/tex/latex/base/size10.clo)) ... ... (Some more stuff that seems OK) ... (c:/texlive/2026/texmf-dist/tex/lualatex/pyluatex/pyluatex.sty...xlive/2026/tex mf-dist/tex/lualatex/pyluatex/pyluatex.lua:58: attempt to index a function valu e (global 'set') stack traceback: ...xlive/2026/texmf-dist/tex/lualatex/pyluatex/pyluatex.lua:58: in main chunk [C]: in function 'require' [\directlua]:1: in main chunk. l.23 } ? Note: if I uncomment the \usepackage{luadraw} and put it after the \usepackage{pyluatex}, then it actually does compile without error. However, if I then replace the ok with something that uses pyluatex, like \py{'ok'}, then I get another error. So simply switching the loading order does not really solve the issue. Note: I recently (April 29, 2026) ran tlmgr update --all, and also re-installed a current version (version 2.8) of luadraw (using l3build install as described at https://github.com/pfradin/luadraw). Question: Is it possible to use both pyluatex and luadraw together in one document? Secondary question: Is this a bug, and if so, is there one package that is at fault? I would be happy to file a bug report somewhere if that is appropriate. Neither package seems to cause problems for me on its own; it is only when both are loaded that I am experiencing a problem.

  • Create an author's index
    by Janice Carter on April 29, 2026 at 8:16 pm

    I want to automatically create an author's index and I'm not sure what I doing wrong. I am using TeXShop to compile. My file will compile in Latex with no errors. However, I don't get an author's index. What am i missing? What steps do I need to complete to get author's index. Here's my preamble: \documentclass[10pt,twoside]{article} %\makeatletter %\def\cleartoleftpage{\clearpage\if@twoside \ifodd\c@page %\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} %\makeatother \let\oldsection\section \def\section{\cleardoublepage\oldsection} %\makeatletter %\def\clearevenpage{\clearpage\if@twoside \ifodd\c@page % \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} %\makeatother \usepackage{authorindex} \usepackage{amssymb,amsxtra} \usepackage{graphicx} \usepackage{amscd} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} %\usepackage{showkeys} \usepackage{hyperref} %\usepackage[linktocpage]{hyperref} \hypersetup{ colorlinks = true, linkcolor = blue, citecolor = red } %\usepackage{compress, biblabel}{cite} \usepackage{cite}\def\citepunct{], [} \def\citedash{]--[} %\bibliographystyle{unsrt} %\usepackage{bibentry} \usepackage[left=5.12cm,right=4.5cm,top=5.5cm,bottom=5.5cm]{geometry}%set margin of page \usepackage{atbegshi}% http://ctan.org/pkg/atbegshi \AtBeginDocument{\AtBeginShipoutNext{\AtBeginShipoutDiscard}} \addtocounter{page}{-1} \usepackage{fancyhdr} %\usepackage{lipsum} \fancyhf{} \fancyhead[LO]{\footnotesize\bfseries\nouppercase{\rightmark}} \fancyhead[RE]{\footnotesize\bfseries\nouppercase{\leftmark}} \fancyhead[RO,LE]{\footnotesize\bfseries\thepage} \renewcommand{\headrulewidth}{0pt} \fancypagestyle{plain}{% \fancyhf{}% \fancyfoot[C]{\footnotesize\bfseries\thepage}% \renewcommand{\headrulewidth}{0pt}% } \pagestyle{fancy} %\renewcommand{\figurename}{Fig.} %\renewcommand{\thefigure}{\arabic{figure}} \numberwithin{figure}{section} \newcommand{\mca}{\mathcal{A}} \newcommand{\mfa}{\mathfrak{a}} \newcommand{\mfb}{\mathfrak{b}} \newcommand{\mcb}{\mathcal{B}} \newcommand{\mcc}{\mathcal{C}} \newcommand{\mbc}{\mathbb{C}} \newcommand{\mbd}{\mathbb{D}} \newcommand{\mcd}{\mathcal{D}} \newcommand{\mfd}{\mathfrak{d}} \newcommand{\mfD}{\mathfrak{D}} \newcommand{\mfe}{\mathfrak{e}} \newcommand{\mcf}{\mathcal{F}} \newcommand{\mbf}{\mathbb{F}} \newcommand{\bff}{{\bf F}} \newcommand{\mcg}{\mathcal{G}} \newcommand{\mbh}{\mathbb{H}} \newcommand{\bfh}{{\bf H}} \newcommand{\mch}{\mathcal{H}} \newcommand{\mcl}{\mathcal{L}} \newcommand{\mfl}{\mathfrak{l}} \newcommand{\mcm}{\mathcal{M}} \newcommand{\mcn}{\mathcal{N}} \newcommand{\mbn}{\mathbb{N}} \newcommand{\mcp}{\mathcal{P}} \newcommand{\bfp}{{\bf p}} \newcommand{\mcq}{\mathcal{Q}} \newcommand{\mbq}{\mathbb{Q}} \newcommand{\mcr}{\mathcal{R}} \newcommand{\mbr}{\mathbb{R}} \newcommand{\mcs}{\mathcal{S}} \newcommand{\mfs}{\mathfrak{s}} \newcommand{\mct}{\mathcal{T}} \newcommand{\mft}{\mathfrak{T}} \newcommand{\mcu}{\mathcal{U}} \newcommand{\mcv}{\mathcal{V}} \newcommand{\mcw}{\mathcal{W}} \newcommand{\mbz}{\mathbb{Z}} \newcommand{\mcz}{\mathcal{Z}} \newcommand{\widez}{\widetilde{\zeta}} \newcommand{\Res}[1]{\text{Re}(#1)} \newcommand{\ao}{A, \Omega} \newcommand{\zao}{\zeta_{A, \Omega}} \newcommand{\tzao}{\widetilde{\zeta}_{A, \Omega}} \newcommand{\tzad}{\widetilde{\zeta}_{A, D}} \newcommand{\ptoo}{\partial \Omega, \Omega} \newcommand{\res}{\operatorname{res}} \newcommand{\re}{\text{\rm Re}} \newcommand{\pr}{\text{\rm pr}} \newcommand{\Tr}{\text{\rm Tr}} %\newcommand{\sc}{\text{\rm sc}} \newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}} %\renewcommand{\labelenumi}{{\normalfont (\roman{enumi})}} \newcommand{\rmparen}[1]{{\rm{(}}#1{\rm{)}}} %enclose text in roman parentheses \newtheorem{theorem}{Theorem}[section] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{thm}[theorem]{Theorem} \newtheorem{cor}[theorem]{Corollary} \newtheorem{lem}[theorem]{Lemma} \newtheorem{prop}[theorem]{Proposition} \newtheorem{definition}[theorem]{Definition} \newtheorem{defn}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{examples}[theorem]{Examples} \newtheorem{remark}[theorem]{Remark} \newtheorem{hypothesis}[theorem]{Hypothesis} \newtheorem{question}[theorem]{Question} \newtheorem{notation}[theorem]{Notation} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{problem1}[theorem]{Open Problem} \newtheorem{problem}[theorem]{Problem} \newtheorem{exercise}[theorem]{Exercise} %\newtheorem{rmkwithenum}{Remark}[section] \numberwithin{equation}{section} %\begin{document} %\addtocounter{page}{1} \begin{document} \clearpage \maketitle \thispagestyle{empty} \pagenumbering{roman} %\setcounter{page}{1} \newpage \pagenumbering{roman} \newpage %\pagenumbering{roman} \tableofcontents %\addtocontents{toc}{\protect\vspace{2ex}}\include{ListofFigures} %\printindex \printauthorindex \end{document}

  • Representation of a double cone with section and orthogonal projections
    by Sebastiano on April 29, 2026 at 8:08 pm

    I should create a drawing that illustrates this domain in 3D: T= \{(x, y, z) \in \mathbb{R}^3\colon x^2 +y^2\leq (z-9)^2, 0\leq z\leq 3 \}. It is a double cone with vertex at (0,0,3) if it were x^2 +y^2= (z-9)^2. I may have to change the scale but I don’t want the drawing to look worse. How can I colour the two-sloped cone part that satisfies the inequality x^2 +y^2\leq (z-9)^2? ...and then adding 0\leq z\leq 3? \documentclass{article} \usepackage{tikz} \usetikzlibrary{patterns} \usepackage{tikz-3dplot} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} \setlength\PreviewBorder{2pt} \begin{document} \tdplotsetmaincoords{60}{110} \begin{tikzpicture}[tdplot_main_coords,scale=0.9] \pgfmathsetmacro{\tini}{0.5*pi} \pgfmathsetmacro{\tfin}{1.85*pi} \pgfmathsetmacro{\tend}{2.5*pi} \def\h{10.2} \draw[thick,->] (0,0,0) -- (3.5,0,0) node[below left] {$x$}; \draw[dashed] (0,0,0) -- (-2.5,0,0); \draw[thick,->] (0,0,0) -- (0,3.5,0) node[right] {$y$}; \draw[dashed] (0,0,0) -- (0,-2.5,0); \draw[thick,->] (0,0,0) -- (0,0,12) node[above] {$z$}; \fill (0,0,9) circle (1pt); \node[right] at (0,0,9) {$(0,0,9)$}; \foreach \angulo in {0,2,...,358}{ \draw[cyan,very thick,opacity=0.12,rotate around z=\angulo] plot[domain=0:2,smooth,variable=\t] ({0},{\t},{9 + \t}); \draw[cyan,very thick,opacity=0.12,rotate around z=\angulo] plot[domain=0:2,smooth,variable=\t] ({0},{\t},{9 - \t}); } \foreach \z in {7.6,7.8,...,10.4}{ \pgfmathsetmacro{\r}{abs(\z-9)} \draw[cyan,thick,opacity=0.35] plot[domain=\tini:\tfin,smooth,variable=\t] ({\r*cos(\t r)},{\r*sin(\t r)},{\z}); } \foreach \z in {7.6,7.8,...,10.4}{ \pgfmathsetmacro{\r}{abs(\z-9)} \draw[cyan,thick,opacity=0.35] plot[domain=\tfin:\tend,smooth,variable=\t] ({\r*cos(\t r)},{\r*sin(\t r)},{\z}); } \pgfmathsetmacro{\r}{abs(\h-9)} \draw[red,very thick] plot[domain=0:360,smooth,variable=\t] ({\r*cos(\t)},{\r*sin(\t)},{\h}); \node[red, above right] at ({\r},0,\h) {$z=h$}; \fill[yellow,opacity=0.35] plot[domain=0:360,smooth,variable=\t] ({\r*cos(\t)},{\r*sin(\t)},0); \draw[red,thick] plot[domain=0:360,smooth,variable=\t] ({\r*cos(\t)},{\r*sin(\t)},0); \foreach \angle in {0,45,...,315}{ \pgfmathsetmacro{\x}{\r*cos(\angle)} \pgfmathsetmacro{\y}{\r*sin(\angle)} \draw[gray,dashed,opacity=0.5] (\x,\y,0) -- (\x,\y,\h); } \node[blue,right] at (0,0,11.5) {$x^2 + y^2 = (z-9)^2$}; \end{tikzpicture} \end{document}

  • What is the proper way of implementing specific formatting requirements?
    by Simon on April 29, 2026 at 7:14 pm

    I want to implement given formatting requirements, however, I feel overwhelmed by the number of parameters and their dependencies, and, thus, I don't know which to begin with, as I feel like all of them need to be considered simultaniously. Furthermore, there are even more formatting requirements to fulfill, yet, the following should be the most essential ones, which is why I want to implement these first and condensed them in a table: I use the KOMA-script class scrreprt and would have used the parskip=full- option to seperate paragraphs from each other. If there is any info missing, please tell me and I'll provide it. And if some requirement seems odd, please also let me know. Thanks in advance! EDIT - This MWE should cover all eventualities: \LoadClass[a4paper,parskip=full-]{scrreprt} \RequirePackage[top=3.5cm,bottom=2.5cm,left=3cm,right=3cm]{geometry} \begin{document} \chapter{Chapter Chapter Chapter Chapter Chapter} \section{Section Section Section Section Section Section Section Section} \subsection{Subsection Subsection Subsection Subsection Subsection Subsection Subsection} \subsubsection{Subsubsection Subsubsection Subsubsection Subsubsection Subsubsection Subsubsection} Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph \subsubsection{Subsubsection} Paragraph \subsection{Subsection} Paragraph \section{Section} Paragraph \end{document}

  • Different LaTeX compilers affect the depth of hyperlink boxes
    by 許秋迟 on April 29, 2026 at 1:30 pm

    I have the following example(From display inline style affected the hyperlink box's size?): \documentclass{article} \everymath{\displaystyle} \usepackage{xcolor} \usepackage{lipsum} \usepackage{amsmath} \usepackage{zref-clever}%<- \usepackage{hyperref} \hypersetup{linkbordercolor=magenta} \begin{document} \section{Mathematical Expressions} \begin{equation} a^2+b^2=c^2 \label{eqn} \end{equation} \lipsum[1][1-3] cite the eqn at here \zcref{eqn} and $\iint x^2+y^2 \, dx \, dy$ lalala \lipsum[1][1-3] cite the eqn at here \ref{eqn} and $\iint x^2+y^2 \, dx \, dy$ lalala \lipsum[1][1-3] cite the eqn at here \eqref{eqn} and $\iint x^2+y^2 \, dx \, dy$ lalala \lipsum[1][1-3] \end{document} When using pdfLaTeX or LuaLaTeX But When using XeLaTeX Different LaTeX compilers affect the depth of hyperlink boxes. Is this expected behavior, and why specifically?

  • Creating a custom symbol in TikZ whose colour agrees with that of the surrounding text
    by varkor on April 29, 2026 at 11:36 am

    I have created a custom ⍟ symbol using TikZ, which works well, except that it ignores the colour of the surrounding text. MWE: \documentclass{article} \usepackage{tikz} \usepackage{scalerel} \newsavebox{\whitecircstar}\sbox{\whitecircstar}{\kern.075em\tikz{\node[draw, circle,line width=.36pt, inner sep=0]{$*$};}\kern.075em} \newcommand{\ostar}{\mathbin{\scalerel*{\usebox{\whitecircstar}}{\odot}}} \begin{document} \textcolor{red}{Before $\ostar$ After} \end{document} Output: How can I make \ostar the same colour as the surrounding text? My understanding was that . was a special symbol for the current colour in xcolor, but adding color=. to the node arguments had no effect.

  • $\implies$ makes "! Missing } inserted" error
    by Harry on April 29, 2026 at 11:17 am

    In my tex I have a sentence: No external torque $\implies$ Angular momentum $L$ is conserved: After I compile the tex file, it throws out "! Missing } inserted" error. If I delete the $\implies$ in the above sentence, all is fine. Why and how to solve it? The whole tex code (I run it with XeLatex+MakeIndex+BibTex): \documentclass{beamer} % 默认就是 4:3 \usetheme{Madrid} \usecolortheme{seahorse} \usepackage{amsmath} \usepackage{amssymb} \usepackage{physics} \usepackage{tikz} \usepackage{tikz-3dplot} \usetikzlibrary{calc, decorations.markings, arrows.meta, angles, quotes} \usetikzlibrary{patterns,decorations.pathmorphing} \usepackage{amsfonts} \usepackage[utf8]{inputenc} \usepackage[T3,T1]{fontenc} \usepackage{tipa} \usepackage{xcolor} \usepackage{booktabs} % 用于绘制专业的表格线 \usepackage{setspace} \usepackage{fontspec} % 如果你是 Windows 用户,通常 Arial 包含最全的音标字符 \setmainfont{Arial} \usepackage{siunitx} \begin{document} \begin{frame}{Exercise: Angular Momentum Conservation} \textbf{Problem:} \\ Two flywheels $A$ and $B$ share a common axis. Initially, $B$ is at rest, and $A$ rotates with angular velocity $\omega_A$. After they are coupled by clutch $C$, they rotate together with velocity $\omega$. Find $J_B$ if $A$'s moment of inertia is $J_A$. \textbf{Solution:} \\ No external torque $\implies$ Angular momentum $L$ is conserved: \begin{equation*} J_A \omega_A = (J_A + J_B) \omega \end{equation*} \pause \end{frame} \end{document}

  • LuaLatex fontspec problem
    by Stéphane Ducasse on April 29, 2026 at 9:28 am

    I face the following problem since I migrated to texlive 2025 with the deprecation of gentium-tug When I build my books on a minimnal installation I get the following error (/home/runner/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty (/home/runner/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty (/home/runner/texlive/texmf-dist/tex/latex/base/fontenc.sty) (/home/runner/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))) luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: File not found: "Gentium-Regular.ttf". ! Package fontspec Error: (fontspec) The font "Gentium-Regular" cannot be found; this (fontspec) may be but usually is not a fontspec bug. Either (fontspec) there is a typo in the font name/file, the font is (fontspec) not installed (correctly), or there is a bug in (fontspec) the underlying font loading engine (fontspec) (XeTeX/luaotfload). It is working locally on my LaTeX 2025 installation going from %%% %%% Fonts & paragraph typography %%% \RequirePackage{fontspec,gentiumbook,opensans,FiraMono} \setmainfont{Gentium Book Plus} \setsansfont{Open Sans}[ \@ifpackagelater{opensans}{2019/06/19}% test for font naming bug {}% 2019/06/20 fixed it {BoldFont = {* Bold},} Scale=MatchLowercase, Numbers=OldStyle ] \setmonofont{Fira Mono}[ Scale=MatchLowercase, HyphenChar={-} % enable hyphenation (disabled by default in mono fonts) % caveat: LuaLaTeX doesn't support changing the actual character % alternative solution: \usepackage[htt]{hyphenat} ] to %%% %%% Fonts & paragraph typography %%% \RequirePackage{fontspec,opensans,FiraMono} \setmainfont{GentiumBookPlus} \setsansfont{Open Sans}[ sBoldFont = {* Bold}, Scale=MatchLowercase, Numbers=OldStyle ] \setmonofont{Fira Mono}[ Scale=MatchLowercase, HyphenChar={-} % enable hyphenation (disabled by default in mono fonts) % caveat: LuaLaTeX doesn't support changing the actual character % alternative solution: \usepackage[htt]{hyphenat} ] It works but my problem is that I build a system that helps users to generate books written in markdown and automatically translated to LaTeX and I propose a smaller version of texlive and hosting it on github Here are the dependencies I extract from my builds. TeX Live 2025 is frozen and will no longer be routinely updated. This happens when a new release is made, or will be made shortly. For general status information about TeX Live, see its home page: https://tug.org/texlive tlmgr: package repository https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2025/tlnet-final/ (verified) tlmgr install: package already present: cm tlmgr install: package already present: graphics tlmgr install: package already present: graphics-cfg tlmgr install: package already present: graphics-def tlmgr install: package already present: l3backend tlmgr install: package already present: l3kernel tlmgr install: package already present: latex tlmgr install: package already present: latex-fonts tlmgr install: package already present: latexconfig tlmgr install: package already present: lua-uni-algos tlmgr install: package already present: lualibs tlmgr install: package already present: luaotfload tlmgr install: package already present: tex-ini-files tlmgr install: package already present: unicode-data [1/65, ??:??/??:??] install: atbegshi [5k] [2/65, 00:01/01:18:23] install: atveryend [2k] [3/65, 00:01/01:02:50] install: auxhook [2k] [4/65, 00:02/01:38:01] install: bigintcalc [7k] [5/65, 00:02/52:40] install: bitset [6k] [6/65, 00:02/37:28] install: booktabs [3k] [7/65, 00:03/50:34] install: environ [2k] [8/65, 00:03/46:34] install: epstopdf.x86_64-linux [1k] [9/65, 00:03/45:52] install: epstopdf [15k] [10/65, 00:04/37:52] install: epstopdf-pkg [5k] [11/65, 00:04/34:12] install: etexcmds [3k] [12/65, 00:05/40:27] install: etoolbox [9k] [13/65, 00:05/33:57] install: euenc [4k] [14/65, 00:05/32:02] install: filehook [5k] [15/65, 00:06/35:25] install: fira [15170k] [16/65, 00:09/00:12] install: fontaxes [5k] [17/65, 00:09/00:12] install: fontspec [27k] [18/65, 00:09/00:12] install: footmisc [8k] [19/65, 00:10/00:14] install: fp [19k] [20/65, 00:10/00:14] install: gentium-otf [3k] [21/65, 00:11/00:15] install: gettitlestring [3k] [22/65, 00:11/00:15] install: hycolor [4k] [23/65, 00:11/00:15] install: hyperref [88k] [24/65, 00:12/00:16] install: iftex [4k] [25/65, 00:12/00:16] install: import [3k] [26/65, 00:13/00:18] install: infwarerr [3k] [27/65, 00:13/00:18] install: intcalc [6k] [28/65, 00:13/00:18] install: kvdefinekeys [3k] [29/65, 00:14/00:19] install: kvoptions [8k] [30/65, 00:14/00:19] install: kvsetkeys [4k] [31/65, 00:14/00:19] install: l3packages [20k] [32/65, 00:15/00:21] install: letltxmacro [3k] [33/65, 00:15/00:21] install: listings [149k] [34/65, 00:16/00:22] install: ltxcmds [5k] [35/65, 00:16/00:22] install: makecmds [2k] [36/65, 00:17/00:23] install: memoir [68k] [37/65, 00:17/00:23] install: mptopdf.x86_64-linux [1k] [38/65, 00:18/00:25] install: mptopdf [37k] [39/65, 00:18/00:24] install: multirow [3k] [40/65, 00:18/00:24] install: opensans [1979k] [41/65, 00:20/00:24] install: pdfcol [3k] [42/65, 00:20/00:24] install: pdfescape [5k] [43/65, 00:21/00:25] install: pdftexcmds [7k] [44/65, 00:21/00:25] install: pgf [702k] [45/65, 00:22/00:26] install: polyglossia [123k] [46/65, 00:23/00:27] install: ragged2e [3k] [47/65, 00:23/00:27] install: refcount [3k] [48/65, 00:24/00:28] install: rerunfilecheck [4k] [49/65, 00:24/00:28] install: stringenc [23k] [50/65, 00:24/00:28] install: tcolorbox [230k] [51/65, 00:25/00:28] install: textcase [2k] [52/65, 00:26/00:30] install: tikzfill [5k] [53/65, 00:26/00:30] install: tipa [2809k] [54/65, 00:28/00:28] install: tools [47k] [55/65, 00:28/00:28] install: trimspaces [1k] [56/65, 00:29/00:29] install: ulem [7k] [57/65, 00:29/00:29] install: uniquecounter [3k] [58/65, 00:29/00:29] install: url [6k] [59/65, 00:30/00:30] install: varwidth [5k] [60/65, 00:30/00:30] install: xcolor [18k] [61/65, 00:30/00:30] install: xkeyval [9k] [62/65, 00:31/00:31] install: xpatch [2k] [63/65, 00:31/00:31] install: xtab [5k] [64/65, 00:32/00:32] install: xunicode [26k] [65/65, 00:32/00:32] install: zapfding [46k] running mktexlsr ... done running mktexlsr. running updmap-sys ... done running updmap-sys. regenerating fmtutil.cnf in /home/runner/texlive/texmf-dist running fmtutil-sys --byfmt mptopdf --no-error-if-no-engine=luametatex,luajithbtex,luajittex,mfluajit --status-file=/tmp/yCFX9JaktR/XWxxYEwl7V ... OK: mptopdf.fmt/pdftex tlmgr: package log updated: $TEXDIR/texmf-var/web2c/tlmgr.log tlmgr: command log updated: $TEXDIR/texmf-var/web2c/tlmgr-commands.log I tried \setmainfont[Ligatures=TeX,]{Gentium-Regular.ttf} as mentioned in another post. but did not work. I spent several days already trying to solve this problem but I miserably failed. Any

  • Multiple splits in Tikz rectangle with distinct lines
    by iago on April 29, 2026 at 9:24 am

    My goal is to get a rectangle like the one below, but with text in the nested rectangles. Line types could be for example the following: I saw tikz: Multiple splits of rectangle, but it does not answer the question on the line types. Beyond that, I am a beginner using Tikz, and I'd like the answer explained, since the linked answer is complex to understand. Thanks!

  • Minipage figures are not aligned horizontally
    by Tarran M on April 29, 2026 at 9:12 am

    Not sure what is wrong with my minipage figures, this is the same kind of layout that I have used in the past with no problems, but for some reason now it is not working. I am trying to have all four figures have the same width, with all the captions also aligned on the same line. The following code \documentclass[12pt, a4paper, twoside, openright]{article} \usepackage{graphicx} \usepackage{float} \usepackage{caption} \begin{document} \begin{figure}[h!] \centering \begin{minipage}{0.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{images/quartier_1.png} \caption{Quartier 1}\label{fig:q1} \end{minipage}\hfill \begin{minipage}{0.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{images/quartier_2.png} \caption{Quartier 2}\label{fig:q2} \end{minipage} \hfill \begin{minipage}{0.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{images/quartier_3.png} \caption{Quartier 3}\label{fig:q3} \end{minipage} \begin{minipage}{0.25\textwidth} \centering \includegraphics[width=0.9\textwidth]{images/quartier_4.png} \caption{Quartier 4}\label{fig:q4} \end{minipage} \end{figure} \end{document} returns the following result:

  • Cref (or ref) is referring to wrong theorem numbers [closed]
    by Aditya Thorat on April 29, 2026 at 8:51 am

    In my overleaf document, some of my theorem numbers are changed by \ref for example, when I click Lemma 2.1 goes to Lemma 1.1 and lemma 2.2 goes to lemma 1.2. The section number is wrong. When I remove numberwithin=section, everything works fine. But I want to have separate numbering for each section. Here is an example document: \documentclass[11 pt]{amsart} \usepackage{amsmath} \usepackage{etoolbox} \usepackage[foot]{amsaddr} \usepackage{graphicx} % Required for inserting images \usepackage{enumitem} \usepackage{caption} \usepackage{subfigure} \usepackage{subcaption} \usepackage{float} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{patterns} \usepackage{tcolorbox}%for comments \usepackage{blindtext} %for \text % for \tags and \eqref macros \usepackage{amssymb} \usepackage{amsthm} \usepackage{mathtools} \usepackage{mathrsfs} \usepackage{mdframed} \usepackage{lipsum} \usepackage{mathtools} \usepackage{color} \usepackage{setspace} \doublespacing \usepackage[margin=1in]{geometry} \usepackage{thmtools, thm-restate} \declaretheorem[numberwithin=section]{theorem} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{cor}[theorem]{Corollary} \newtheorem{question}[theorem]{Question} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem{notation}[theorem]{Notation} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{remark}[theorem]{Remark} \newtheorem{fact}[theorem]{Fact} \usepackage[hidelinks]{hyperref} \hypersetup{linktocpage, colorlinks=true, linkcolor= red } \usepackage{cleveref} \author[Aditya Thorat]{Aditya Thorat} \title{Rnadddjlk} \author{Aditya Thorat} \date{May 2026} \begin{document} \maketitle \section{First} \begin{lemma}\label{lemma: first} something \end{lemma} \pagebreak \section{Second} \begin{lemma}\label{lemma: second} something else. \end{lemma} \pagebreak \section{Third} By lemma \ref{lemma: second} and \ref{lemma: first} the following follows. \end{document}

  • Unexpected spacing with negative coordinates in a command for projective coordinates using `expl3`
    by Antonio on April 29, 2026 at 6:57 am

    I have an issue with the following code, kindly provided by egreg some time ago answer by egreg. It worked well, but I recently noticed an unwanted behavior. I am not sufficiently familiar with expl3 to fix it myself, nor do I fully understand how the code works. \ExplSyntaxOn \NewDocumentCommand{\pc}{m} % projective coordinates { \seq_set_split:NVn \l_tmpa_seq \c_colon_str { #1 } ( \seq_use:Nn \l_tmpa_seq { \mspace{1\medmuskip}{:}\mspace{1\medmuskip} } ) } \ExplSyntaxOff \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{aligned} &(a:b:c) & & (1:-1:2) & &\qquad\verb|standard|\\ &\pc{a:b:c} & & \pc{1:-1:3} & &\qquad\verb|with \pc command|\\ &(a:-b:c) & & (1:-2:3) & &\qquad\verb|standard|\\ &\pc{a:-b:c}& & \pc{1:-2:3} & &\qquad\verb|with \pc command| \end{aligned} \] \[ \pc{a,b,c,d}\quad \pc{a;b;c;d,e,f:g:h:i,l} \] \end{document} Here is the output of the minimal working example: The actual issue appears when a coordinate other than the first is negative (for example \pc{a:-b:c} or \pc{1:-2:3}), where the spacing/output differs from the standard notation. As an aside, I also do not understand why commands such as \pc{a,b,c} or \pc{a;b;c:d} produce the output they do. Could someone explain what is happening here, and how to modify the macro so that it behaves correctly in all cases?

  • How to add a translucent background picture on a title page, behind titles?
    by Cham on April 28, 2026 at 10:08 pm

    I would like to add a very large picture on a title page, covering the whole page with a large offset (picture pasted to the upper-left side of the page), blended on the page background (below the title, author's name and other text elements), with some transparency effect, and background blending effect. How should we achieve this? The picture is supposed to be partly shown on the page, about half of it showing on the upper-left side, like an "intrusion" on the page (sorry for the bad english description. I hope you get the picture). Here's a MWE to be modified, showing a title page prototype: \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{titlesec} \usepackage{graphicx} \usepackage[dvipsnames]{xcolor} \usepackage{float} \usepackage{fancyhdr} \usepackage[titles]{tocloft} \usepackage{shadowtext} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \frontmatter % Title Page : \begin{titlepage} \definecolor{lightbrown}{RGB}{177, 149, 93} \definecolor{darkbrown1}{RGB}{58, 41, 26} \definecolor{darkbrown2}{RGB}{50, 30, 0} % Frame : \begin{tikzpicture}[remember picture, overlay] \draw[line width = 1in,color = white] ($(current page.north west) + (0.25in,0.25in)$) rectangle ($(current page.south east) + (0.25in,-0.25in)$); \draw[line width = 0.25pt,color = black] ($(current page.north west) + (0.75in,-0.25in)$) rectangle ($(current page.south east) + (-0.25in,0.25in)$); %\draw[line width = 1pt,color = darkbrown1] ($(current page.north west) + (1in,-0.5in)$) rectangle ($(current page.south east) + (-0.5in,0.5in)$); \end{tikzpicture} \shadowoffsetx{2.5pt} \shadowoffsety{3.5pt} \shadowcolor{gray!80} \definecolor{pagetitre}{RGB}{150,120,100} \pagecolor{pagetitre} \centering \vspace*{\baselineskip} \vfill {\textcolor{black}{\fontsize{26}{0}\selectfont\sffamily\textbf{\shadowtext{Some Nice Title Here}}}} \\[2.5\baselineskip] {\textcolor{black}{\huge\sffamily\scshape Someone}} \vfill \vfill \includegraphics[width=11cm]{example-grid-100x100pt} \vfill {\textcolor{black}{\Large\selectfont\sffamily\scshape Some copyright notice}} \end{titlepage} \pagecolor{white} Blabla \end{document} So how can I add a very large picture blended with the page background colour, with some transparency effect, and a large up-left offset? The large picture should fit inside the frame defined with the tikzpicture environment, and stay below all text on the title page.

  • How can I include an image in a header in LaTeX?
    by Javier Cabezas Zapata on April 28, 2026 at 6:08 pm

    I am trying to include an image in the center part of the header (between the course name and semester, and the professor's name. I have tried but it keeps moving, or hiding text behind. Here's my code: \documentclass[12pt]{article} \usepackage{color,fancyhdr,ifthen,amssymb,amsfonts,amsmath} \usepackage{ragged2e} \usepackage[table]{xcolor} \usepackage{makecell} \usepackage{inputenc} \pagestyle{fancy} \setlength{\topmargin}{-.5in} \setlength{\textheight}{9in} \setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{0in} \setlength{\textwidth}{6.5in} \setlength{\headwidth}{\textwidth} \parindent=0em \newcommand{\forceindent}{\leavevmode{\parindent=2em\indent}} \newcounter{questionNumber} \setcounter{questionNumber}{1} \newcommand{\headandfoot}[3]{\lhead{#1}\chead{ \includegraphics[width=2cm,height=\n1]{VU_CLAS.png}} }\rhead{Dr. Name{\\{\hspace{}}}{}} \lfoot{}\cfoot{}\rfoot{\thepage} \linespread{1.75} \headandfoot{SPA 1122 -- Spring 26 \\ Examen Final}{}{} \setlength{\headsep}{0.5in} \begin{document} \begin{FlushRight} \vspace{1em} Nombre: \underline{\hspace{8cm}} \\ \vspace{0.2cm} Nota: \underline{\hspace{2cm}} / 100 \end{FlushRight} \end{document}

  • How to add two-sided harpoon arrows with proper label position elegantly?
    by Explorer on April 27, 2026 at 5:14 pm

    Learning from the link here and here, I have the following code: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]}, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \node[draw,circle,fill=teal] (A) at (0,1) {A}; \node[draw,circle,fill=magenta] (B) at (0,-1) {B}; \node[draw,circle,fill=cyan] (C) at (2.5,.5) {C}; \draw[-foo,mystyle,transform canvas={xshift=-0.3ex}] (A) -- node[left] {$\Delta$} (B); \draw[foo-,mystyle,transform canvas={xshift=+0.3ex}] (A) -- node[right] {$\nabla$} (B); % \draw[dualharpoon={$\Delta$}{$\nabla$}] (A) -- (B); % ? \draw[-foo,mystyle,transform canvas={yshift=-0.3ex}] (B) -- node[below right=-3pt] {$f(x)$} (C); \draw[foo-,mystyle,transform canvas={yshift=+0.3ex}] (B) -- node[above left=-3pt] {$g(x)$} (C); % \draw[dualharpoon={$f(x)$}{$g(x)$}] (B) -- (C); % ? \end{tikzpicture} \end{document} I want more smartly syntax like: \draw[dualharpoon={$\Delta$}{$\nabla$}] (A) -- (B); \draw[dualharpoon={$f(x)$}{$g(x)$}] (B) -- (C); which control exactly how much to xshift/yshift moved towards in the direction perpendicular to the connection between the two nodes, in addition, I also don't want to decide the node's position by above left=-3pt manually. Any suggestions on how to support such two-sided harpoon arrow with label? Edited after cfr's answer(first edition): % Source - https://tex.stackexchange.com/a/762315 % Posted by cfr % Retrieved 2026-04-28, License - CC BY-SA 4.0 \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \makeatletter \newcommand\dualharpoon{} \newcommand\dualharpoon@aux{} \newcommand\dualharpoon@noaux{} \protected\def\dualharpoon{% \@ifnextchar[\dualharpoon@aux\dualharpoon@noaux } \protected\def\dualharpoon@noaux{% \dualharpoon@aux[]% } \long\protected\def\dualharpoon@aux[#1]#2#3#4#5{% \path (#4.center); \pgfgetlastxy{\temp@ax}{\temp@ay} \path (#5.center); \pgfgetlastxy{\temp@bx}{\temp@by} \edef\temp@angle{\fpeval{(atan((\temp@by-\temp@ay)/(\temp@bx-\temp@ax)))*(180/pi)}} \draw[-foo,mystyle] (#4.{\temp@angle - 5}) -- coordinate (temp@1) (#5.{185 + \temp@angle}); \node[anchor={90+\temp@angle}] at (temp@1) {#2} ; \draw[foo-,mystyle] (#4.{\temp@angle + 5}) -- coordinate (temp@2) (#5.{175 + \temp@angle}); \node[anchor={270+\temp@angle}] at (temp@2) {#3}; } \makeatother \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]}, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \node[draw,circle,fill=teal] (A) at (0,1) {A}; \node[draw,circle,fill=magenta] (B) at (0,-1) {B}; \node[draw,circle,fill=cyan] (C) at (2.5,.5) {C}; \node[draw,circle,fill=olive] (D) at (-3,1) {D}; \dualharpoon{$\Delta$}{$\nabla$}{A}{B} \dualharpoon{$g(x)$}{$f(x)$}{B}{C} \dualharpoon{$p$}{$q$}{B}{D} \end{tikzpicture} \end{document}

  • How can we obtain a smoother sphere when cutting it with a plane and moving the cut portion?
    by minthao_2011 on April 26, 2026 at 11:11 am

    I am using this code in luadraw to cut a sphere with a plane and move one of the cut parts to another position. Currently, the surface of the sphere is not really smooth. If I increase the number in this line local S = sphere(Origin, R, 60, 60) to a larger value, the compilation becomes slower. How can I make the sphere smoother? \documentclass[border=5pt]{standalone} \usepackage[svgnames]{xcolor} \usepackage[3d]{luadraw} \begin{document} \begin{luadraw}{name=sphere_clip3d_fixed} local R = 3 local g = graph3d:new{window={-R-2, R+1, -R-1, R}, viewdir={110, 60}, size={10, 10}} Hiddenlinestyle = "dashed" local S = sphere(Origin, R, 60, 60) local Box = parallelep(M(-5,-5,1.5), 10*vecI, 10*vecJ, 10*vecK) local S_top = clip3d(S, Box) local S_bottom = clip3d(S, Box, true) local vector = 2*vecK + 5*vecJ local S_top_shifted = shift3d(S_top, vector) local I_bottom = border(S_bottom) local I_top_shifted = border(S_top_shifted) g:Dscene3d( g:addFacet(S_bottom, {draw="ball color=orange", color="orange", backcull=true}), g:addFacet(S_top_shifted, {draw="ball color=orange", color="orange", backcull=true}), g:addPolyline(I_bottom, {color="Navy", hidden=true}), g:addPolyline(I_top_shifted, {color="Navy", hidden=true}) ) g:Show() \end{luadraw} \end{document}