Hot
- Changeable parameter in equation tagby Jinwen on November 26, 2025 at 3:43 am
Is it possible to have a changeable parameter in the Tag of an equation? Consider the following example: \documentclass{article} \usepackage{hyperref} \usepackage{mathtools} \begin{document} \def\EqCParameter{\mu} \[\tag{C${_{\EqCParameter}}$}\label{eq:C} x_{\mu} y_{\mu} z_{\mu} = 1 \] \( (x^{(0)},y^{(0)},z^{(0)}) \) satisfies {\def\EqCParameter{1}\eqref{eq:C}}. % <- want to show (C_1) \end{document} I am using \eqref to refer to the equation since this will make the reference clickable. However, I would like this parameter \mu in the equation tag to be changeable, so that one could directly say "... satisfies (C_1)", and when reader clicks on (C_1) it will jump to the original definition (C_\mu). Is this possible to achieve this? It seems that \tag will expand its argument so even if I define it as a macro (here \EqCParameter), the tag will still stay the same while referencing even when the content of this macro changes.
- \tcblistof conflicts with {amsart}by D.R on November 26, 2025 at 12:34 am
If one uncomments the \tcblistof... line in the below, an error (Incomplete \ifx) arises. If one changes {amsart} to say {article}, then the problem is fine. Question: why is this error popping up, and how do I fix it? (Some of the MWE code is lifted from \listoftheorems and its alternative with tcbtheorems not displaying, , Restating a theorem environment created using \newtcbtheorem) I also test out \newkeytheorem and \listofkeytheorems, instead of \newtcbtheorem and \tcblistof, and that package has no issue with {amsart}. Only \tcblistof has issues with {amsart} \documentclass[11pt,reqno]{amsart} \usepackage[colorlinks = true, urlcolor = linkcolor, linkcolor = blue]{hyperref} \usepackage[theorems,breakable]{tcolorbox} \definecolor{defred}{RGB}{162, 21, 40} \usepackage{keytheorems} \newkeytheoremstyle{tcbstydef} { tcolorbox = { colframe=defred, enlarge top by=0.15cm, before skip=3pt, after skip=6.5pt, breakable }, bodyfont=\normalfont, headfont=\slshape, notefont=\slshape, notebraces={}{}, noteseparator={: }, headpunct={}, } \newkeytheorem{myrdef}[name=Definition,numberwithin=section,style=tcbstydef] \newtcbtheorem[number within=section,list inside={mylistall}]{mydef}{Definition}% {colframe=defred,enlarge top by=0.15cm,before skip=3pt,after skip=6.5pt,fonttitle=\slshape,breakable}{def} \begin{document} \tableofcontents %\tcblistof[\section*]{mylistall}{Definitionsverzeichnis} % https://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/keytheorems/doc/keytheorems-doc.pdf \listofkeytheorems[ title=List of Key Boxed Content ] \section{hello} \subsection{world} \section{new section} \subsection{new subsection for definitons} % example definition \begin{mydef*}{Hello Definition}{old}% a nice definition \end{mydef*} \begin{myrdef}[ note=My Title, label=def:labelHEY, store=labelHEY] a nice definition \end{myrdef} \getkeytheorem{labelHEY} Definition \ref{def:labelHEY} \end{document}
- Two columns of text for quotes written in two languagesby ncant on November 25, 2025 at 10:08 pm
This is a screenshot from the Italian Wikipedia page on Richard Feynman: At the top of the page there is one of Feynman's quotes, repeated twice: first in English and then translated into Italian. These two versions are arranged in an “invisible” structure (without lines marking the boundaries) similar to a table. I would like to replicate this structure, but without having to manually wrap the text, which discouraged me from using a table. I am open to any suggestions on how to achieve this result. I would also like this structure, when typeset in the final document, not to occupy the entire text area of the page; instead, it should leave some space on the left and right margins, as in the following modified screenshot: Can you please help me with this? Thank you.
- Is there a good way to define common code between LaTeX projects?by Dov on November 25, 2025 at 9:59 pm
I have multiple courses, each containing similar LaTeX code. There are tests built on exam, slides built on beamer. I often include a file with the common files if there are multiple files for example: \input{slides_preamble.tex} or \input{test_preamble.tex} I find myself repeating these files though, and they get out of sync. I would like to have one standard slides and test file in a common place. Defining a common directory in LaTeX seems bad. For one thing, that is embedding the directory structure in the code. I would prefer to do it in a makefile external to the documents: COMMON=/my/path and then some way to refer to that variable in LaTeX, so the code is not linux or windows dependent, and certainly not so I have to change it if I change directory structures. I have started giving my code to fellow professors as well, so this affects that as well. I don't know much about styles. Is that a way out of this? All I really need at this point is to be able to specify external variables. I can definitely see a use for having a common folder for graphics (for the Logo of the University, department, etc), a common directory for the course (for information that doesn't change with the semester, the exercise/test/etc. I use pdflatex to generate output if that affects the answer. Last, when sharing all this, it would be nice if I can export it to overleaf.com. It may not be the fastest environment, and I prefer to work locally, but it does have the huge benefit that we edit collaboratively together when editing papers. On overleaf I don't know how to control the environment at all. Chatgpt suggested using TEXINPUTS for code but to generate a custom script from environment variables if I want to do this for graphics and code. #!/usr/bin/env bash COURSE="${COURSE:-/path/to/course}" BASE="${BASE:-/path/to/shared}" cat > localpaths.tex <<EOF \makeatletter \def\input@path{{./code/}{${COURSE}/code/}{${BASE}/code/}} \makeatother \usepackage{graphicx} \graphicspath{{./figs/}{${COURSE}/figs/}{${BASE}/figs/}} EOF This at least gave me some options, and hopefully let me ask the question better, but for this kind of question I want human advice, preferably from someone who has encountered this problem before.
- My caption doesn't appear in a wide tableby hager moharram on November 25, 2025 at 7:18 pm
I was preparing a table in LaTeX (Springer Nature template) and the table ended up too wide for the page. I used many tricks to put it still on the page with some codes like \setlength{\tabcolsep}{3.5pt} and \resizebox{1\textwidth}{!}{}. While this worked, the problem is that my caption doesn't appear anymore, and it is just allowing it to be inserted as a \textbf{}. I need to arrange my labels, and the template allows either the caption or the modified table. Are there any other ways to put the caption? This is the code of the table: \newpage \begin{table} \centering \addtocounter{table}{1} \begin{flushleft}\textbf{Table 2} Comparison between anthropometric and clinical data within each group at baseline and post-treatment, and between the two groups \end{flushleft} \vspace{2mm} \setlength{\tabcolsep}{3.5pt} \resizebox{1\textwidth}{!}{ \begin{tabular}{cccccccc} \cmidrule(r){1-8} \multirow{2}{*}{Variable} & \multicolumn{2}{c}{\textbf{Group I (n=35)}} & \multirow{2}{*}{$P$1} & \multicolumn{2}{c}{\textbf{Group 2}} & \multirow{2}{*}{$P$2} & \multirow{2}{*}{$P$3} \\\addlinespace[0.5ex] \cmidrule(r){2-3}\cmidrule(r){5-6} \addlinespace[0.5ex] & bbbbbbbb & tttttttttttttt & & bbbbbbbb & tttttttttttttt & & \\\cmidrule(r){1-8} kkkkkk (kk)& 00.00 ± 00.00 & 00.00 ± 00.00& 0.000* & 00.00 ± 00.00 & 00.00 ± 00.00 & 0.000 & 0.000 \\ mmm (mm/mm)& 00.00 ± 0.00 & 00.00 ± 0.00 & 0.000* & 00.00 0.00 & 00.00 ± 0.00 & 0.000 & 0.000 \\ mmmmmmmm & 0.00 (0.00 – 0.00) & 0.00 (0.00 – 0.00) &$<$0.000* & 0.00 (0.00 – 0.00) &0.00 (0.00 – 0.00) &$<$0.000* & 0.000 \\ jjj (mg/dL)& 000.0 (000.0 – 000.0) &149.0 (000.0 – 000.0) & $<$0.000* & 000.0 (000 – 000.0) & 000.0 (0.000 – 000.5) & $<$0.000* & 0.000 \\ kkk (kkk/kk)& 0.00(0.00 – 00.00) & 0.0 0(0.00 – 00.00) & 0.000 & 0.00 (0.00 – 0.00) & 0.00 (0.00 – 00.0)0 & 0.000 & 0.099 \\ jjjj-jj& 0.00 (0.00 – 0.0)0 &0.0 0(0.00 – 0.00) &0.000* & 0.00 (0.00– 0.00) & 0.0 0(0.00 – 0.0)0& $<$0.000*& 0.000 \\ jjjjjjjj (jj/jj) &0.00 (0.00 – 0.00) &0.00 (0.00 – 0.00) &0.000 & 0.00 (0.00 –0.00) & 0.00 (0.00 – 0.00) &0.000* & 0.000 \\ ggggggggg (jj/j)& 000.0 (000.0 – 000.0) & 000.0 (000.0 – 000.0) &0.000* & 000.0 (000.0 – 0.0) & 0.0 (0.0 – 000.0) & 0.000 & 0.000* \\ \bottomrule \end{tabular}} \begin{flushleft}\footnotetext{\footnotesize \raggedright }\end{flushleft} \end{table}
- How to get a structure of this nodes tower with proper coordinates?by Explorer on November 25, 2025 at 5:54 pm
What I want to achieve is something as below(sorry for drawing in a hurry): The only requirements is vertical alignment(shown as the red dashed lines), the spacing of each nodes could be design, given that would not ruin the figure is okay. What I have tried is as below: \documentclass[tikz,border=5pt]{standalone} \newcommand\mynode[2][1]{% \node[draw,thick,minimum width=8cm,minimum height=2cm,font=\Huge\bfseries,scale=#1] at (#2) {AAAA}; } \begin{document} \begin{tikzpicture} % \mynode[1]{0,0} % \mynode[.45]{-2.25,-2} % \mynode[.45]{2.25,-2} % \mynode[.225]{-3.25,-3} % \mynode[.225]{1.25,-3} % \mynode[.225]{-1.25,-3} % \mynode[.225]{3.25,-3} %... \foreach \x[ evaluate=\x as \y using {int(2^(\x-1))} ] in {1,...,6}{ \foreach \t in {1,...,\y}{ \def\xx{\fpeval{-4 + (8/(\y+1))*\t*1.25}} \def\yy{\fpeval{(8/(\x+1))*1.25}} \mynode[\fpeval{1/\y}]{\xx,\yy} } } \end{tikzpicture} \end{document} It gives: I found that dilemma to determine the proper spacing, and exact coordinates calculation to guarentee vertical alignment at the same time. Is that any powerful tikz tools or something other (box, coffin?) to achieve this? Or I maybe just to make more effort to solve the better numerical relationship or working with the recursive structure?
- Graph of a relationby Dimitrios ANAGNOSTOU on November 25, 2025 at 4:24 pm
First attempt to create a graph with TikZ. More precisely, I want to be able to create figures like the following one. After much trial and error, I was able to get something close with the code below: \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{arrows.meta,positioning} \begin{document} \begin{tikzpicture}[ >=Stealth, node/.style={circle, fill=black, inner sep=2pt}, every loop/.style={min distance=15mm, looseness=8} ] % Define nodes \node[node, label=left:4] (4) at (0, 3) {}; \node[node, label=left:1] (1) at (0, 1) {}; \node[node, label=below left:2] (2) at (-2, 0) {}; \node[node, label=below right:3] (3) at (2, 0) {}; % Draw edges \draw[->] (1) -- (4); \draw[->] (1) -- (2); \draw[->] (1) -- (3); \draw[->] (2) to[bend left=30] (4); \draw[->] (3) to[bend right=30] (4); \draw[->] (2) to[bend right=30] (3); % % Self-loops \draw[->] (4) edge[loop above] (4); \draw[->] (1) edge[loop right] (1); \draw[->] (2) edge[loop left] (2); \draw[->] (3) edge[loop right] (3); \end{tikzpicture} \end{document} How can I get something closer to the book picture? Also, is there any TikZ library/extension that automates such staff? Thank you very much for your time.
- Wild Turkeys in TikZby karlh on November 25, 2025 at 4:20 pm
I have an annual scavenger hunt at Thanksgiving in which the TikZlings and TikZ ducks (and related fauna) guide my nieces and nephew through the course. Given that it is Thanksgiving, I wanted to include a turkey munching on pie and sipping wine, but the closest I can come is \documentclass{article} \usepackage{tikzlings} \begin{document} \begin{tikzpicture} \chicken[cake=orange!50!brown,wine] \end{tikzpicture} \end{document} and that just doesn't have the same ring to it. I found a good wild turkey drawn in MetaPost (Draw a turkey, a pumpkin pie, or any other object traditionally associated with Thanksgiving), but since the holiday is only two days away, I thought I'd see whether anyone was interested in making a picture of Meleagris gallopavo.
- Using TikZ with a command only defined on second passby Jason on November 25, 2025 at 3:39 pm
I have a number of commands that work a lot like the \ref command in that its true typeset value is only defined after an initial pass is performed. In the first pass they typeset ? - like the \ref command, and in the second pass that ? is instead a number or some string. It would be nice if I could use these commands inside a tikzpicture environment as a parameter. Obviously, tikz errors out when it gets the LaTeX command, and even if I can get the command to expand, it still errors due to tikz trying to understand the ? on the first pass - thus breaking the compile before it can build the correct value for a second pass. Is there a way to generically redefine a command (or tikz elements I guess?) so such commands still executes as normal on the first pass (a \ref command waits for a corresponding label to get defined so it has a value, but a generic command may execute some TeX like writing to an external file or change some settings/variables in the compile which it would still need to do on the first pass before it was defined in a way to be used in the tikzpicture env on the second pass), but it doesn't generate an error in tikz in the first pass (or the error is ignored/doesn't stop compile) so that the command gets a chance to be defined for the second pass - then have tikz actually use the command output on the second pass once it is correctly defined? Below is a MWE for what I am looking for, using a \label and \ref combo as a simple version of what I am after, but it would be ideal if it could work on generic commands that expand into arbitrary tikz code. \documentclass{article} \usepackage{tikz} \begin{document} \setcounter{section}{6} \section{Introduction}\label{temp} \ref{temp}% Should display 7 \begin{tikz}% Should display a 7 radius circle \draw circle(\ref{temp}pt); \end{tikz} \setcounter{section}{13} \section{Intro2}\label{temp2} \ref{temp2}% Should display 14 \begin{tikz}% Should display a 14 radius circle \draw circle(\ref{temp}pt); \end{tikz} \end{document} EDIT FOR MORE INFO The primary use case I want to apply this to is the \sage{arg} command, which on the first pass outputs a ? and writes out to an external file. That file is then processed before a second LaTeX pass. On the second pass, the \sage{arg} command grabs the definition of arg from the external file, and then the \sage{arg} command expands as the definition given by the external file. The actual particulars of sage itself aren't really important (I think), it's more that I want to have a normal LaTeX command get run inside a tikz environment, but without stopping the compile because its initial output is just a ?. But the first pass generates something so that on the second pass the command expands into tikZ parseable code, so that in the second pass it will then actually be used in tikzpicture correctly. In particular, I would actually expect any solution for this, to also work for \label and \ref, assuming that \ref is a number or somehow a string that tikz should be able to parse normally.
- Check for and report excessively large dimensions in \tkzGetNodesby Alain Matthes on November 25, 2025 at 1:46 pm
This is a refinement I would like to add to the following macro: \def\tkzGetNodes{\directlua{% local n,sd,ft,xft, xsd for K,V in pairs(z) do n = string.len(K) if n > 1 then _,_,ft, sd = string.find(K, "(.+)(.)" ) if sd == "p" then K=ft.."'" end _,_,xft, xsd = string.find(ft, "(.+)(.)" ) if xsd == "p" then K=xft.."''" end end tex.sprint("\\coordinate ("..K..") at ("..V.re..","..V.im..") ; \string\r") end }} This macro allows you to switch between points created with lua and TikZ nodes. K is a key, or more simply the name of the point and then the node, while V.re and V.im are the future coordinates of this node. The issue is not so much controlling the value of the coordinates, although it is interesting to know the largest possible value, as it is the ability to inform the user that coordinates have been rejected. Is this possible, and how can it be done?
- Difficulties in using string.find with directluaby Alain Matthes on November 25, 2025 at 1:36 pm
The main macro in tkz-elements is \tkzGetNodes. This macro retrieves the elements from the z table in order to create nodes. The elements in the table provide the node name and its coordinates. The code for this macro is as follows: \def\tkzGetNodes{\directlua{% for K,V in pairs(z) do local n,sd,ft n = string.len(K) if n > 1 then _,_,ft, sd = string.find(K, "(.+)(.)" ) if sd == "p" then K=ft.."'" end _,_,xft, xsd = string.find(ft, "(.+)(.)" ) if xsd == "p" then K=xft.."'".."'" end end tex.sprint("\\coordinate ("..K..") at ("..V.re..","..V.im..") ; \string\r") end }} There is no problem with the contact details, but I am having difficulty processing the names. Of course, whether it is on the lua or TeX side, certain characters are not accepted. As the use is primarily mathematical, I need certain characters. _ poses no difficulty, but in order to use prime (') and double prime (''), I had to find a workaround. This involves reserving the letter p or the pair pp, replacing them with ' and '' if they appear at the end of a name. Thus, z.Ap = point(1, 2) becomes node A' with coordinates (1, 2). z.Bpp becomes B'' and z.p becomes p. Example: \documentclass{standalone} \usepackage[mini]{tkz-euclide} \usepackage{tkz-elements} \begin{document} \directlua{ z.Ap = point(0, 0) z.Bpp = point(5, 1) z.p = point(2, 3) % z.apo = point(1, 1) } \begin{tikzpicture} \tkzGetNodes \tkzDrawPolygon(A',B'',p) \tkzDrawPoints(A',B'',p) \tkzLabelPoints(A',B'') \tkzLabelPoints[above](p) \end{tikzpicture} \end{document} Question: How can I modify my macro so that point names that do not have a p at the end are accepted, but one or more letters p in their bodies? The following case appears to be the only one ... With z.apo, I obtain ./name.tex:18: Package pgf Error: No shape named `apo' is known. Ultimately, I am not filtering the names correctly, and with z.xpy, xpy is transformed into x''?
- Error based on interaction of thmtools and an implemantation of a refable delayed proof environmentby Klimace on November 25, 2025 at 12:39 pm
I added the solution by @egreg to the question Reference to proof prints section instead to my document and it did not work throwing the error: Undefined control sequence. \@hyper@@anchor ...r@spot {#2#3}\let \put@me@back The culprit as it turns out is thmtools: \documentclass{article} \usepackage{amsthm} \usepackage[colorlinks]{hyperref} \usepackage{cleveref} \usepackage{thmtools} %Only addition compared to the used solution \newtheorem{theorem}{Theorem} \newenvironment{delayedproof}[1] {\begin{proof}[\raisedtarget{#1}Proof of \Cref{#1}]} {\end{proof}} \newcommand{\raisedtarget}[1]{% \raisebox{\fontcharht\font`P}[0pt][0pt]{\hypertarget{#1}{}}% } \newcommand{\proofref}[1]{\hyperlink{#1}{proof}} \begin{document} \section{Theorems} \begin{theorem}\label{thm:some-theorem} This is a theorem. \end{theorem} For an intuition, see the \proofref{thm:some-theorem}. \appendix \section{Proofs} \begin{delayedproof}{thm:some-theorem} This is a proof. \end{delayedproof} \end{document} I am now interested in answering what exactly breaks and if there is a better, i.e. the hyperlink does the right thing, fix that what I have come up with: \newenvironment{delayedproof}[1] {\raisedtarget{#1}\begin{proof}[Proof of \Cref{#1}]} {\end{proof}} \newcommand{\raisedtarget}[1]{% \raisebox{\fontcharht\font`P}[0pt][0pt]{\hypertarget{#1}{}}% }
- How to ensure a text starts exactly at the left margin of the text area?by Denis Bitouzé on November 25, 2025 at 11:28 am
In the following MCE, there is a small space between the left margin of the text area and the “F” of “Foo”. Hence, the “F” and the red horizontal rule below this text aren't vertically aligned. How to make them vertically aligned? \documentclass{article} \usepackage{xcolor} \usepackage[showframe,paperwidth=5cm,paperheight=3cm,noheadfoot,nomarginpar]{geometry} \setlength{\parindent}{0cm} \pagestyle{empty} \begin{document} \sffamily% Foo\par \color{red}\hrulefill \end{document}
- How can I draw grid of cylinders?by minthao_2011 on November 25, 2025 at 9:02 am
I used Mathematica and tried grid of cylinder I don’t know how to draw with other tools. How can I draw it?
- Implementing certain unicode-math symbolsby userא0 on November 25, 2025 at 8:31 am
I came across the following extensive list of symbols defined by unicode-math and am struggling to implement them in my document. Attempting to to use certain commands mentioned in the linked list I rad to the following problem; I am interested in implementing the \mup commands. Trying to use any of the \mup... commands (mentioned in section 13.1.1 in the linked document) does not change anything. I mean that \alpha and \mupalpha looks the same after compiling the file (and the same is true for all other greek letters). Another thing might be worth mentioning is that, writing any individual \mup command literally compiles as text mupalpha and not \alpha. here is a minimal working example; % Preview source code %% LyX 2.4.1 created this file. For more info, see https://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[english,hebrew,no-math]{extarticle} \usepackage{amsmath} \usepackage{amsthm} \usepackage{fontspec} \setmainfont[Mapping=tex-text]{Hadasim CLM} \setsansfont[Mapping=tex-text]{Palatino} \setmonofont{Palatino} \usepackage[a4paper]{geometry} \geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=2cm,rmargin=2cm,headheight=2cm,headsep=2cm} \usepackage{setspace} \doublespacing \usepackage[pdfusetitle, bookmarks=true,bookmarksnumbered=false,bookmarksopen=false, breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false] {hyperref} \makeatletter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. \numberwithin{equation}{section} \newlength{\lyxlabelwidth} % auxiliary length \@ifundefined{date}{}{\date{}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \usepackage{faktor} \usepackage{graphicx, nicefrac} \usepackage[all]{xy} \usepackage{fancyhdr} \usepackage{xcolor} \pagestyle{fancy} \usepackage{bbm} \usepackage{xfrac} \usepackage[dvipsnames]{xcolor} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{unicode-math} \setmathfont{texgyrepagella-math.otf}[math-style=french, Scale=1] \setmathfont{STIXTwoMath-Regular.otf}[range={cal, bfcal}, StylisticSet=0] \usepackage[scr=rsfs]{mathalfa} \makeatother \usepackage{polyglossia} \setdefaultlanguage{hebrew} \setotherlanguage{english} \begin{document} $\mupalpha$ \end{document} Thanks a lot!
- Does LaTeX support abstract class like Java and C sharp?by YCH817 on November 25, 2025 at 6:16 am
I find out that Till Tantau's pgf supports OOP programming . But does it support abstract classes ? Here is a small example : \pgfooclass{mathobj}{ \attribute form LaTeX ; \attribute form Verb ; \method mathobj(#1) {% \pgfooset{form LaTeX}{\ensuremath{#1}}% } \method print LaTeX() {% \pgfoovalueof{form LaTeX}% } } \pgfoonew\mymathobj=new mathobj(x^2) \mymathobj.print LaTeX() I wish the mathobj class can be the abstract class or interface in Java , and other classes can inherit / implement it .
- How to create two bottom-aligned side-by-side figures in llncs?by user20478285 on November 25, 2025 at 2:13 am
I want to create two side-by-side subfigures that are bottom aligned. With subcaption, I would do it this way: \documentclass{llncs} \usepackage{graphicx} \usepackage{subcaption} \begin{document} \begin{figure} \centering \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=4cm, angle=90, origin=c]{example-image-a}% \caption{Foo.} \label{fig:foo} \end{subfigure}% \hfil \begin{subfigure}[b]{0.4\textwidth} \centering \includegraphics[width=4cm]{example-image-b}% \caption{Bar.} \label{fig:bar} \end{subfigure} \caption{Foo (\ref{fig:foo}) and Bar (\ref{fig:bar}) using \texttt{subcaption}.} \label{fig:foobar} \end{figure} \end{document} And obtain this result: The figures are properly aligned, but by loading subcaption it reset llncs's default caption setup. It seems the subcaption package cannot be used with llncs (Package caption Warning: Unknown document class (or package), standard defaults will be used. See the caption package documentation for explanation.) and changes the default caption format. As an alternative I tried subfig, and what I have now is \documentclass{llncs} \usepackage{graphicx} \usepackage[caption=false]{subfig} \begin{document} \begin{figure} \centering \subfloat[% Foo.% \label{fig:foo}% ]{% \centering \includegraphics[width=4cm, angle=90, origin=c]{example-image-a}% } \hfil \subfloat[% Bar.% \label{fig:bar}% ]{% \centering \includegraphics[width=4cm]{example-image-b}% } \caption{Foo (\ref{fig:foo}) and Bar (\ref{fig:bar}) using \texttt{subfig}.} \label{fig:foobar} \end{figure} \end{document} where the captions look fine (style-wise) but the result looks unpleasing as the two figures are not bottom-aligned: I am not limited to the subfig package; if there are other packages that allow me to create side-by-side figures with individual labels and captions I'd happily give them a try, as long as they can be used with llncs (i.e. do not modify its default caption setup). Any help is much appreciated!
- Why does putting the alignment tab after relation operators in the align environment cause the spacing after the operator to be too thin?by palapapa on November 25, 2025 at 12:53 am
For example: \begin{align} a =& b \end{align} causes there to be too little space after the equal sign, but if I put the alignment tab before the equal sign, this doesn't happen. Why? Does the align environment magically put an empty atom after alignment tabs so that the equal sign gets spaced correctly?
- Length adjusted mapsfrom with text above itby Rabeeb Ibrat on November 25, 2025 at 12:25 am
How do I get a length adjusted \mapsfrom arrow with text over it similar to \xmapsto? I have tried the following: \overset{fghij}{\mapsfrom}, and \overset{fghij}{\longmapsfrom} but these don't adjust the length of the arrow flexibly. Instead I get the following: Is there a way to do this from the existing packages?
- pdfLaTeX puts invalid characters into generated PDF filesby blackcat on November 24, 2025 at 11:15 pm
I have found that pdfLaTeX replaces two input Cyrillic letters with their Latin counterparts breaking full text search. I'm talking about і and І (U+0456 and U+0406), they are replaced with i and I (U+0069 and U+0049). I tested two projects: one old with cp1251 as an input encoding and a font encoding (T2A) set by babel, and another one with utf-8 as input and OT2,TA2 as fontenc. It doesn't matter whether cmap package is used. My question is what package is to blame and report a bug against: babel, fontenc or something else? Just in case: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[belarusian]{babel} \begin{document} Latin: iI Cyrillic: іІ \end{document} LuaLaTeX generates correct PDF, it only needs \usepackage{fontspec}\setmainfont{Noto Serif} added to use a font with Cyrillic glyphs.
- How can I make an align equation look neaterby George Dewhirst on November 24, 2025 at 10:40 pm
I know a bit of LaTeX but struggle with making large multi-line equations look professional. Apologies if this is the wrong way/place to ask. Literally any help would be grand. Specifically I would like the formatting to be on the left. (Here is some LaTeX for reference...) \begin{proof} First we prove \eqref{E-alpha-1}. \begin{align} \left|\mathbf{E}_{\alpha,1}^{(\beta)}( t) v\right|_{\mu} = \sum_{j=1}^{\infty}\lambda_j^{\mu}\langle(E_{\alpha,1}^{(\beta)}(t)v,e_j\rangle^2 \end{align} Note that $\langle(\mathbf{E}_{\alpha,1}^{(\beta)}t)v,e_j\rangle = \sum_{k=0}^{\infty}\frac{\langle (-A)^{\beta k}t^{\alpha k}v,e_j\rangle}{\Gamma(\alpha k+1)} = \sum_{k=0}^{\infty}\frac{\langle (-\lambda_j)^{\beta k}t^{\alpha k}v,e_j\rangle}{\Gamma(\alpha k+1)} = E_{\alpha,1}(-\lambda_j^{\beta} t^{\alpha})\langle v, e_j \rangle$. Using that $A^{\beta k}e_j = \lambda_j^{\beta k} e_j$ whenever $e_j$ are the eigenvectors of $A$. Next we use the result that $|E_{\alpha,1}(z)|^2\leq \frac{C}{(1+|z|)^2}$ Thus \begin{align} |\mathbf{E}_{\alpha,1}^{(\beta)}( t) v|_{\mu}^2 = \sum_{j=1}^{\infty}\lambda_j^{\mu}\langle(E_{\alpha,1}^{(\beta)}(t)v,e_j\rangle^2 = \sum_{j=1}^{\infty}\lambda_j^{\mu}\langle v, e_j \rangle^2 |E_{\alpha,1}(-\lambda_j^{\beta} t^{\alpha})|^2 \\ \leq \sum_{j=1}^{\infty}\lambda_j^{\mu}\langle v, e_j \rangle^2 \frac{1}{(1+\lambda_j^{\beta}t^{\alpha})^2}\\ \leq C t^{-\frac{\alpha}{\beta}(\mu - \nu)} \sum_{j=1}^{\infty}\frac{(\lambda_j^\beta t^{\alpha})^{\frac{\mu-\nu}{\beta}}}{(1+\lambda_j^{\beta}t^{\alpha})^2}\lambda^{\nu}_j\langle v, e_j \rangle^2 \\ \leq Ct^{-\frac{\alpha(\mu-\nu)}{\beta}}\sum_{j=1}^{\infty}\lambda_j^{\nu}\langle v, e_j\rangle^2 \leq Ct^{-\frac{\alpha(\mu-\nu)}{\beta}}|v|_{\nu}^2 \end{align} \end{proof} )
- Inaccurate TikZ/PGF plotby Dominique on November 24, 2025 at 6:31 pm
I'm using the following code to produce a plot: \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[ width = 15cm, xtick = {0, 1, 2, 3, 4, 5}, ] \addplot[black, thick, smooth, domain=0:5] {exp(-100 * \x) + sin(\x)}; \addplot[blue, thick, smooth] table {stiff.dat}; \end{axis} \end{tikzpicture} \end{document} It produces the following plot: Here, the blue curve plots data points generated with Matlab for the same function. The blue curve is correct, but the black one is not. It seems TikZ is not able to plot the function accurately. I've read on this forum about this issue and I tried a few things: \ustikzlibrary{fpu}: did not help; that may be because the PFU is limited to 4-5 digits \usepackage{xfp}: I could not get this to work and kept getting an error with \fpeval \usepackage{expl3}: same. I must be doing something wrong. What is the correct incantation here? I would rather not resort to compiling with Lua because my document is part of series that all compile fine with PDFLaTeX. Thank you in advance!
- circuitikz: Rename self-drawn 'bipole symbol'by cis on November 24, 2025 at 4:46 pm
I drew a new bipol-symbol (which is similar to a capacitor from pgfcircbipoles.tex) and I want to be able to say \draw[] (0,0) to[newname] (2,0) to[vC] (4,0); instead of \draw[] (0,0) to[capacitor] (2,0) to[vC] (4,0); I thought I could do the same trick as here. Simply "search and replace" doesn't work. What do I have to do? %\documentclass[a4paper]{article} \documentclass[margin=5pt]{standalone} \usepackage{circuitikz} \makeatletter %% Normaly-Open-Contact Dipol Symbol ============ \ctikzset{bipoles/capacitor/height/.initial=0.35}% default 0.6 \ctikzset{bipoles/capacitor/width/.initial=0.3}% default 0.2 \pgfcircdeclarebipolescaled{capacitors} {} {\ctikzvalof{bipoles/capacitor/height}} {capacitor} {\ctikzvalof{bipoles/capacitor/height}} {\ctikzvalof{bipoles/capacitor/width}} { \pgfcirc@maybe@fill@straight@capacitor \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{2\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{2\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{2\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{2\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} } \pgfcirc@activate@bipole@simple{l}{capacitor} %% ============================= \makeatother \begin{document} \begin{circuitikz}[] \draw[] (0,0) to[capacitor] (2,0) to[vC] (4,0); \end{circuitikz} \end{document}
- Add a DPDT switchby Nicolas on November 24, 2025 at 1:55 pm
I've diagrammed the charging and discharging of a capacitor. \documentclass[border = 1mm]{standalone} \usepackage[utf8]{inputenc} \usepackage{siunitx} \usepackage[european, straightvoltages, RPvoltages]{circuitikz} \usetikzlibrary{babel} \begin{document} \begin{circuitikz} \draw (0,0) node[spdt,rotate=90,anchor=in] (Sw) {} (Sw.in)--++(0,-1) coordinate(RC) --++(1,0) to[R] ++(0,-1.5) to [leDo]++(0,-1.5) --++(-1,0) (RC)--++(-1,0) to[capacitor]++(0,-3)--++(1,0) (RC)--++(1,0) to[R] ++(0,-1.5) to [leDo]++(0,-1.5) coordinate (basRC) ($(basRC)+(-1,0)$) --++(0,-1) node[ground](GND){} (Sw.out 1) to[R] ++(-2,0) to[leDo, invert, mirror] ++(-2,0) coordinate(posSource) to [vsource] (posSource|-GND) --(GND) (Sw.out 2) --++(3,0) coordinate (posMoteur) to [Telmech=M,n=motor] (posMoteur|-GND)--(GND); \end{circuitikz} \end{document} For the discharge, I'd like to add a DPDT switch (and an LED + protection resistor in the corresponding loop) to be able to change the motor's direction of rotation: I haven't found anything about this in the documentation.
- LaTeX "minted" is not working with MikTeX, Win10by J AK on November 24, 2025 at 11:29 am
I want to submit a paper in e-informatica, so I am using their file, which is available here. But without any change, their file is not working. It generates the error Error message: minted v3+ executable is not installed or is not added to PATH with two other errors. I have uninstalled and reinstalled the package, and I have also already tried pdflatex --shell-escape your_document.tex pip install minted Please guide how I can fix this.
- Why do expl3 setting commands use \edef?by jlab on November 24, 2025 at 9:21 am
Looking at the definition of \tl_set:Nn (for example, with latexdef \tl_set:Nn), we find \tl_set:Nn: \protected\long macro:#1#2->\__kernel_tl_set:Nx #1{\__kernel_exp_not:w {#2}} where \__kernel_tl_set:Nx is simply \edef; and \__kernel_exp_not:w is \unexpanded. So, \tl_set:Nn \l_my_tl {...} means \edef \l_my_tl {\unexpanded {...}} that is to say: \edef requests for the expansion of the macro definition, but this expansion is prevented by \unexpanded. I'm curious, why not using instead \def \l_my_tl {...} ?
- LaTeX and tabluarray themeby Aaron on November 24, 2025 at 7:26 am
The table with the local settings works perfectly. But if I want to have a theme = compact, it no longer works. I want to write lines 25 and 26 into a global theme and only customize the specific changes locally, see line 25. \documentclass{scrbook} \usepackage{fontspec} \usepackage[sfdefault]{noto} \setmonofont{Noto Sans Mono}[UprightFont = * SemiBold] \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \NewTblrTheme{compact}{% \DefTblrTemplate{contfoot-text}{default}{}% \DefTblrTemplate{conthead-text}{default}{}% % Style for the first line (header) \SetTblrStyle{row}{1}{font={\sffamily\bfseries\small},abovesep=3pt,belowsep=3pt}% % Style for all data rows \SetTblrStyle{row}{2-Z}{font={\sffamily\small},abovesep=1pt,belowsep=1pt}% } \begin{longtblr}[ theme = compact, caption = {Test}, label = {tab:test} ]{ colspec = {cX[l]}, rowhead = 1, % row{1} = {font={\small\sffamily\bfseries}, abovesep=3pt, belowsep=3pt}, % row{2-Z} = {font={\small\sffamily}, abovesep=1pt, belowsep=1pt}, cell{2-Z}{1} = {font=\ttfamily\small} } \toprule Spalte 1 & Spalte \\ \midrule 123 - 456 & Zeile 1 \\ 123 - 456 & Zeile 2 \\ 123 - 456 & Zeile 3 \\ 123 - 456 & Zeile 4 \\ \bottomrule \end{longtblr} \end{document}
- floating point arithmetic and boolean operations with \ifthenelseby underflow on November 24, 2025 at 6:50 am
This is a follow up to my previous post about arithmetic operations and tikz I would like to performance floating point arithmetic & boolean operations in conjunction with \ifthenelse. Here is a minimal example: \usepackage{tikz, ifthen} \begin{document} \begin{tikzpicture} \foreach \a in {-6,...,6} { \foreach \b in {-6,...,6} { \ifthenelse{ (\a+1.4*b < 4) \and (\a - 1.4*b)> 1 } { \node at ( (\a, \b ) {(\a, \b)}; } {} } } \end{tikzpicture} \end{document} Many thanks for your help!
- How to Make TikZ Overlay Arrows Smoother and Better Arranged in Table?by mingabua on November 23, 2025 at 6:33 pm
I'm creating a table with TikZ overlay arrows to illustrate the data flow between cells. The arrows currently work, but they look somewhat crude and could be improved. I'm looking for suggestions on: How to make the curved arrows look more fluid and natural Better positioning strategies for the labeled nodes (A, B, C, D) so they don't overlap with arrows How to avoid awkward arrow angles and improve the overall visual flow Here's my MWE: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath} \usepackage{booktabs} \usepackage{xcolor} \usepackage{lipsum} \usepackage{caption} \usepackage{tikz} \usetikzlibrary{tikzmark} \usepackage[most]{tcolorbox} % Color \definecolor{boxBack}{RGB}{245, 247, 250} \definecolor{darkgrey}{HTML}{464e51} \definecolor{customGray}{HTML}{DDDDDD} \definecolor{customRed}{HTML}{FDE7A9} \definecolor{customOrange}{HTML}{FC8E64} \definecolor{customBlue}{HTML}{B83779} % tcolorbox settings \tcbset{ enhanced, colback=boxBack, colframe=gray!40, boxrule=0.5pt, fonttitle=\bfseries\sffamily, coltitle=black, attach boxed title to top left={xshift=0.5cm, yshift=-3mm}, boxed title style={colback=white, colframe=gray!40, arc=3pt}, top=1em, bottom=1em, left=1em, right=1em } \begin{document} \lipsum[1-3] \begin{tcolorbox}[title=Test] \footnotesize $\quad$ \lipsum[1] \renewcommand{\arraystretch}{1.2} \begin{center} \captionsetup{font=footnotesize,labelfont={color=darkgrey,bf}} \captionof{table}{\textcolor{darkgray}{Example}} \label{tab:shifte} \vspace{-0.5cm} \[ \begin{array}{@{\hspace{1em}}c@{\hspace{2em}}c@{\hspace{3.5em}}c@{\hspace{3.5em}}c@{\hspace{3.5em}}c@{\hspace{2em}}c@{\hspace{1.0em}}} \toprule \text{Day} & \text{$1$} & \text{$2$} & \text{$3$} & \text{$4$} & \text{$\ldots$} \\ \midrule \text{{\fontsize{9}{10}\selectfont ...}} & \text{{E}} & \text{{L}} & \text{{O}} & \text{{E}} & \text{$\ldots$} \\[6pt] \text{$a_{ds}$} & \tikzmarknode{A2}{\text{$(1,0)$}} & \tikzmarknode{A3}{\text{$(0,1)$}} & \tikzmarknode{A4}{\text{$(0,0)$}} & \tikzmarknode{A5}{\text{$(1,0)$}} & \tikzmarknode{A6}{$\ldots$} \\[6pt] \text{$b_{ds}$} & \tikzmarknode{B2}{\text{$(1,0)$}} & \tikzmarknode{B3}{\text{$(1,0)$}} & \tikzmarknode{B4}{\text{$(0,1)$}} & \tikzmarknode{B5}{\text{$(0,1)$}} & \tikzmarknode{B6}{$\ldots$} \\[6pt] \text{$c_{ds}$} & \text{$(0,0)$} & \text{$(0,0)$} & \tikzmarknode{Z1}{\text{$(0,1)$}} & \text{$(0,0)$} & \text{$\ldots$} \\[6pt] \text{$v_{ds}$} & \tikzmarknode{E3}{\text{$(0,0)$}} & \tikzmarknode{E4}{\text{$(0,1)$}} & \text{$(0,0)$} & \tikzmarknode{E5}{\text{$(1,0)$}} & \tikzmarknode{E6}{$\ldots$ } \\ [6pt] \text{$d_{d}$} & \text{$0$} & \text{$1$} & \tikzmarknode{Z12}{\text{$0$}} & \text{$1$} & \text{$\ldots$} \\ \bottomrule \end{array} \] \begin{tikzpicture}[remember picture,overlay] % Fixed the typo here \draw[thick, ->] (-1.94,0.98) -- (-1.32,0.98); \draw[thick, -<] (-1.94,2.02) -- (-1.32,2.02); \draw[thick, -<] (-1.94,2.58) -- (-1.32,2.58); \draw[thick, ->] (-2.44,2.8) -- (-1.32,2.26); \draw[thick, customGray, -] (1.48,1.6) -- (2.56,2.22); \draw[thick, ->] (-0.44,2.8) -- (0.6,1.60); \draw[thick, ->] (1.48,1.6) -- (2.56,2.22); \draw[thick, -] (-1.94,2.58) -- (-1.94,0.98); \fill[customGray] (-2.21,2.65) circle (0.19); \fill[customGray] (2.02,1.91) circle (0.19); \fill[customGray] (0.08,2.16) circle (0.19); \fill[customGray] (-1.94,1.5) circle (0.19); \node[circle,draw,inner sep=1pt,font=\tiny] at (-2.21,2.65) {A}; \node[circle,draw,inner sep=1pt,font=\tiny] at (-1.94,1.5) {B}; \node[circle,draw,inner sep=1pt,font=\tiny] at (0.08,2.16) {C}; \node[circle,draw,inner sep=1pt,font=\tiny] at (2.02,1.91) {D}; \end{tikzpicture} \end{center} \noindent \lipsum[1] \end{tcolorbox} \normalsize \lipsum[2] \end{document} I want the arrows to look something like this:
- How to recreate a DuPont schemeby Dorian on November 22, 2025 at 1:30 pm
I'd like to recreate a DuPont scheme as the image below. I’m not necessarily asking for the exact code used to recreate the graphic, but rather for the packages and commands that would allow me to do it myself. Is there anything more “accessible” than TikZ? Thank you in advance 😉