Week
- Circuitikz full list of `\ctikzset` optionsby aulven on December 17, 2025 at 3:56 pm
Where can I find the full list of options for \ctikzset? I couldn't find something like this in the documentation from CTAN, or in the Github repository, and for the life of me I cannot figure a consistent pattern between examples that are in the documentation. For instance if I pick up a line from examples and change it from bipoles to tripoles it sometimes works, sometimes throws and error and sometimes does nothing whatsoever. Or, otherwise, how do people figure out what the syntax for what they want to do is? As an example, the last problem I encountered that lead me to write this is adjusting the font size of transistors. Conveniently the document has the section titled Labels and Annotations under Labels, Voltages and Currents. Here it gives the example for bipoles, \ctikzset{bipole label style/.style={font=\tiny}} Which works as it should, however, it concerns bipoles only. My attempt of modifying it to: \ctikzset{tripole label style/.style={font=\tiny}} does nothing. neither does my other extrapolation attemps like quadpole, multipole, tripole/transistors, multipole/transistors, tripoles/.style, tripoles/transistors/nigfete/.style and so on. None of these do nothing and doesn't give an error either, unlike some other attemps which did give errors at least. At this point, I don't know if I'm missing the correct syntax or whether this feature exists in the first place. This happens to be my last frustration (that I'm yet to solve). However countless times in the past I have searched for similar modifications, it always boils down to finding the magic words for ctikzset and I don't know where to look. MRE \documentclass[8pt, a4paper]{article} \usepackage[american]{circuitikz} \begin{document} \begin{figure*} \begin{circuitikz} \ctikzset{bipole label style/.style={font=\tiny}} %<- From the doc. \ctikzset{tripole label style/.style={font=\tiny}} %<- My guess \draw (0,0) to[R, l=$R$] (2,0); \draw (0,2) node[nigfete]{$Q$}; \end{circuitikz} \end{figure*} \end{document}
- Footnote numbering and `breakable` option in tcolorboxesby clueless on December 17, 2025 at 1:28 pm
Footnotes within tcolorbox followof different numbering scheme that those in regular text. How can I make them uniformly numbered? \documentclass[notitlepage,a4paper]{book} \usepackage{keytheorems} \usepackage{tcolorbox} \tcbuselibrary{breakable} \usepackage{footnote} \BeforeBeginEnvironment{tcolorbox}{\savenotes} \AfterEndEnvironment{tcolorbox}{\spewnotes} \newkeytheoremstyle{my} { noteseparator={: }, notebraces={}{}, notefont=\bfseries, headpunct={}, bodyfont=\normalfont, } \newkeytheorem{theorem}[style=my,tcolorbox={breakable},name=Thm] \begin{document} \begin{theorem} text\footnote{fotnote within tcolorbox} with footnote. \end{theorem} text out of the box\footnote{fotnote out of tcolorbox} \end{document}
- pgfplots: 3D Line Plot with Multiple x Axesby Dr. Manuel Kuehner on December 17, 2025 at 9:25 am
Happy Xmas all together. This question is about pgfplots, specifically about plotting line plots ins 3D. Ideally, I woudl have three x axes labelled x_1, x_2 and x_3, one y axis and one z axis (called F for force). I managned to ge the belwo MWE but from there, I am stuck (did not try ChatGPT yet!). I attached two hand drawings to show the desired outcome. It is ok to fake the three x axes as long there is a easy to understand logic / syntax. Remark: In my real world example, the y axis is reversed but I did not want to overcomplicate the question. (typo: y = -15 should say y = +15 and vice versa) \documentclass{article} \usepackage{pgfplots} \pgfplotsset{ width = \textwidth, compat = 1.18, } \begin{document} \begin{tikzpicture} \begin{axis}[ view = {60}{30}, title = {MWE}, xlabel = {$x$}, ylabel = {$y$}, zlabel = {$F$}, xmin = -30, xmax = 30, ymin = -30, ymax = 30, zmin = -100, % F zmax = 100, grid = major, axis lines = center, ] % Plots \addplot3 [ red, domain = -30:30, % for x I assume samples = 100, samples y = 1, % not sure what this does ](5,x,x^2); \end{axis} \end{tikzpicture} \end{document}
- Is it possible to test if a float is at the top of a page?by Denis Bitouzé on December 17, 2025 at 7:30 am
Is it possible to test if a float is at (say) the top of a page? The use case is the following: for a class I'm working on, the floating figures (are customized thanks to a floatrow style in order to) have (their captions in the left margin and) horizontal lines just above and below them and I'd like to remove e.g. the top lines of the figures that happen to be at the top of the pages (especially because there is already an horizontal line at the top of each page that separates the header and the text). Here is a MCE: \documentclass{article} \usepackage{floatrow} \usepackage{mwe} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead[L]{I'm a header} \DeclareMarginSet{hangleft}{% \setfloatmargins{\hskip-3cm}{\hfil}% } \DeclareFloatVCode{ruleabove}{% \par\rule{\hsize}{.8pt}\vskip4pt\par% } \DeclareFloatVCode{rulebelow}{% \par\vskip2pt\rule{\hsize}{.8pt}\par% } \DeclareFloatStyle{ruled}{ rowprecode=ruleabove, rowpostcode=rulebelow, } \floatsetup{objectset=justified} \floatsetup[figure]{ style=ruled, margins=hangleft, capposition=beside, capbesideposition={top,left}, floatwidth=0.85\textwidth } \begin{document} \lipsum[1-5] \begin{figure}[ht] \includegraphics[width=\linewidth]{example-image} \caption{A very very very very very very very very very very very very very very very very very very very very very long caption} \end{figure} \lipsum[1-5] \end{document}
- Why \verb| test } | fail in section header with the use of cprotect?by Nasser on December 17, 2025 at 3:54 am
I am processing 1000's of input where section title can contain random text. Hence I am using this set up \cprotect\section{\verb| the title read from file|} And the above works for any title (which do not ofcourse already have | in it). But why does it fail for this title below which do not have | in it? \documentclass[12pt]{article}% \usepackage{cprotect} \begin{document} %%%%%%%%%%%%%%%%%%%%% \cprotect\section{\verb|Adding footnote to the table leads to the error: ! Extra } |} text \end{document} Compiling with lualatex gives >lualatex A.tex This is LuaHBTeX, Version 1.24.0 (TeX Live 2026/dev) restricted system commands enabled. (./A.tex LaTeX2e <2025-11-01> L3 programming layer <2025-11-06> (/usr/local/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (/usr/local/texlive/2025/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2025/texmf-dist/tex/latex/cprotect/cprotect.sty (/usr/local/texlive/2025/texmf-dist/tex/latex/base/ifthen.sty) (/usr/local/texlive/2025/texmf-dist/tex/latex/bigfoot/suffix.sty)) (/usr/local/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-luatex.def) (./A.aux) (./A-1.cpt ! LaTeX Error: \verb ended by end of line. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.1 ...he table leads to the error: ! Extra ^^E^^L ? It is because } inside the title. But I thought \verb| ....| means I can put anything inside it? Note that in body of text \verb|Adding footnote to the table leads to the error: ! Extra } | works and there is no error. It is only in the section title. It is easy for me to workaround this, I just add extra check in the program that the title read do not have { or } in it and remove these for now, like it does for |. I was just wondering why } can not be inside \verb when in section. It seems the parser of the section title looked at the first } inside the the closing for the section itself and not part of the inner title. TL 2025
- Unexpected behavior in luatexbase.add_to_callbackby rallg on December 16, 2025 at 8:02 pm
Using TeXlive 2025/Linux, up-to-date: I expect that when I use luatexbase.add_to_callback then whatever is already in the callback should remain in effect, with my own code added. But apparently that is not the case. I have tried tweaking the callback by adding a priority number (values tried: -1000, 0, 1, 2, 1000) but no obvious difference. In this MWE, the undefined \dingle command throws an error, and the Terminal correctly informs me that the name of the undefined command is \dingle. But if I uncomment the callback, the error fails to show me the command name. Why is that? I expect that it should show the command name as usual, then perform my added function. In actual usage, I have an external *.lua file, but that makes no difference. \documentclass{article} % Compile only with lualatex. \directlua{% to see difference, uncomment the following line: % luatexbase.add_to_callback('show_error_hook', function() texio.write_nl('BOO HOO') end, 'boo_hoo') } \begin{document} Hello, World.\par % Next command is undefined, throws error: \dingle \end{document} RE-EDIT: This is in light of the accepted answer, below. In my workflow (popular fiction, no math), the writers know very little *TeX, but type (mostly) plain text into a template (custom document class). The rare need for *TeX is for things such as \textit for italics. The PDF goes to a human editor who knows no *TeX at all, but will apply highlights and sticky notes, as editors do. Then, back to the writer. Re-cycle as needed. There is no point in submitting an erroneous PDF to the editor. It wastes valuable time, if the content of the PDF was not what the writer intended. So, my custom class traps most errors and warnings, and modifies the PDF metadata if something went wrong. Then, the editor can glance at the metadata in any PDF reader, and send it back when the metadata identifies the PDF as bad. Also, I work with PDF/X-1a:2001, and the metadata conformance identifier will be omitted when an error was trapped (this is not shown here). For example, if an unknown command is typed, the error will offer the default possibility of simply ignoring the unknown command, and continuing. Sometimes ignoring the error will still produce a valid PDF, although the content of the PDF is not what the writer intended. In this example, the mis-typed \txtit can be ignored, and the PDF is valid. But its metadata producer string identifies it as BAD CODE. \documentclass{article} % Compile only with lualatex. \directlua{% badstuff = false luatexbase.add_to_callback('show_error_hook', function() badstuff = true texio.write_nl(status.lasterrorcontext) end, 'boo_hoo') } \AtEndDocument{% \def\goodresult{1}% \directlua{% if badstuff == true then tex.sprint('\\def\\goodresult{0}') end }% \ifnum\goodresult=0\relax% \pdfextension info{/Producer (BAD RESULT)}% \fi }% \begin{document} % Mis-spelled \txtit should be \textit. Throws error: It was a \txtit{dark and stormy} night.\par \end{document}
- unicode-math or lua-unicode-math?by Svend Tveskæg on December 16, 2025 at 5:02 pm
I just noticed the lua-unicode-math package. Question I compile all my .tex documents using lualatex and therefore my question is as follows: What are the main differences between lua-unicode-math and unicode-math and when should I use which package?
- Defining an option key for TColorboxby Jesco on December 16, 2025 at 10:41 am
I would like to add an option key "points" to my custom tcolorbox aufgabe (so you use points=n, where n is a number, that acts as if I had added the option after title app={\hfill n Punkt(e}, where Punkt(e) depends on n (so without an e for 1). Concretely: My current aufgabe definition \renewcommand{\theaufgabe}{\arabic{aufgabe}} \refstepcounter{aufgabe} \newtcolorbox{aufgabe}[1][]{% before title={Aufgabe \theaufgabe \ (}, after title={)}, coltitle=black, colback=\typecolor!10, colframe=\typecolor, fonttitle=\bfseries, before upper={\refstepcounter{aufgabe}}, segmentation style={draw=\typecolor, line width=2pt}, #1 } Intended usage \begin{aufgabe}[title=some title, points=6] some task \end{aufgabe} should act like \begin{aufgabe}[title=some title, after title app={\hfill 6 Punkte}] some task \end{aufgabe} Edit: Fair point by @samcarter. This is a minimum example of what I would like: \documentclass[a4paper, 12pt]{article} \usepackage[many]{tcolorbox} \newcounter{aufgabe}[section] \renewcommand{\theaufgabe}{\arabic{aufgabe}} \refstepcounter{aufgabe} \newtcolorbox{aufgabe}[1][]{% before title={Aufgabe \theaufgabe \ (}, after title={)}, coltitle=black, fonttitle=\bfseries, before upper={\refstepcounter{aufgabe}}, #1 } \begin{document} \begin{aufgabe}[title=title, after title app={\hfill 6 Punkte}] some task \end{aufgabe} \end{document}
- Matrix with NiceMatrixby Knudsen on December 15, 2025 at 5:01 am
I am trying to produce a (n+1)x(n+1) matrix with diagonal elements equal to 1 supradiagonal (one above the diagonal) a sequence from 1 to n everything else 0 in the package NiceMatrix, and with the code (processed twice): \documentclass{report} \usepackage{nicematrix} \begin{document} \[ \begin{pNiceMatrix}[renew-dots] 1 & 1 & 0 & \Cdots & 0 \\ 0 & 1 & \ddots & \ddots & \Vdots\\ \Vdots & \ddots & \ddots & & 0 \\ & & & 1 & n \\ 0 & \Cdots & & 0 & 1 \end{pNiceMatrix} \] \end{document} I get a strange shortening of the vertical separation of the two last rows, which is considerably smaller than the separation of the first two, producing an artifact at the meeting of the two dotted lines at the last zero on the matrix. What could be causing this? I do know that I can add [0.22cm] to the line before last and add some space, but that seems a bit weird.
- My (\xdef) definitions are expanding to blanks. I'm not sure whyby Jasper on December 14, 2025 at 10:11 pm
I am trying to make an algorithm to do my homework for me. I am having trouble with some csname definitions being blank when I call them. I tried making a more minimal example, but I could not reproduce the error. The empty parenthesis at the end should be the (red) expansion of 2.0. \documentclass[letterpaper]{article} \usepackage{tikz} \pgfmathsetmacro{\m}{7} \pgfmathsetmacro{\b}{2} \pgfmathsetmacro{\lettersInAlphabet}{26} \begin{document} Euclidean-Bezoution algorithm: \foreach[count=\countdooku from 1] \i in {1,...,9} { \ifnum\i=1 \pgfmathsetmacro{\remainder}{mod(\lettersInAlphabet,\m)} \pgfmathsetmacro{\coefficient}{(\lettersInAlphabet-\remainder)/\m} \lettersInAlphabet=\coefficient(\m)+\remainder\par \pgfmathparse{-floor(\lettersInAlphabet/\m)} \color{red}{\remainder=(1)(\lettersInAlphabet)+(\pgfmathresult)(\m)}\par % this isn't being stored correctly \expandafter\xdef\csname str\i\endcsname{(1)(\lettersInAlphabet)+(\pgfmathresult)(\m)} \global\let\remainder\remainder \global\let\coefficient\coefficient \global\let\lettersInAlphabet\lettersInAlphabet \else \pgfmathsetmacro{\lettersInAlphabet}{\m} \pgfmathsetmacro{\m}{\remainder} \pgfmathsetmacro{\remainder}{mod(\lettersInAlphabet,\m)} \pgfmathsetmacro{\coefficient}{(\lettersInAlphabet-\remainder)/\m} \pgfmathsetmacro{\coefficienttwo}{-floor(\lettersInAlphabet/\m)} \lettersInAlphabet=\coefficient(\m)+\remainder\par \pgfmathparse{\remainder == 0} \ifnum\pgfmathresult=1 \breakforeach \else \color{red}{\remainder=(1)(\lettersInAlphabet)+(\coefficienttwo)(\m)}\par \pgfmathsetmacro{\j}{\i-1} % and neither is this \expandafter\xdef\csname str\i\endcsname{(1)(\lettersInAlphabet)+(\coefficienttwo)(\csname str\j\endcsname)} \global\let\remainder\remainder \global\let\coefficient\coefficient \global\let\lettersInAlphabet\lettersInAlphabet \global\let\m\m \global\let\coefficienttwo\coefficienttwo \fi \fi \global\let\countdooku\countdooku } \color{blue}{\countdooku} 1=(\remainder)(\lettersInAlphabet)+(\coefficienttwo)(\m)\par \foreach \i in {\countdooku,...,1} { \pgfmathparse{\i==3.0} \ifnum\pgfmathresult=1 \breakforeach \else 1=(\remainder)(\lettersInAlphabet)+(\coefficienttwo)(\expandafter\csname str\i\endcsname)\par \fi } \end{document}
- Evolution of “Computer Modern” or who lowered the dot on the “i”?by Alain Stalder on December 14, 2025 at 12:27 pm
In the process of hopefully migrating some documents from pdflatex that use Computer Modern fonts (mostly Sans) to LuaLaTeX, I am looking at the different variants that have evolved since the original METAFONT Computer Modern family. The good news for me is that the differences seem to be smaller than it first appeared, both regarding glyphs and metrics. The most prominent difference in Latin Modern with “plain English characters” is that the dot on the lowercase letter “i” is a bit lower, at least in the Sans variants (except in ligatures like “fi” where the height of the dot matches the too of the “f”). Was that a conscious choice in Latin Modern? Or maybe already in an earlier variant which I could not find, yet? (Computer Modern Unicode and CM-Super seem to have the original height of the dot on the “i”.) CTAN does list various Computer Modern variants and there is also some info in its external references, but I was wondering if there is maybe additional historical info about the evolution of “Computer Modern” variants, maybe a TUGboat article about that or maybe that someone who was already somewhat involved at the time would still remember? Below some examples with sources and — to make sure — the font that was actually used from the console log, and some differences noticed in the example text. pdflatex / Computer Modern (the reference; same result with \usepackage{amsfonts}, as expected): % !TEX TS-program = pdflatex \documentclass{article} \renewcommand\familydefault{\sfdefault} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/type1/public/amsfonts/cm/cmss10.pfb> \end{document} pdflatex / CM-Super: % !TEX TS-program = pdflatex \documentclass{article} \usepackage[T1]{fontenc} \renewcommand\familydefault{\sfdefault} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/type1/public/cm-super/sfss1000.pfb> \end{document} (Different “ß” and different spacing before “, rest same incl. “i”.) LuaLaTeX / Computer Modern Unicode: % !TEX TS-program = lualatex \documentclass{article} \usepackage{fontspec} \setmainfont{CMU Sans Serif} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/opentype/public/cm-unicode/cmunss.otf> \end{document} (Same alternative “ß” as CM-Super, different space after ”, denser ellipsis, rest same incl. “i”) LuaLaTeX / AMS Type 1 converted to OpenType (using FontLab 8 on Mac): % !TEX TS-program = lualatex \documentclass{article} \usepackage{fontspec} \setmainfont{ams-cmss10.ttf} \begin{document} % emulated ellipsis… Liegenstraße 95 in “larger” Wil.\,.\,. % <./ams-cmss10.ttf> \end{document} (Almost identical to Computer Modern (as expected), except line overall a bit denser and had to emulate the ellipsis, same “i”.) LuaLaTeX / Latin Modern: % !TEX TS-program = lualatex \documentclass{article} \renewcommand\familydefault{\sfdefault} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/opentype/public/lm/lmsans10-regular.otf> \end{document} Here the dot on the “i” is a bit lower. Also, the “a” has the same metric but is shifted a bit to the right. Also, more space inside “...”, and also denser ellipsis. Diff between LM and AMS OpenType (would be practically the same to pdflatex / Computer Modern, but wanted to stick to OpenType, into the future): The dot on the “i” is lowered and the “a” is shifted, otherwise letters just shifted a tiny little bit, but maybe that would be just a rendering artefact/limitation, at some point becomes the princess and the pea… But overall, seems like an “AMS to OpenType x Latin Modern” (as new font or maybe a virtual font on-the-fly) could already come close to the original pdflatex / Computer Modern look and feel for texts that could already be typset with the limitations regarding language support of pdflatex / Computer Modern. Added same day: Here’s a diff between LuaLaTeX / Latin Modern and pdflatex / Computer Modern, almost only the dot on the ”i” and the shift of the “a” are different, the other letters shifted in the diff above was just that was more condensed with LuaLaTeX / ”AMS OpenType” as I had mentioned but forgot about again. Added 2025-12-16: Examples with “New Computer Modern” also in the heavier book style. Note that, at least so far, I can only see 8pt and 10pt versions of that font in TeXLive 2025, i.e. at different sizes results would differ more from Computer Modern (and also from Latin Modern, for example), which would so far be a no-go for me because I have lots of 9pt stuff in my documents. Also, slanted text seems to be very heavily slanted. LuaLaTex / New Computer Modern: % !TEX TS-program = lualatex \documentclass{article} \usepackage[sansdefault]{fontsetup} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/opentype/public/newcomputermodern/NewCMSans10-Regular.otf> \end{document} (Output identical to Latin Modern, except that the upper horizontal line of the uppercase letter “L” is completely horizontal; I guess the choice in Computer Modern and Latin Modern for 10pt might have been to make it look horizontal at 10pt and maybe with New Conmputer Modern, since that is also the largest size font, it was made horizontal to look horizontal at larger point sizes?) LuaLaTex / New Computer Modern Book: % !TEX TS-program = lualatex \documentclass{article} \usepackage[default]{fontsetup} \renewcommand\familydefault{\sfdefault} \begin{document} Liegenstraße 95 in “larger” Wil… % </usr/local/texlive/2025/texmf-dist/fonts/opentype/public/newcomputermodern/NewCMSans10-Book.otf> \end{document} (As expected a bit heavier (with a nice amount to me), but otherwise the same.) Added 2025-12-17: pdflatex / Computer Modern with simulated bleeding via \pdfpkmode (modes.mf): % !TEX TS-program = pdflatex \documentclass{article} \pdfpkresolution=1200 \pdfpkmode={lexmarkr} \pdfmapfile{} \renewcommand\familydefault{\sfdefault} \begin{document} Liegenstraße 95 in “larger” Wil… % </Users/alain/Library/texlive/2025/texmf-var/fonts/pk/lexmarkr/public/cm/cmss10.1200pk> \end{document} (A bit thicker but otherwise the same as pdflatex/CM and if you zoom in a bit you can see that the glyphs are rasterized. Uses a Metafont-generated *.pk font, packaged *.tfm font, TeX font metric; not sure in which form exactly that goes into the pdf.) Added 2025-12-18: Just one more addition related to my comments regarding FakeBold. I now understand why with OpenType/FakeBold I had to also reduce the Scale of the font to get a similar effect, namely because FakeBold grows the font in all directions, while with METAFONT/modes.mf that is more subtle and apparently could be tweaked in more than one way… Diff CM with \pdfpkmode={lexmarkr} to CM: Diff OpenType AMS CM with FakeBold=1 to OpenType AMS CM:
- How to draw a parabola in Ipe?by Dominik Mokriš on December 14, 2025 at 12:13 pm
Note: This question has been closed as off-topic on stackoverflow.com. I believe it's on-topic here under the [ipe] Tag. How can you draw a parabola in ipe? Usually, I use "Splines [I]" but it's not exactly convenient, as I need to construct four control points so that they correspond to a degree-elevated Bézier curve. Recently, I noticed the option "Ipelets > Goodies > Make parabolas". However, I am failing to guess the correct inputs. Here's what I tried: Make a line segment using "Lines and polylines [P]." Create a point using "Marks [M]." Select the line, press "Shift" and select the point. Go to "Ipelets > Goodies > Make parabolas." This fails with the following message. Neither in the manual, nor googling around have I found any further hints. Ideas?
- Why does \changefontsize from the fontsize package mess with \centering?by palapapa on December 14, 2025 at 5:44 am
MWE: \documentclass{article} \usepackage{anyfontsize} \usepackage[fontsize = 40]{fontsize} \begin{document} \centering \changefontsize{40} aaa \end{document} Notice how I am changing the font to the same size, yet the problem still happens. The large font size makes it easier to see that the line is off-center. Result: If I swap the order of \changefontsize and \centering or remove \changefontsize, the text will be correctly centered. Why is this?
- TikZ, \x^2 != \x * \x?by ana on December 13, 2025 at 8:04 pm
Why do the two \draw commands produce two different plots? Shouldn't they both produce a parabola? How do you use the ^2 notation to plot a parabola? \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[domain=-1:1] plot (\x, \x^2); \draw[domain=-1:1] plot (\x, \x * \x); \end{tikzpicture} \end{document}
- Graphing the function y=x^2sin(1/x)by azetina on December 13, 2025 at 6:50 pm
Consider the following MWE: \documentclass{article} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis equal, axis lines = middle, xlabel = $x$, ylabel = $y$, xmin = -0.4, xmax = 0.4, ymin = -0.4, ymax = 0.4, grid = both, grid style = {line width=.1pt, draw=gray!10}, major grid style = {line width=.2pt, draw=gray!50}, samples = 200, legend pos = north west, width = 10cm, height = 8cm ] % Plot the curve \addplot[domain=-0.4:0.4, thick, blue] {x^2*sin(1/x)}; \addlegendentry{$y = x^2\sin(1/x)$} % Tangent line at (1, -2) \addplot[domain=-0.5:0.5, thick, red] {x^2}; \addplot[domain=-0.5:0.5, thick, red] {-x^2}; \addlegendentry{$y=\pm x^2$} \end{axis} \end{tikzpicture} \end{document} Currently, I am getting: But I would like the curve to show like in the following image: What am I missing?
- Strange spacing on a matrixby Knudsen on December 13, 2025 at 6:46 pm
Why would the vertical spacing between the 2nd and 3rd lines in this matrix be larger than the others? \documentclass{report} \usepackage{amsmath} \begin{document} \[ \begin{pmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots&\vdots&\ddots&\vdots\\ 0 & 0 & \cdots & 1 \end{pmatrix} \] \end{document}
- How can I mimic Griffiths' quantum mechanics textbook (3rd edition)?by Lucas Cesena on December 13, 2025 at 4:06 pm
I'm using LaTex to write my physics bachelor thesis and I want it to look similar to one of my favourite undergraduate textbooks on physics: Griffith's Introduction to Quantum Mechanics, specifically the third edition of 2018. I've successfully mimicked the example/proof boxes and also the problem boxes using the tcolorbox package, but didn't manage to find out how to do the same chapter/section display and what font is being used. If anyone can help me on this I'd be extremely grateful! Here is one example page:
- Additive color mixing in set diagramsby Alma Arjuna on December 13, 2025 at 3:19 pm
I've made a pretty set diagram! I'm not happy with how the colors are interacting on the set intersections, though. Because of the order the sets are built, each one is visibly 'above' or 'below' each other, breaking the symmetry of the figure. Of course, this behavior is expected. Can we make so that the colors interact additively instead? I know I can go intersection-by-intersection changing the colors to whatever I want, but this seems very inefficient and I wouldn't know how to manually combine the colors anyway... Here is the code. \documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{calc} \tikzstyle{vertex}=[circle,fill=black,inner sep=2.2pt] \begin{document} \begin{tikzpicture}[scale=1] \coordinate (A) at (18:{sqrt(5)}); \coordinate (B) at (90:{sqrt(5)}); \coordinate (C) at (162:{sqrt(5)}); \coordinate (D) at (234:{sqrt(5)}); \coordinate (E) at (306:{sqrt(5)}); \def\set{ellipse (2.618cm and 0.382cm)} \fill[magenta, opacity=.36] ($(A)!0.5!(C)$) \set; \fill[cyan, opacity=.36, rotate=72] ($(B)!0.5!(D)$) \set; \fill[yellow, opacity=.36, rotate=144] ($(C)!0.5!(E)$) \set; \fill[violet, opacity=.36, rotate=216] ($(D)!0.5!(A)$) \set; \fill[green, opacity=.36, rotate=288] ($(E)!0.5!(B)$) \set; \node[vertex] at (A) {}; \node[vertex] at (B) {}; \node[vertex] at (C) {}; \node[vertex] at (D) {}; \node[vertex] at (E) {}; \coordinate[vertex] (F) at ($(A)!0.382!(C)$); \coordinate[vertex] (G) at ($(B)!0.382!(D)$); \coordinate[vertex] (H) at ($(C)!0.382!(E)$); \coordinate[vertex] (I) at ($(D)!0.382!(A)$); \coordinate[vertex] (J) at ($(E)!0.382!(B)$); \end{tikzpicture} \end{document}
- Using \par directly in enumitem's itemjoinby Erwann on December 13, 2025 at 3:10 am
I'm using enumitem to typeset paragraphs, whether contiguous or joined using \par. For this last case, itemjoin={\par} triggers an error, hence the shown workaround. Is there an inline solution (wild guess \exp_not:N did not work). *.tex \documentclass{article} \usepackage{enumitem} \usepackage{lipsum} \ExplSyntaxOn \cs_new:Npn \g__erw_par { \par } % workaround \newlist{my-list}{itemize*}{1} \setlist[my-list]{ label={}, % itemjoin={\par} itemjoin={\g__erw_par} % workaround } \ExplSyntaxOff \begin{document} \ExplSyntaxOn \begin{my-list}[after={\g__erw_par foo}] \item \lipsum[1][1] \item \lipsum[1][2] \end{my-list} \ExplSyntaxOff \lipsum[1][1-2] \end{document} Post Scriptum: the proposed workaround solves the compilation error but does not render as expected. The choice seems to between itemize or itemize*, but no crossover. terminal: Runaway argument? {label={},itemjoin={ ! Paragraph ended before \enit@setlist@i was complete. <to be read again> \par l.11 itemjoin={\par } ?
- Lettrine breaks wrapfigure and marginnoteby DanDucky on December 13, 2025 at 1:30 am
I'm trying to make a template which uses wrapfigure (for wrapped text), marginnote, and lettrine. I've gotten all of the first 2 to play nice together, but the problem has started at lettrine. Basically, when I use lettrine and marginnote together then wrapfigure breaks and stops placing its text in the correct place. If I remove the marginnote then wrapfigure works with lettrine. The marginnote itself remains unaffected when I use lettrine, it just breaks wrapfigure. I've tried recreating the lettrine effect with wrapfigure only but ran into similar issues. I've made a minimum reproduction of this below, thank you in advance. I'm using Tectonic. \documentclass{article} \usepackage[ letterpaper, % or letterpaper, etc. margin=3cm, footskip=1cm % space between bottom of text and baseline of footer ]{geometry} \usepackage{lettrine} \usepackage{wrapfig} \usepackage{marginnote} \usepackage{lipsum} \usepackage{marginnote} \newcommand{\colnote}[1]{% \marginnote{% \footnotesize% #1% }% \normalmarginpar% in my main code this is determined by a \whichcolumn } \newcommand{\wrappedtext}[1]{% % in my main code this is l/r depending on column \begin{wrapfigure}{l}{0.4\linewidth}% \textit{#1}% \end{wrapfigure}% } \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % when this is uncommented the whole thing breaks %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %\lettrine{L}{orem} \lipsum[1][1-8] \wrappedtext{\lipsum[1][1-2]} \lipsum[1][11-15] \colnote{\lipsum[1][3-4]} \lipsum[2-3] \end{document}
- Top align display style formula in table cellby lela2011 on December 12, 2025 at 10:46 pm
I am currently working on a cheat sheet. It is composed of a table with three columns. The first one is a keyword, the second one either a text explanation or a formula and the third one is a variable definition. The following is a minimal working example \documentclass[a4paper, twocolumn, landscape]{article} \usepackage[margin = 7mm, headsep=3mm, includehead]{geometry} \usepackage[fleqn]{amsmath} \usepackage{amsfonts, amssymb, mathtools} \usepackage{bm} \usepackage{siunitx} \usepackage{braket} \newcommand{\dd}{\mathrm{d}} \newcommand{\pd}{\partial} \DeclareMathOperator{\ham}{\hat{H}} \DeclareMathOperator{\mom}{\hat{p}} \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \DeclarePairedDelimiter{\norm}{\lVert}{\rVert} \makeatletter \let\oldabs\abs \def\abs{\@ifstar{\oldabs}{\oldabs*}} % \let\oldnorm\norm \def\norm{\@ifstar{\oldnorm}{\oldnorm*}} \makeatother \usepackage{tabularx} \usepackage{booktabs} \usepackage{array} \usepackage{makecell} \newcommand{\mc}[1]{\makecell{#1}} \renewcommand{\cellalign}{tl} \newcolumntype{L}{>{\raggedright\arraybackslash}p{0.2\linewidth}} \newcolumntype{F}{>{\raggedright\arraybackslash \abovedisplayskip=0pt \belowdisplayskip=0pt \abovedisplayshortskip=0pt \belowdisplayshortskip=0pt \mathindent=0pt \partopsep=0pt \topsep=0pt}p{0.5\linewidth}} \newcolumntype{E}{>{\raggedright\arraybackslash}X} \newenvironment{formtab}[1][1.2] { \renewcommand{\arraystretch}{#1} \fontsize{8}{8}\selectfont \tabularx{\linewidth}{@{} L F E @{}} } { \endtabularx } \begin{document} \subsubsection{Wavefunction - Discrete} \begin{formtab} discrete basis & set of discrete states $\{ \Psi_n \}$ with $\braket{\Psi_n | \Psi_m} = \delta_{nm}$ & \\ arbitrary state & \[ \ket{\Psi} = \sum_{n=1}^\infty a_n \ket{\Psi_n}, \quad a_n = \braket{\Psi_n | \Psi} \] & \\ probability & $P_\Psi(n) = \abs{a_n}^2 = \abs{\braket{\Psi_n | \Psi}}^2$ & \\ normalization & $\braket{\Psi | \Psi} = 1$ \end{formtab} \end{document} The table now looks like this I want the display style formula to sit flush with the top of the cell though. I have tried using $\displaystyle a^2+b^2=c^2$. This causes the keyword to be centered with the formula. Using \vspace(-.5cm) works partially but that would require me to manually find the correction which is not sensible if the entire document is made up of formulas. Do you have any ideas how this could be achieved?
- How to draw a pattern within a path that features a visible decorated path and also invisible paths? OR How to visualize the ground?by Simon on December 12, 2025 at 6:13 pm
How does the following MWE need to be modified to only visualize the decorated path but not the remaining path and draw the top right-hand corner not rounded? \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \path[draw,pattern=north west lines] decorate[decoration={random steps,segment length=1,amplitude=.2},rounded corners=.2] {(-1,0) -- (0,0) -- (1,0)} -- (1,-.25) -- (-1,-.25) -- cycle; \end{tikzpicture} \end{document} Thanks in advance!
- Different authors handled as same author in bibliography when using CSL styleby dbmei on December 12, 2025 at 3:24 pm
Problem I have two bibliographic entries in my database with similar author fields. In the first case, it is an article only by author A. In the second case, A (Luz) is the first author, followed by B, C, and D (Luz, Frank, Riches, Klimkeit). I abbreviate with et al. for more than 3 authors. However, in my bibliography the entries appear under the same name A, which is quite confusing. Any idea, folks, why this happens? I think it might have to do with the csl-style I wrote by myself, but I am not sure. I use .json as file format for my bibliography for different reasons. Thanks for any help! Wrong output Wanted Solution MWE Code, run with LuaLaTex \documentclass[10pt,openany,a4paper]{article} \usepackage[utf8x]{inputenc} \usepackage[english,ngerman]{babel} \usepackage[style=ownstyle]{citation-style-language} \addbibresource{Bib.json} \begin{document} Some text\cite{LuzEtAl_NachfolgeTRE}. Some further Text\cite{Luz_TRE23Nachfolge}. \printbibliography \end{document} Bibliography file, file format .json [ {"id":"Luz_TRE23Nachfolge","author":[{"family":"Luz","given":"Ulrich"}],"citation-key":"Luz_TRE23Nachfolge","collection-title":"TRE","container-title":"TRE","issued":{"date-parts":[["1994"]]},"page":"678–686","title":"Nachfolge Jesu I. Neues Testament","title-short":"Nachfolge Jesu I. Neues Testament","type":"entry-encyclopedia","volume":"23"}, {"id":"LuzEtAl_NachfolgeTRE","author":[{"family":"Luz","given":"Ulrich"},{"family":"Frank","given":"Karl Suso"},{"family":"Riches","given":"John K."},{"family":"Klimkeit","given":"Hans-Joachim"}],"citation-key":"LuzEtAl_NachfolgeTRE","collection-title":"TRE","container-title":"TRE","issued":{"date-parts":[["1994"]]},"page":"678--713","title":"Nachfolge Christi","title-short":"Nachfolge Christi","type":"entry-encyclopedia","volume":"23"} ] CSL-Style (note: I deleted a lot for this MWE, compliation still works fine but some code might be unnecessary, like if/else-if - please ignore) <?xml version="1.0" encoding="utf-8"?> <style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" page-range-format="expanded" default-locale="de-DE" demote-non-dropping-particle="sort-only"> <info></info> <!-- ########## # Locale # ########## --> <locale xml:lang="de"> <terms> <!--<term name="cited">op. cit.</term>--> <term name="editor" form="short"> <single>Hg.</single> <multiple>Hg.</multiple> </term> <term name="container-author" form="short"> <single>Hg.</single> <multiple>Hg.</multiple> </term> <term name="director" form="long"> <single>Regie</single> <multiple>Regie</multiple> </term> </terms> </locale> <!-- ########## # Macros # ########## --> <macro name="author-bib"> <!--Autorenangabe i.d. Bibliographie--> <choose> <if variable="author"> <names variable="author" font-variant="normal" suffix=", "> <name font-style="normal" delimiter="/" delimiter-precedes-last="never" et-al-min="4" et-al-use-first="1" name-as-sort-order="all"> <!-- initialize-with="." #sorgt für Initalisierung von Vornamen--> <name-part name="family" font-variant="small-caps"/> <name-part name="given" font-variant="small-caps"/> </name> </names> </if> </choose> </macro> <!-- --> <macro name="author-intext"> <!--Autorenangabe im Fußnotentext--> <choose> <if variable="author"> <names variable="author" font-variant="normal" suffix=", "> <name form="short" font-style="normal" delimiter="/" delimiter-precedes-last="never" et-al-min="4" et-al-use-first="1" name-as-sort-order="all"> <!-- initialize-with="." #sorgt für Initalisierung von Vornamen--> <name-part name="family" font-variant="small-caps"/> </name> </names> </if> </choose> </macro> <!-- --> <macro name="title-bib"> <!--Titelangabe i.d. Bibliographie--> <choose> <if type="entry-encyclopedia" match="any"> <text variable="title" suffix=", "/> </if> <else-if> <text variable="title"/> </else-if> </choose> </macro> <!-- --> <macro name="title-intext"> <!--Titelangabe im Fußnotentext--> <choose> <if type="entry-encyclopedia" match="any"> <text variable="title" form="short"/> </if> <else-if> <text variable="title" form="short"/> </else-if> </choose> </macro> <!-- --> <macro name="edition"> <!--Auflage--> <choose> <if type="entry-encyclopedia" match="any"> <choose> <if is-numeric="edition"> <group > <number vertical-align="sup" variable="edition"/> </group> </if> </choose> </if> </choose> </macro> <!-- --> <macro name="date-year"> <!--Jahr d. Veröffentlichung--> <choose> <if type="entry-encyclopedia" match="any"> <date variable="issued"> <date-part name="year" prefix="(" suffix=")"/> </date> </if> <else> <date variable="issued"> <date-part name="year" /> </date> </else> </choose> </macro> <!-- --> <macro name="volume"> <!--Band einer mehrbändigen Ausgabe--> <choose> <if type="entry-encyclopedia"> <group> <text variable="volume"/> </group> </if> </choose> </macro> <!-- --> <macro name="page-bib"> <!--Seitenangabe--> <group> <text variable="page"/> </group> </macro> <!-- --> <macro name="collection"> <!--Titel mehrbändiger Ausgaben, z.B. Lexika, Editionen--> <choose> <if type="entry-encyclopedia"> <text variable="container-title" /> </if> </choose> </macro> <!-- #################### # In-Text Citation # #################### --> <citation> <layout suffix="" delimiter="; "> <choose> <if position="subsequent"> <group> <text macro="author-intext"/> <text macro="title-intext"/> </group> </if> <else-if type="entry-encyclopedia" match="any"> <group> <text macro="author-intext"/> <text macro="title-intext" prefix="Art. " suffix=", "/> <text macro="collection" /> <text macro="edition"/> <text macro="volume" prefix=" "/> </group> </else-if> <else> <group> <text macro="author-intext"/> <text macro="title-intext"/> </group> </else> </choose> </layout> </citation> <!-- ######################### # Bibliography Citation # ######################### --> <bibliography hanging-indent="true" et-al-min="3" et-al-use-first="1" line-spacing="1" entry-spacing="1" subsequent-author-substitute="---"> <sort> <key macro="author-bib" names-min="5" names-use-first="5"/> <key variable="date-year" sort="ascending"/> </sort> <layout suffix="."> <choose> <if type="entry-encyclopedia" match="any"> <!--Lexikonartikel--> <group> <text macro="author-bib"/> <text macro="title-bib" prefix="Art. " /> <text macro="collection" /> <text macro="edition" suffix=" "/> <text macro="volume" prefix=" " suffix=" "/> <text macro="date-year" prefix=" " suffix=", "/> <text macro="page-bib"/> </group> </if> </choose> </layout> </bibliography> </style>
- LuaTeX (and other engines) equivalent of the \showglyphs command in ConTeXt for mathby Apoorv Potnis on December 12, 2025 at 3:07 pm
We can use the \showglyphs commannd in ConTeXt to show the bounding boxes of glyphs, both text and math. It also shows the baseline. \showglyphs \starttext Lorem ipsum \startformula \int_\Gamma f \cdot dx = 1 \stopformula \stoptext What are the equivalent commands with other engines, such as Lua(La)TeX, Xe(La)TeX, OpTeX, and even pdf(La)TeX if possible? The answers here don't work for math: Bounding box for each letter. The package lua-visual-debug does not seem to create boxes for all the glyphs involved in the equations.
- Reduce spacing in TikZ state diagram with split nodesby mingabua on December 12, 2025 at 11:55 am
I have the following code to create a tikzpicture of a labelling algorithm. However, I am currently not satisfied with the way it looks right now. Every looks to big and to much spread out. How can I create a more condense but still clear version of it. For (1); the vertical space between the boxes should be smaller. (2) the box height should be decreased and (3) the text inside the box should be more condense. The font size could be decreased as well. This is my code: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{tikz} \usepackage{amsmath} \usetikzlibrary{positioning, arrows.meta, shapes.multipart, calc} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{figure}[htbp] \centering \begin{tikzpicture}[ scale=1, % --- STYLES --- node distance=2.5cm and 3cm, font=\sffamily\footnotesize, % Label Box labelnode/.style={ rectangle split, rectangle split parts=2, draw=black!80, rounded corners, fill=gray!5, align=center, inner sep=3pt, minimum width=2.1cm }, % Infeasible (MS Pruning) - Rot infeasible/.style={ labelnode, draw=red!80, fill=red!5, dashed }, % Dominated (History Dominance) - Lila dominated/.style={ labelnode, draw=violet!80, fill=violet!5, dashed }, % Optimal Path Node - Grün optimal/.style={ labelnode, draw=green!50!black, fill=green!10, line width=1pt }, % Edges worker/.style={-{Latex[length=3mm]}, blue!70!black, thick}, ai/.style={-{Latex[length=3mm]}, orange!80!black, thick}, optedge/.style={worker, line width=1.5pt, green!40!black}, prunededge/.style={-{Latex[length=3mm]}, red!70, dashed}, domedge/.style={-{Latex[length=3mm]}, violet!70, dashed} ] % --- ZEITACHSE --- % Verschiebung nach oben (y=7) und Skalierung x (Faktor 3.2) \draw[->, thick, gray] (0, 7) -- (10.5, 7) node[right] {Time $t$}; \foreach \x in {0,1,2,3} \node[gray] at (\x*3.2, 7.3) {$t=\x$}; % --- KNOTEN --- % t=0 \node[labelnode] (start) at (0,0) { \textbf{Start} \nodepart{second} $V=0$\\$\omega=0$ }; % t=1 % Worker \node[optimal] (t1_w) at (3.2, 2.0) { \textbf{W1} \nodepart{second} $V=3$\\$\omega=1.0$\\$h=[1]$ }; % AI \node[labelnode] (t1_a) at (3.2, -2.0) { \textbf{A1} \nodepart{second} $V=1$\\$\omega=0.3$\\$h=[0]$ }; % t=2 % PATH A: \node[optimal] (t2_ww) at (6.4, 3.8) { \textbf{W $\to$ W} \nodepart{second} $V=6$\\$\omega=2.0$\\$h=[1,1]$ }; % PATH B: \node[labelnode] (t2_aw) at (6.4, 0) { \textbf{AI $\to$ W} \nodepart{second} $V=4$\\$\omega=1.3$\\$\mathbf{h=[0,1]}$ }; % PATH C: \node[dominated] (t2_wa) at (6.4, -2.5) { \textbf{W $\to$ AI} \nodepart{second} \textit{Dominated}\\$V=4$\\$\omega=1.3$\\$\mathbf{h=[1,0]}$ }; % PATH D: \node[infeasible] (t2_aa) at (6.4, -4.5) { \textbf{AI $\to$ AI} \nodepart{second} \textit{Pruned}\\$h=[0,0]$ }; % PATH A+: W -> W -> W \node[optimal] (t3_www) at (9.6, 4.8) { \textbf{3 Workers} \nodepart{second} $V=9$\\$\omega=3.0$\\Target Met }; % --- Arcs --- % t0 -> t1 \draw[optedge] (start) -- (t1_w) node[midway, above, sloped] {W (+3)}; \draw[ai] (start) -- (t1_a) node[midway, below, sloped] {AI (+1)}; % t1 -> t2 \draw[optedge] (t1_w) -- (t2_ww) node[midway, above, sloped] {W (+3)}; \draw[ai] (t1_w) -- (t2_wa) node[midway, below, sloped, pos=0.3] {AI (+1)}; \draw[worker] (t1_a) -- (t2_aw) node[midway, above, sloped, pos=0.4] {W (+3)}; \draw[prunededge] (t1_a) -- (t2_aa) node[midway, below, sloped] {Violation}; % t2 -> t3 \draw[optedge] (t2_ww) -- (t3_www) node[midway, above, sloped] {W (+3)}; % --- DOMINANCE --- \draw[->, violet, thick] (t2_aw) -- (t2_wa) node[midway, right, align=left, font=\scriptsize, xshift=2mm] {\textbf{Dominance Check}}; % --- NOTES BEREICH UNTER DEM PLOT --- \node[align=left, text width=12cm, anchor=north west, font=\sffamily\small] at (-0.5, -5.5) { \textbf{Notes:}\\ }; \end{tikzpicture} \caption{Your caption here} \label{fig:your-label} \end{figure} \lipsum[2] \end{document}
- Simulating language-related OpenType font featuresby Apothikon on December 12, 2025 at 10:03 am
In LuaLaTeX, is it possible to use babel (or anything else) to simulate some language-related OpenType features not defined in the font? I give an example of what I mean: Writing in ecclesiastical latin requires to put an acute accent on some vowels. On my Italian keyboard I've only the character é, thus typing á, í, ó, ú is quite inefficient. I would like to tell LaTeX that, inside an ecclesiasticallatin environment, whenever I type à, ì, ò, ù, it must be rendered as á, í, ó, ú. Thanks in advance.
- Draw line at right angleby user4035 on December 12, 2025 at 9:09 am
Code: \documentclass[12pt]{standalone} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage[T2A]{fontenc} \usepackage{tikz} \usetikzlibrary{shapes, positioning, decorations.pathreplacing,calc,arrows} \begin{document} \begin{tikzpicture} \tikzset{ node/.style={draw, rectangle, rounded corners}, } \node [node] (excursions) {excursions}; \node [node, below right = 2.5cm of excursions] (excursions_cities_from) {excursions\_cities\_from}; \node [node, right = 3.5cm of excursions] (currencies) {currencies}; \draw[->] (currencies.west) -- node [below] {(id, currency\_id)} (excursions.east); \draw[->] (currencies.south) -> node [right] {(id, currency\_id)} (excursions_cities_from.north); \end{tikzpicture} \end{document} Is it possible to move the line \draw[->] (currencies.south) -> node [right] {(id, currency\_id)} (excursions_cities_from.north); to the position, indicated with red line? How to calculate coordinate from currencies.south - down until to top line of excursions_cities_from where the red arrow ends?
- What is the minimum set of commands to compile a plain tex file with UTF-8 Chinese characters to PDF?by merlin2011 on December 12, 2025 at 4:42 am
Consider the following minimum Tex example with Chinese characters: 你好 \bye I tried to compile it the traditional way, and it produces an blank document: tex Hello.tex dvipdf Hello.dvi I tried to compile it with xetex and get an error: sudo apt install texlive-xetex xetex Hello.tex This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023/Debian) (preloaded format=xetex) restricted \write18 enabled. kpathsea: Running mktexfmt xetex.fmt mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order): mktexfmt: /usr/share/texmf/web2c/fmtutil.cnf mktexfmt: /usr/share/texlive/texmf-dist/web2c/fmtutil.cnf mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes: mktexfmt: /home/hq6/.texlive2023/texmf-config/web2c/fmtutil.cnf mktexfmt [INFO]: writing formats under /home/hq6/.texlive2023/texmf-var/web2c mktexfmt [INFO]: Did not find entry for byfmt=xetex skipped mktexfmt [INFO]: not selected formats: 8 mktexfmt [INFO]: total formats: 8 mktexfmt [INFO]: exiting with status 0 I can't find the format file `xetex.fmt'! I tried running the command suggested in a different question and it completed successfully, but I still get the same error: sudo fmtutil-sys --all ... ... 50 preloaded fonts No pages of output. Transcript written on dviluatex.log. fmtutil [INFO]: log file copied to: /var/lib/texmf/web2c/luatex/dviluatex.log fmtutil [INFO]: /var/lib/texmf/web2c/luatex/dviluatex.fmt installed. fmtutil [INFO]: successfully rebuilt formats: 8 fmtutil [INFO]: total formats: 8 fmtutil [INFO]: exiting with status 0 How might I fix this error and compile the UTF-8 to PDF?
- Problem inputing a file into another with LuaLaTeXby Knudsen on December 12, 2025 at 2:55 am
I am trying to write a macro to input a set of small text files into a larger file, in lualatex, but seeing some variances how the text is inserted in the main file. So far I prepared this: \documentclass[11pt]{report} \usepackage{amsthm} \usepackage{polyglossia} \setmainfont{STIX Two Text} \usepackage[ a4paper, margin=4cm, marginparwidth=50pt, ]{geometry} \newtheoremstyle{problemstyle}% name of the style to be used {\topsep}% measure of space to leave above the theorem. E.g.: 3pt {\topsep}% measure of space to leave below the theorem. E.g.: 3pt {}% name of font to use in the body of the theorem {0pt}% measure of space to indent {\bfseries}% name of head font {}% punctuation between head and body { }% space after theorem head; " " = normal interword space {\thmname{#1}\thmnumber{ #2}\textbf{\thmnote{ (#3)}}} \theoremstyle{problemstyle} \newtheorem{problema}{\textbf{Problem}}[section] \newcommand{\bp}[1]{\begin{problema}[#1] \input{#1} \label{#1}\end{problema}} \begin{document} \bp{Fa87}% \begin{problema}[Fa87] Prove that $\cos^p \theta \leq \cos p\theta$ for $0 \leq \theta \leq \pi /2$ and $0 < p < 1$. \end{problema} \begin{problema}[Fa87] Prove that $\cos^p \theta \leq \cos p\theta$ for $0 \leq \theta \leq \pi /2$ and $0 < p < 1$. \end{problema} \begin{problema}[Fa87] Prove that $\cos^p \theta \leq \cos p\theta$ for $0 \leq \theta \leq \pi /2$ and $0 < p < 1$. \end{problema} \end{document} ẁith the text of Fa87 to be exactly Prove that $\cos^p \theta \leq \cos p\theta$ for $0 \leq \theta \leq \pi /2$ and $0 < p < 1$. all of it to be processed with lualatex. The variance can be seen here: where the spacing after the entry that uses the command \bp is about twice as much as the spacing of all others, entered directly into the text. Observe that the text introduced by the command is exactly the same as the one directly in the main file. The problem seems to be related to the text getting closer to the end of the line, but I fail to gresp how to address it.
- Official documentation of \pgfmathparse's behavior when processing a comma-separated list of ⟨expressions⟩?by Ulrich Diez on December 11, 2025 at 11:19 pm
\pgfmathparse{(1*2),(2+2),(sqrt(36))} yields defining \pgfmathresult as macro:->{2.0}{4.0}{6.00000} : \documentclass{article} \usepackage{tikz} \begin{document} \pgfmathparse{(1*2),(2+2),(sqrt(36))} \ttfamily \meaning\pgfmathresult \end{document} But this feature of processing a comma-separated list of ⟨expressions⟩ via \pgfmathparse in one go for obtaining a list of undelimited macro arguments seems not documented clearly/explicitly in pgfmanual.pdf. Precise syntax-rules for the quantity "⟨expression⟩", which is introduced and referred to in pgfmanual.pdf, seem to be missing, too. So the question is: Can you rely on \pgfmathparse calculating all components of a comma-separated tuple of independent ⟨expressions⟩ in one go and via \pgfmathresult delivering the results as a tuple of undelimited macro arguments? (In section "96 Customizing the Mathematical Engine" of the TikZ & PGF Manual for Version 3.1.11a you find: For functions with more than nine arguments, or functions with a variable number of arguments, these macros are only defined as taking one argument. The public macro expects its arguments to be comma separated, for example, \pgfmathVariableArgs{1.1,3.5,-1.5,2.6}. Each argument is parsed and passed on to the private macro as follows: \pgfmathVariableArgs@{{1.1}{3.5}{-1.5}{2.6}}. However, this does not exactly refer to \pgfmathparse/\pgfmathresult...)