Hot
- Tizk and circuitikz How to put frame around collection of commands inside?by Nasser on April 9, 2026 at 9:36 am
I am using circuitikz to make 2 small diagrams with spring mass. I'd like to put a frame around each. I tried many things, such as using \fbox and \node[draw=black, inner sep=5pt]{...}; but nothing works. I keep getting errors. Below is what I have as MWE \documentclass[tikz, border=2mm]{standalone} \usepackage{circuitikz} \usetikzlibrary{calc} \usepackage{amsmath} \usetikzlibrary{patterns,hobby,decorations.pathmorphing} \usetikzlibrary{fit} \begin{document} \begin{circuitikz}[remember picture, overlay] %\draw[step=1cm, gray, very thin] (current page.south west) grid (current page.north east); \coordinate (A) at (3,-.5); \coordinate (B) at (12,-.5); %ground %\node[draw=black, inner sep=5pt]{ %does not work \pattern[pattern=north east lines] (A) rectangle ($(A)+(4,0.15)$); \draw[thick] (A) -- ($(A)+(4,0)$); \draw ($(A)+(1.5,0)$) to[spring, l_=$k$] ($(A)+(1.5,-2)$); \draw ($(A)+(2.5,0)$) to[damper, l=$c$] ($(A)+(2.5,-2)$); \draw[fill=gray!30] ($(A)+(1,-2)$) rectangle ($(A)+(3,-3)$); \node[font=\Large] at ($(A)+(2,-2.5)$) {$m$}; \draw[thin,dashed] ($(A)+(3.25,-2.5)$) -- ($(A)+(4.5,-2.5)$); \node[align=left,font=\small] at ($(A)+(5.25,-2.5)$) {equilibrium\\position}; \draw[thin, ->] ($(A)+(4,-2.5)$) -- ($(A)+(4,-3)$); \node at ($(A)+(4,-3.2)$) {$x$}; \node at ($(A)+(2,-4)$) {$\boxed{m x'' + c x' + k x = 0}$}; %}; %does not work %------------------------------------ %\fbox{ %does not work \pattern[pattern=north east lines] (B) rectangle ($(B)+(4,0.15)$); \draw[thick] (B) -- ($(B)+(4,0)$); \draw ($(B)+(2,0)$) to[spring, l_=$k$] ($(B)+(2,-2)$); \draw[fill=gray!30] ($(B)+(1,-2)$) rectangle ($(B)+(3,-3)$); \node[font=\Large] at ($(B)+(2,-2.5)$) {$m$}; \draw[thin,dashed] ($(B)+(3.25,-2.5)$) -- ($(B)+(4.5,-2.5)$); \node[align=left,font=\small] at ($(B)+(5.25,-2.5)$) {equilibrium\\position}; \draw[thin, ->] ($(B)+(4,-2.5)$) -- ($(B)+(4,-3)$); \node at ($(B)+(4,-3.2)$) {$x$}; \draw[thick, ->] ($(B)+(2,-3)$) -- ($(B)+(2,-3.5)$); \node at ($(B)+(2,-3.75)$) {$F_0 \cos(\varpi)$}; \node at ($(B)+(2,-4.5)$) {$\boxed{m x'' + k x = F_0 \cos(\varpi)}$}; %} %does not work \end{circuitikz} \end{document} Compiling with lualatex gives this I'd like to make it look like this I do not want to make 2 separate \begin{circuitikz} and put fbox or frame outside each. But want just one \begin{circuitikz} as above, and inside it, put a frame around any collection of commands I want. Is this possible to do? All examples I saw says to put frame around the whole tikz picture. But that is not what I want. May be \node[draw=black, inner sep=5pt]{...}; does not work inside circuitik?
- setdoubleBAR offset in the startpiece environmentby ABV on April 8, 2026 at 11:58 pm
When using setdoubleBAR in musixtex, it has been generated an offset in the startpiece environment. The basic code is as follow: \documentclass[% border={10pt -21pt 23pt -6pt},% left bottom right top varwidth]{standalone}% ========== PAQUETES ========== \usepackage{tikz}% \usetikzlibrary{quotes}% \usetikzlibrary{shapes}% \usetikzlibrary{fit,positioning}% \usetikzlibrary{arrows.meta}% \usetikzlibrary{decorations}% \usepackage{amsmath}% \usepackage{tikz}% AÑADIENDO PARA LETRAS Y FORMAS \usepackage{xcolor}% AÑADIENDO PARA LETRAS Y FORMAS \usetikzlibrary{calc}% ← AGREGAR PARA LAS LINEAS \usepackage{musicography}% \usepackage{musixtex}% \input musixlyr% \usepackage{xcolor}% \xdefinecolor{red-undar}{RGB}{179,35,79}% \begin{document}% \begin{music}% \staffbotmarg5\Interligne% \font\B=phvb8t at 8pt% \font\A=phvb8t at 10pt% added for letter type. \setlyrics{cifradoA}{I VII6 V IV6 VI6 IV V IV6 V I VII6 I}% \setlyrics{cifradoB}{8 6 5 3 8 6 7 6 3 8 7 5 6 6 4 8 7 3 8 7 6 8}% \setsongraise1{3mm}% \setsongraise2{-1mm}% \hsize=\linewidth% \parindent16mm% \instrumentnumber{2}% \setstaffs1{1}% instrumento 1 (inferior) = 1 pentagrama \setstaffs2{1}% instrumento 2 (superior) = 1 pentagrama \setclef1{6}% inferior = clave de fa \setclef2{4}% superior = clave de DO \setmeter1{{\meterfrac44}}% inferior=4/4 \setmeter2{{\meterfrac44}}% inferior=4/4 superior=4/4 \setname1{Barítono}% nombre del instrumento 1 \setname2{Tenor}% nombre del instrumento 2 \songtop{2}% ← corchete desde instrumento 2 \songbottom{1}% ← hasta instrumento 1 \sepbarrules%ESTO elimina las líneas flotantes entre instrumentos \nobarnumbers% \interstaff{10}% \generalsignature{-1}% %\startextract \startpiece%\addspace\afterruleskip% \A\assignlyrics1{cifradoA}% \A\assignlyrics2{cifradoB}% \Notes\hqsk\wh{M}\zcharnote{-4}{\small\hspace*{-8mm}C.D.}&\hp\en% \Notes\sk&\hl{T}\en\bar% \Notes\wh{N}&\hl{S}\en% \Notes\sk&\hl{R}\en\bar% \Notes\wh{J}&\hl{S}\en% \Notes\sk&\hl{Q}\en\bar% \Notes\wh{K}&\hl{P}\hl{Q}\en\bar% \Notes\wh{M}&\hl{R}\hl{O}\en\bar% \Notes\wh{I}&\hl{P}\en%\bar% \Notes\sk&\hl{O}\en%\bar% \generalmeter{\meterfrac{4}4}% \alaligne% \Notes\wh{J}&\hl{N}\en% \Notes\sk&\hl{O}\en\bar% \Notes\wh{K}&\hl{P}\en% \Notes\sk&\hl{N}\en\bar% \Notes\wh{J}&\hl{Q}\en% \Notes\sk&\hl{P}\en\bar% \Notes\wh{M}&\hl{O}\en% \Notes\sk&\isluru1T\loffset{0.6}{\hl{T}}\en\bar% \Notes\wh{N}&\tslur1T\hl{T}\en% \Notes\sk&\hl{S}\en\bar% \Notes\wh{M}&\hl{T}\en% \Notes\sk&\hp\en\setdoubleBAR% \nolyr% \lyricsoff% \endpiece% \end{music}% \end{document}% The current ouput is as follow:
- Issue with \only in beamer with Tikz and fragile is being used [duplicate]by Fractal20 on April 8, 2026 at 9:39 pm
I'm having an issue with specific Tikz pictures in beamer when using \only, even when including the [fragile] in the Beamer frame creation. I have a minimal example below. If the \only is removed, it compiles fine. As is, it gives an illegal parameter error. I haven't had issues with other tikz pictures so I think it might be coming from some of the set up. Any ideas? \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{matrix, positioning,decorations.pathreplacing} \begin{document} \begin{frame}[fragile] \only<1>{ \begin{tikzpicture}[scale=1,b/.style={draw, minimum size=5mm, fill=black},w/.style={draw, minimum size=5mm, fill=white}, m/.style={matrix of nodes, column sep=1pt, row sep=1pt, draw=none, label=below:#1}, node distance=1pt] \node[] (A1) at (0,0) {}; \matrix (A2) [m=, right=of A1]{ 1&0&1\\ }; \end{tikzpicture} } \end{frame} \end{document}
- Where is my title on the poster: beamer [duplicate]by Ricky W. on April 8, 2026 at 9:11 pm
I am using "beamer" of latex to create a poster. So I try to use the beamer theme of "Rochester" and color theme of "seahorse" But I am not sure where I do wrong. I mean I can't find my poster title. which should include the name of the poster, name of the researches and the school. Here is my code. \documentclass{beamer} \usepackage{times} \usepackage{amsmath,amsthm, amssymb} \boldmath \usetheme{Rochester} \usecolortheme{seahorse} \usepackage[ orientation=landscape, size=custom, width=121.92, height=91.44, scale=1.4 ]{beamerposter} \title[Beamer Poster]{A Title That Makes Sense} \author[hello@text.edu]{Name} \institute[Overleaf University] {First Department,Overleaf University} \date{\today} \logo{\includegraphics[height=7.5cm]{overleaf-logo}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 \begin{document} \begin{frame}{} \vfill \begin{block}{\large Fontsizes} \centering {\tiny tiny}\par {\scriptsize scriptsize}\par {\footnotesize footnotesize}\par {\normalsize normalsize}\par {\large large}\par {\Large Large}\par {\LARGE LARGE}\par {\veryHuge VeryHuge}\par {\VeryHuge VeryHuge}\par {\VERYHuge VERYHuge}\par \end{block} \vfill \vfill \begin{block}{\large Fontsizes} \centering {\tiny tiny}\par {\scriptsize scriptsize}\par {\footnotesize footnotesize}\par {\normalsize normalsize}\par {\large large}\par {\Large Large}\par {\LARGE LARGE}\par {\veryHuge VeryHuge}\par {\VeryHuge VeryHuge}\par {\VERYHuge VERYHuge}\par \end{block} \vfill \begin{columns}[t] \begin{column}{.30\linewidth} \begin{block}{Introduction} \begin{itemize} \item some items \item some items \item some items \item some items \end{itemize} \end{block} \end{column} \begin{column}{.48\linewidth} \begin{block}{Introduction} \begin{itemize} \item some items and $\alpha=\gamma, \sum_{i}$ \item some items \item some items \item some items \end{itemize} $$\alpha=\gamma, \sum_{i}$$ \end{block} \begin{block}{Introduction} \begin{itemize} \item some items \item some items \item some items \item some items \end{itemize} \end{block} \begin{block}{Introduction} \begin{itemize} \item some items and $\alpha=\gamma, \sum_{i}$ \item some items \item some items \item some items \end{itemize} $$\alpha=\gamma, \sum_{i}$$ \end{block} \end{column} \end{columns} \end{frame} \end{document} Please help
- descriptions of what latex packages, styles, environments actually doby morris roger on April 8, 2026 at 8:24 pm
To use CTAN one has to know what one is looking for. I would like to browse a list for packages, and (hopefully) say to myself, "that is something that may help me now or in the future". Then I would like to know what it does (usually omitted, along with the syntax, from the code). As an example: I would like a list of all the font syles (especially the ones that I never heard of) so that I can use fntsample to print out the characters. If one types "font styles" in CTAN there are only 28 hits, omitting fonts that I know exist. (I now see from answer that tug.org/FontCatalogue will work for fonts). That still leaves the myriad of other packages
- How to make METAFONT messages? [closed]by Grzegorz Brzęczyszczykiewicz on April 8, 2026 at 8:21 pm
I know you can just do message "Hello World!" but it doesn't "look like" a true message, it just looks like a random bit of text. I want it to start from a new line. I don't want my METAFONT log to look like jumbled text. Each message should start from a new line.
- "Two-layer" compilation from a single source?by Randall on April 8, 2026 at 1:47 pm
N.B.: I don't know if there is a technical term for what I'm trying to describe, so I just made up "two-layer" as a proxy. I have a set of course notes that have become popular among a group of colleagues. There is a desire to have an "instructor's version" with various instructional tips and hints for solutions. OK, fine, I have all that already in various files. As I've begun writing the instructor's version, it's become clear that having two separate source files (one for student, one for instructor) is supremely annoying. Any edits I want to make to the student content must then also be copied over to the instructor file. My desire is to have one source file, but two ways to compile. One would compile the whole works, creating the instructor's version. A second would skip all the instructor addenda, leading to the the student's version. This way, edits to the body and exposition need be made only once, not twice. I have to believe this is possible. I thought about creating an instructor's environment like a newtheorem to segregate out the instructor's content, but then I don't know how to toggle on or off the inclusion of those lines (and this is probably not the smart solution, anyway). Is there a way to create two versions of a document from a single file?
- Space after mdenv and AddtoHook commandby Olivier Ramaré on April 8, 2026 at 12:51 pm
A strange space appears in the code below after the first \end{thmN}. The next line is slightly indented. I have a solution, see the code, by adding a "%" after \end{thmN}, but I would like my user not to have to care about that. Many thanks for you lights! Best, Olivier \documentclass{article} \usepackage{mdframed} \newcounter{mythmcnt} \setcounter{mythmcnt}{0} \newmdenv{ispecialthm} \newenvironment{thmenvN}[2][]{\refstepcounter{mythmcnt}% \begin{ispecialthm}[frametitle={#2\ \themythmcnt}]}{\end{ispecialthm}} \newenvironment{thmN}[1][]{\begin{thmenvN}[#1]{Theorem}}{\end{thmenvN}} \AddToHook{env/thmN/after}{\noindent} \begin{document} \begin{thmN} This is the first theorem. \end{thmN} we are the champions we are the champions we are the champions we are the champions we are the champions \begin{thmN} This is the first theorem. \end{thmN}% we are the champions we are the champions we are the champions we are the champions we are the champions \end{document}
- Improvements to code used for a special headingby yannisl on April 8, 2026 at 11:51 am
The following code snippet draws a box in box for a heading. I would like some help to improve the code so that only the top right corner of the bottom box is rounded. Most of the values are currently hardcoded, as this forms part of a larger code that calls the macro \tikzspecial defines keys that are passed as options. The height of the blue top box should be 3cm, I seem to be about a couple of mm out, any help with that I would also appreciate. \documentclass[10pt,twoside]{book} \usepackage[bottom=2cm,top=2cm, left=3cm, right=4cm,showframe]{geometry} \usepackage{tikz} \usepackage{kantlipsum} \ExplSyntaxOn \makeatletter \NewDocumentCommand{\tikzspecial}{s O +m}{ %% First band \begin{tikzpicture}[remember~picture,overlay,inner~sep=0pt,outer~sep=0pt] \draw[draw=none,fill=cyan,outer~sep=0pt,inner~sep=0pt, xshift={-2cm},yshift=-\dimexpr3cm+10pt] (current~page.north~west) rectangle (\paperwidth,2.5cm); \end{tikzpicture} %% Second band with rounded corners \begin{tikzpicture}[remember~picture,overlay] \node~at~(current~page.north~west)~[yshift=-\dimexpr3cm+5.4pt,xshift=-10pt,%.3 klls corners on left anchor=south~west,inner~sep=10pt, outer~sep=0,white,fill=black, draw=none,rounded~corners=10pt,align=left, text~width=\textwidth]{\leftskip10pt \large \sffamily\LARGE\bfseries \IfBooleanTF{#1}{}{\thechapter.\space} #3\par }; \end{tikzpicture} \vspace*{4\baselineskip} \par \@afterindentfalse \@afterheading } \makeatother \ExplSyntaxOff \begin{document} \parindent=2em % simulate chapter \stepcounter{chapter} \tikzspecial*{Some Special Layout\\ Format} \kant[1-9] \end{document}
- Thickness and color of vertical line symbolsby J.-E. Pin on April 8, 2026 at 9:33 am
This is a follow up to this question, which asks for delimiters with thicker lines. I would like to add the option to choose the color of these delimiters, as in the following example \documentclass[]{amsart} \usepackage{color} \begin{document} \newcommand{\Red}[1]{\textcolor{red}{#1}} \newcommand{\mynorm}[1]{\Red{\lvert} #1 \Red{\rvert}} $\mynorm{v}$ \end{document} which produces this: Thus my question is how to add this color parameter to egreg's answer to the linked question. I tried to do it myself, with no success so far.
- How Can I Speed Up LaTeX startup times? [closed]by ivo Welch on April 8, 2026 at 12:39 am
I have been experimenting with an essentially empty tex file to see how long it takes pdflatex just to get started. On one of the fastest 2026 machines around, an Apple M4, here is what I get: Baseline (just \documentclass): 1.4s biblatex: +1.9s (the single biggest offender) microtype: +0.6s tikz: +0.6s hyperref: +0.5s All heavy packages combined: 4.8s total (3.4s of package overhead) I am now wondering whether I should regress to the older Bibtex (or Natbib??) and dump biblatex. More generally, I understand that there are formats that can replace the entire article class. Alas, what I really would like is a format that can replace just a set of style files --- or better yet, a way to "cache" a whole set of my standard style files that I am always including. Is this possible? Any ideas how to keep my beloved pidflatex output and have it move faster? pointers appreciated. /iaw
- Section heading number periods and no hanging indent (sockets, plugs, templates... oh my!)by Alexander Perlis on April 7, 2026 at 9:12 pm
A style guide demands: heading numbers end in a period; headings titles do not hang off the number. Example of desired output: In the past I could accomplish this by modifying \@seccntformat and \@hangfrom: \documentclass{article} \makeatletter \def\@seccntformat#1{\csname the#1\endcsname.\enskip} \def\@hangfrom#1{\noindent#1} \makeatother \begin{document} \section{My section title with an extremely long title spanning multiple lines} \subsection{My subsection title with an extremely long title spanning multiple lines} \end{document} But in TeX Live 2026 with \DocumentMetadata{tagging=on}, the hanging indent reappears! I believe the tagging code enables the socket sec/title/hang whose default plug does not call \@hangfrom. I could mimic the kernel plug with my own variant and assign it to the socket: % Put the following inside the `\makeatletter`/`\makeatother` block. \ExplSyntaxOn \cs_new_protected:Npn \__tag_set_title_NOHANG:nNnn #1 #2 #3 #4 %#1 level, %#2 boolean: nonumber? (will be later \l__head_nonumber_bool) %#3 formated number /hang space %#4 title { \protected@edef\l__tag_sec_tmpa_tl {#4} \tagstructbegin{tag=\UseStructureName{sec/#1/title},title-o={\l__tag_sec_tmpa_tl}} \cs_if_exist_use:N \__tag_gincr_para_begin_int: \bool_if:NF #2 { \tagstructbegin{tag=\UseStructureName{sec/#1/number}} } \setbox\@tempboxa\hbox{{#3}} \bool_set_false:N \l__tag_para_bool %\hangindent \wd\@tempboxa\noindent %%% <-- REMOVED \noindent %%% <-- INSERTED \bool_set_true:N \l__tag_para_bool \bool_if:NTF #2 { \box\@tempboxa } { \tagmcbegin{} \tag_mc_reset_box:N\@tempboxa \box\@tempboxa \tagmcend \tagstructend } \tagmcbegin{} } \NewTaggingSocketPlug{sec/title/hang}{myoverlay} { \__tag_set_title_NOHANG:nNnn #1 } \AssignTaggingSocketPlug{sec/title/hang}{myoverlay} \ExplSyntaxOff This feels fragile. Is there a better approach? Now the plot thickens. I am actually trying to use TeX Live 2026 lualatex-dev to benefit from a bug fix. But in lualatex-dev with \DocumentMetadata (with or without tagging=on), it seems \@seccntformat is no longer called, thus there is no longer a period after the section number. I believe lualatex-dev is bringing templates into play (in the file latex-lab-testphase-sec-template.sty). I am new to templates. How do I adjust the templates to put a period after the number? And do templates then perhaps also provide a less fragile way to eliminate \hangindent so I no longer need to replace \__tag_set_title_hang (earlier part of this post)?
- Combining subfiles with different .sty packages into one main document (Overleaf)by Christopher Madec on April 7, 2026 at 8:35 pm
I'm looking for a way to combine multiple .tex files that require different .sty packages, and need to be merged into a single output document within Overleaf and without manual PDF handling. For instance, I am working on a LaTeX project (on Overleaf) where I have multiple .tex files located in a section/ directory. Each file compiles correctly on its own and uses a specific .sty package. Each package works independently and cannot be merged into one common .sty. section/Flashcard.tex \documentclass[../test.tex]{subfiles} \usepackage{Flashcard} % specific to flashcards \begin{document} % Flashcard content \end{document} section/main.tex \documentclass[../test.tex]{subfiles} \usepackage{agrphy} % specific to my course \begin{document} % Course content \end{document} Each file compiles without any issue when compiled individually. I want to point out that the two .sty files are extremely different and fundamentally incompatible by design: for example, Flashcard.sty restructures each page into 8 minipages to generate flashcards, while agrphy.sty defines a very specific layout with custom margins and a grid-based background for lecture notes. As a result, merging their behaviors into a single preamble does not seem feasible. Goal I would like to combine both outputs into a single document to distribute to my students. test.tex \documentclass[11pt,a4paper,svgnames]{book} \usepackage{subfiles} \begin{document} \subfile{section/main} \subfile{section/Flashcard} \end{document} ze problem When compiling the main document, it fails. It seems that the individual .sty packages (Flashcard and agrphy) are not properly loaded or conflict with the main preamble. From my understanding, subfiles force all subdocuments to share the same main preamble, which prevents using different packages independently in each subfile. What I have tried (desperately) subfiles: works for individual compilation, but not for combining different styles standalone: I could not get it to work properly in this setup pdfpages: this would work easily, but on Overleaf, I cannot automatically reuse the generated PDFs from other .tex files without manually downloading and re-uploading them, and I have a looooooooot to compile
- 3d Tikz Graph highlighting a specific interp line and axis problemby FishDrowned on April 7, 2026 at 2:43 pm
I'm currently trying to graphically represent Feynman's technique. Specifically, I have the function rad(atan(sqrt(2-x*x)))/(1+x*x) which is being parametrized as rad(atan(t*sqrt(2-x*x)))/(1+x*x). I managed to create the graph for the function, \documentclass{standalone} \usepackage{tikz,pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = center, axis on top, view={50}{30}, xlabel={$x$}, ylabel={$t$}, zlabel={}, xmin=-2, xmax=2, ymin=-2, ymax=2, zmin=-2, zmax=2, tick label style={font=\tiny} ] \addplot3[ surf, shader=faceted interp, faceted color=black!60, opacity=0.85, samples=22, samples y=18, domain=-1.4:1.4, domain y=-2:2, ] {rad(atan(y*sqrt(2-x*x)))/(1+x*x)}; \end{axis} \end{tikzpicture} \end{document} But I'm having trouble figuring out how to a) highlight the specific line along the function that represents rad(atan(sqrt(2-x*x)))/(1+x*x) and b) getting the axis lines to be above and below the 3d surface when the surface is above and below.
- Difference between \def\R{{\mathbb{R}}} and \def\R{\mathbb{R}}by X3nius on April 7, 2026 at 2:14 pm
I don't understand what the difference is between \def\R{{\mathbb{R}}} and \def\R{\mathbb{R}} When compiling \R (in math mode, obviously), I get ℝ in both cases and it doesn't show an error.
- How to plot y = x^{2/3} + 0.8 cos(kx) √(3-x²) in LaTeX TikZby hola on April 7, 2026 at 1:45 pm
I would like to plot the following function in LaTeX using TikZ or pgfplots: \[ y = x^{2/3} + 0.8 \cdot \cos(kx) \cdot \sqrt{3 - x^2} \] The domain is \( - \sqrt{3} \leq x \leq \sqrt{3} \). I need to create a nice graph where: The curve looks smooth I can easily change the value of \( k \) (number of oscillations) The modulated amplitude (the \( \sqrt{3-x^2} \) part) is clearly visible I have tried basic \addplot but I have problems with the fractional power \( x^{2/3} \) and with making the cosine oscillation look good. MWE (Minimal Working Example): \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot {x^(2/3)}; % this part works, but adding the rest is difficult \end{axis} \end{tikzpicture} \end{document} pgfplots tikz-pgf plot functions graphics
- list of all packages included in a collection and remove particular packagesby vrgovinda on April 7, 2026 at 10:14 am
My wonderful TeX friends. I need to downsize my TeXLive installation. I would like to see a list of packages that are part of a collection and remove those packages which I don't need. What I have tried doing: tlmgr list --only-installed > installed_texlive_packages.txt I tried to uninstall a package only to get an error: tlmgr remove xstacks tlmgr: saving backups to /usr/local/texlive/2025/tlpkg/backups tlmgr: not removing xstacks, needed by collection-latexextra tlmgr: no packages removed. tlmgr: action remove returned an error; continuing. tlmgr: An error has occurred. See above messages. Exiting. But there are certain packages in collection-latexextra that I use. I want to remove only those packages which I don't use or don't need. Thanks.
- How are uppercase Greek letters handled in T1?by Grzegorz Brzęczyszczykiewicz on April 7, 2026 at 7:01 am
Does it auto-switch to OT1 internally, or is there another encoding specifically for these "missing" letters? I'm specifically talking about these specific letters: and not to the entire Greek alphabet. The reason why I'm asking about them is that these letters are included in OT1, but I don't see them anywhere in the definition of T1.
- dashed arrows in AMScd [closed]by Quay Chern on April 7, 2026 at 6:37 am
How can I draw a downward and dashed arrow by the AMScd package in MathJax (more exactly it is in Mathematics Stack Exchange)? $$ \begin{CD} U(X)\ @V\phi VV\ A \end{CD} $$ $$ \begin{CD} U(X)\\ @V\phi VV\\ A \end{CD} $$
- Why can't I use \AddToHook{shipout/background} in conjunction with \@starttoc/\tableofcontents?by Elayson Abreu on April 7, 2026 at 12:22 am
When I use \AddToHook{shipout/background} in conjunction with @starttoc, the content appears in first page, but not the following ones. Why? MWE: \documentclass{article} \makeatletter \AddToHook{shipout/background}{\lower .5\paperwidth \vtop{XYZ\@starttoc{toc}}} \makeatother \begin{document} \addcontentsline{toc}{section}{ABCDEFG} \addcontentsline{toc}{section}{HIJKLMN} \null\newpage\null \end{document} In the image below, XYZ appears on both pages, but @starttoc only appears on the first one. UPDATE I'll post a more complete example of what I'd like to do, following John Kormylo's response. I would like hyperlinks to work when hyperref is loaded. Unfortunately, they're not working here. \documentclass{article} \usepackage{lipsum} \usepackage[colorlinks]{hyperref} \usepackage[showframe,top=2cm]{geometry} \def\sec#1{\par\leavevmode\addcontentsline{dates}{sec}{#1}} \makeatletter \def\l@sec#1#2{#1\par\medskip} \def\structure{\@starttoc{dates}} \makeatother \AddToHook{shipout/background}{\lower\dimexpr2cm+\topskip \vtop{\usebox\structbox}} \AtBeginDocument{ \newbox\structbox \setbox\structbox=\vtop{\structure} } \begin{document} \sec{01/01/2026} \lipsum[1] \newpage \sec{02/01/2026} \lipsum[1] \sec{03/01/2026} \lipsum[1] \end{document}
- Problem with cross-references in the Tufte class in MacTeX2026by Alejandro Munoz Ossa on April 6, 2026 at 9:31 pm
I’m writing a book using the tufte class and compiling with LuaLaTeX. I recently updated to MacTeX 2026 and noticed that the class no longer works properly, especially with cross-references. So I decided to reinstall MacTeX 2025 to make sure it worked correctly in that version. Something changed in the update and is causing an error with these references. Using MacTeX2026, the first example I’m showing you is \documentclass[]{tufte-book} \usepackage{graphicx} \begin{document} \chapter{Capítulo 1} La figura \ref{figexample} es \begin{figure} \includegraphics[width=\linewidth]{example-image-a}\label{figexample}\caption{text} \end{figure} La figura en margen es \ref{figexamplem} \begin{marginfigure} \includegraphics[width=\linewidth]{example-image-b}\label{figexamplem}\caption{text} \end{marginfigure} \end{document} which produces this result As you can see, Figure 1 is referenced correctly, but the figure in the margin is not. Now see what happens if I load the mathtools and/or amsmath packages \documentclass[]{tufte-book} \usepackage{graphicx} \usepackage{mathtools} \usepackage{amsmath} \begin{document} \chapter{Capítulo 1} La figura \ref{figexample} es \begin{figure} \includegraphics[width=\linewidth]{example-image-a}\label{figexample}\caption{text} \end{figure} La figura en margen es \ref{figexamplem} \begin{marginfigure} \includegraphics[width=\linewidth]{example-image-b}\label{figexamplem}\caption{text} \end{marginfigure} \end{document} which produces this result Thus, neither of the two figures is properly cited. While doing some research, I found that there is a new version of the tufte class called xtufte, so I decided to test it, and the result is the same—there are no correct cross-references. \documentclass[]{xtufte-book} \begin{document} \chapter{Capítulo 1} La figura \ref{figexample} es \begin{figure} \includegraphics[width=\linewidth]{example-image-a}\label{figexample}\caption{text} \end{figure} La figura en margen es \ref{figexamplem} \begin{marginfigure} \includegraphics[width=\linewidth]{example-image-b}\label{figexamplem}\caption{text} \end{marginfigure} \end{document}
- How to draw an orientation link with tikzpictureby DLIN on April 6, 2026 at 5:14 pm
I want to draw the above picture in the book Lecture on the topology of 3-manifold. So far, I can only draw the Hopf link: \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{knots} \begin{document} \begin{tikzpicture} \begin{knot}[flip crossing={2}] \strand (1.5,0) circle (1.0); \strand (2.5,0) circle (1.0); \end{knot} \end{tikzpicture} \end{document} Q: I do not know what kind of command I should use to draw the above picture.
- Creating a repeated text watermark gone wrongby user516076 on April 6, 2026 at 2:14 am
the current document of mine has a messy watermark Code: \documentclass[12pt]{article} \usepackage[a4paper,margin=2.5cm]{geometry} \usepackage{lipsum} \usepackage{tikz} \usepackage{background} \usepackage[T1]{fontenc} \usepackage{cabin} \newcommand{\watermarkHsep}{4em} \newcommand{\watermarkVsep}{3ex} \newcommand*\watermarktext[1]{% \leavevmode\hbox to 2\textwidth{% \leaders\vbox to 2\textheight{% \leaders\hbox{#1\hspace{\watermarkHsep}}\vfil% \vspace{\watermarkVsep}% }\hfil% }% } \backgroundsetup{ scale=1, angle=0, opacity=1, contents={% \tikz[remember picture, overlay] \node [black, opacity=0.1, rotate=45, scale=4.0] at (current page.center) {\watermarktext{% {\cabinfamily\bfseries Arrohmah IIBS}% }};% } } \begin{document} \section*{Sample Document} \lipsum[1-12] \end{document} it has this output: Notice that it doesn't read the Cabin font and bfseries to bold I wish to have something similar to this one, smaller font, nicer and neater:
- Diagrams in LaTeXby Ripsad on April 5, 2026 at 6:47 pm
I am trying to tex a diagram. I use overleaf with the tikz-cd package. I am currently wrinting by Bachelor thesis and am using a LeTeX template of my university (TUM). Without this template everything worrks just fine but using this template the diagram does not compile. The problem seems to be that LaTeX interpretes the lable of the arrows as the color parameter. It seems to be a conflict with the pgfkeys and the xcolors package. The error message is the following Package pgfkeys Error: I do not know the key '/tikz/"f"'' and I am going to ignore it. Perhaps you misspelled it. Package xcolor Error: Undefined color `"g\circ f"'. Package pgfkeys Error: I do not know the key '/tikz/"g"'' and I am going to ignore it. Perhaps you misspelled it. My code is: \documentclass{report} \usepackage{tikz-cd} \usepackage[german]{babel} \begin{document} \begin{tikzcd} x \arrow[rr, "f"', ] \arrow[rrrr, "g\circ f", bend left] & & y \arrow[rr, "g"', ] & & z \end{tikzcd} \end{document} According to tikzcd.yichuanshen this code is correct and also works perfectly in a plain document without the TUM-template. Does anyone here have an idea of why this problem occurs and how I might fix it?
- How to convert my normal IEEE conference paper to Elsevier Journal paper format?by Ani on April 5, 2026 at 4:07 pm
Body Draft I am trying to convert my paper from the standard IEEE conference format (IEEEtran) to the Elsevier journal format (elsarticle), and I am honestly very confused. I have watched about 6 to 8 different tutorial videos, but they all seem to show different ways of doing things, and I'm struggling to get my document to compile correctly. I am particularly stuck on these three areas: Complex Affiliations: My paper has multiple authors from different institutions. In IEEE, I used the \and command, but Elsevier uses a labeling system (\author[1] and \address[1]). I can't get the superscript numbers to map correctly to the right addresses. Declarations & Forms: The journal requires specific "Declaration of Interest" and "CRediT authorship contribution" sections. Should these be included in the LaTeX source code itself (before or after the references), or are they usually uploaded as separate files during the submission process? Findings/Results Layout: My original IEEE paper uses a two-column layout which makes my large tables look fine. When I switch to elsarticle, the formatting breaks. How do I handle wide tables or "Findings" sections in the Elsevier template? What I have tried so far: I've tried using the \begin{frontmatter} environment as suggested in the elsarticle documentation, but I keep getting errors regarding the placement of the abstract and keywords. \documentclass[review]{elsarticle} \begin{document} \begin{frontmatter} \title{My Research Title} % Struggling with the affiliation logic here \author[1]{Author A} \author[2]{Author B} \address[1]{Department, University, City} \begin{abstract} ... \end{abstract} \end{frontmatter} Could someone provide a simple "checklist" or a minimal working example (MWE) for a clean conversion? I've spent hours on YouTube and I'm still hitting walls.
- Arranging nodes to have a nice circle shapeby user516076 on April 5, 2026 at 1:42 am
I need your help to make the label, i.e. the numbers to be arranged circular nicely and spot-on (not estimating and guessing using rectangle coordinate, which is very difficult). i'm thinking of polar coordinate, but how to implement it so that it can be positioned exactly in the middle of each part? You see, I used manual and it looks ugly and messy... \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=1.2, every node/.style={font=\Large}] % Radii \def\R{3} \def\r{1.75} % Outer circle (black) \draw[black, line width=1.2pt] (0,0) circle (\R); % Inner circle (cyan) \draw[cyan!70!black, line width=1.2pt] (0,0) circle (\r); % Straight dividing lines (green) \draw[green!60!black, line width=1.2pt] (-\R,0) -- (\R,0); \draw[green!60!black, line width=1.2pt] ({\R*cos(60)},{\R*sin(60)}) -- ({\R*cos(240)},{\R*sin(240)}); \draw[green!60!black, line width=1.2pt] ({\R*cos(120)},{\R*sin(120)}) -- ({\R*cos(300)},{\R*sin(300)}); % Outer ring numbers (red) % Top sector \node[red] at (-0.55, 2.35) {3}; \node[red] at ( 0.55, 2.35) {5}; % Upper-right sector \node[red] at (1.90, 1.65) {4}; \node[red] at (2.30, 0.65) {7}; % Lower-right sector \node[red] at (2.35,-0.65) {0}; \node[red] at (1.90,-1.65) {6}; % Bottom sector \node[red] at (-0.55,-2.35) {2}; \node[red] at ( 0.55,-2.35) {10}; % Lower-left sector \node[red] at (-1.90,-0.65) {4}; \node[red] at (-2.30,-1.65) {1}; % Upper-left sector \node[red] at (-2.30, 0.65) {8}; \node[red] at (-1.90, 1.65) {7}; % Inner circle numbers (red) \node[red] at ( 0.00, 0.95) {?}; \node[red] at ( 1.05, 0.25) {5}; \node[red] at ( 1.00,-0.65) {15}; \node[red] at ( 0.00,-1.10) {8}; \node[red] at (-0.95,-0.60) {11}; \node[red] at (-1.05, 0.25) {6}; \end{tikzpicture} \end{document} At least, I wish to have something similar to this:
- Picking marbles probability courseby Arne Timperman on April 4, 2026 at 1:21 pm
For my probability course, I want to create the following figure with marbles. EDIT: red purple means, it could be red or purble I could create this in Tikz, placing each marble separately, but that does not seem like the correct method to me. AI returned the following (incorrect code). \documentclass[10pt,a4paper,svgnames,openleft,explicit]{book} \usepackage{tikz} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{center} \begin{tikzpicture} % Parameters \def\r{0.35} % radius \def\dx{1.0} % x distance \def\dy{1.0} % y distance % --- BOVENSTE 4 RIJEN: rood/paars half --- \foreach \row in {0,1,2,3}{ \foreach \col in {0,...,7}{ % paars rechts \fill[purple] (\col*\dx, -\row*\dy) arc[start angle=-45, end angle=135, radius=\r] -- (\col*\dx, -\row*\dy) -- cycle; % rood links \fill[red] (\col*\dx, -\row*\dy) arc[start angle=135, end angle=315, radius=\r] -- (\col*\dx, -\row*\dy) -- cycle; } } % --- ONDERSTE 4 RIJEN: geel --- \foreach \row in {4,5,6,7}{ \foreach \col in {0,...,7}{ \fill[yellow] (\col*\dx, -\row*\dy) circle (\r); } } % --- ACCOLADE + tekst --- \draw[line width=1pt] (8.5, -0.3) -- (8.5, -3.7) decorate[decoration={brace, amplitude=8pt}]{(8.5,-3.7) -- (8.5,-0.3)}; \node[right] at (8.7, -2) {geen 6 gele}; \end{tikzpicture} \end{center} \end{document} Resulting in this figure Any suggestions?
- Nicely organized graph representing Feynmanby FishDrowned on April 3, 2026 at 1:26 pm
I don't quite understand why the first node is no longer pointing toward $C_0$. How can I move $C_0$ to be on the far right side, still level with the first node (kind of looking like a trapezoid) while still connected to the first node? \documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs} \begin{document} \begin{center} \scalebox{1.2}{ \tikz \graph [grow right sep]{ x1 [as =$\displaystyle \int_a^b{f(x)dx}$] -> {x2[as=$C_0$, red], x3[as=$F(t)$] -> x4[as=$F^\prime(t)$] -> x5[as=$\displaystyle \int{F^\prime(t)dt}$] -> x6[as=$C(t) + C_{1}$, red]->x2}; }; } \end{center} \end{document} This is what it currently looks like: This is the intended result (essentially, ignore the terrible drawing lol): Any help or a push toward some sort of useful resource is much appreciated.
- Equation numbers with multiple alignmentsby lenskihe on April 2, 2026 at 3:11 pm
I would like to typeset an equation with two alignment points, but also have an equation number on each line. What I am aiming for should look like this: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} a &= \text{Something very very long} \\ &\begin{aligned} {}\leq b\Bigl(&ccc \\ &+d \\ &+e \Bigr) \end{aligned} \end{align} \end{document} However, the inner aligned environment produces only a single equation number, whereas I would like one number per line. I tried to solve this is using alignat. \documentclass{article} \usepackage{amsmath} \usepackage{mathtools} \begin{document} \begin{alignat}{3} a &= \mathrlap{\text{Something very very long}} \\ &\leq b\Bigl(&&ccc \\ &&& +d \\ &&& +e\Bigr) \end{alignat} \end{document} This gives me multiple equation numbers, but using \mathrlap causes the whole expression to become visually misaligned (no longer centered properly). My two tries are shown below. Is there a way to achieve what I am looking for?
- How to colorized any line drawed with draw (nor with plot expression)?by Mika Ike on April 1, 2026 at 1:44 pm
How to colorized any line drawed with draw (nor with plot expression)? \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = middle, %title={Cor baseada no valor de $y$}, title={Color depending on $y$ coordinate}, colormap/hot % Podes usar 'hot', 'cool', 'jet', etc. ] \addplot[ mesh, % Divide o trazo en segmentos para aplicar cores thick, domain=-3:3, samples=100, point meta=y % Indica que a cor depende do valor de y ] {x^2}; % A función matemática \draw[thick, xshift=0.5,rounded corners] (-2,0.5) .. controls (0,-1) and (0,7) .. (1,7.8) .. controls (2,1) and (2,4) .. (3,3) node[anchor=east,pos=0.95] {How to colorize black line with colormap?} node[anchor=north east,pos=0.95] {depending on $y$ coordinate}; \end{axis} \end{tikzpicture} \end{document}