• How to place two photos aligned in the left and right of the headline?
    by Learner on February 2, 2026 at 12:57 am

    I am making a conference poster. I want to add a photo on the left and a photo on the right of the headline. I have written the following source code: \documentclass[12pt]{article} \usepackage[a4paper,margin=1.5cm]{geometry} \usepackage{setspace} \usepackage{graphicx} \usepackage{amsmath,amssymb} \usepackage{enumitem} \usepackage{ragged2e} \usepackage{titlesec} \usepackage{xcolor} \usepackage{pagecolor} % Background and text colors \definecolor{instblue}{HTML}{E9F0F8} \pagecolor{instblue} \color{black} \pagestyle{empty} % Section style \titleformat{\section}{\large\bfseries\color{blue}}{}{0pt}{} \begin{document} \noindent \begin{minipage}[t]{0.18\textwidth} \raggedright \includegraphics[width=0.9\linewidth]{DHU_logo.png} \end{minipage} \hfill \begin{minipage}[t]{0.58\textwidth} \centering {\Large \textbf{A Two-Day Workshop and Conference in Mathematics}}\\[0.2cm] {\Large \textbf{Honoring Srinivasa Ramanujan}}\\[0.4cm] {\large \textbf{May 4--5, 2026}}\\ {\large \textbf{Venue:} Darjeeling Hills University}\\ {\normalsize ITI Building, Mungpoo, Darjeeling,}\\ {West Bengal, India -- 734313} \end{minipage} \hfill \begin{minipage}[t]{0.18\textwidth} \raggedleft \includegraphics[width=0.9\linewidth]{ramanujan.jpg} \end{minipage} \vspace{0.6cm} \section*{About the Event} \justifying This two-day workshop and conference is organized in honor of the remarkable contributions of \textbf{Srinivasa Ramanujan} to mathematics. The event aims to promote academic interaction among researchers, faculty members, and students, and to encourage participation from diverse and emerging academic regions. Certificates will be issued to participants for academic and professional purposes. \vspace{0.4cm} \begin{minipage}[t]{0.48\textwidth} \section*{Invited Speakers} \begin{itemize}[leftmargin=1.2cm] \item Professor 1 \item Professor 2 \item Professor 3 \end{itemize} \end{minipage} \hfill \begin{minipage}[t]{0.48\textwidth} \section*{Scientific Committee} \begin{itemize}[leftmargin=1.1cm, itemsep=2pt] \item Professor 1 \item Professor 2 \item Professor 3 \end{itemize} \end{minipage} \vspace{0.3cm} \begin{minipage}[t]{0.40\textwidth} \section*{Paper Presentation} \justifying PhD scholars and Faculty members are invited to present their research papers for certificate purposes. Interested participants should submit an \textbf{abstract} to: \texttt{email@example.com} \end{minipage} \hfill \begin{minipage}[t]{0.48\textwidth} \section*{Registration and Participation} \begin{itemize}[leftmargin=1.2cm] \item \textbf{Registration Link:} Fill the google form \item \textbf{Registration fee:} None \end{itemize} \end{minipage} \vspace{0.3cm} \noindent \begin{minipage}[t]{0.48\textwidth} \section*{Organizing Committee} \begin{itemize}[leftmargin=1.1cm, itemsep=2pt] \item Professor 1 (Convener) \item Professor 2 \item Professor 3 \end{itemize} \end{minipage} \hfill \begin{minipage}[t]{0.48\textwidth} \section*{Accommodation Support} \justifying Limited accommodation is available for participants. Allocation will be on a first-come, first-served basis. Free lunch and tea will be provided to all participants with preference to outstation candidates. \end{minipage} \section*{Contact Person:} name, phone and email to be given \end{document} The out is the following: You can see that left hand photo (University logo) and the right hand photo (Ramanujan photo) are not aligned with the headline. How to do it nicely? Also suggests for better poster. Thanks

  • Bug with multicols
    by Math Attack on February 1, 2026 at 11:00 pm

    I wrote a .pdf of 250 pages with 350 images. Normally I write in a single .tex for my convenience, but now it's becoming unmanageable because it's excessively long (about 1.5 million characters) and I have to work on it with someone else so I wanted to separate it into chapters. Context Schematically, .tex is now structured like this: \part{A} \begin{multicols}{2} %<<<< \section{A.1} text of A.1 \section{A.2} text of A.2 ... \section{A.9} text of A.9 \end{multicols} %<<<< % other parts I wrote 9 file .tex with all the sections and used \import{sectionA1.tex} ... \import{sectionA9.tex} in a main.tex Problem In section A5 I had to break the multicols command to insert a very long array that didn't fit in one column, but in 2. This didn't cause any problems in the single file; the problem is that it causes bugs when separating the files. In practice, the sectionA5.tex file looks like this: % no \begin{document} or macros, only text and images text, images, text, images,... \end{multicols} \[\begin{array}...\end{array}\] \begin{multicols} text, images, text, images,... % no \end{document} The compiler says it can't find the images beyond the new \begin{multicols} command. Solution I found Solution 1 I found two solutions to this thing (to make it compile), but they both have problems: Start all sectionAX.tex files with \begin{multicols} and end them with \end{multicols} Problem for solution 1 This solution changes the way I lay out my pages; instead of having a continuous column, it breaks them down the middle of the page, so maybe on the 1st column there's an internal part of section 1 and then the beginning of section 2, and on the second column there's the end of section 1 and the internal part of section 2 (the correct version should be that on the first column there's the end of section 1 and the beginning of section 2, while on the 2nd column there's the middle of section 2). Solution 2 Add the full path to the images. I wrote the all path in the .tex \includegraphics[scale=1]{C:/Users/MyName/Desktop/Project/PartA/SectionA5/ImgSectionA5/NameImg.png} Problem for solution 2 This is the best solution we've found so far; the problem is that if you change your computer, or simply change the folder name or anything else that changes the path, you have to change every path, which isn't feasible (and generally limits the ease of sharing). Question Does anyone know how to fix this? Maybe not using \import but something else.

  • Spacing with mathematical symbols in brakets
    by Danya Zh on February 1, 2026 at 9:38 pm

    In the braket package I have noticed a spacing issue with mathematical operators; plus and minus symbols after | will be treated as binary operators, even if they represent an ordinary operator. For example $\braket{+45|+45}$ will have no spacing for the first + symbol (treated as class 0), but will have the operator spacing for the second + symbol (treated as class 2). \documentclass{article} \usepackage{braket} \begin{document} How can we fix spacing in $\braket{+45|+45}$ without invoking \verb+\!+ \end{document} I would like to have a solution that does not involve inline spacing fixes. I am confident that the command can be redefined in a way that would resolve this issue.

  • Printing blank pages from TexStudio
    by Ramon A. Mata-Toledo on February 1, 2026 at 8:20 pm

    All of a sudden, I cannot print the PDF from TexStudio even user external viewer. I can print on TexShop with no problem. I could change but I like TexStudio. Any suggestion?

  • Put exercises and solutions into resizable boxes (question and answer on separate pages)
    by palloc on February 1, 2026 at 5:32 pm

    I have the following LaTeX code. In Hungarian, Kérdés means Question and Válasz means Answer. \documentclass[12pt]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[hungarian]{babel} \usepackage{xsim} \DeclareExerciseType{question}{ exercise-env = question, solution-env = answer, exercise-name = Kérdés, solution-name = Válasz, exercise-template = default, solution-template = default } \xsimsetup{solution/print=false} \begin{document} \section*{Kérdések} \begin{question} Mi $2+2$? \end{question} \begin{answer} $2+2=4$. \end{answer} \begin{question} Mennyi $\sqrt{16}$? \end{question} \begin{answer} $\sqrt{16}=4$. \end{answer} \begin{question} Mennyi $5^2$? \end{question} \begin{answer} $5^2=25$. \end{answer} \newpage \section*{Válaszok} \ForEachUsedExerciseByOrder{% \XSIMprint{exercise}{#1}{#2} \XSIMprint{solution}{#1}{#2} } \end{document} First page Second page On the first page I want to print only the questions, and on the second page I print the questions again together with their answers (as shown in the screenshots below). The code works. However, I would like to put the content into framed boxes: On the first page, each question should be inside a box. On the second page, the question and its answer should be inside a box (one combined box see the example screenshots). The boxes should automatically expand if a question or answer spans multiple lines. How can I do this with xsim, I open to use any other package as well? First page Second page

  • How to transform canvas with `grid` and not to affect the `node`'s content at the same time?
    by Explorer on February 1, 2026 at 5:24 pm

    Description As the successor of my prevoius not-supported l3draw attempt, I try with plain-tikz: \documentclass[tikz,border=5pt]{standalone} \usepackage{mathpazo} \usepackage{amsmath} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[ x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}, ] \fill[orange!10] (-2,-2) rectangle (5,5); \draw[orange] (-2,-2) grid (5,5); \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}] \fill[orange!10] (-2,-2) rectangle (5,5); % \draw[orange] (-2,-2) grid (5,5); \foreach \i in {-2,-1,...,5} {\draw[orange] (\i,-2) -- ++(0,7) (-2,\i) -- ++(7,0);} \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \begin{tikzpicture}[line cap=round] \clip (-.5,-.5) rectangle (4.5,4.5); \begin{scope}[ transform canvas={cm={1.5, 0.5, 0.5, 2, (0,0)}} ] \fill[orange!10] (-2,-2) rectangle (5,5); \draw[orange] (-2,-2) grid (5,5); \draw[orange,ultra thick,-Stealth] (0,0) -- +(1,0) node[below] {$\mathbf{b_1}$}; \draw[orange,ultra thick,-Stealth] (0,0) -- +(0,1) node[below left] {$\mathbf{b_2}$}; \draw[black,ultra thick,-Stealth] (0,0) -- +(1,1) node[right] {$\mathbf{x}$}; \end{scope} \end{tikzpicture} \end{document} Here, I have three proposals: FIRST: the grid doesn't transform by x={(1.5cm,0.5cm)}, y={(0.5cm,2cm)}. SECOND: the manual \foreach gives what I want, but I don't think manually mimic what feature grid do is the best practice. THIRD: with transform canvas, it affected the grid, but all on the canvas, the text and arrow are both sheared, that is not I want. Question: Is there better approach without manually plot the grid? I would make good use of feature grid in my case as possible.

  • In 2026, what kind of plot requirement is suitable with `l3draw`?
    by Explorer on February 1, 2026 at 3:38 pm

    I want to mimic the following figure with l3draw, the \draw_transform_matrix:nnnn feature to apply transformation matrix. Here below is my attempt: \documentclass[border=5pt]{standalone} \usepackage{l3draw} \usepackage{amsmath} \begin{document} \ExplSyntaxOn \draw_begin: \color_set:nnn { orange } {RGB} {255, 165, 0} \draw_scope_begin: \draw_transform_matrix:nnnn { 2.5 } { 0.5 } { 0.5 } { 3 } \draw_set_cap_round: \draw_path_rectangle_corners:nn { -5mm , -5mm } { 35mm , 35mm } \color_fill:n { orange!25 } \draw_path_use_clear:n { fill } \draw_path_grid:nnnn { 1cm } { 1cm } { -5mm , -5mm } { 35mm , 35mm } \color_stroke:n { orange } \draw_path_use_clear:n { stroke, fill } \draw_set_linewidth:n { .1cm } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 0cm, 1cm } \draw_path_use_clear:n { stroke } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 1cm, 0cm } \draw_path_use_clear:n { stroke } \color_stroke:n { black } \draw_path_moveto:n { 0cm, 0cm } \draw_path_lineto:n { 2cm, 2cm } \draw_path_use_clear:n { stroke } \draw_scope_end: \hbox_set:Nn \l_tmpa_box { \color_math:nn {orange} {$b\sb2$} } \draw_box_use:Nn \l_tmpa_box { 0cm, 2.7cm } \draw_end: \ExplSyntaxOff \end{document} My question is: Is that possible to plot the image of "arrow" in l3draw's code framework? In 2026, when to choose l3draw? (I found that there are only 17 posts on this site was tagged l3draw since now) By reading the post on this site, l3draw is more used to constuct symbols(without arrow), or apply some transformations with l3box.... (Notes: I don't think my second question is a quite different one, in my state now, it's quite natural to ask if some features didn't provide by l3draw, while I have written the code shown above) Edited: Since Joseph has commented that: Currently arrows are not implemented, partly as I've not had a need to do it - the priority is really to get the code stable ATM I still wonder what kind of plotting requirement is suitable to play with l3draw in the current state(2026.02)?

  • Tagging of \sqrt with and without unicode-math
    by imnothere on February 1, 2026 at 2:10 pm

    In this MWE to be compiled with LuaLaTeX for MathML structure tagging, when the math expression contains a\sqrt, an extra node Marked content on page 1: √ is produced in the tagged output: \DocumentMetadata{lang=en, tagging=on, tagging-setup={math/setup=mathml-SE}, pdfstandard=ua-2} \documentclass{article} % \usepackage{unicode-math} % \usepackage{lua-unicode-math} \begin{document} $ \sqrt{x} $ \end{document} And the derived HTML produced by ngPDF would show the extra √ . The extra √ won't appear in the tagged output if unicode-math is loaded: But loading lua-unicode-math doesn't remove the extra √. Is this a bug in the current tagging code, or is there a more proper way of typesetting/tagging square roots, with or without (lua-)unicode-math?

  • Best way to structure .sty files
    by palloc on February 1, 2026 at 1:51 pm

    I’m wondering what the best practice is for organizing a main.tex file: should I put custom settings into one .sty file, or split them across multiple .sty files? For example, I have a block of code that customizes the table of contents, the list of figures/tables, and caption formatting. For readability, I’m considering moving it into a separate style file, e.g. toc_lof_lot_caption.sty, so that main.tex stays clean. So I format this: % Source - https://tex.stackexchange.com/a/758901 % Posted by taiwan12 % Retrieved 2026-02-01, License - CC BY-SA 4.0 \documentclass[11pt]{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage{graphicx} \usepackage{parskip} \usepackage{float} \usepackage{setspace} \usepackage[colorlinks]{hyperref} % Caption settings: disable chapter-based numbering for figures and tables \usepackage{caption} \captionsetup{figurewithin=none} \captionsetup{tablewithin=none} % Caption label formatting: "1. ábra: ..." instead of "Figure 1" \captionsetup[figure]{labelsep=colon} % Caption label formatting: "1. táblázat: ..." instead of "Table 1" \captionsetup[table]{labelsep=colon} % Package for customizing TOC / LOF / LOT formatting \usepackage{tocloft} % -------------------------------------------------- % Combine list of figures and list of tables % -------------------------------------------------- \makeatletter \let\ext@table\ext@figure % Make tables use the same file extension as figures (so they appear in the same list) \newcommand{\listoffigsandtabs}{% \clearpage % Start on a new page \phantomsection % Create anchor for hyperref \addcontentsline{toc}{chapter}{Ábrák és táblázatok jegyzéke} % Add entry to TOC \renewcommand{\listfigurename}{Ábrák és táblázatok jegyzéke} % Rename list title \listoffigures % Print combined list } \makeatother % -------------------------------------------------- % Formatting of TOC and List of Figures/Tables entries % -------------------------------------------------- \makeatletter % -------------------------------------------------- % Customize chapter entries in the Table of Contents % Format: "1. Fejezet: Title" % -------------------------------------------------- \let\oldl@chapter\l@chapter % Save the original \l@chapter command \renewcommand*\l@chapter[2]{% Redefine how chapter entries appear in the TOC \begingroup % Start a local group so changes don’t leak outside \renewcommand*\numberline[1]{##1.\ Fejezet:\ \hspace{0.2em}}% % Redefine the number format: % ##1 = chapter number % Adds "Fejezet:" after the number % Adds a small horizontal space after it \oldl@chapter{#1}{#2} % Call the original TOC formatting with the new numberline \endgroup % End local group } % -------------------------------------------------- % Customize figure entries in the List of Figures % Format: "1 ábra: Caption" % -------------------------------------------------- \let\oldl@figure\l@figure % Save the original \l@figure command \renewcommand*\l@figure[2]{% Redefine how figure entries appear in the List of Figures \begingroup \renewcommand*\numberline[1]{% \makebox[6em][l]{##1\ ábra:}% % Creates a fixed-width box (6em) for the number + label % Left-aligned ("[l]") so all captions line up nicely }% \oldl@figure{#1}{#2} % Use the original formatting with the modified numberline \endgroup } % -------------------------------------------------- % Customize table entries in the List of Tables % Format: "1 táblázat: Caption" % -------------------------------------------------- \let\oldl@table\l@table % Save the original \l@table command \renewcommand*\l@table[2]{% Redefine how table entries appear in the List of Tables \begingroup \renewcommand*\numberline[1]{% \makebox[6em][l]{##1\ táblázat:}% % Fixed-width box for table number + label }% \oldl@table{#1}{#2} % Call the original formatting command \endgroup } \makeatother % -------------------------------------------------- % Visual spacing and alignment tweaks for lists % -------------------------------------------------- \setlength{\cftfigindent}{0pt} % No indentation for figure entries \setlength{\cfttabindent}{0pt} % No indentation for table entries \begin{document} \onehalfspacing \tableofcontents % Generate table of contents \listoffigsandtabs % Generate combined list of figures and tables \chapter{First} \section{First} \begin{figure}[H] \caption{First fig} \end{figure} \begin{table}[!ht] \caption{First tab} \end{table} \section{Second} \begin{table}[!ht] \caption{Second tab} \end{table} \chapter{Second} \begin{figure}[!ht] \caption{Second fig} \end{figure} \end{document} into this: main.tex \documentclass[11pt]{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage{graphicx} \usepackage{parskip} \usepackage{float} \usepackage{setspace} \usepackage[colorlinks]{hyperref} \usepackage{toc_lof_lot_caption} \begin{document} \onehalfspacing \tableofcontents % Generate table of contents \listoffigsandtabs % Generate combined list of figures and tables \chapter{First} \section{First} \begin{figure}[H] \caption{First fig} \end{figure} \begin{table}[!ht] \caption{First tab} \end{table} \section{Second} \begin{table}[!ht] \caption{Second tab} \end{table} \chapter{Second} \begin{figure}[!ht] \caption{Second fig} \end{figure} \end{document} toc_lof_lot_caption.sty % Caption settings: disable chapter-based numbering for figures and tables \usepackage{caption} \captionsetup{figurewithin=none} \captionsetup{tablewithin=none} % Caption label formatting: "1. ábra: ..." instead of "Figure 1" \captionsetup[figure]{labelsep=colon} % Caption label formatting: "1. táblázat: ..." instead of "Table 1" \captionsetup[table]{labelsep=colon} % Package for customizing TOC / LOF / LOT formatting \usepackage{tocloft} % -------------------------------------------------- % Combine list of figures and list of tables % -------------------------------------------------- \makeatletter \let\ext@table\ext@figure % Make tables use the same file extension as figures (so they appear in the same list) \newcommand{\listoffigsandtabs}{% \clearpage % Start on a new page \phantomsection % Create anchor for hyperref \addcontentsline{toc}{chapter}{Ábrák és táblázatok jegyzéke} % Add entry to TOC \renewcommand{\listfigurename}{Ábrák és táblázatok jegyzéke} % Rename list title \listoffigures % Print combined list } \makeatother % -------------------------------------------------- % Formatting of TOC and List of Figures/Tables entries % -------------------------------------------------- \makeatletter % -------------------------------------------------- % Customize chapter entries in the Table of Contents % Format: "1. Fejezet: Title" % -------------------------------------------------- \let\oldl@chapter\l@chapter % Save the original \l@chapter command \renewcommand*\l@chapter[2]{% Redefine how chapter entries appear in the TOC \begingroup % Start a local group so changes don’t leak outside \renewcommand*\numberline[1]{##1.\ Fejezet:\ \hspace{0.2em}}% % Redefine the number format: % ##1 = chapter number % Adds "Fejezet:" after the number % Adds a small horizontal space after it \oldl@chapter{#1}{#2} % Call the original TOC formatting with the new numberline \endgroup % End local group } % -------------------------------------------------- % Customize figure entries in the List of Figures % Format: "1 ábra: Caption" % -------------------------------------------------- \let\oldl@figure\l@figure % Save the original \l@figure command \renewcommand*\l@figure[2]{% Redefine how figure entries appear in the List of Figures \begingroup \renewcommand*\numberline[1]{% \makebox[6em][l]{##1\ ábra:}% % Creates a fixed-width box (6em) for the number + label % Left-aligned ("[l]") so all captions line up nicely }% \oldl@figure{#1}{#2} % Use the original formatting with the modified numberline \endgroup } % -------------------------------------------------- % Customize table entries in the List of Tables % Format: "1 táblázat: Caption" % -------------------------------------------------- \let\oldl@table\l@table % Save the original \l@table command \renewcommand*\l@table[2]{% Redefine how table entries appear in the List of Tables \begingroup \renewcommand*\numberline[1]{% \makebox[6em][l]{##1\ táblázat:}% % Fixed-width box for table number + label }% \oldl@table{#1}{#2} % Call the original formatting command \endgroup } \makeatother % -------------------------------------------------- % Visual spacing and alignment tweaks for lists % -------------------------------------------------- \setlength{\cftfigindent}{0pt} % No indentation for figure entries \setlength{\cfttabindent}{0pt} % No indentation for table entries If I also have other style files such as table_mod.sty, figure_mod.sty, etc., is it a good idea to keep these as separate .sty files, or should I merge them into a single style file? What is the best advide

  • Write the "gradings" under a map
    by Jinwen on February 1, 2026 at 11:43 am

    How should one write the term-by-term "grading" under the equation, as in the following pictures? There should be various ways to achieve this. But at least, I would like to know how to do this in the usual situation, and with tikz-cd. Here is an example code of the above two equations: \documentclass{article} \usepackage{mathtools,amssymb,tikz-cd} \def\A{\mathbb{A}} \begin{document} Situation 1 (2 places): \[ H_X \colon [X \times \A^1] \to [X] \] Situation 2 (3 places): \[ [U \cap V] \xrightarrow{[j']-[i']} [U] \oplus [V] \xrightarrow{[i]+[j]} [X] \] Situation 2' (with \texttt{tikz-cd}): \[ \begin{tikzcd}[column sep=large] {[U \cap V]} & {[U] \oplus [V]} & {[X]} \arrow["{[j']-[i']}", from=1-1, to=1-2] \arrow["{[i]+[j]}", from=1-2, to=1-3] \end{tikzcd} \] \end{document}

  • Drawing a pulley system
    by Fatai Bakare on February 1, 2026 at 8:32 am

    I need to draw a pulley system as in the figure. How can I do that? Specific information about the figure: A block of mass Mo is on a horizontal surface and attached by a string to a hanging block, also of mass Mo , as shown in the figure. Friction between the block and the horizontal surface is negligible. The masses of the string and pulley are negligible, and the pulley can rotate with negligible friction around its axle.

  • Redefine `\item` so its first "argument" is a full word
    by mathbekunkus on February 1, 2026 at 5:37 am

    I defined a Tikz macro and I want to use it so the item of an inline itemize is passed as its argument. So far, my solution is this: \documentclass{article} \usepackage[inline]{enumitem} \usepackage{tikz} \newcommand\itemvalue[1]{ \tikz[baseline=(o.base)] { \node[ inner xsep=0pt, inner ysep = 1pt, outer xsep=2pt, outer ysep=2pt ] (o) at (0,0) {\textcolor{blue!80!black}{\fontsize{10}{16}\textbf{#1}}}; \draw[color=gray!50, thick] ([xshift=(-1.3)]o.south west) -- ([xshift=(1.3)]o.south east); } } \begin{document} \let\olditem\item \renewcommand\item[1]{\olditem\itemvalue{#1}} \begin{itemize*}[label={}, labelsep=2em, parsep=2ex] \item {First} \item {Second} \item {Third} \end{itemize*} \end{document} The output looks like this: This is what I want but I was wondering if there was a way of redefining \item so it reads the full word (not only its first letter). If I remove the braces on each item, the output looks like this: This makes sense as far as I can tell how \item works, but I'd like a workaround that doesn't use braces on each item. Thanks!

  • Wrapping a circle on a torus
    by M. Al Jumaily on February 1, 2026 at 4:19 am

    I have used the sample code from latexdraw that draws a torus. I am trying to draw a filled circle and a dashed circle where they should be wrap around the torus instead of being drawn uniformly at z=0. I am looking for a TikZ solution. The closest I have seen is this solution but it is too difficult for me to decipher. Any help would be appreciated! \documentclass[margin=4pt]{standalone} \usepackage{tikz} \usepackage{pgfplots} \usepackage{tikz-3dplot} \usepgfplotslibrary{colormaps} \pgfplotsset{ compat=newest, colormap={manifoldmap}{color=(lightgray) color=(white) color=(lightgray)} } \begin{document} \begin{tikzpicture} \def\R{2.75} % Major radius (distance from torus centre to tube centre) \def\offset{0.5} % Radial displacement from the torus centre circle \def\thetaB{2.5} % Angular position (in radians) for highlighted point \begin{axis}[ width=12cm, axis equal image, hide axis, z buffer=sort, view={125}{35}, clip=false ] % Parametric torus equations: % x = (R + cos(x)) cos(y) % y = (R + cos(x)) sin(y) % z = sin(x) \addplot3[ surf, shader = faceted interp, samples = 30, samples y = 40, domain = 0:2*pi, domain y = 0:2*pi, colormap name = manifoldmap, thin, opacity=0.75 ] ( {(\R + cos(deg(x))) * cos(deg(y))}, {(\R + cos(deg(x))) * sin(deg(y))}, {sin(deg(x))} ); \begin{scope}[canvas is xy plane at z=0, transform shape] \coordinate (p) at ({(\R + \offset) * cos(deg(\thetaB))}, {(\R + \offset) * sin(deg(\thetaB))}); \draw[fill=red, draw=none] (p) circle (4pt); \draw[blue, dashed, thick] (p) circle (16pt); \end{scope} \end{axis} \end{tikzpicture} \end{document}

  • parskip after opening in scrlttr2
    by user1 on January 31, 2026 at 8:41 pm

    Using the parskip=half option, scrlttr2 still sets a full parskip after the opening. I feel that this is not intended and also not appealing. Is there a way to only get a half skip? I did not find anything like \setplength{openingaftervskip}{0.5\baselineskip} \documentclass{scrlttr2} \KOMAoptions{addrfield=false, parskip=half} \begin{document} \setkomavar{subject}{subject} \begin{letter}{} \opening{Dear} text text text \end{letter} \end{document}

  • How to draw a figure (horizontal and diagonal ines) with numbers / variables within (easy) [closed]
    by Justin Eaves on January 31, 2026 at 6:56 pm

    I am looking to draw diagrams similar to this many times over the course of a document, and fill in all (6) of the negative spaces (top, bottom, top left, top right, bottom left, bottom right). The numbers in each diagram will vary. The center of the diagram need not be hollow as in the photo below, that was just sloppy line drawing. Just an "X" with a horizontal line through it, and a way to add numbers in each negative space. I'm sure this is easy, but I have zero experience with tikz. Anyone have an easy solution? Thanks in advance!

  • Why does this pdf figure crash lualatex?
    by Ian Thompson on January 31, 2026 at 4:01 pm

    I have an old workflow that uses LaTeX itself to process diagrams and plots. I've used this generate hundreds of figures over the years. This has suddenly started producing invalid pdf figure files: they won't open in Acrobat (though they do open in SumatraPDF); including them in a document causes luatex to output several warning messages (invalid compressed object) and a corrupt final file. Strangely, they do seem to work with pdftex. Compiling this document with lualatex is enough to trigger the problem on my machine. \documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics[width=\textwidth]{embed.pdf} \end{document} Here is embed.pdf The figure was initially generated by gnuplot, using the following: set term postscript eps mono set output "fig.eps" plot x**2 title "AAA" I then created a version with a Greek letter by compiling this document (embed.tex) using latex+dvips \documentclass{article} \usepackage{graphicx} \usepackage{psfrag} \pagestyle{empty} \begin{document} \psfrag{AAA}{\(\alpha\)} \includegraphics{fig.eps} \end{document} Finally, I did ps2eps --ignoreBB embed.ps epstopdf embed.eps to create the pdf figure. Converting embed.eps to pdf using cloudconvert.com does seem to work, so I think the problem is caused by either epstopdf or ghostscript. What's going on here? I think this old question is probably related, but there is no example pdf file so it's impossible to be sure. EDIT It seems increasingly likely that something is going wrong at the very last step (eps2pdf conversion). Here is the eps file that is being converted: embed.eps. What's not clear is whether the issue is limited to my own machine (running texlive 2025 under cygwin).

  • \bm makes \dot and \hat of capital letters A-F reset the whole letter to \Gamma
    by Ishan Singh on January 31, 2026 at 2:56 pm

    When using \bm, I can't use \dot and \hat on uppercases A-F (lowercases and the rest of the alphabet are fine), and it instead writes the Gamma character, along with an error message the the value input to \bm was to high. \documentclass{article} \usepackage{amsmath} \usepackage{bm} %this is just the layout of the "table" \newcommand{\layer}[2]{&#1&&\dot #1&&\hat #1&&\widehat #1&&#2&&\dot #2&&\hat #2&&\widehat #2\\&\bm{#1}&&\bm{\dot #1}&&\bm{\hat #1}&&\bm{\widehat #1}&&\bm{#2}&&\bm{\dot #2}&&\bm{\hat #2}&&\bm{\widehat #2}\\} \begin{document} \begin{equation} \begin{aligned} \layer{a}{A}\\ \layer{b}{B}\\ \layer{c}{C}\\ \layer{d}{D}\\ \layer{e}{E}\\ \layer{f}{F}\\ \layer{g}{G} \end{aligned} \end{equation} \end{document} And the console says \layer{a}{A} \\ A mathchar number must be between 0 and 32767. I changed this one to zero. and similar for the other letters B-F.

  • Putting two flowcharts on the same page side by side in Latex
    by Destr on January 31, 2026 at 12:27 pm

    So i have the following code in latex and i'm trying to put these two flowcharts side by side, for some reason i cant do that and instead one is on top of the other , i can't understand what i do wrong. Below is the code and here is the resulting image https://i.sstatic.net/kHcPDRb8.png \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{tikz} \usetikzlibrary{arrows.meta, positioning, calc} \usepackage{xcolor} \usepackage{graphicx} \usetikzlibrary{shapes.geometric, arrows.meta, positioning,calc} \usepackage{algorithm} \usepackage{algorithmic} \begin{document} \begin{figure}[ht] \centering % ================= LEFT DIAGRAM ================= \begin{minipage}[t]{0.30\textwidth} \centering \begin{tikzpicture}[ scale=0.75, transform shape, node distance=1cm, every node/.style={font=\scriptsize}, block/.style={rectangle, draw, rounded corners, minimum width=2.6cm, minimum height=0.7cm, align=center}, adder/.style={circle, draw, minimum size=0.45cm, inner sep=0pt}, arrow/.style={->, thick} ] \tikzset{ inputoutput/.style={block, fill=cyan!40}, linear/.style={block, fill=green!40}, mixup/.style={block, fill=BrickRed!40}, penc/.style={block, fill=purple!40}, cmamba/.style={block, fill=red!40}, rms/.style={block, fill=yellow!40} } \node[inputoutput] (input) {Input}; \node[mixup, above=of input] (mixup) {Channel Mixup}; \node[linear, above=of mixup] (lin1) {Linear}; \node[penc, above=of lin1] (penc) {Positional Encoding}; \node[adder, above=of penc] (add) {$+$}; \node[cmamba, above=of add] (cmamba) {CMamba}; \node[rms, above=of cmamba] (rms) {RMS Norm}; \node[linear, above=of rms] (lin2) {Linear}; \node[inputoutput, above=of lin2] (output) {Output}; \draw[arrow] (input) -- (mixup); \draw[arrow] (mixup) -- (lin1); \draw[arrow] (lin1) -- (penc); \draw[arrow] (penc) -- (add); \draw[arrow] (add) -- (cmamba); \draw[arrow] (cmamba) -- (rms); \draw[arrow] (rms) -- (lin2); \draw[arrow] (lin2) -- (output); \draw[arrow] (input.east) -- ++(1.2,0) |- (add.east); \end{tikzpicture} \caption*{(a) Overall Architecture} \end{minipage} \hfill % ================= RIGHT DIAGRAM ================= \begin{minipage}[t]{0.30\textwidth} \centering \begin{tikzpicture}[ scale=0.7, transform shape, node distance=0.45cm, every node/.style={font=\scriptsize}, block/.style={rectangle, draw, rounded corners, minimum width=3.2cm, minimum height=0.7cm, align=center}, mult/.style={circle, draw, minimum size=0.45cm, inner sep=0pt}, arrow/.style={->, thick} ] \node[block, fill=green!40] (linL) {Linear}; \node[block, fill=RoyalBlue!40, above=of linL] (conv) {Conv1D}; \node[block, fill=magenta!40, above=of conv] (siluL) {SiLU}; \node[block, fill=red!40, above=of siluL] (ssm) {SSM}; \node[block, fill=green!40, right=0.8cm of linL] (linR) {Linear}; \node[block, fill=magenta!40, above=of linR] (siluR) {SiLU}; \node[mult] (mult) at ($(ssm.north)!0.5!(siluR.north) + (0,2cm)$) {$\times$}; \draw[arrow] (linL) -- (conv); \draw[arrow] (conv) -- (siluL); \draw[arrow] (siluL) -- (ssm); \draw[arrow] (linR) -- (siluR); \draw[arrow] (ssm.north) |- (mult.west); \draw[arrow] (siluR.north) |- (mult.east); \node[block, fill=yellow!40, above=0.4cm of mult] (rms2) {RMS Norm}; \draw[arrow] (mult) -- (rms2); \end{tikzpicture} \caption*{(b) CMamba Block (Expanded)} \end{minipage} \caption{Overview of the model architecture and the internal structure of the CMamba block.} \label{fig:cmamba_combined} \end{figure} \end{document}

  • The choice between pdflatex and xelatex, and the use of newcomputermodern
    by Ho Man-Ho on January 31, 2026 at 9:07 am

    It is kind of a short and soft question. Let me provide some background for my question: I am compiling a latex project, which involves a main tex file and more than 100 other tex files with no figures (except for a few simple diagrams) or pictures. The resulting pdf file has more than 600 pages. Initially, I was using pdflatex and newtxtext for font, and to save time for compilation, I put a % for the tex files whenever I am not typing or editing them. However, recently I am more inclined to use NewComputerModern, in particular I like the slightly thicker font. As we know, to use NewComputerModern, we must either use xelatex or lulatex. I chose the former because it seems to be slightly faster than using lulatex, but it is slower than pdflatex. So I ended up spending more time for compliation, especially when I am editing the tex files for the pages of the end of the pdf file. The packages I am using are: amsfonts, amsmath, amscd, amssymb, euscript, amsthm, fancyhdr, pgf, tikz, pgfplots, caption, subcaption, enumitem, thmtools, color, centernot, mathtools, afterpage, amsbsy, systeme, sectsty, multirow, float, tikz-cd, etoolbox, microtype, mathrsfs, fontspec, fncychap, xy, appendix My question is: is there any get around for this problem? I want to minimize the time for compilation while keep looking at NewComputerModern rather than newtxtext. I considered using pdflatex and newtxtext during editing, and xelatex and NewComputerModern right before finish editing. But I think we should be able to do better than this.

  • Is the use of boxes (un)limited? Using boxes instead of an outfile
    by MBE on January 31, 2026 at 8:38 am

    In this file, I use boxes instead of an outfile. \FOXNum=1 %startbox defines the number of the first box, \lastFOXNum=10 defines the last box. The values are optional.(1-10,20-50,1000-4000). \newcount\sections \def\section#1{\vskip\baselineskip\advance\sections by 1{\bf \the\sections \hskip10pt #1}\vskip\baselineskip} \newcount\subsections \def\subsection#1{\vskip\baselineskip\advance\subsections by 1{\bf \the\sections.\the\subsections \hskip10pt #1}\vskip\baselineskip} \font\tinyfont=cmr5 \newcount\start \newcount\maxFOXnum \newcount\lastFOXNum \newcount\FOXNum \FOXNum=1 %startbox \maxFOXnum=\FOXNum \lastFOXNum=10 \newcount\internalNum \def\FOXName#1{\advance\internalNum by 1 \setbox\the\FOXNum\hbox to \hsize{ \the\sections.\the\subsections \hskip10pt F\the\internalNum. #1 \hfill \the\pageno}\advance\FOXNum by 1} \def\FOXnotes#1{ \start=\maxFOXnum \advance\lastFOXNum by 1 \vskip4\baselineskip\hrule \vskip\baselineskip #1 \vskip\baselineskip \loop \ifnum\start<\the\lastFOXNum \box\the\start %\vskip0.5\baselineskip \advance\start by 1 \repeat \start=\FOXNum} \section{FOX}``Good morning\FOXName{I just came by.}'', said the FOX. ''I never thought to be here with you.\FOXName{Glad if you could stay with me.}'' \subsection{Rabbit} ``Nice to have you'' said the RABBIT, ``We all hope the best.''\FOXName{No use to be worried, I just had my breakfast.} \FOXnotes{FOXnotes} \bye

  • How may I replace the name(s) of definition(s)?
    by MBE on January 31, 2026 at 8:12 am

    In this example, notes are defined. Here as "FOXName{xy}". By replacing FOX with another word,I can define as many note-routines as I like, f.e "RABBITName{xy}" How may I do this inside a definition? P.S. (I am using boxes instead of an outfile, this will be subject for another question). \newcount\sections \def\section#1{\vskip\baselineskip\advance\sections by 1{\bf \the\sections \hskip10pt #1}\vskip\baselineskip} \newcount\subsections \def\subsection#1{\vskip\baselineskip\advance\subsections by 1{\bf \the\sections.\the\subsections \hskip10pt #1}\vskip\baselineskip} \font\tinyfont=cmr5 \newcount\start \newcount\maxFOXnum \newcount\lastFOXNum \newcount\FOXNum \FOXNum=1 %startbox \maxFOXnum=\FOXNum \lastFOXNum=10 \newcount\internalNum \def\FOXName#1{\advance\internalNum by 1 \setbox\the\FOXNum\hbox to \hsize{ \the\sections.\the\subsections \hskip10pt F\the\internalNum. #1 \hfill \the\pageno}\advance\FOXNum by 1} \def\FOXnotes#1{ \start=\maxFOXnum \advance\lastFOXNum by 1 \vskip4\baselineskip\hrule \vskip\baselineskip #1 \vskip\baselineskip \loop \ifnum\start<\the\lastFOXNum \box\the\start %\vskip0.5\baselineskip \advance\start by 1 \repeat \start=\FOXNum} \section{FOX}``Good morning\FOXName{I just came by.}'', said the FOX. ''I never thought to be here with you.\FOXName{Glad if you could stay with me.}'' \subsection{Rabbit} ``Nice to have you'' said the RABBIT, ``We all hope the best.''\FOXName{No use to be worried, I just had my breakfast.} \FOXnotes{FOXnotes} \bye

  • Best practice for structuring a long thesis with \input
    by palloc on January 31, 2026 at 8:11 am

    I am about to start writing my thesis, which will be a fairly long document. I would like to organize the project in a clean and maintainable way using. This is what I came up with, is it good, or is there a better way? main.tex \documentclass{report} \usepackage{geometry} \usepackage{lipsum} \usepackage[backend=biber,style=ieee]{biblatex} \addbibresource{bib.bib} \usepackage[colorlinks]{hyperref} \begin{document} \input{titlepage/titlepage} \tableofcontents \input{1.a/a} \input{2.b/b} \printbibliography[heading=bibintoc] \listoffigures \addcontentsline{toc}{chapter}{List of Figures} \listoftables \addcontentsline{toc}{chapter}{List of Tables} \appendix \input{appendix/appendixA} \input{appendix/appendixB} \end{document} titlepage.tex \lipsum[1-2] a.tex \chapter{First} \input{1.a/a1} \input{1.a/a2} a1.tex \section{section} \cite{knuth1984texbook} \begin{figure} \caption{fig} \end{figure} \begin{table}[] \caption{tab} \end{table} \lipsum[1-2] a2.tex \section{section} \lipsum[1-2] b.tex \chapter{Second} \input{2.b/b1} \input{2.b/b2} b1.tex \section{section} \lipsum[1-2] b2.tex \section{section} \lipsum[1-2] appendixA.tex \chapter*{Appendix A} \addcontentsline{toc}{chapter}{Appendix A} \lipsum[1-2] appendixB.tex \chapter*{Appendix B} \addcontentsline{toc}{chapter}{Appendix B} \lipsum[1-2] bib.bib @book{knuth1984texbook, title={The texbook}, author={Knuth, Donald Ervin and Bibby, Duane}, volume={15}, year={1984}, publisher={Addison-Wesley Reading} }

  • How to get rid of the double quotation mark produced by `\string\eta`?
    by YCH817 on January 31, 2026 at 7:20 am

    Trying to implementing this : \RegistVarType{obj}BG{pink}Font{\sf} will produce a command named \obj, \obj c will display a "c" in \sf font with pink background color; also, \RegistVarType{ntf}BG{LightBlue}Font{} will produce a command named \ntf, \ntf \eta will display a "\eta" with LightBlue background color. \RegistVarFreqType{obj}Disp{c}ppppp.... will produce a series of command, \objcp will produce c', \objcpp will produce c'', \objcpn1 will produce c'_1, \objcpppn2 will produce c'''_2 , ... ; However I am stuck at dealing with \RegistVarFreqType{ntf}Disp{\eta}pppp..... : my idea is to use \string command to get rid of the backslash and obtain eta , but the \string\eta will produce something like “eta thing . How to get rid of the double quotation mark ? Here is my implementation : \documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{mathtools} \usepackage[ dvipsnames, svgnames, table ]{xcolor} \begin{document} \let\xpndaft=\expandafter \let\ncm=\newcommand \let\rcm=\renewcommand % ----- \let\ph=\phantom \let\hph=\hphantom \let\vph=\vphantom \let\mrel=\mathrel \let\mbin=\mathbin \let\mop=\mathop \let\mllap=\mathllap % \let\mrlap=\mathrlap % \let\mclap=\mathclap % \def\vts#1{\lvert#1\rvert} \def\prs#1{\left(#1\right)} \def\bcs#1{\left\{#1\right\}} \def\bks#1{\left[#1\right]} \def\plr#1{\vph{(fg)}\smash{#1}} % pillar \def\etc{\plr{\rm etc}} % stands for "..." \def\occ{\plr{\tt\_}} % \makeatletter \def\RegistVarType#1BG#2Font#3{ \colorlet{color#1}{#2} \xpndaft\newif\csname ifColorVarType#1\endcsname % check whether the highlighting is enable \xpndaft\def\csname #1\endcsname##1{% \setlength{\fboxsep}{0pt}% \setlength{\fboxrule}{0pt}% \let\RegistVarTypeCache=\relax \csname ifColorVarType#1\endcsname{% \gdef\RegistVarTypeCache{\colorbox{color#1}}% }\else{% \gdef\RegistVarTypeCache{\fbox}% }\fi% \RegistVarTypeCache{\ensuremath{\plr{#3 ##1}}}% } \csname ColorVarType#1true\endcsname % enable the highlighting in default } \makeatletter \def\RegistVarFreqType#1Disp#2{% \xpndaft\def\csname #1#2\endcsname{% \csname #1\endcsname{{#2}^{}}% } \xpndaft\def\csname #1#2n\endcsname##1{% \csname #1\endcsname{{#2}_{##1}^{}}% } \@ifnextchar p {\RegistVarFreqType@Loop{#1}{#2}{p}{'}} {\relax} } \def\RegistVarFreqType@Loop#1#2#3#4p{% \xpndaft\def\csname #1#2#3\endcsname{% \csname #1\endcsname{{#2}{#4}}% } \xpndaft\def\csname #1#2#3n\endcsname##1{% \csname #1\endcsname{{#2}_{##1}{#4}}% } \@ifnextchar p {\RegistVarFreqType@Loop{#1}{#2}{#3p}{#4'}} {\relax} } \makeatother \RegistVarType{obj}BG{pink}Font{\sf} % create command \obj \RegistVarType{ntf}BG{LightBlue}Font{} % create command \ntf \RegistVarFreqType{obj}Disp{c}ppppp \RegistVarFreqType{ntf}Disp{η}ppppp $\objc$ , $\objcpp$ , $\objcppp$ , $\objcppppp$ , $\objcppn1$ , $\objcpn2$ \end{document}

  • How to check if pdfmanagement tools are loaded are not in *a stable way*?
    by Niranjan on January 31, 2026 at 5:24 am

    Of course, one can check \IfPackageLoadedTF{pdfmanagement-testphase}{true}{false}, but since the name has testphase, I assume that some day it will go. If I use this test in a package, some day it will produce the exact opposite result as the package pdfmanagement-testphase will not be loaded despite having used \DocumentMetadata. So I was thinking if something more stable can be used as a test? I understand that most of the stuff is experimental and can be expected to change, but if there is something in the current code that is planned to be sustained during the development, I would like to build my test around it. Is there a way to check if pdfmanagement was used?

  • How to tweak this inline chemical equation in a uniform framework?
    by Explorer on January 30, 2026 at 2:52 pm

    What I want to typeset is something as below inline: Here below is my (ugly) attempt: \documentclass{article} \usepackage{lipsum} \usepackage{chemfig} \usepackage[version=4]{mhchem} \usepackage{extarrows} % https://tex.stackexchange.com/a/267541/322482 \makeatletter \DeclareRobustCommand{\textsupsub}[2]{{% \m@th\ensuremath{% ^{\mbox{\fontsize\sf@size\z@#1}}% _{\mbox{\fontsize\sf@size\z@#2}}% }% }} \makeatother \begin{document} \lipsum[2][1-6] HCHO + SO\textsupsub{2--}{3} + H\textsuperscript{+} $\xlongequal{\phantom{xxx}}$ \chemfig[atom sep=2em]{HO-[:30]-[:-30]S(=[:-120]O)(=[:60]O)-[:-30]O\rlap{${}^-$}} \lipsum[3][1-5] \ce{HCHO + SO_3^2- + H^+} $\xlongequal{\phantom{xxx}}$ \chemfig[atom sep=2em]{HO-[:30]-[:-30]S(=[:-120]O)(=[:60]O)-[:-30]O\rlap{${}^-$}} \lipsum[2] \end{document} which combined with: text mode's formula abruptly \xlongequal with abrupt \phantom chemfig which is not properly coordinated in length I wonder is that mechem or chemfig that could typeset this chemical equation in a uniform package framework, instead of composed of multiple isolated parts.

  • Macro with mandatory argument in xint (xintexpr)
    by cis on January 30, 2026 at 12:30 pm

    This is my first time using of xint.sty; therefore, I have a few questions: (1) Is \NewDocumentCommand{\sn}{m}{ subsn(expr, var1=value1; var2=#1) } ​​the correct way to define a macro with a mandatory argument for xint? Or does xint provide its own method? (2) The defined command \sn{*} works. However, I can't say \def\x{0.61} \sn{\x}. What do I need to do? \documentclass[margin=10mm, varwidth]{standalone} \usepackage{xintexpr} \begin{document} \section{Test with \texttt{xint}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Is this the correct way to create a xint-macro? %%%%%%%% \NewDocumentCommand{\sn}{m}{% Normal Distr. (with max error of 1.2e-7) \xintieval[5]{subsn(% 'simultaneous substitutions' 0.5 * (2-h*exp( -0.5*x^2 -1.26551223 +1.00002368*h +0.37409196*h^2 +0.09678418*h^3 -0.18628806*h^4 +0.27886807*h^5 -1.13520398*h^6 +1.48851587*h^7 -0.82215223*h^8 +0.17087277*h^9) ), h=1/(1+0.25*sqrt(2)*x); x=#1 )}} \subsection{Direct input \textbackslash sn\{0.61\} - works} sn(0.61) = \sn{0.61} \def\x{0.61} \subsection{Direct input \textbackslash sn\{\textbackslash x\} - works not} sn(\x) = % \sn{\x} \end{document}

  • Too much space after prime
    by bubba on January 30, 2026 at 10:38 am

    When I write M'(t) or H''(t) to denote derivatives, I get an unpleasantly large space between the "prime" symbol and the parenthesis. I'm wondering if I perhaps have a corrupted font. Or do people think the output is good and as expected, and my tastes are weird? Second question: what's the best way to fix this? \documentclass{article} \begin{document} $$ \mathbf{M}'(t) = \mathbf{H}''(t) $$ \end{document}

  • Calculate values ​of standard normal distribution table as macro
    by cis on January 30, 2026 at 9:18 am

    I calc values of the Standard normal table (with 5-digit accuracy). So I wrote a calculation with numerica.sty (using approximate values ​​of the error function). This works so far; if I put in a concrete value like ... [..., x=0.61]. But I would like to have this as a macro, say \sn{<#1>}, for example \sn{0.61} → 0.72907. I tried to put the whole thing into a newcommand, but this seems to be not that easy. I'd like to implement this inside pdflatex, using a package (not Lua, Mathematica, etc.). I've implemented it here using the numerica package because it worked without problems (including the use of the help-variable h, see MWE). However, I'm not sure if numerica is the best choice. The xintexpr package seems promising, but I'm currently unclear on its syntax. In any case: if anyone knows of a better implementation using a different package (e.g., xint.sty), it would be nice too. \documentclass[margin=10mm, varwidth]{standalone} \usepackage{numerica} \begin{document} \section{Test with \texttt{numerica}} \xdef\x{0.61} sn(\x) = \eval*{% 0.5 (2-h \exp( -0.5 x^2 -1.26551223 +1.00002368 h +0.37409196 h^2 +0.09678418 h^3 -0.18628806 h^4 +0.27886807 h^5 -1.13520398 h^6 +1.48851587* h^7 -0.82215223 h^8 +0.17087277 h^9)) }[h=1/(1+0.25*\sqrt{2}*x), x=0.61% cannot use \x here 🙁 ][5] \section{Test with \texttt{xint}} ... ? .... \end{document}

  • Best ways to calculate sums in LaTeX
    by cis on January 28, 2026 at 2:13 pm

    In many computer algebra systems, one can sum a sequence of numbers using the syntax sum(a(k), k, kStart, kEnd) for a sequence a(k) (of real and integer values) with the variable k. What's the best and fastest way to do this with LaTeX? For example, when you want to calculate thousands of values ​​for a table. I've developed a MWE using foreach and fpeval. \documentclass[margin=5pt, varwidth]{standalone} \usepackage{amsmath} \usepackage{tikz} \newcommand\Sum[4]{% \def\mysum{0}% \foreach #2 in {#3,...,#4}{% \def\psum{\fpeval{(#1)}}% \xdef\mysum{\fpeval{\mysum+\psum}}% }\mysum} \begin{document} Test 1: $\displaystyle\sum\limits_{k=1}^{100} k = \Sum{\k}{\k}{1}{100}$ \newcommand\binomial[2]{\fpeval{fact(#1)/(fact(#2)*fact(#1-#2))}} Test 2: $\displaystyle\sum\limits_{k=0}^{5} \dbinom{5}{k} = \Sum{ \binomial{5}{\k} }{\k}{0}{5} =2^5 = \fpeval{2^5}$ \end{document}

  • Showcase of beautiful 'electrical circuit diagrams' done in TeX & friends
    by cis on January 27, 2026 at 7:03 am

    When I saw this thread How to customize CircuiTikz ac - dc symbols or this one Showcase of beautiful typography done in TeX & friends, I had the idea to add a showcase for electrical circuit diagrams. The package would typically be circuitikz. Feel free to post your large, small, or elegant circuit diagrams here in the community wiki. (I will also add some examples occasionally.) Attach your codes (if possible); this would be a great opportunity to learn from your coding and your style. \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors] \draw[] (0,0) to[R=$R_1$, a_=$1\Omega$, name=R1, invert] (3,0); \end{circuitikz} \end{document}