Week
- an error with using a variable defined by pgfmathsetmacro in "let...in..."by Khánh Bùi on December 29, 2025 at 10:30 am
An error occurs when I try to create the point C1. How can I fix this? \documentclass[12pt,a4paper]{book} \usepackage[left=1cm, right=1cm, top=2cm, bottom=2cm]{geometry} \usepackage{mathtools, amssymb, amsthm, amsmath} \usepackage{tikz} \usetikzlibrary{intersections,calc} \begin{document} \begin{tikzpicture} \path (2,5) coordinate (B) (4,0) coordinate (C) ($(B)!1/3!(C)$) coordinate (L) ; % CALCULATE BL and CL and assign them to \bl and \cl respectively \path let \p1 = (B), \p2 = (C), \p3 = (L), \n1 = {veclen(\x1-\x3,\y1-\y3)}, \n2 = {veclen(\x2-\x3,\y2-\y3)} in \pgfextra{ \pgfmathsetmacro{\bl}{\n1} \pgfmathsetmacro{\cl}{\n2} } ; \path ($(C) + (30:\cl)$) coordinate (C1) ; \draw[fill=red] (C1) circle (2pt); \end{tikzpicture} \end{document} after compiling, it said : test.tex: error: 32: Undefined control sequence. ($(C) + (30:\cl) test.tex: error: 32: Missing number, treated as zero. ($(C) + (30:\cl) test.tex: error: 32: Undefined control sequence. ($(C) + (30:\cl) test.tex: error: 32: Argument of \pgfmath@@onquick has an extra }. ($(C) + (30:\cl) test.tex: error: 32: Paragraph ended before \pgfmath@@onquick was complete. ($(C) + (30:\cl)
- Footnote overlaps last line when the next page starts with a theorem under certain conditionsby Utkan Gezer on December 29, 2025 at 4:34 am
For some reason, if the next page begins with a theorem and thmtools (with amsthm) is used or the theorem has a label that is given right at the beginning of the theorem the space between the footnote and the last line on this page gets smaller (and even negative) with increasing \parskip. This continues, until the \parskip gets too large, in which case the space just becomes normal. When \baselinestretch (or \setstretch) is used, the effects get so accentuated that the footnote starts to overlap the page contents. Adding 12pt option to \documentclass also seems to increase the allowance on how much \parskip can be increased, which further worsens the situation. Here is an example: \documentclass{article} \usepackage{lipsum} \usepackage{amsthm} \usepackage{setspace} % \renewcommand{\baselinestretch}{1.5} \setstretch{1.5} \setlength{\parskip}{21pt} \newtheorem{theorem}{Theorem} \begin{document} \lipsum[1] \lipsum[1]\footnote{\lipsum[1][1]} \lipsum[1][1-10] \begin{theorem}\label{thm:A} \lipsum[1][1-4] \end{theorem} \end{document} Putting the \label to the end of theorem is not a great workaround, since that, for some reason, adds extra space after the theorem if the contents of the theorem is only a display math (which is the situation in my case). See MWE: \documentclass{article} \usepackage{lipsum} \usepackage{amsthm} \usepackage{setspace} % \renewcommand{\baselinestretch}{1.5} \setstretch{1.5} \setlength{\parskip}{21pt} \newtheorem{theorem}{Theorem} \begin{document} \lipsum[1] \lipsum[1]\footnote{\lipsum[1][1]} \lipsum[1][1-10] \begin{theorem} $$TEST$$ \label{thm:A} % Move this line above the display math and the huge space below shrinks \end{theorem} \lipsum[1] \end{document} Adding a non-breaking space (~) in front of the \label fixes the issue. I can do away with this workaround, but my question is: Why is the overlap happening? How can the overlap be fixed properly (with something in the preamble)?
- Custom list not incrementing properlyby azetina on December 28, 2025 at 7:11 pm
Consider the following MWE: \documentclass{article} \usepackage{amsmath} \usepackage{enumitem} \usepackage{ragged2e} \usepackage{array,booktabs} %----------------------------------------------------------------------------------------------------------------------------- % Create new list environment %----------------------------------------------------------------------------------------------------------------------------- \newlist{csecmoduleso}{enumerate}{2} % Only 2 level needed \newcounter{csecmodulesocounter}[table] % Format the item label \renewcommand{\thecsecmodulesocounter}{\thesubsection.\arabic{csecmodulesocounter}} \setlist[csecmoduleso,1]{ label=\thecsecmodulesocounter, % Produces 1.1.1., 1.1.2., etc. ref=\thecsecmodulesocounter, % For referencing leftmargin=*, align=left, labelwidth=3em, labelsep=0.5em, noitemsep, before={\refstepcounter{csecmodulesocounter}\begin{minipage}[t]{\hsize}\RaggedRight}, after={\end{minipage}}, %resume } \begin{document} \section{test} \subsection{subtest} \begin{tabular}{@{}p{\dimexpr0.5\textwidth-\tabcolsep\relax}p{\dimexpr0.5\textwidth-\tabcolsep\relax}@{}} \begin{csecmoduleso} \item Test \item My name \item My name \item My name \item My name \end{csecmoduleso} & b\\ %\addlinespace[2ex] This is needed as text overlaps \begin{csecmoduleso} \item Test \end{csecmoduleso} & b\\ \begin{csecmoduleso} \item Test \end{csecmoduleso} & b\\ \end{tabular} \end{document} I am currently getting: 1.2.1 Test 1.2.1 My name 1.2.1 My name 1.2.1 My name 1.2.1 My name 1.2.2 Test 1.2.3 Test Why isnt the counter increasing after the first item 1.2.1?
- Three fonts supports for polyglossia package?by Explorer on December 28, 2025 at 5:32 pm
The code is partially taken from egreg's this answer. I want to typeset the following three languages with three fonts: English: EB Garamond Chinese: FandolSong Greek: Old Standard Noted that I want to write an "English and Chinese" mixed article(which means that it need to switch frequently) to introduced the third language——Greek. As below: \documentclass{book} \usepackage{fontspec} \usepackage{polyglossia} \setmainlanguage{english} \setmainfont{EB Garamond}% English \newfontfamily{\chinesefont}{FandolSong}% Chinese \setotherlanguage{greek} \newfontfamily{\greekfont}{Old Standard}% Greek \begin{document} I want to typeset an article, whose main text is the combination of English, Chinese, which is used to introduced the Greek letters. I want three fonts for them. So, I want to use English and Chinese, switching frequently. And use Greek fonts in whole paragraph. \bigskip English: English Saṃskṛtāvāk Chinese: {\chinesefont 英语、中文 01234 这是一个测试} Greek: {\greekfont τὸν πόλεμον τῶν Ἀθηναῖος} It works well. However, what I want in the real case, is as follows: \bigskip An paragraph of English and Chinese, which shifts frequently. 我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。我是英语 English 和中文 Chinese 混排。 {\chinesefont 我是英语} English {\chinesefont 和中文} Chinese {\chinesefont 混排。} is okay, but extremely difficult to switch... Then a paragraph of Greek letters. \textgreek{Θουκυδίδης Ἀθηναῖος ξυνέγραψε τὸν πόλεμον τῶν Πελοποννησίων καὶ Ἀθηναίων, ὡς ἐπολέμησαν πρὸς ἀλλήλους, ἀρξάμενος εὐθὺς καθισταμένου καὶ ἐλπίσας μέγαν τε ἔσεσθαι καὶ ἀξιολογώτατον τῶν προγεγενημένων, τεκμαιρόμενος ὅτι ἀκμάζοντές τε ᾖσαν ἐς αὐτὸν ἀμφότεροι παρασκευῇ τῇ πάσῃ καὶ τὸ ἄλλο Ἑλληνικὸν ὁρῶν ξυνιστάμενον πρὸς ἑκατέρους, τὸ μὲν εὐθύς, τὸ δὲ καὶ διανοούμενον.} It's hard for \texttt{polyglossia} to support an English font together another Chinese font. Is that any ideas? \end{document} I can't set Chinese and English fonts seperately, so frequently switch is quite difficult. I have also tried Fallback, but it doesn't work: \setmainfont[Fallback=FandolSong]{EB Garamond} If somebody get familiar with ctex-bundle, to set Chinese fonts and English fonts seperately, we could use: \usepackage{ctex} \setmainfont{EB Garamond} \setCJKmainfont{FandolSong} However, polyglossia is a little bit conflict with ctex(That maybe my another question or issues). So, this post, I was only after for a ployglossia(or babel) solution.
- With mini frames, beamer content too far downby scottkosty on December 28, 2025 at 5:11 pm
The content in some of my frames extends too far down, even when there is vertical space above that could be used. Here is an example. I would prefer for it to use the vertical space at the top before extending off the page. Is there a clean way to accomplish (at least part) this without doing a manual negative vspace? \documentclass{beamer} \useoutertheme{smoothbars} \begin{document} \section{Summation operator and the mean} \begin{frame} \begin{theorem} Is the following equality necessarily true? \[ \sum^{n}_{i=1}\left(ax_{i}+by_{i}\right)=a\sum^{n}_{i=1}x_{i}+b\sum^{n}_{i=1}y_{i} \] \end{theorem} % \begin{theorem} Yes, it is true. But what's the intuition for it? \end{theorem} \begin{itemize} \item Whenever you're stuck proving a general statement, it's often useful to try a special case. For example, what if $n$ equals 2? \begin{block}{} Then the question reduces to the following: \begin{align} \left(ax_{1}+by_{1}\right)+\left(ax_{2}+by_{2}\right) & \,\,\,=\,\,\,a(x_{1}+x_{2})+b(y_{1}+y_{2})\\ & \Longleftrightarrow\\ \left(ax_{1}+ax_{2}\right)+\left(by_{1}+by_{2}\right) & \,\,\,=\,\,\,a(x_{1}+x_{2})+b(y_{1}+y_{2}) \end{align} \end{block} \item We're summing the same numbers, just in a different order! \end{itemize} \end{frame} \end{document} Here is the result that I get: I understand there is no so much vertical space at the top, but I would still rather have the "Theorem" text start just after the mini frames, rather than content go off the page. Maybe what I'm asking for is "vfill" behavior, where it stretches or squeezes depending on the situation?
- How to make a command "eat" a space? [duplicate]by user424920 on December 28, 2025 at 11:03 am
I searched for something similar, but I didn't find anything. \documentclass{report} \usepackage{amsmath} \usepackage{mathtools} \DeclareMathOperator{\diff}{d} \begin{document} \[\int x\diff x\] \end{document} I want to get "dx" and not "d x". I was looking at ways to eat spaces after the command, but nothing, I would like to avoid adding the "x" as a parameter to the \diff operator. I would like you know if there is a way.
- Aligning text to drop caps with different distance for each lineby Gary on December 28, 2025 at 6:09 am
It appears that \setupinitial and \placeinitial are the method used to generate drop caps. May I ask a couple general questions, please. In the first example with the "I", how can the second and third lines be shifted to the right? I suppose, instead, the distance could be increased and the first line shifted to the left. In the second and third examples, is it possible to slope the distance to follow the "A" and "W" slopes? In the "I", the three lines of text appear to be aligned vertically; but, with the "A" and "W", the first line ("E") appears to be a bit more to the left than the other two lines. Why is this? Can the LibInit font be defined as 12pt such that the value of n in \setupinitials will set its size? I tried to do so, but it was either turned to bold or appeared as 12pt at the bottom of the third line. Thank you. (I received a lot of help the past couple days and thank you for that. I don't expect an answer to these four points, I just wanted to explain what I would like to do and, perhaps, someone can point me to where I can learn to do so.) \mainlanguage[en] \setuplayout[textwidth=4.0in] \setupbodyfont[libertinus,12pt,serif,regular] \definefont [LibInit] [name:LibertinusSerifInitials-Regular*default at 54pt] \definefontfeature [default] [default] [protrusion=quality,expansion=quality] \setupalign[justified,hyphenated,hanging,hz] \starttext \setupinitial[n=3,m=1,font=normal,hoffset=7pt,distance=-0.2em] \placeinitial {\LibInit I}Ellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec odio elit, dictum in, hendrerit sit amet, egestas sed, leo. Praesent feugiat sapien aliquet odio. Integer vitae justo. \setupinitial[n=3,m=1,font=normal,hoffset=4pt,distance=-0.1em] \placeinitial {\LibInit A}Ellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec odio elit, dictum in, hendrerit sit amet, egestas sed, leo. Praesent feugiat sapien aliquet odio. Integer vitae justo. \setupinitial[n=3,m=1,font=normal,hoffset=3pt,distance=-0.1em] \placeinitial {\LibInit W}Ellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec odio elit, dictum in, hendrerit sit amet, egestas sed, leo. Praesent feugiat sapien aliquet odio. Integer vitae justo. \stoptext
- Why does \textstyle not work in \smashoperator?by John Lee on December 28, 2025 at 3:23 am
In the following code, the \sum in \smashoperator appears too big. But if I put \textstyle\sum in \smashoperator, then it gives the error "*.tex: error: 290: Limit controls must follow a math operator. ...extstyle\sum_{\alpha\in D_{1}\cup D_{2}}}". I don't know what to do and need help. The MWE LaTeX code is as below: \documentclass[11pt,twoside]{article}% \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{mathtools} \usepackage[title,titletoc,header]{appendix} \usepackage{geometry} \usepackage{graphicx} \usepackage{indentfirst} \usepackage{mathrsfs} \usepackage{nopageno} \usepackage{setspace} \usepackage{remreset} \newtheorem{theorem}{Theorem}[section] \newtheorem{definition}[theorem]{Definition} \begin{document} \begin{enumerate} \item $\smashoperator{\sum_{\alpha\in D_{1}\cup D_{2}}}\,x_{\alpha}\,=\underset{\alpha\in D_{1}}{\textstyle\sum}x_{\alpha} \,+\underset{\alpha\in D_{2}}{\textstyle\sum}x_{\alpha}$ \end{enumerate} \end{document}
- Weird Overleaf errorby DavidIsDumb on December 28, 2025 at 2:31 am
I'm writing some math stuff using overleaf but it broke mysteriously. I wrote: \documentclass[11pt]{scrartcl} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage[shortlabels]{enumitem} \usepackage[framemethod=TikZ]{mdframed} \usepackage{amsmath,amssymb,amsthm} \usepackage{epigraph} \usepackage[colorlinks]{hyperref} \usepackage{microtype} \usepackage{mathtools} \usepackage[headsepline]{scrlayer-scrpage} \usepackage{thmtools} \usepackage{listings} \usepackage{derivative} \renewcommand{\epigraphsize}{\scriptsize} \renewcommand{\epigraphwidth}{60ex} \ihead{\footnotesize\textbf{Some text here}} \ohead{\footnotesize Some text here} \providecommand{\re}{\text{Re}} \providecommand{\im}{\text{Im}} \providecommand{\ol}{\overline} \providecommand{\eps}{\varepsilon} \providecommand{\half}{\frac{1}{2}} \providecommand{\dang}{\measuredangle} \providecommand{\CC}{\mathbb C} \providecommand{\FF}{\mathbb F} \providecommand{\NN}{\mathbb N} \providecommand{\QQ}{\mathbb Q} \providecommand{\RR}{\mathbb R} \providecommand{\ZZ}{\mathbb Z} \providecommand{\dg}{^\circ} \providecommand{\ii}{\item} \providecommand{\alert}{\textbf} \providecommand{\opname}{\operatorname} \providecommand{\ts}{\textsuperscript} \DeclareMathOperator{\sign}{sign} \providecommand{\tarc}{\mbox{\large$\frown$}} \providecommand{\arc}[1]{\stackrel{\tarc}{#1}} \reversemarginpar \providecommand{\printpuid}[1]{\marginpar{\href{https://otis.evanchen.cc/arch/#1}{\ttfamily\footnotesize\color{green!40!black}#1}}} \mdfdefinestyle{mdgreenbox}{linecolor=ForestGreen,backgroundcolor=ForestGreen!5, linewidth=2pt,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[headfont=\bfseries\sffamily\color{ForestGreen!70!black}, mdframed={style=mdgreenbox},headpunct={.},]{thmgreenbox} \mdfdefinestyle{mdredbox}{frametitlefont=\bfseries,innerbottommargin=8pt, nobreak=true,backgroundcolor=Salmon!5,linecolor=RawSienna,} \declaretheoremstyle[headfont=\bfseries\color{RawSienna}, mdframed={style=mdredbox},headpunct={\\[3pt]},postheadspace=0pt,]{thmredbox} \mdfdefinestyle{mdblackbox}{linecolor=black,backgroundcolor=RedViolet!5!gray!5, linewidth=3pt,nobreak=true,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[mdframed={style=mdblackbox}]{thmblackbox} \declaretheorem[style=thmredbox,name=Problem]{problem} \declaretheorem[style=thmblackbox,name=Outline,numbered=no]{sol} \declaretheorem[style=thmgreenbox,name=Claim,numbered=no]{claim*} \usepackage{asymptote} \begin{asydef} size(8cm); // set a reasonable default usepackage("amsmath"); usepackage("amssymb"); settings.tex="pdflatex"; settings.outformat="pdf"; import geometry; void filldraw(picture pic = currentpicture, conic g, pen fillpen=defaultpen, pen drawpen=defaultpen) { filldraw(pic, (path) g, fillpen, drawpen); } void fill(picture pic = currentpicture, conic g, pen p=defaultpen) { filldraw(pic, (path) g, p); } pair foot(pair P, pair A, pair B) { return foot(triangle(A,B,P).VC); } pair centroid(pair A, pair B, pair C) { return (A+B+C)/3; } \end{asydef} \begin{document} \title{Some text here} \subtitle{Some text here} \author{Some text here} \date{\today} \maketitle \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} \end{document} When I compile there is no error message, but the last line has a red circle saying "unexpected \end{problem} after $" and the line before that says "unclosed $ found at \end{problem}". All the other probs with this format didn't break, so there's probably no problem with the \end. However, I found that if I type \begin{problem}[some text here] Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} instead for the problem part nothing happens! No error if I delete like half a paragraph. Can somebody explain what is happening? Edit: Also in the first case autocompile doesn't work, saying that my code has errors that must be fixed first before that can run, but for the second case autocompile works. I also found out that autocompile works when I type: \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0.) \end{problem} for the problem, but the last line has the following error message: LaTeX Error: Command \end{mdframed} invalid in math mode. \ (button saying suggest fix using AI) \ Missing $ inserted. \ Missing } inserted. \ Extra }, or forgotten \endgroup.
- DNA helix and chromosome symbols built in tikz-pgf [closed]by Sebastiano on December 27, 2025 at 10:22 pm
I'm wondering if there are predefined symbols chromosomes-dna in pdfLaTeX or done in TikZ similar to those used in biology textbooks. Here two examples: What libraries can I use to create the envelope curves in blue for the "X"? (For the 2-nd figure, credit from wikipedia https://en.wikipedia.org/wiki/Chromosome#/media/File:Chromosome.svg)
- How to call an expl3 function within Lua codeby wehro on December 27, 2025 at 6:55 pm
In an expl3 package a Lua module shall be used because Lua simplifies programming some functions. The Lua module shall call some expl3 functions from the package. But this does not work in all cases. In the following example only \MyDocumentCommandA works, not \MyDocumendCommandB. \begin{filecontents*}{mypackage.sty} \ProvidesExplPackage{mypackage}{2025-12-27}{1.0}{My package} \directlua { myluamodule = require ('myluamodule') } \cs_new:Npn \mypackage_command:n #1 { \int_to_Roman:n {#1} } \NewDocumentCommand \MyDocumentCommandA {m} { \directlua { myluamodule.functionA ( #1 ) } } \NewDocumentCommand \MyDocumentCommandB {m} { \directlua { myluamodule.functionB ( #1 ) } } \end{filecontents*} \begin{filecontents*}{myluamodule.lua} local myluamodule = {} myluamodule.functionA = function (nr) tex.sprint("bla blub ") tex.sprint("\\ExplSyntaxOn") tex.sprint("\\mypackage_command:n{"..nr.."}") tex.sprint("\\ExplSyntaxOff") end myluamodule.functionB = function (nr) tex.sprint("\\section{") myluamodule.functionA(nr) tex.sprint("}") end return myluamodule \end{filecontents*} \documentclass{article} \usepackage{mypackage} \begin{document} \MyDocumentCommandA{75} \MyDocumentCommandB{85} \end{document} The error message is: ! Undefined control sequence. <argument> bla blub \ExplSyntaxOn \mypackage _command:n{85}\ExplSyntaxOff l.43 \MyDocumentCommandB{85}
- Glitch of \overrightarrow with `NewCMMath-Book.otf` font?by Explorer on December 27, 2025 at 10:17 am
I have the following code: \documentclass{article} \usepackage{unicode-math} % \setmathfont{NewCMMath-Regular.otf} % normal \setmathfont{NewCMMath-Book.otf} % abnormal \begin{document} \[ \overrightarrow{e} \quad \overrightarrow{\pi} \quad \overrightarrow{\Pi} \] \end{document} Which gives: We noticed that if the arguments is too wide, the glitch appeared. While it's normal with NewCMMath-Regular.otf:
- aligned inside tikz-cdby Jinwen on December 27, 2025 at 9:11 am
I would like to reproduce the following diagram in Yves André's book: However, it is unclear to me how to produce the multi-line node inside the diagram. Currently, what I could achieve is this: However, the alignment inside aligned is not working the way I expected. May I ask what is the correct way to do this? Thanks! Below is a MWE. \documentclass{article} \usepackage{mathtools,amssymb} \usepackage{tikz-cd} \begin{document} \[ \begin{tikzcd} {\{\,{\text{\( k \)-schémas étales finis}}\,\}} & {\begin{aligned} &\{\, \text{ensembles finis munis}\\ &\quad\text{d'une action continue de \( \mathrm{Gal}(\overline{k}/k) \)}\,\} \end{aligned}} \\ {AM(k)_{\mathbb{Q}}} & {\begin{aligned} &\{\, \text{\( \mathbb{Q} \)‑espaces vectoriels de dimension finie munis}\\ &\quad\text{d'une action linéaire continue de \( \mathrm{Gal}(\overline{k}/k) \)}\,\} \end{aligned}} \arrow["\sim", from=1-1, to=1-2] \arrow["{\mathfrak{h}}"', from=1-1, to=2-1] \arrow["{\mathfrak{l}}", from=1-2, to=2-2] \arrow["\sim", from=2-1, to=2-2] \end{tikzcd} \] \end{document}
- Interleave blank pages at specific locationsby MysteryGuy on December 26, 2025 at 2:55 pm
All is in the title: I have a current document with (plain) numbered pages and I would like to interleave blank pages but only after current page 3, that is, put one blank page between every plain page, starting from page 3 (so keep my current pages 1, 2, 3 unchanged, then start interleaving blank pages). These blank pages should be either numbered or not numbered but keeping the numbering of the plain pages coherent (i.e., I don't want to go from plain page 4 to 6). I can not use newpage since of course, I don't exactly know where the page breaks might occur regarding the content. Thanks in advance for help !
- Epicycle and deferent of the Ptolemaic modelby Sebastiano on December 26, 2025 at 2:22 pm
About 15 years ago, I had created a drawing using GeoGebra that looks similar to the attached image. The source .ggb file from GeoGebra is available here, and I'm happy to share it with anyone interested. I was wondering if it's possible to replicate this drawing exactly using TikZ-PGF. I have the .ggb file and I'm wondering if there's a way to convert it or if TikZ can reproduce the same graphic. Additionally, I found a more recent package, named pst-sphericaltrochoid, which might be useful for generating spherical trochoid curves, and the package is documented in the PDF manual from December 25, 2025. Moreover, I would like to have this drawing animated in LaTeX. When export in tikz-pgf using Geogebra the output is not the expected result like the image (with animations). I never done a drawing with animate package or similar. \documentclass[10pt]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{ffwwqq}{rgb}{1,0.4,0} \definecolor{zzttqq}{rgb}{0.6,0.2,0} \definecolor{xdxdff}{rgb}{0.49019607843137253,0.49019607843137253,1} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm] \begin{axis}[ x=1cm,y=1cm, axis lines=middle, grid style=dashed, xmin=-24.649425971185988, xmax=51.05123247996474, ymin=-17.77843276444837, ymax=20.90166759086156, xtick={-20,-15,...,50}, ytick={-15,-10,...,20},] \clip(-24.649425971185988,-17.77843276444837) rectangle (51.05123247996474,20.90166759086156); \draw [line width=0.8pt] (0,0) circle (8cm); \draw [line width=0.8pt] (4.690951292494638,6.480353074597315) circle (2cm); \draw[line width=4pt] (-22.73456951795283,17.710240168806287) -- (-9.968859829731798,17.710240168806287); \draw[line width=4pt] (-22.73456951795283,15.157098231162069) -- (-9.968859829731798,15.157098231162069); \begin{scriptsize} \draw [fill=xdxdff] (4.690951292494638,6.480353074597315) circle (0.5pt); \draw[color=xdxdff] (4.137249375752443,7.338101047126645) node {$A$}; \draw [fill=black] (-17.202761986390385,17.710240168806287) circle (2.5pt); \draw[color=black] (-16.096400480077897,19.40169670249558) node {$k = 1.3$}; \draw [fill=zzttqq] (2.345168103332513,5.359058630909856) circle (1pt); \draw[color=zzttqq] (4.392563569516864,6.316844272068956) node {$Pianeta$}; \draw [fill=black] (-17.06092076763237,15.157098231162069) circle (2.5pt); \draw[color=black] (-16.479371770724526,16.848554764851364) node {$v = 5$}; \draw [color=ffwwqq] (0,0) circle (4.5pt); \draw[color=ffwwqq] (1.264964695902711,1.4658745905449386) node {$Sole$}; \end{scriptsize} \end{axis} \end{tikzpicture} \end{document} My idea is to animate the drawing using the animate package for my students of an high school, with the ability to modify parameters and see how the drawing changes in real time. Could I add interactive buttons to allow users to modify the parameters of the animation? If anyone has experience animating drawings in LaTeX, I'd be happy to receive suggestions on how to implement it. Also, how can I animate package this drawing and add interactive buttons to control the parameters?
- natbib option "super" not working properly with make4htby MadyYuvi on December 26, 2025 at 11:13 am
I'm trying with: \documentclass[]{article} \usepackage[numbers,super,sort&compress,comma]{natbib} \begin{document} Test\cite{ref1,ref2,ref3,ref4,ref5,ref6,ref7,ref8,ref9,ref10} \begin{thebibliography}{99} \bibitem{ref1} Entry 1 \bibitem{ref2} Entry 2 \bibitem{ref3} Entry 3 \bibitem{ref4} Entry 4 \bibitem{ref5} Entry 5 \bibitem{ref6} Entry 6 \bibitem{ref7} Entry 7 \bibitem{ref8} Entry 8 \bibitem{ref9} Entry 9 \bibitem{ref10} Entry 10 \end{thebibliography} \end{document} For HTML conversion, I'm trying with make4ht filename and the output was: If I remove the option super, then it works correctly: But I'm in need to use options numbers,super,sort&compress,comma, how can I meet this? Please advise.
- Don't get decimal output with luacasby Fa-Mat on December 26, 2025 at 10:38 am
First of all "Merry Christmas" to everyone. I'm trying to get decimal output with luacas and don't get it. \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \directlua{ a=3 b=8 c=a/b tex.print('$',c,'$') } \end{document} The code above gives the expectet 0.375. Changing to \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \begin{CAS} a=3 b=8 c=Rational(a,b) \end{CAS} $\print{a}$ $\print{b}$ $\print{c}$ $\print{c.numerator}$ $\print{c.denominator}$ \end{document} gives 3, 8, the fraction 3 over 8, 3 and 8. In the manual there is the funtion :asnumber() given but \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \begin{CAS} a=3 b=8 c=Rational(a,b) d=c:asnumber() \end{CAS} $\print{a}$ $\print{b}$ $\print{c}$ $\print{c.numerator}$ $\print{c.denominator}$ $\print{d}$ \end{document} gives Lua-Error and the $\print{d}$ is ignored. I also tried something like d=Rational:asnumber(c) or used the funktions ZZ(), QQ() and RR() but without any success. Also $\print{c:asnumber()}$ fails. Trying to print the decimal with $\directlua{tex.print(string.format("\csstring\%.3f",c))}$ gives also a Lua error ('c' is a table but a number is expected by 'string.format()'). I'm not having any ideas how to solve it any more. Thank you for your help.
- How to make a straight-line stroke that transitions from thick to thin in METAFONT?by Grzegorz Brzczyszczykiewicz on December 25, 2025 at 1:32 pm
is it possible to make a stroke that transitions from thick to thin, like a Chinese brush or a calligraphy pen? Not like a bent hook that fakes the transition using elliptical pens, that one is cheating. I want a perfectly straight line, that starts out thick and transitions to thin. Is it possible to do such a "dynamic brush" effect"?
- Precision issue with Tikz tangent coordinate systemby I. Cho on December 25, 2025 at 12:21 pm
The TikZ tangent coordinate system appears to be inaccurate. The blue and red lines are expected to overlap, but they fail to do so. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \draw [help lines,dotted,thick] (0,0) grid (10,10); \def\rA{.5} \def\rB{4} \coordinate (OA) at (1,1); \coordinate (OB) at (5,5); \path (OA) node (A) [draw,circle,minimum size=2*\rA cm] {A}; \path (OB) node (B) [draw,circle,minimum size=2*\rB cm] {B}; \path ($(A.center)!{\rA/(\rA - \rB)}!(B.center)$) coordinate (X) node [below left] {X}; \path (tangent cs:node=A,point={(X)},solution=1) coordinate (A1); \path (tangent cs:node=A,point={(X)},solution=2) coordinate (A2); \path (tangent cs:node=B,point={(X)},solution=1) coordinate (B1); \path (tangent cs:node=B,point={(X)},solution=2) coordinate (B2); \draw [blue] (X) -- (A1) -- ([turn]0:9cm); \draw [red] (X) -- (B1) -- ([turn]0:5cm); \draw [blue] (X) -- (A2) -- ([turn]0:9cm); \draw [red] (X) -- (B2) -- ([turn]0:5cm); \end{tikzpicture} \end{document} Corrected by adding outer sep=0pt: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \draw [help lines,dotted,thick] (0,0) grid (10,10); \def\rA{.5} \def\rB{4} \coordinate (OA) at (1,1); \coordinate (OB) at (5,5); \path (OA) node (A) [draw,circle,minimum size=2*\rA cm,outer sep=0pt] {A}; %% \path (OB) node (B) [draw,circle,minimum size=2*\rB cm,outer sep=0pt] {B}; %% \path ($(A.center)!{\rA/(\rA - \rB)}!(B.center)$) coordinate (X) node [below left] {X}; \path (tangent cs:node=A,point={(X)},solution=1) coordinate (A1); \path (tangent cs:node=A,point={(X)},solution=2) coordinate (A2); \path (tangent cs:node=B,point={(X)},solution=1) coordinate (B1); \path (tangent cs:node=B,point={(X)},solution=2) coordinate (B2); \draw [blue] (X) -- (A1) -- ([turn]0:9cm); \draw [red] (X) -- (B1) -- ([turn]0:5cm); \draw [blue] (X) -- (A2) -- ([turn]0:9cm); \draw [red] (X) -- (B2) -- ([turn]0:5cm); \end{tikzpicture} \end{document}
- Unexpected (to me!) behaviour when trying to resume enum item numbers in subsequent enumerate environmentsby dmorg on December 24, 2025 at 8:09 pm
I have defined a counter (firstcounter) and, in the first column, item numbers display as I'd expect. However, in the middle column with the same code (but a secondcounter to avoid interaction with the first list), I have changed \only<1-> to \only<1-4> and it breaks the numbering. The right hand column (with two separate counters, thirdcounter and fourthcounter), 'works' but unsatisfactorily; I feel I should not need an extra counter for each resumption of enumeration. Can someone explain to me what I'm doing wrong? \documentclass{beamer} \newcounter{firstcounter} \newcommand{\setfirst}{\setcounter{firstcounter}{\value{enumi}}} \newcommand{\contfirst}{\setcounter{enumi}{\value{firstcounter}}} \newcounter{secondcounter} \newcommand{\setsecond}{\setcounter{secondcounter}{\value{enumi}}} \newcommand{\contsecond}{\setcounter{enumi}{\value{secondcounter}}} \newcounter{thirdcounter} \newcommand{\setthird}{\setcounter{thirdcounter}{\value{enumi}}} \newcommand{\contthird}{\setcounter{enumi}{\value{thirdcounter}}} \newcounter{fourthcounter} \newcommand{\setfourth}{\setcounter{fourthcounter}{\value{enumi}}} \newcommand{\contfourth}{\setcounter{enumi}{\value{fourthcounter}}} \begin{document} \begin{frame} %left column \begin{minipage}{0.3\textwidth} \only<1->{ \begin{enumerate} \item 1st \item <2-> 2nd \item <3-> 3rd. \item <4-> 4th \setfirst \end{enumerate} } \only<5->{ \begin{enumerate} \contfirst \item 5th. \item <6-> 6th. \item <7-> 7th. \setfirst \end{enumerate} } \only<8->{ \begin{enumerate} \contfirst \item 8th. \item <9-> 9th. \item <10-> 10th. \end{enumerate} } \end{minipage} % middle column \begin{minipage}{0.3\textwidth} \only<1-4>{ \begin{enumerate} \item 1st \item <2-> 2nd \item <3-> 3rd. \item <4-> 4th \setsecond \end{enumerate} } \only<5->{ \begin{enumerate} \contsecond \item 5th. \item <6-> 6th. \item <7-> 7th. \setsecond \end{enumerate} } \only<8->{ \begin{enumerate} \contsecond \item 8th. \item <9-> 9th. \item <10-> 10th. \end{enumerate} } \end{minipage} % right column \begin{minipage}{0.3\textwidth} \only<1-4>{ \begin{enumerate} \item 1st \item <2-> 2nd \item <3-> 3rd. \item <4-> 4th \setthird \end{enumerate} } \only<5->{ \begin{enumerate} \contthird \item 5th. \item <6-> 6th. \item <7-> 7th. \setfourth \end{enumerate} } \only<8->{ \begin{enumerate} \contfourth \item 8th. \item <9-> 9th. \item <10-> 10th. \end{enumerate} } \end{minipage} \end{frame} \end{document} These are all the same lists and should have the same numbering.
- nicematrix submatrix fails when \Cdots is usedby projetmbc on December 24, 2025 at 2:52 pm
The following M(not)WE fails because of the \Cdots used. Is there a quick fix of this bug? The log file indicates the error below if I uncomment the failing sub matrix command. Package nicematrix Error: Impossible delimiter. (nicematrix) It's impossible to draw the right delimiter of (nicematrix) your \SubMatrix because all the cells are empty (nicematrix) in that column. (nicematrix) This \SubMatrix will be ignored. Here is the LaTeX code. \documentclass[border=5pt, varwidth]{standalone} \usepackage{nicematrix} \begin{document} $\begin{NiceArray}{*{7}{c}}[cell-space-limits=3pt] & & & & & & \Vdots \\ & & & & & & a[k]_{mj} \\ & & & & & & \Vdots \\ & & & & & & a[k]_{m'j} \\ & & & & & & \Vdots \\ & & & & & & \phantom{X} \\ \Cdots & 1 & \Cdots & 0 & \Cdots & \hspace{12.5pt} & a[k+1]_{ij} % \CodeAfter \SubMatrix({1-7}{5-7})[slim] % \SubMatrix({7-1}{7-5}) % <-- This fails! \SubMatrix({7-7}{7-7})%[slim] \end{NiceArray}$ $\begin{NiceArray}{*{7}{c}}[cell-space-limits=3pt] & & & & & & \Vdots \\ & & & & & & a[k]_{mj} \\ & & & & & & \Vdots \\ & & & & & & a[k]_{m'j} \\ & & & & & & \Vdots \\ & & & & & & \phantom{X} \\ Cdots & 1 & Cdots & 0 & Cdots & \hspace{12.5pt} & a[k+1]_{ij} % \CodeAfter \SubMatrix({1-7}{5-7})[slim] \SubMatrix({7-1}{7-5}) \SubMatrix({7-7}{7-7})%[slim] \end{NiceArray}$ \end{document} PS: for those who are curious, this is just to demonstrate how to calculate the number of paths of known length using an adjacency matrix.
- Incompatibility between KOMA-script classes and babel Spanishby mlg on December 24, 2025 at 10:57 am
While using [spanish]babel with a KOMA-script class (I've tried with scrartcl and scrbook) I get the following error: LaTeX hooks: Generic hooks cannot be added to '\@startsection'. How can I fix this? Here is my MWE. \documentclass{scrartcl} \usepackage[spanish]{babel} \begin{document} Buenos días. \end{document}
- How to get reproducible PDFby user2609605 on December 23, 2025 at 9:43 pm
For quite some span of time, I was sure to have solved that problem. I got the build time from the original PDF file, e.g. via pdfinfo. Then i made the next build with SOURCE_DATE_EPOCH using exactly that time. Also FORCE_SOURCE_DATE must be set. This worked with lualatex and PDF 1.7. Now, adding pdfa/A, tagging, PDF/UA and moving on to PDF2.0, it does not work any more. Some experiments show, the critical feature is tagging. It is a great feature and i dont want to do without it. I search for a way to keep reproducibility even if tagging is present. Well, in fact, reproducibility is no longer trustable, sometimes it works. I observe that sometimes the lengths of the files differ minimally. Visually, they are the same, also XMP data seems the same. But my old simple concept of bytewise equivalence is gone. I tried with uncompress as suggested by DavidCarlisle, << /Type /Namespace /NS (data:,AC8956-1B7-A6A9-1928-C381ECC1E1C) >> << /Type /Namespace /NS (data:,5F48FB81-AC9C-B85B-A0B9-890FA89F45CC) >> is the first difference. The next is in a sequence of xref 0 17537 0000000002 65535 f 0007003671 00000 n 0000000003 00000 f But i cannot interprete these... and remarkable that even the trailer IDs coincide. In my dark thougths I even read the PDF spec and found that the trailer ID may depend on the location of the PDF also... So maybe there is another problem I do face only if there are more developers compiling in different environments. Maybe latex compilers dont use location to create the trailer ID, do they? Any advice on a sound foundation for reproducibiliby also in the future? Future is >PDF1.7, and PDF/A, PDF/UA, including tagging.
- Is there a reference on how to make tables better, or a more standard way of pre-contemplating them?by Jasper on December 23, 2025 at 6:39 pm
Is there a reference on how to make tables better, or a more standard way of pre-contemplating them? I was trying to tabulate the elementary linear transformations, and noticed that my table was rather unaesthetic. My hope is that someone could guide me on how I could better pre-contemplate these tables, so that they don't come out looking like this: \documentclass[letterpaper]{book} \usepackage{nicematrix} \usepackage{booktabs} \usepackage{tikz} \usepackage{microtype} \usepackage{mathtools} \usepackage{unicode-math} \newcommand{\temp}{% \begin{tikzpicture} \draw (-1,-1) rectangle (1,1); \node at (0,0) {Blah.}; \end{tikzpicture}% } \begin{document} \begin{table} \centering \begin{tabular}{lll} \toprule Linear transformation & Example Matrix & Geometric effect \\ \midrule Scale & \({\begin{bNiceArray}{cc} t & 0 \\ 0 & 1 \end{bNiceArray}}\) & \temp \\ \midrule Shear & \({\begin{bNiceArray}{cc} 1 & t \\ 0 & 1 \end{bNiceArray}}\) & \temp \\ \midrule Swap & \({\begin{bNiceArray}{cc} 0 & 1 \\ 1 & 0 \end{bNiceArray}}\) & \temp \\ \bottomrule \end{tabular} \caption{The elementary matrices are blah blah blah.} \label{table:chap-elem-mat} \end{table} \end{document}
- Tikz to plot a part of a coneby Latexfan on December 23, 2025 at 10:30 am
I try to use tikz to plot the following image ... \documentclass[border=0.2cm]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{colormaps} \pgfplotsset{compat = newest} \begin{document} \begin{tikzpicture} \begin{axis}[ axis equal image, grid = both, minor tick num = 2, xlabel = {$x$}, ylabel = {$y$}, zlabel = {$z$}, major grid style = {draw = lightgray}, minor grid style = {draw = lightgray!25}, xmin = 0, xmax = 1, ymin = 0, ymax = 1, zmin = 0, zmax = 2, scale = 3, view = {60}{30}, samples = 30, samples y = 30, z buffer = sort, ] % Kjeglesektor \addplot3[ surf, shader = interp, opacity = 0.75, colormap/viridis, ] ({x},{y},{sqrt(3)*sqrt(x^2+y^2)}); \end{axis} \end{tikzpicture} \end{document} But I do not get similar image ... can you please help me?
- Running Lua function on biblatex outputby L33 on December 23, 2025 at 2:23 am
I want to automatically transliterate titles and author names I'm citing if they're written in another script. For example, given an author named مَحْمُود, I would like to be able to cite them inline as "(مَحْمُود maḥmūd 2020)". Supposing this author wrote a paper titled أَبْجَد هَوَّز, I would like to be able to cite it inline as "أَبْجَد هَوَّز ʾabjad hawwaz (مَحْمُود maḥmūd 2020)". Ideally the compiled bibliography should show these transliterations as well. I've written a Lua module transliteration.lua that exports a function transliterate() such that, for example, transliterate('مَحْمُود') returns the string 'maḥmūd'. However, I can't figure out where or if it's even possible to call my transliteration.transliterate() function within my paper in order for it to correctly apply to biblatex citations. This seems to interact in a complex way with the need to compile multiple times in order to format references correctly. Is there a combination of control sequences and compilation steps that will net exactly the citation formats I've described above? Is there a low-level way to override how names and titles and such are generated such that I can continue to use the default \cite(s), \parencite(s), \autocite(s), \citeauthor, etc. commands without redefining my own? This differs from prior transliteration questions like Auto transliteration in that I don't wish to directly write text in the other script. A question that seemed related was biblatex: Use field value in tex document before compilation but I couldn't figure out how to apply it to my situation. Below is a non-functioning example that demonstrates a rudimentary (and incorrect) understanding of \latelua, \expandafter, \DeclareCiteCommand, etc. (For demonstration, this is generic string substitution without reference to a specific script except in the comment about babel.) I am compiling this with the VSCode Latex Workshop extension's latexmk (lualatex) recipe, which as of writing runs latexmk -synctex=1 -interaction=nonstopmode -file-line-error -lualatex -outdir=%OUTDIR% %DOC%. -- transliteration.lua local exports = {} exports.transliterate = function(text) text = text:gsub("bb", "cc") text = text:gsub("aa", "bb") return text .. ' (this parenthetical indicates that the translit function ran)' end return exports \documentclass{article} \usepackage{biblatex} \directlua{tr = require("transliteration.lua")} \begin{filecontents}[overwrite]{test.bib} @misc{test, author = "aa", title = "bb", year = 2020} \end{filecontents} \addbibresource{test.bib} \DeclareCiteCommand{\translitciteauthor}{}{\directlua{tex.print(tr.transliterate("\\printnames{author}"))}}{}{} \begin{document} 1 % runs function but does not transliterate % additionally, if including babel and using an RTL script, this throws a "missing number, treated as zero" \directlua{tex.print(tr.transliterate("\\citeauthor{test}"))} 2 % runs function but does not transliterate \directlua{tex.print(tr.transliterate("\\expandafter{\\citeauthor{test}}"))} 3 % does nothing \latelua{pdf.print(tr.transliterate("\\citeauthor{test}"))} 4 % runs function but does not transliterate \translitciteauthor{test} \end{document}
- Graph of a projection functionby Octavius on December 22, 2025 at 9:49 pm
I have the following code, but I can’t manage to replicate the figure shown in the attached image. Could you help me with the code and provide the figure? Thank you very much. \documentclass[12pt]{article} % --- Márgenes (opcional) --- \usepackage[margin=2.2cm]{geometry} % --- Idioma y acentos --- \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[spanish]{babel} % --- Matemática y TikZ --- \usepackage{amsmath,amssymb} \usepackage{xcolor} \usepackage{tikz} \usetikzlibrary{arrows.meta,calc,3d} \pagestyle{empty} \begin{document} \begin{center} % --- TU FIGURA --- \begin{tikzpicture}[ scale=1.15, line cap=round, line join=round, x={(-0.95cm,-0.55cm)}, % Eje X: oblicuo hacia abajo-izquierda y={(1.15cm,0cm)}, % Eje Y: horizontal z={(0cm,1.15cm)} % Eje Z: vertical ] % Colores/estilos \definecolor{axisblue}{RGB}{20,90,130} \tikzset{ axis/.style={very thick, draw=axisblue, -Latex}, proj/.style={dashed, black, line width=0.8pt}, edge/.style={black, line width=0.9pt}, face/.style={draw=black, fill=gray!35, opacity=0.55}, topface/.style={draw=black, fill=gray!25, opacity=0.55}, frontface/.style={draw=black, fill=gray!45, opacity=0.55} } % Ejes \draw[axis] (0,0,0) -- (4.8,0,0) node[below left] {Eje X}; \draw[axis] (0,0,0) -- (0,5.4,0) node[right] {Eje Y}; \draw[axis] (0,0,0) -- (0,0,4.8) node[above] {Eje Z}; % Título \node[anchor=west] at (0.9,2.4,4.0) {\Large Gráfico de $g(x,y)=x$}; % -------- PRISMA 1: x in [0,1], y in [-1,1], altura 1 -------- \def\xa{0}\def\xb{1} \def\ya{-1}\def\yb{1} \def\hA{1} % Vértices base \coordinate (A1) at (\xa,\ya,0); \coordinate (B1) at (\xb,\ya,0); \coordinate (C1) at (\xb,\yb,0); \coordinate (D1) at (\xa,\yb,0); % Vértices top \coordinate (A1t) at (\xa,\ya,\hA); \coordinate (B1t) at (\xb,\ya,\hA); \coordinate (C1t) at (\xb,\yb,\hA); \coordinate (D1t) at (\xa,\yb,\hA); % Proyecciones (sombras) al plano z=0 \draw[proj] (A1) -- (A1t); \draw[proj] (B1) -- (B1t); \draw[proj] (C1) -- (C1t); \draw[proj] (D1) -- (D1t); % Caras visibles \filldraw[frontface] (A1) -- (B1) -- (B1t) -- (A1t) -- cycle; % cara "frontal" \filldraw[face] (B1) -- (C1) -- (C1t) -- (B1t) -- cycle; % cara derecha \filldraw[topface] (A1t) -- (B1t) -- (C1t) -- (D1t) -- cycle; % tapa % Aristas principales \draw[edge] (A1) -- (B1) -- (C1) -- (D1) -- cycle; \draw[edge] (A1t) -- (B1t) -- (C1t) -- (D1t) -- cycle; \draw[edge] (A1) -- (A1t); \draw[edge] (B1) -- (B1t); \draw[edge] (C1) -- (C1t); \draw[edge] (D1) -- (D1t); % Etiquetas \node at (\xa,\ya,\hA) [above left] {$1$}; \node at (0.55,0, -0.02) [below, yshift=-2pt] {$[0,1]\times(-1,1)$}; % -------- PRISMA 2: x in [2,3], y in [-1,1], altura 2 -------- \def\xc{2}\def\xd{3} \def\hB{2} \coordinate (A2) at (\xc,\ya,0); \coordinate (B2) at (\xd,\ya,0); \coordinate (C2) at (\xd,\yb,0); \coordinate (D2) at (\xc,\yb,0); \coordinate (A2t) at (\xc,\ya,\hB); \coordinate (B2t) at (\xd,\ya,\hB); \coordinate (C2t) at (\xd,\yb,\hB); \coordinate (D2t) at (\xc,\yb,\hB); % Proyecciones \draw[proj] (A2) -- (A2t); \draw[proj] (B2) -- (B2t); \draw[proj] (C2) -- (C2t); \draw[proj] (D2) -- (D2t); % Caras \filldraw[frontface] (A2) -- (B2) -- (B2t) -- (A2t) -- cycle; \filldraw[face] (B2) -- (C2) -- (C2t) -- (B2t) -- cycle; \filldraw[topface] (A2t) -- (B2t) -- (C2t) -- (D2t) -- cycle; % Aristas \draw[edge] (A2) -- (B2) -- (C2) -- (D2) -- cycle; \draw[edge] (A2t) -- (B2t) -- (C2t) -- (D2t) -- cycle; \draw[edge] (A2) -- (A2t); \draw[edge] (B2) -- (B2t); \draw[edge] (C2) -- (C2t); \draw[edge] (D2) -- (D2t); % Etiquetas \node at (\xc,\ya,\hB) [above left] {$2$}; \node at (2.55,0,-0.02) [below, yshift=-2pt] {$[2,3]\times(-1,1)$}; % Marcas -1 y 1 sobre eje Y (opcional) \node at (0,-1,0) [below] {$-1$}; \node at (0, 1,0) [below] {$1$}; \end{tikzpicture} \end{center} \end{document}
- circuitikz inverted voltage EU vs americanby MrI2C on December 22, 2025 at 8:49 pm
I was wondering why there's a different polarity used in EU vs american symbols for voltage sources. As one can see the eu version and the american version have oposite polarity, which make's it hard once you start mixing circuits with a EU base and american base. example: \documentclass[a4paper,11pt]{article} \usepackage{circuitikz} \usepackage{siunitx} %\sisetup{locale = DE} % komma als decimaalteken (optioneel) \begin{document} \begin{circuitikz}[american] \draw (0,0) to[V=10V] (2,0); \end{circuitikz} \begin{circuitikz}[european] \draw (0,0) to[V=10V] (2,0); \end{circuitikz} \begin{circuitikz} \draw (0,0) to[V=10V] (2,0); \end{circuitikz} \end{document} So I get a polarity swap between EU and american If a read the manual it should not invert (image/code 1 vs 3 )
- Booktabs cmidrule creates unwanted vertical spaceby profj on December 22, 2025 at 7:30 pm
I am making the following table using LaTeX. One way to do it is to make a separate row for the "Top Header" header. However, this results in space below that header and the "sub headers": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule & & \multicolumn{2}{c}{Top Header} \\ \cmidrule(lr){3-4} Main & Main & \\ Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} An alternative way is to include "Top Header" on the same line as the top line of the "Main Headers", but the use of \cmidrule creates awkward space for the two "Main Headers": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule Main & Main & \multicolumn{2}{c}{Top Header} \\ \cmidrule(lr){3-4} Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} A third way, with no \cmidrule gets the vertical spacing right, but I do want a to use \cmidrule to get a line under "Top Header": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule Main & Main & \multicolumn{2}{c}{Top Header} \\ Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} How can I get columns 1 and 2 to behave as in the first table, but columns 3 and 4 to behave as in the second table? In other words, I'd like the headers to take up two lines, as in the second table, and I'd like to use the \cmidrule command for columns 3 and 4, but I don't want the the extra space in between "Main" and "Header 1" and "Main" and "Header 2" that we see in the second table.
- CircuiTikZ inconsistent behaviour of voltage/distance from nodeby DraUX on December 22, 2025 at 2:40 pm
I found that the behaviour of the voltage/distance from node-key varies depending on the component, as can be seen in the mwe below. Is there a fix that I am missing? Also, when I set voltage/distance from node=0 there is still some distance to the actual center of the node (marked in red). I have no idea where this is coming from (maybe a TikZ-thing?). I thought, maybe the inner sep of the nodes was not being accounted for, but after some testing, I found that the distance differs from the standard inner sep of nodes. Does someone have an idea? \documentclass{standalone} \usepackage{tikz} \usepackage[straightvoltages]{circuitikz} \begin{document} \begin{tikzpicture} \draw (0,0) to[R,name=R,v=U,voltage/distance from node=0] (2,0); \draw (0,-1) to[open,name=v,v=U,voltage/distance from node=0] (2,-1); \draw (0,-1.25) to[open,v=U,voltage/distance from node=0,open voltage position = legacy] (2,-1.25); \draw[red] (0,0 |- R-Vfrom) -- (R-Vfrom) node[midway,below] {?}; \draw[red] (0,-1) -- (v-Vfrom) node[midway,below] {?}; \end{tikzpicture} \end{document}