Hot
- Failed to modify \input@pathby lyl on September 1, 2026 at 2:33 am
I want to make seach paths in my project like this: \documentclass{article} \usepackage{graphics} % [#1:optional arg,a list of paths delimited by comma, would be added to "./, lib/, material/"] % {#2:a path searched from} \ExplSyntaxOn \newcommand{\setsearchpath}[2][./, lib/, material/]{ \def\pathcomb{} \clist_map_inline:nn {#1} { \tl_put_right:Nx \pathcomb { {#2\tl_trim_spaces:n {##1}} } } \expandafter\graphicspath\expandafter{\pathcomb} \def\input@path{\pathcomb\input@path} }%\setsearchpath \ExplSyntaxOff \begin{document} \setsearchpath{../} \includegraphics{paperclip} \input{test} %This causes error. \end{document} Test this code showes that the set of graphic paths works all rigth, the input paths however fails. What's wrong with my code? And how to make my \setsearchpath work?
- How to align this text in the first letter?by Alastair Stratford on September 1, 2026 at 1:02 am
I'm currently a freshman taking Math program. I don't have any much to do so I want to learn LaTeX. Yet when I try to align this in the center, it looks like this: \documentclass{article} \usepackage{graphicx} \begin{document} \begin{align*} u &= x^2-4 & v &= -2e^{-x/2} \\ du &= 2x & dv &= e^{-x/2} \end{align*} \end{document} I don't now how to compile this here, but here's the picture I want to align the it in the first letter, which is in d, and I want to tighter the space of it. How can I do it?
- parindent not working inside musixjt from Musixtexby ABV on August 31, 2026 at 10:34 pm
It's needed to use \parindent inside musixjt for Musixtex score. The basic code is as follow: \documentclass[12pt]{article} % ========== FORMATO DE PÁGINA: A4 VERTICAL ========== \usepackage[a4paper,portrait,left=0.4cm,right=0.2cm,top=0.2cm,bottom=0.2cm]{geometry} \pagestyle{empty} % ========== PAQUETES ========== \usepackage{tikz} \usetikzlibrary{quotes} \usetikzlibrary{shapes} \usetikzlibrary{fit,positioning} \usetikzlibrary{arrows.meta} \usetikzlibrary{decorations} \usepackage{amsmath} \usepackage{xcolor} \usetikzlibrary{calc} \usepackage{musicography} \usepackage{musixtex} \input musixlyr \xdefinecolor{red-undar}{RGB}{179,35,79} \begin{document} \begin{music} \input musixjt \begin{center} \Bigtype M\,A\,L\,\,\,\,\,\,\,P\,A\,S\,O\\[1ex] \medtype Agrupación Los Kipus del Perú \end{center} % ========== CONFIGURACIÓN GLOBAL ========== \parindent15mm% \staffbotmarg6\Interligne \font\B=phvb8t at 8pt \font\A=phvb8t at 10pt \A% \setsongraise1{4mm} \setstaffs1{1} \setlines{1}{5} \setclef{1}{\treble} \setclefsymbol{1}{\empty}% \generalmeter{\meterfrac34}% \setname1{Cajón} \nobarnumbers% \nostartrule % ancho de sistema = ancho del texto de la página A4 (sin sobreancho) % ========== SISTEMA 1 (6 compases) ========== \startpiece \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\Dqbu jj\Dqbu fj\Dqbu ff\en\setdoubleBAR% \nolyr% \lyricsoff% \endpiece% \end{music} \end{document} The current output is as follow: The target should be as follow:
- Ratio inside scalebox doesn't workby AGI on August 31, 2026 at 8:37 pm
my main problem that I'm looking forward to solving and understanding is the following: With the graphicx package we have the \scalebox{}[]{} macro. I don't quite know the most technical parts but I do know about tokenization of TeX code and category codes but the thing is that if I try to use calc in order to use the \ratio macro to produce a dynamical scaling of the expresion I get an error. A snippet of my code (example +packages loaded) would be \documentclass{article} \usepackage{etoolbox} \usepackage{mathtools} \usepackage{graphicx} \usepackage{cancel} \usepackage{amssymb} \usepackage{xparse} \usepackage{ifthen} \usepackage{calc} \usepackage{intcalc} \usepackage{forloop} \usepackage{nicematrix} \usepackage{xfp} \NewDocumentCommand{\set}{+m}{\ifblank{#1}{\varnothing}{ \scalebox{1}[\ratio{\heightof{#1}}{\heightof{X}}]{ \raisebox{0.04em}{\{} } #1 \scalebox{1}[\ratio{\heightof{#1}}{\heightof{X}}]{ \raisebox{0.04em}{\} } }}} \begin{document} %induces error %$\set{}$ %$\br{X}$ \renewcommand{\set}{\ifblank{#1}{\varnothing}{ \scalebox{1}[1.15]{ \raisebox{0.04em}{\{} } #1 \scalebox{1}[1.15]{ \raisebox{0.04em}{\}} $\set{}$ %produces \varnothing $\set{a,B}$ %produces {a,B} with adjusted height of braces \renewcommand{\br}[1]{\raisebox{0.1em}{[} #1 \raisebox{0.1em}{]} $\mathds R\br{X}$ %produces set of polinomials with coeficients in R and variable X with adjusted braces \end{document} I have tried using 1*\ratio... and expl3 but those also gives errors. These are the error messages I see I also know about mathtools and \DeclareMathDelimiterX but I also want code that handles translating of the expresion, like in \newcommand{\br}[1]{\raisebox{0.1em}{[} {#1} \raisebox{0.1em}{]}} Which, for what I know isn't possible with it. I hope you know how to solve this and can help me. What I want is that it scales with respect to the height of X for reference. Edit2: So for more added context, I also defined a macro for an adjusted integral (I'm a bit picky with symbols hahaha) and I would also (just to be sure) that it can scale by that much. \NewDocumentCommand{\integral}{+O{} +O{} +m +m +O{}}{\ifthenelse{\equal{#5}{partial}}{ \mathchoice{ \scalebox{1.1}[1.25]{$\displaystyle \int_{{#1}}^{{#2}}$}\kern0.25em{ \scalebox{1}{$\displaystyle {#3} \, \partial{}{#4}$}} }{ \scalebox{1}[1.1363]{$\int_{{#1}}^{{#2}}$} \kern0.1em \scalebox{0.8}{${#3} \, \partial{}{#4}$} }{ \scalebox{0.6}[0.68]{$\int_{{#1}}^{{#2}}$} \kern0.1em \scalebox{0.5}{$ {#3} \, \partial{}{#4}$} }{ \scalebox{0.55}[0.57]{$\int_{{#1}}^{{#2}}$} \kern0.1em \scalebox{0.4}{$ {#3} \, \partial{}{#4}$}} }{ \mathchoice{ \scalebox{1.1}[1.25]{$\displaystyle \int_{{#1}}^{{#2}}$} \kern0.25em{ \scalebox{1}{$\displaystyle {#3} \, \diff{}{#4}$}} }{ \scalebox{1}[1.1363]{$\int_{{#1}}^{{#2}}$} \kern0.1em \scalebox{0.8}{${#3} \, \diff{}{#4}$} }{ \scalebox{0.6}[0.68]{$\int_{{#1}}^{{#2}}$} \kern0.1em \scalebox{0.5}{$ {#3} \, \diff{}{#4}$} }{ \scalebox{0.5}[0.57]{$\int_{{#1}}^{{#2}}$} \kern0.1em \scalebox{0.4}{$ {#3} \, \diff{}{#4}$}} } } This is the largest symbol I have adjusted for personal use.
- Circle with tkz-euclide and transform shape goes wrongby Sander on August 31, 2026 at 6:41 pm
I'm using tkz-euclide to draw a circle with center M through point A: \documentclass{article} \usepackage{tikz} \usepackage{tkz-base} \usepackage{tkz-euclide} \begin{document} \tikzset{ xaxe style/.style ={-}, yaxe style/.style ={-}, } \begin{tikzpicture}[scale=0.6, transform shape] \tkzInit[xmin=-3,xmax=7,ymin=-4,ymax=6] \tkzGrid[color=black!20](-3.5, -4.5)(7.5, 6.5) \tkzDrawX[left space=0.5, right space=0.5] \tkzDrawY[up space=0.5, down space=0.5] \tkzLabelX[orig=false] \tkzLabelY[orig=false] \tkzDefPoint(0,0){O} \tkzLabelPoint[below left=2pt](O){\(O\)} \tkzDefPoints{2/1/M, -2/-2/A} \tkzDrawCircle[draw=blue!80!black, line width=.75pt](M,A) \tkzDrawPoints[fill=black, size=4](M,A) \tkzLabelPoint[below left](A){\(A\)} \tkzLabelPoint[below right](M){\(M\)} \end{tikzpicture} \end{document} The result of this code is a circle with center M, but not through A: Apparently this is caused by using transform shape in combination with scale=0.6. When I remove transform shape everything works fine. Does anybody know how to make tkz-euclide draw the correct circle in combination with transform shape?
- Problem with siunitx when defining own unitsby Jürgen on August 31, 2026 at 5:40 pm
As you can see, I can't get the desired result with a self defined unit (according to section 3.7 of the manual). What's my fault? \documentclass{scrartcl} \usepackage{siunitx} \DeclareSIUnit[per-mode=symbol]{\dBperK}{\dB(1\per\kelvin)} \begin{document} \indent desired: \qty{1}{dB(1/K)} not desired: \qty{1}{\dBperK} \end{document} The result comes along with the following error messages: ! Undefined control sequence. \dB ->\ERROR l.11 not desired: \qty{1}{\dBperK} ?
- `\tl_replace_all` doesn’t work with countersby fauve on August 31, 2026 at 2:55 pm
The goal I try to make a macro witch transform arabic digits (0123456789) into farsi ones (). The final goal is to transform counters, espaceilaly page counters intor farsi form. The current situation I made the command, it work when I just use normal input numbers, but it fail when I give it a counter. MWE \documentclass{article} \usepackage{fontspec} \newfontfamily\arabicfont[ Ligatures=TeX, Script=Arabic, Language=Persian, ]{IranNastaliq} % Conversion des chiffres occidentaux en chiffres persans \ExplSyntaxOn \NewDocumentCommand{\persiandigits}{m} { \tl_set:Nn \l_tmpa_tl {#1} \tl_replace_all:Nnn \l_tmpa_tl {0} {۰} \tl_replace_all:Nnn \l_tmpa_tl {1} {۱} \tl_replace_all:Nnn \l_tmpa_tl {2} {۲} \tl_replace_all:Nnn \l_tmpa_tl {3} {۳} \tl_replace_all:Nnn \l_tmpa_tl {4} {۴} \tl_replace_all:Nnn \l_tmpa_tl {5} {۵} \tl_replace_all:Nnn \l_tmpa_tl {6} {۶} \tl_replace_all:Nnn \l_tmpa_tl {7} {۷} \tl_replace_all:Nnn \l_tmpa_tl {8} {۸} \tl_replace_all:Nnn \l_tmpa_tl {9} {۹} \tl_use:N \l_tmpa_tl } \ExplSyntaxOff \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \fancyfoot[C]{% \thepage\quad \arabicfont\persiandigits{\thepage} } \begin{document} Chiffres normaux : 12345 Chiffres persans : {\arabicfont\persiandigits{12345}} Numéro de page : {\arabicfont\persiandigits{\the\value{page}}} \end{document} Rendernig Chiffres normaux : 12345 Chiffres persans : ۱۲۳۴۵ Numéro de page : 1 <- here the problem happend The question How to make \persiandigits even work with \thepage ?
- How to draw realistic chemistry lab procedures (dilution and solution preparation) in pure TikZ?by user446526 on August 31, 2026 at 12:42 pm
I am trying to recreate two educational chemistry diagrams using TikZ. The diagrams illustrate the steps for diluting a solution and preparing a solution from a solid solute, including Arabic labels. Here is the first target image (dilution): Here is the second target image (solution preparation): I have made an initial attempt at the first image. However, my shapes (flasks, volumetric pipette, wash bottle) look very flat and basic compared to the realistic, semi-3D illustrations in the target images. I haven't started on the second image yet because I am unsure how to approach drawing complex elements like the digital scale, the funnel, and the hands holding the glassware. Here is my current Minimum Working Example (MWE) for the first image, compiled with XeLaTeX/LuaLaTeX for the Arabic text: \documentclass[11pt, a4paper, landscape]{article} \usepackage{geometry} \geometry{margin=1in} \usepackage{tikz} \usetikzlibrary{calc, arrows.meta, positioning} \usepackage{polyglossia} \setmainlanguage{arabic} \setotherlanguage{english} \newfontfamily\arabicfont[Script=Arabic]{Amiri} \tikzset{ pics/flask/.style args={#1/#2}{ code={ \pgfmathsetmacro{\liqh}{#1} \begin{scope} \clip (-0.5, 0) .. controls (-1.2, 0) and (-1.0, 1.2) .. (-0.15, 1.5) -- (-0.15, 3.2) -- (0.15, 3.2) -- (0.15, 1.5) .. controls (1.0, 1.2) and (1.2, 0) .. (0.5, 0) -- cycle; \fill[#2] (-1.5, 0) rectangle (1.5, \liqh); \ifdim \liqh pt > 0pt \fill[black, opacity=0.1] (-1.5, \liqh-0.05) rectangle (1.5, \liqh); \fi \end{scope} \draw[glassware] (-0.5, 0) .. controls (-1.2, 0) and (-1.0, 1.2) .. (-0.15, 1.5) -- (-0.15, 3.2) -- (0.15, 3.2) -- (0.15, 1.5) .. controls (1.0, 1.2) and (1.2, 0) .. (0.5, 0) -- cycle; \draw[thick, red!70!black] (-0.15, 2.5) -- (0.15, 2.5); \draw[thick, draw=black!70, fill=white, fill opacity=0.5] (-0.2, 3.2) rectangle (0.2, 3.35); } }, pics/pipette/.style args={#1/#2}{ code={ \pgfmathsetmacro{\bfill}{#1} \pgfmathsetmacro{\tfill}{#2} \begin{scope} \clip (-0.06, 0) -- (-0.06, 1.5) .. controls (-0.06, 1.7) and (-0.25, 1.8) .. (-0.25, 2.2) .. controls (-0.25, 2.6) and (-0.06, 2.7) .. (-0.06, 2.9) -- (-0.06, 4.5) -- (0.06, 4.5) -- (0.06, 2.9) .. controls (0.06, 2.7) and (0.25, 2.6) .. (0.25, 2.2) .. controls (0.25, 1.8) and (0.06, 1.7) .. (0.06, 1.5) -- (0.06, 0) -- cycle; \fill[blue!50!cyan, opacity=0.85] (-0.3, \bfill) rectangle (0.3, \tfill); \end{scope} \draw[glassware, fill opacity=0.3] (-0.06, 0) -- (-0.06, 1.5) .. controls (-0.06, 1.7) and (-0.25, 1.8) .. (-0.25, 2.2) .. controls (-0.25, 2.6) and (-0.06, 2.7) .. (-0.06, 2.9) -- (-0.06, 4.5) -- (0.06, 4.5) -- (0.06, 2.9) .. controls (0.06, 2.7) and (0.25, 2.6) .. (0.25, 2.2) .. controls (0.25, 1.8) and (0.06, 1.7) .. (0.06, 1.5) -- (0.06, 0) -- cycle; \foreach \y in {3.2, 3.4, 3.6, 3.8, 4.0} \draw[very thin, black!60] (-0.06, \y) -- (0, \y); \foreach \y in {0.5, 0.7, 0.9, 1.1} \draw[very thin, black!60] (-0.06, \y) -- (0, \y); } }, pics/washbottle/.style={ code={ \begin{scope} \clip (-0.8, 0) rectangle (0.8, 2.5); \fill[blue!10, opacity=0.5] (-0.9, 0) rectangle (0.9, 1.9); \end{scope} \draw[glassware, rounded corners=3pt] (-0.8, 0) -- (-0.8, 2.5) -- (-0.5, 2.8) -- (0.5, 2.8) -- (0.8, 2.5) -- (0.8, 0) -- cycle; \draw[thick, draw=black!70, fill=white] (-0.5, 2.8) rectangle (0.5, 3.1); \draw[thick, draw=black!70, fill=white] (-0.4, 3.1) rectangle (0.4, 3.3); \draw[thick, draw=black!40] (0, 0.2) -- (0, 3.3); \draw[thick, draw=black!70, double=white, double distance=2.5pt] (0, 3.2) -- (0, 3.8) .. controls (0, 4.0) and (-0.3, 4.1) .. (-0.6, 3.9) -- (-1.6, 3.1); } } } \begin{document} \begin{center} \begin{tikzpicture}[ x=1.2cm, y=1.2cm, stock liquid/.style={top color=blue!40!cyan, bottom color=blue!70!cyan}, dilute liquid/.style={top color=blue!20!cyan, bottom color=blue!40!cyan}, glassware/.style={thick, draw=black!70, fill=cyan!10, fill opacity=0.15, join=round}, text node/.style={align=center, font=\small} ] % --- Step 1 (Left) --- \begin{scope}[shift={(0,0)}] \pic at (0,0) {flask={1.1/stock liquid}}; \pic at (0,0.3) {pipette={0/3.9}}; \draw[-{Stealth[length=2.5mm]}, thick] (-0.4, 0.3) -- (-0.4, 1.1); \pic at (2.5,0) {flask={0/white}}; \node[text node] (lblStock) at (-2.0, 0.5) {\textbf{المحلول الأم}\\\textenglish{Stock}\\\textenglish{solution}}; \draw (lblStock) -- (-0.8, 0.4); \node[text node] (lblPipette) at (2.0, 4.0) {\textbf{ماصة عيارية}\\\textenglish{Volumetric}\\\textenglish{pipette}}; \draw (lblPipette) -- (0.1, 3.2); \node[text node, text width=4.5cm] at (1.25, -1.8) {\textbf{نأخذ بواسطة ماصة عيارية حجم \textenglish{V0} من المحلول الأم.}}; \end{scope} % --- Step 2 (Middle) --- \begin{scope}[shift={(6.5,0)}] \pic at (0,0) {flask={0.6/stock liquid}}; \pic at (2.5,0) {flask={0.3/stock liquid}}; \pic at (2.5,0.6) {pipette={0/2.0}}; \draw[-{Stealth[length=2.5mm]}, thick] (2.1, 1.4) -- (2.1, 0.6); \node[text node, text width=4.5cm] at (1.25, -1.8) {\textbf{نفرغ المحتوى في حوجلة عيارية بها القليل من الماء المقطر.}}; \end{scope} % --- Step 3 (Right) --- \begin{scope}[shift={(13,0)}] \pic at (0,0) {flask={0.6/stock liquid}}; \pic at (2.5,0) {flask={2.5/dilute liquid}}; \pic at (4.5, 1.2) {washbottle}; \node[text node] (lblDilute) at (4.5, 0.5) {\textbf{المحلول البنت}\\\textenglish{Dilute}\\\textenglish{solution}}; \draw (lblDilute) -- (3.5, 0.4); \node[text node] (lblWater) at (6.5, 2.5) {\textbf{ماء مقطر}}; \draw (lblWater) -- (5.0, 2.2); \node[text node, text width=4.5cm] at (1.25, -1.8) {\textbf{نكمل بالماء المقطر حتى نحصل على الحجم المطلوب (العياري).}}; \end{scope} \end{tikzpicture} \end{center} \end{document} My questions: How can I improve the shading and gradients of the glassware (flasks, pipettes) to achieve the 3D, glossy look shown in the targets? Are there any existing pure TikZ libraries or packages designed specifically for modern, realistic laboratory equipment? (Please note I do not want to use pst-labo or any PSTricks-based packages). How can I approach drawing the digital scale, the funnel, and the human hands holding the glassware for the second image?
- How do I type the “幾年幾班” classification format for birth years in the Republic of China era in Taiwan using LaTeX?by mathrm alpha on August 31, 2026 at 12:17 pm
In Taiwan, there’s a humorous, interesting, and somewhat quirky way of categorizing people based on their birth year. For example, if you were born in a certain year of the Republic of China era, you’re referred to as “幾年幾班” I’d like to create a LaTeX script that automatically generates this “幾年幾班” format. For example, in the Republic of China, the classification system that maps birth years to grade levels is as follows: Born in the 35th year (1946 year) = 3 年 5 班 https://carsoncheng.wordpress.com/2006/05/18/%E4%BD%A0%E5%B9%BE%E5%B9%B4%E7%B4%9A%EF%BC%9F/
- Two columns of itemsby Andy Fletcher on August 31, 2026 at 8:54 am
I'm creating a list of items in two columns as the picture show, with the first half in the left and the second one in the right. In the process I used minipage, but the items are not horizontal aligned, line by line. For instance, in the example, item 1 and 3 are not under the same horinzontal line. There is a way to creating these two columns such that, in each line, the items are in the same horinzontal line? Thanks. \documentclass{article} \usepackage{amsmath} \usepackage{enumitem} \begin{document} \begin{enumerate} \begin{minipage}[l]{0.45\textwidth} \item a. \item b. \end{minipage} \begin{minipage}[l]{0.45\textwidth} \item c: $\dfrac{\dfrac{a}{b}}{2}$. \item d \end{minipage} \end{enumerate} \end{document}
- Why box255 has non-zero depth when height is sufficient?by Igor Liferenko on August 31, 2026 at 5:50 am
If we run TeX on this file \immediate\write16{vsize=\the\vsize} \def\pagebody{\immediate\write16{ht=\the\ht255 \space dp=\the\dp255 } \box255 } \hbox{A\vrule depth1pt B} \eject \end we get this output vsize=643.20255pt ht=643.20255pt dp=1.0pt Why height of box255 is equal to vsize while the height of hbox is less then vsize? Also, vsize is large enough to contain height+depth of hbox, but box255 has depth of hbox. Why? Where is this behavior documented in TeXbook?
- Suppressing an expl3 warning [duplicate]by Andrew Stacey on August 30, 2026 at 10:58 pm
I've installed TeXLive 2026, and for some reason there's a mismatch between expl3 versions: the package that got installed and the LaTeX format. I get a warning when a package loads expl3 explicitly: ! LaTeX Error: Mismatched LaTeX support files detected. (LaTeX) Loading 'expl3.sty' aborted! (LaTeX) (LaTeX) The L3 programming layer in the LaTeX format (LaTeX) is dated 2026-03-20, but in your TeX tree the files require (LaTeX) at least 2026-04-28. For immediate help type H <return>. ... l.78 \ExplLoaderFileDate{expl3.sty}} % While I can remove the explicit load of expl3 from my own packages, I find that there are still plenty in the TL tree that load it for themselves (the current culprit being unicode-math). What's the best way to get rid of this warning? Did a step fail to run when I last updated TeXLive (and if so, how do I force it?)? The reason why I can't just ignore it is that it's messing up some automatic scripts that rely on LaTeX's exit codes.
- Texstudio won't let me edit files [closed]by msaul on August 30, 2026 at 4:36 pm
I updated Texstudios and it all went to pieces. After I update (i.e. edit) a .tex file, Texstudio does not recognize the changes. Upon compilation, I see just what I didn't want from the old version; Texstudio refuses to automatically open a .pdf viewer--either Sumatra or Adobe. I have to open it 'by hand'. All this happened when I foolishly updated Texstudio to a new improved version. It simply doesn't work! WHy can't these people leave well enough alone? My fault for updating. ALl change is bad.
- Some tcolorbox options not working after centering a section titleby AO3 user without CSS knowledge on August 30, 2026 at 11:12 am
The raster column skip option of tcolorbox doesn't work correctly when I try to use it after centering the title for that section. WME: \documentclass[12pt,a4paper]{article} \usepackage{tcolorbox} \tcbuselibrary{raster} \begin{document} \begin{center} \section*{Title} \end{center} \begin{tcbitemize}[raster columns=2, raster column skip=2cm] \tcbitem box 1 \tcbitem box 2 \end{tcbitemize} \end{document} There should be a space of 2cm between the two boxes, but it doesn't appear. Instead, the space happens after the second box. Expected behaviour: Removing the \begin{center} ... \end{center} makes the code work correctly, as does removing the \section*{Title} and writing normal text inside of the center environment. Only the two combined create this problem. raster left skip has the exact same issue. Do I have to use \centering instead, or can I make this work with \begin{center} ?
- Including Octave source code and output in LaTeX document?by Kevin Zembower on August 29, 2026 at 7:56 pm
all, I'm trying to create a LaTeX document that contains both source Octave code and output, like the way that Rmarkdown can be used to create a LaTeX document with both R source code and its output. Here's an example of what I'm trying to do, in a file named 'Ex.tex': \documentclass{article} \title{Exercise 1.1 T1} \author{Kevin Zembower} \date{} \begin{document} \maketitle \section{T1} This is an example from the documentation: ```{octave,engine.path='/usr/bin/octave',results='asis',echo=TRUE} x=-10:0.1:10; plot (x, sin (x)); print -djpg ./myfigure.jpg ``` Import the generated figure: ![My Plot of sin()]{./myfigure.jpg} \end{document} I don't know whether to put this code in a .Rnw, or .tex file. I'm not sure whether to use the << >> or ```{} delimiters. I'm producing the document in Emacs with LaTeX and Polymode enabled. I'm familiar with the latex interpreter in Octave, but I don't want to use it. I want more control over the document's appearance than the markdown in Octave allows. Can I use KnitR to combine Octave and LaTeX? I tried to use the ```{} delimters with the code in a .tex file, but when it's processed with pdflatex, it doesn't execute the Octave code. Am I missing a step to knit or sweave the code? Any help getting started? Any advice or guidance is appreciated. I think I'm confusing KnitR, Rmarkdown and LaTeX codes, with a lot of frustration. -Kevin
- Designing consistent, good-looking inline TikZ nodes for keyboard keys and menu itemsby Marco Moldenhauer on August 29, 2026 at 6:38 pm
I am creating my own inline TikZ commands for a Blender tutorial. So far, I have defined three commands: \KeyboardLetter{...} for keyboard letters, such as \KeyboardLetter{A} \KeyboardSymbol{...} for keyboard symbols, such as \KeyboardSymbol{\shift} \BlenderMenu{...} for Blender menu items, such as \BlenderMenu{Object Mode} My main requirement is that all three types of inline nodes should have the same height, regardless of their contents. I am not particularly happy with my current design (see the output below). How could I improve the design so that keyboard letters, keyboard symbols, and Blender menu items look like they belong to the same visual system? Maybe someone has a creative idea or a nice design suggestion? 🙂 my Code \documentclass{article} \usepackage{menukeys} \tikzset{ keystroke/.style={ draw=black!50, fill=yellow!20, %drop shadow={shadow xshift=0.15ex,shadow yshift=-0.15ex,fill=black,opacity=0.7}, rectangle, %rounded corners=0.8pt, inner xsep=1.5pt, inner ysep=1.5pt, line width=0.3pt, %minimum width=0.21cm, %minimum height=0.21cm, font=\sffamily\small, %text=blue!75!black, %anchor=south } } \newcommand*\KeyboardLetter[1]{% \tikz[baseline=(key.base)] % \node[keystroke](key) {#1} ;% } \newcommand*\KeyboardSymbol[1]{% \tikz[baseline=(key.base)]{% \node[keystroke,inner sep=1.5pt] (key) {\phantom{A}}; \node[ inner sep=0.8pt, transform shape, scale=0.75 ] at (key.center) {#1}; }% } \newcommand*\BlenderMenu[1]{% \tikz[baseline=(key.base)] % \node[% keystroke, %signal, fill=red!5 ](key) {#1} ;% } \begin{document} \KeyboardSymbol{\tab}\KeyboardLetter{A}\KeyboardLetter{P}\KeyboardLetter{=}\KeyboardSymbol{\shift}\KeyboardLetter{,}\BlenderMenu{Object Mode}\BlenderMenu{Edit Mode} \end{document} my Output
- Again: too much whitespace between integral sign and integrandby Jürgen on August 29, 2026 at 3:40 pm
This follow-up question refers to this question. I tried to use the proposal from MadyYuvi, but with this code \documentclass{scrartcl} \usepackage{kpfonts-otf} \removenolimits{\int} \removenolimits{\oint} \let\oldint\int \newcommand{\newint}{\oldint\hspace{-10cm}} \let\int\newint \begin{document} \begin{equation} I = \int_0^x S ds \end{equation} \begin{equation} I = \oint_0^x S ds \end{equation} \end{document} I can't see any effect. What am I doing wrong? -- EDIT: Implementing \AtBeginDocument With the hint from DavidCarlisle I use the code \documentclass{scrartcl} \usepackage{kpfonts-otf} \removenolimits{\int} \removenolimits{\oint} \AtBeginDocument{% \let\oldint\int \newcommand{\newint}{\oldint\!\!} \let\int\newint } \begin{document} \begin{equation} I = \int_0^x S ds \end{equation} \begin{equation} I = \oint_0^x S ds \end{equation} \end{document} and the result is
- tcolorbox suboptimal connexion with dotted borderlineby Denis Bitouzé on August 29, 2026 at 2:40 pm
The example of a dotted borderline in the tcolorbox's documentation (currently page 207): \documentclass{article} \usepackage{tcolorbox} \usepackage{lipsum} \tcbuselibrary{skins} \begin{document} \begin{tcolorbox}[enhanced,arc=3mm,boxrule=1.5mm, frame hidden,colback=blue!10!white, borderline={1mm}{0mm}{blue,dotted} ] \lipsum[2] \end{tcolorbox} \end{document} is miraculously well-connected. But, in general, the connexion is only suboptimal, as shown in the following picture (look at its southwestern corner), obtained by replacing \lipsum[2] by \lipsum[1] in the previous example: Is there a way to get an optimal connexion, I mean automatically, by computing the height of the box and adapting the size of the dots and/or of the space between them?
- How to achieve numbered zref-clever references in enumerated description list?by modallyFragile on August 29, 2026 at 1:15 pm
I want a to write lists which include both a number (like enumerate) and a short description (like description). I can do that as described here. I also want to be able to refer to the numbers of these lists with zref-clever. How can I achieve this? I've got as far as making the list work, and getting zref to recognise references as items, but I can't work out how to get zref to print the relevant number. MWE: \documentclass{article} \usepackage{zref-clever} \usepackage{enumitem} \newcounter{enumdescription} \newlist{enumdescription}{description}{3} \zcsetup{countertype = {enumdescription = item}} \setlist[enumdescription]{% before={ \zcsetup{currentcounter=enumdescription} \setcounter{enumdescription}{0}% start each list at }, font={ \refstepcounter{enumdescription} \normalfont\arabic{enumdescription}.~% \bfseries% } } \begin{document} \begin{enumdescription} \item[Foo]\label{foo} text. \item[Bar]\label{bar} text. \item[Baz]\label{baz} text. \end{enumdescription} Should say `item 1': `\zcref{foo}'. \end{document} (Also nice to have, since it may be useful, would be a way of using zcref's ref option to capture the descriptive labels, so I could do \zcref[ref=desclabel]{foo} and get Foo. But this isn't really important.) TIA!
- Include part number in page referencesby KeithB on August 29, 2026 at 11:38 am
I've got a book with 4 \parts. It would be nice if \pageref would print something like "page ii.567" for page 567 in part 2, but only if the page is not in the current part. Is this possible?
- How to put tikz node at top left in a picture fitting all the A4 document?by Manuel Selva on August 29, 2026 at 8:55 am
I have the following document : \documentclass[a4paper]{article} \usepackage[a4paper,margin=0cm,landscape]{geometry} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture}[remember picture, overlay] \coordinate (nw) at (current page.north west); \coordinate (se) at (current page.south east); \node [fill=red!10, fit=(nw) (se), inner sep=0pt] {}; \node [rectangle,fill=green,draw=black, minimum width=3cm, minimum height=3cm,anchor=north west] at (0, 0) {Manu}; \end{tikzpicture} \end{document} The Manu green rectangle is not in the top left corner of the resulting document while the red background done using fit correctly fits all the page. Why is the green rectangle shifted ?
- How make a tikzpicture filling an A4 page?by Manuel Selva on August 29, 2026 at 6:49 am
I want to use tikz to draw a diagram and I want this diagram occupy all the A4 space of my document (so that I can print it then). How can I achieve this ? Here is what I have for now : \documentclass[a4paper]{article} \usepackage{tikz} \usetikzlibrary{fit} \begin{document} \begin{tikzpicture}[remember picture, overlay] \node [fill=blue, fit=(current page.north west) (current page.south east), inner sep=0pt] {}; \end{tikzpicture} \end{document} But my problem is that I want to have a landscape A4 paper. Adding : \usepackage[a4paper,margin=0in,landscape]{geometry} results in a blue rectangle occupying only part of the document. It seems that current page.north west and current page.south east are no more valid with landscape ?
- Sections taking chapter number, subsections not numberingby GrahamF on August 29, 2026 at 12:49 am
This was working fine in June. Aftrer making edits, section numbering and toc not working properly. MWE: \documentclass[letterpaper, 9pt, oneside]{memoir} \usepackage{inconsolata} \usepackage[T1]{fontenc} % Font encoding \usepackage{lmodern, newpxmath} % Font family % Additional packages \usepackage{import} \usepackage{standalone} \usepackage{enumerate} % subsubsections and higher are numbered \setsecnumdepth{subsubsection} \maxsecnumdepth{subsection} \renewcommand\thesection{\arabic{chapter}} % Number format for sections \copypagestyle{chapter}{Ruled} \checkandfixthelayout % Required \sloppybottom \begin{document} \chapter{Business Requirement}\label{ch:requirement} \section{Background}\label{sec:background} Whilst the connectivity has been periodically upgraded, it is essentially the same functionality dating from 2006 when first implemented. The on-premise server is beyond end-of-life; the software version is out-of-date and represents a potential security vulnerability. Consequently, this project is to implement the next-generation connection. \section{Scope}\label{sec:scope} The following solution components are in scope for the project: \begin{itemize} \item A \item B \item C \item D \item E \item F \end{itemize} The user processes that trigger calculations are: \begin{itemize} \item 1 \item 2 \item 3 \end{itemize} \end{document} This produces the following pdf: My apologies - both for messing-up the Markdown (trying to provide more information) and for the MWE being, well ... minimal. My thanks for the feedback. Following advice above, the section and subsections are numbering, however, for the x-ref to work properly, I need the numbering to be chapter.section.subsection (e.g. 5.3.1 Schema Groups for Vendors) for the main matter and Alpha.section.subsection (e.g. G.3.1 Checklist) for appendices. If this is insufficient, I'll edit again to provide the full .sty and main.tex files. Partial success! \renewcommand\thesection{\arabic{chapter}.\arabic{section}} numbers the mainmatter correctly For the appendix, I used \renewcommand{\thechapter}{\Alph{chapter}} however sections and subsections are numbering as (e.g.) 2.1; 2.2 and what's required is B.1; B.2 etc.
- Alternative \oplus symbol when using newpx packageby rla on August 28, 2026 at 7:35 pm
When using newpx package I would like to change the \oplus and \bigoplus symbols to ones whose circles are slightly greater than the plus sign. I found a partial solution here How do I put a circle around an operator? \documentclass[a4paper, 10pt]{book} \usepackage{graphicx} \usepackage{mathtools} \usepackage{newpxtext} \usepackage[varg, smallerops]{newpxmath} \makeatletter \newcommand\incircbin {% \mathpalette\@incircbin } \newcommand\@incircbin[2] {% \mathbin% {% \ooalign{\hidewidth$#1#2$\hidewidth\crcr$#1\bigcirc$}% }% } \newcommand{\myoplus}{\incircbin{+}} \makeatother \begin{document} \[ \oplus \myoplus \] \[ \bigoplus \prod \sum \] \end{document} Similarly, I would like to define \mybigoplus operator which is basically a larger version of \myoplus. A first attempt would be to use \scalerel or \resizebox commands but that approach make the symbol look like a bold version. How to define a larger version of \myoplus with weight matching with others operator like the originals \prod and \sum from the newpx package? Furthermore, it will be good to have a solution that dynamically fits its size when \textstyle or \displaystyle are imposed.
- Relative paths in pgfkeys vs. usage in TikZby karlh on August 28, 2026 at 3:12 pm
This is more a curiosity (or bug report?) than it is an actual problem. That is, I know how to fix it/work around it, and I'm really asking about the design principle(s). Using \pgfkeys to set a key /pgf/bar is fine, but setting one /pgf/foo/bar will cause an error if the \pgf part is left off inside a TikZ path/node/etc. command: \documentclass{article} \usepackage{tikz} \pgfkeys{% /pgf/bar/.initial=1cm, /pgf/foo/bar/.initial=1cm, } \begin{document} \begin{tikzpicture} \path [bar=2cm] (0,0); \end{tikzpicture} \end{document} compare to \documentclass{article} \usepackage{tikz} \pgfkeys{% /pgf/bar/.initial=1cm, /pgf/foo/bar/.initial=1cm, } \begin{document} \begin{tikzpicture} \path [foo/bar=2cm] (0,0); \end{tikzpicture} \end{document} The latter gives the following error: ! Package pgfkeys Error: I do not know the key '/tikz/foo/bar', to which you passed '2cm', and I am going to ignore it. Perhaps you misspelled it. See the pgfkeys package documentation for explanation. Type H <return> for immediate help. ... l.13 \path [foo/bar=2cm] ( 0,0); ? Making the root path /tikz solves the problem, as does providing the full path /pgf/foo/bar, but given the statement in the TikZ documentation, section 12.4.1, I expected it to work: Is this supposed to work, or is there a reason this list is not followed when a slash is present in the key name?
- How to put test code into a self-designed macro packageby lyl on August 28, 2026 at 2:21 am
I want to put some test code into a macro package like this: %mypkg.sty \newif\iftest\testfalse \RequirePackage{...} some macros designed by myself \iftest\documentclass{article} preamble \begin{document} some test codes \end{document}\else\fi When \testtrue, the file mypkg.sty wish to be compiled and run, to get an output to test if the macros designed in this file work all right. If \testfalse, all the test code would be ignored, and the package mypkg.sty can be introduced by other files. It seems that this dose not work as expected. What's wrong with this method, and if there are better ways to put macros and its test code together into a .sty file?
- `unicode-math`: prevent `\symbf` from switching font styles and just make things boldby moro11 on August 27, 2026 at 7:50 pm
Consider the MWE \documentclass[varwidth]{standalone} \usepackage{unicode-math} \begin{document} $aB\beta\Xi$\\$\symbf{aB\beta\Xi}$ \end{document} I don't like how \symbf switches Latin letters from italic to upright, while i only intend to make them bold, there are other commands to make a letter bold and switch font such as \symbfit and \symbfup. I would like \symbf to just make things bold. I know i can switch the font style (italic/upright) of lower/upper case Latin/Greek letters with the option math-style and the style of bold face letters by bold-style. Although, with the available options, i was only able to achieve the desired behavior with math-style=ISO,bold-style=ISO which results in everything being italic . From pre-unicode-math days, i am used to math-style=TeX and \usepackage{bm} which gives (everything italic except for upper case Greek letters, which are upright in normal and bold font). I guess the ISO/ISO configuration is fine, but i am still wondering if it is possible to reproduce this configuration in unicode-math? or even better, completely turn off the font switch of \symbf, i.e. always use the exact same italic/upright configuration for bold math as used in standard non-bold math, where "standard math" is defined by math-style)?
- Specify version=bold for specific font using unicode-mathby moro11 on August 27, 2026 at 5:38 pm
I am switching to unicode-math and have some trouble with the bold fonts. I know the intended way in unicode-math is to use \symbf, \symbfcal etc. which boldens characters, but no symbols like + or accents like \tilde. This is fine when boldface is used for schematics (e.g. to denote vectors). But sometimes, i want to use mathematics just in an all-bold environment (e.g. in section titles) where just everything should be bold. I know i could set a bold version of a math alphabet and switch to that using \boldmath or \boldsymbol instead of \symbfXY. (of course setting up these fonts has to be done carefully, as one might end up with two different bold fonts otherwise.) Now, i further want to have access to two calligraphic fonts \symcal and \symscr ideally with full support for both, but i can not get that to work. Consider the following MWE (the fonts are available at CTAN): \documentclass[varwidth]{standalone} \usepackage{unicode-math} \setmathfont{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \begin{document} $\symcal{A}$ (symcal) $\symbfcal{A}$ (symbfcal) {\boldmath$\symcal{A}$} (boldmath + symcal)\\ $\symscr{A}$ (symscr) $\symbfscr{A}$ (symbfscr) {\boldmath$\symscr{A}$} (boldmath + symscr) \end{document} producing What i want to have is I tried other configurations as well, such as: \setmathfont{NewCMMath-Regular.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \setmathfont[version=bold, range={scr,bfscr}, StylisticSet=1]{NewCMMath-Bold.otf} I have the bad feeling that i found some hard limits of the unicode-math package. Is there any way to achieve this? I would also be happy with some workarounds if this is not possible. Maybe some adjusted .otf files. Or redefining the mechanic behind \boldmath and \boldsymbol to additionally redefine \symscr and \mathscr with \symbfscr and \mathbfscr or something (i guess these are the only non-bold alphabets, so replacing them with bold version might not be ideal, but probably good enough?) I mean, we are talking about the second calligraphic font in combination with the lesser used bold mechanic, so the use-case is probably not the most relevant. Nevertheless it feels odd to not have support for that at all, especially, as this is no problem without unicode-math using the old 8-bit engine.
- tikz pgfplot fill area between multiple graphs or pathsby paul_schaefer on August 27, 2026 at 12:22 pm
MWE: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[ngerman]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{datavisualization.formats.functions} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture}[scale=1] \begin{axis}[ axis equal, % axis line style=thick, axis x line=center, ylabel={$y$}, xlabel={$x$}, major tick style = {black}, axis y line=middle, every axis y label/.style={ at={(current axis.above origin)}, inner sep=3, anchor=north east, }, every axis x label/.style={ at={(current axis.right of origin)}, inner sep=3, anchor=north east, }, xtick={-1,1}, xticklabels={$-\frac{w}{2}$,$\frac{w}{2}$}, ytick={1}, yticklabels={$h$}, yticklabel style={anchor=south west}, xmin=-1.75, xmax=3.25, ymin=-0.1, ymax=1.5, height=4cm, samples=100] \addplot[domain=-1:1,thick, name path=A] {1 - x * x}; \addplot[domain=0.5:2.5,thick, name path=B] {1 - (x-1.5) * (x-1.5)}; \draw[name path=C, thin] (1/3,8/9) -- (1.5,1); \path [name path=D] (\pgfkeysvalueof{/pgfplots/xmin},0) -- (\pgfkeysvalueof{/pgfplots/xmax},0); \addplot[black!15] fill between[of=C and A, soft clip={domain=0:0.75}]; \addplot[black!15] fill between[of=C and B, soft clip={domain=0.75:1.5}]; \addplot[black!40] fill between[of=B and D, soft clip={domain=0.5:0.75}]; \addplot[black!40] fill between[of=A and D, soft clip={domain=0.75:1}]; \end{axis} \end{tikzpicture} \end{document} results in a graph, where the areas between the both graphs are filled in gray. In this example I splitted the areas into four sections and colored them. Is there a possibility to fill the areas without splitting them into sections? A second problem is, that the separation of each area into two parts will sometimes result in in slight white vertical line between the colored areas. In my case it depends on the scaling of the pdf viewer I use. If there area could be described without separation this should not happen.
- How to draw 3D animation of reflection of a triangle about the bisector?by Learner on August 26, 2026 at 6:50 pm
I want to plot a 3D animation of an equilateral triangle about one bisector. I have plotted the steps by using tikz: \documentclass[a4paper,11pt]{article} \usepackage{tikz} \usepackage[margin=1.2cm]{geometry} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[x=1cm,y=1cm] % First triangle: \begin{scope}[shift={(0,0)}] \coordinate (A) at (0,2); \coordinate (B) at (-1.732,0); \coordinate (C) at (1.732,0); % Median = axis of reflection \draw[dashed,very thick] (0,0) -- (0,2); % Triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Vertex labels \node[above] at (A) {$A$}; \node[below left] at (B) {$B$}; \node[below right] at (C) {$C$}; % Element \node at (0,-0.7) {I}; \end{scope} %Arrow from first triangle to second triangle \draw[->,thick] (2.2,1) -- (5.8,1); \node at (4,1.2) {s}; \node at (4,0.5) {$(\text{reflection})$}; %second triangle \begin{scope}[shift={(8,0)}] \coordinate (A) at (0,2); \coordinate (B) at (-1.732,0); \coordinate (C) at (1.732,0); % Reflect in the vertical median \begin{scope}[xscale=-1] % Triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Vertex labels \node[above left] at (A) {$A$}; \node[below left] at (B) {$B$}; \node[below] at (C) {$C$}; \end{scope} % Reflection axis \draw[dashed,very thick] (0,0) -- (0,2); \node at (0,-1) {II}; \end{scope} \end{tikzpicture} \end{document} which gives the following two triangles: I want to plot a 3D animation to display the reflection about the bisector.I would appreciate to do that. The vertices B and C will be changing every time but A will remain fixed. Note that the first triangle and the last triangle are same.