• Tabularx column type X not working with revtex document class [duplicate]
    by J_mu on July 5, 2025 at 8:49 pm

    Below is a minimal example that shows the problem. I get an error if I try to use the tabularx environment with column type X together with revtex. If I change the column type to c, or the document class to e.g. article, I am able to produce an output. I found people having a similar problem a few years ago (see here and here) but that was only for older versions of revtex, they solved it by using a newer version which doesn't work for me. Interestingly, it works when compiling with Overleaf, but I get the error using MacTex and TeXShop. All packages are updated using Tex Live utility. I am puzzled where this problem comes from and what else to try. \documentclass[10pt]{revtex4-2} % same problem for revtex4-1, but no problem for article \usepackage{xltabular} \usepackage{booktabs} \begin{document} \begin{table} \begin{tabularx}{0.5\textwidth}{X X} % if we use "c c" there is no problem \toprule column 1 & column 2 \\ \midrule example 1 & example 2 \\ \bottomrule \end{tabularx} \end{table} \end{document}

  • \usepackage{cuted} causes failure
    by crayman9 on July 5, 2025 at 8:24 pm

    I'm simply trying to use the "cuted" package and it won't compile. Here's a sample code: \documentclass[twocolumn]{article} \usepackage{cuted} \begin{document} test \end{document} I'm trying to compile with TeXworks using pdfLaTeX and get the following messages: This is pdfTeX, Version 3.141592653-2.6-1.40.25 (MiKTeX 24.1) (preloaded format=pdflatex.fmt) restricted \write18 enabled. entering extended mode (trash.tex LaTeX2e <2023-11-01> patch level 1 L3 programming layer <2024-01-04> (C:\Users\Dan\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls Document Class: article 2023/05/17 v1.4n Standard LaTeX document class (C:\Users\Dan\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo)) (C:\Users\Dan\AppData\Local\Programs\MiKTeX\tex/latex/sttools\cuted.sty LaTeX Warning: You have requested release `2025/06/01' of LaTeX, but only release `2023-11-01' is available. ) (C:\Users\Dan\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-pdfte x.def) (trash.aux) ! Undefined control sequence. \@makecol ... \box \@cclv \@outputbox@removebskip \else \setbox \@outputbox ... l.8 \end{document} ? I've used tons of packages and this is the first I've tried that totally fails. Any idea what's going on?

  • How to set bera font after a certain point in a tex file?
    by Akira on July 5, 2025 at 8:00 pm

    I have a tex file: \documentclass{article} %\usepackage{bera} \newcommand*{\myfont}{\fontfamily{fve}\selectfont} \begin{document} \section{Introduction} We will give a literature review here. \selectfont \section{Preliminary} We will collect related techniques here. \end{document} I would like to use bera font starting from \section{Preliminary}. Following this answer, I use the command \newcommand*{\myfont}{\fontfamily{fve}\selectfont}, but to no avail. Could you explain how to obtain my desired result? From the documentation,

  • Using `evaluate` and `using` in nested Tikz-loop
    by Gerhard on July 5, 2025 at 7:40 pm

    How can I use \evaluate and using within a nested loop, where several loop indices are used? The following code does not work. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x in {0,1,...,9} \foreach \y [evaluate=\y as \p using {\x+\y*10}] in {0,1,...,9} \node [fill=red!\p!yellow, minimum size=0.65cm] at (\x,\y) {\p}; \end{tikzpicture} \end{document}

  • How do I add a second top element to my forest in latex
    by Zilore Mumba on July 5, 2025 at 7:34 pm

    In drawing of my directory structure, I am able to do what I want in tikz. However I would like to do the same using the forest package. As in the attached image, the forest output is ok, except I am not able to include the Build directory at the top. My code below. \documentclass[12pt,twoside,fleqn]{report} \usepackage{tikz} \usetikzlibrary{tikzmark} \usepackage{tikz-3dplot} \usepackage{tikz-3dplot} \usetikzlibrary{shapes.geometric, decorations.pathreplacing, matrix, angles, quotes, arrows, arrows.meta, datavisualization,cd} \usetikzlibrary{through,calc,intersections} \usepackage{forest} \begin{document} \begin{tikzpicture}[node distance=2cm, scale=0.5] \tikzstyle{process} = [rectangle, minimum width=2.0cm, minimum height=1cm, text centered, text width=2.0cm, draw=black, fill=orange!30] \node (proc0) [process, xshift=-8cm] {Build}; \node (proc1) [process, right of=proc0, xshift=1.0cm] {DA}; \node (proc2) [process, below of=proc1, yshift=-0.5cm] {WRF}; \node (proc3) [process, below of=proc2, xshift=-2.0cm,yshift=-1.0cm] {run}; \node (proc4) [process, right of=proc3, xshift=2.0cm] {test}; \node (proc5) [process, below of=proc3, xshift=4cm] {em\_real}; \node (proc6) [process, right of=proc2, xshift=1.0cm] {WPS}; \node (proc7) [process, right of=proc6, xshift=1.0cm] {WRFPLUS}; \node (proc8) [process, right of=proc7, xshift=1.0cm] {3DVAR}; \node (proc9) [process, right of=proc8, xshift=1.0cm] {4DVAR}; \draw [black,thick] (proc0) -- (proc1); \draw [black] (proc1) -- (proc2); \draw [black] (proc2) -- (-10,-11); \draw [black] (proc4) -- (proc5); \draw [black] (proc3) -- (proc4); \draw [black] (proc2) -- (proc6); \draw [black] (proc6) -- (proc7); \draw [black] (proc7) -- (proc8); \draw [black] (proc8) -- (proc9); \end{tikzpicture}\par \bigskip \begin{forest} for tree={ draw, font=\sffamily\bfseries, edge path={ \noexpand\path[draw, \forestoption{edge}] (!u.parent anchor) -- +(0,-5mm) -| (.child anchor)\forestoption{edge label}; }, parent anchor=south, child anchor=north, l sep=10mm, tier/.wrap pgfmath arg={tier #1}{level()}, edge={ultra thick, rounded corners=2pt}, ultra thick, inner color=blue, outer color=gray!20, rounded corners=2pt, s sep=1.0cm, minimum width=1.8cm, minimum height=0.6cm, } [DA [WPS] [WRF [\color{green}run] [\color{orange}test [\color{green}em\_real] ] ] [WRFPLUS] [3DVAR] [4DVAR] ] \end{forest} \end{document} Is it possible to include "Build" in the forest version? Help please.

  • Trying to get good floating behavior for figure in two column document
    by crayman9 on July 5, 2025 at 7:06 pm

    I have a two-column document that contains a figure spanning the width of both columns. I've added the figure at a point near the top of the 2nd page (after word "Important"). There's plenty of space to put the figure at the bottom of that page, but it ends up at the top of the 3rd page. In general, how can I get good floating behavior in this environment: if there's room on the current page, it should be placed on the bottom of the page; if not, at the top of the next page. \documentclass[twocolumn]{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepackage{lipsum} \begin{document} \lipsum[1-11] \textbf{Important:} \begin{figure*}[t] \centering \begin{tikzpicture} \begin{axis}[ width=\textwidth, height=0.8\textwidth, axis lines=none, ticks=none, scale only axis, xmin=0, xmax=1, ymin=0, ymax=1, clip=false ] \draw[thick] (axis cs:0,0) rectangle (axis cs:1,1); \end{axis} \end{tikzpicture} \end{figure*} \lipsum[12-28] \end{document}

  • Redefine quote environment to avoid splitting on page breaks
    by Vincent ISOZ on July 5, 2025 at 6:55 pm

    For my LaTeX book i use the following code for quotes: \documentclass[12pt,a4paper,openright]{article} \usepackage{amsmath,amsthm,amssymb,amsfonts,tkz-linknodes} \usepackage[table,xcdraw]{xcolor} \usepackage{lipsum} %----------------------------- %fancy unnumbered quotes starts here \newcommand{\newumargnote}[1]{\marginnote{\setstretch{.6}\parbox[t]{\marginparwidth}{\emph{#1}}}} \definecolor{quotemark}{gray}{0.7} \makeatletter \def\fuquote{% \@ifnextchar[{\fuquote@i}{\fuquote@i[]}%] }% \def\fuquote@i[#1]{% \def\tempa{#1}% \@ifnextchar[{\fuquote@ii}{\fuquote@ii[]}%] }% \def\fuquote@ii[#1]{% \def\tempb{#1}% \@ifnextchar[{\fuquote@iii}{\fuquote@iii[]}%] }% \def\fuquote@iii[#1]{% \def\tempc{#1}% \vspace{0.4em}% \noindent% \begin{list}{}{% \setlength{\leftmargin}{0.1\textwidth}% \setlength{\rightmargin}{0.1\textwidth}% }% \item[]% \begin{picture}(0,0)% \put(-15,-5){\makebox(0,0){\scalebox{3}{\textcolor{quotemark}{''}}}}% \end{picture}% \begingroup\itshape}% \def\endfuquote{% \endgroup\par% \makebox[0pt][l]{% \hspace{0.8\textwidth}% \begin{picture}(0,0)(0,0)% \put(15,15){\makebox(0,0){% \scalebox{3}{\color{quotemark}''}}}% \end{picture}}% \ifx\tempa\empty% \else% \ifx\tempc\empty% \hfill\rule{110pt}{0.5pt}\\\mbox{}\hfill\tempa\ \emph{\tempb}% \else% \hfill\rule{110pt}{0.5pt}\\\mbox{}\hfill\tempa\ \emph{\tempb}\ \tempc% \fi\fi\par% %\vspace{0.4em}% \end{list}% }% \makeatother %----------------------------- \begin{document} \setlength{\parskip}{12pt} bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla \begin{fuquote}We don't debunk lies to convince the liars, we debunk lies to educate other people that lies aren't going unchallenged! \end{fuquote} \end{document} It works great. However we i call it sometimes the quote is broken between two pages as illustrated here: How can i avoid this?

  • How can unexpected vertical spacing caused by a TikZ picture inside a subfigure be eliminated?
    by user405302 on July 5, 2025 at 5:30 pm

    Edit: The missing boost.tex and boost_new.tex files have been included, the figure was updated to show bounding boxes and baselines, and the original figure code is replaced with a minimal main.tex script for reproducibility as requested in the comments. I'm encountering unexpected vertical spacing when placing different TikZ pictures, created with the CircuitTikz package, in a single figure environment as can be seen in the top row of the figure. This issue does not occur when both TikZ pictures on the same row are identical as can be seen in the bottom row of the figure. Both TikZ pictures occupy approximately the same dimensions, around 5.25 by 5 units in coordinate space, so I assumed they would have approximately the same bounding box dimensions. I tried using \resizebox{\linewidth}{!}{\input{...}, but this had no effect on the vertical alignment. This led me to believe the issue is not related to relative sizes, though I am not certain. I have not found a solution in the forums so far. If one does exist, apologies for missing it. For reference, the relevant code: main.tex: \documentclass{article} \usepackage{tikz} \usepackage{subcaption} \usepackage{circuitikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{figure}[htbp] \centering \begin{subfigure}[b]{0.45\textwidth} \centering \input{boost.tex} \caption{Subcaption 1.} \label{fig:subref1} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \input{boost_new.tex} \caption{Subcaption 2.} \label{fig:subref2} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \input{boost.tex} \caption{Subcaption 3.} \label{fig:subref3} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \input{boost.tex} \caption{Subcaption 4.} \label{fig:subref4} \end{subfigure} \caption{Caption.} \label{fig:ref} \end{figure} \end{document} boost.tex: \begin{tikzpicture} \begin{circuitikz}[american] \pgfmathsetmacro{\hor}{1.5} \pgfmathsetmacro{\ver}{2.5} \pgfmathsetmacro{\compW}{1} \pgfmathsetmacro{\relhD}{\ver} \pgfmathsetmacro{\wCin}{\compW} \pgfmathsetmacro{\wL}{\compW} \pgfmathsetmacro{\wD}{\compW} \pgfmathsetmacro{\wR}{\compW/2} \pgfmathsetmacro{\endxCin}{\wCin*\hor} \pgfmathsetmacro{\endxL}{\endxCin + \wL*\hor} \pgfmathsetmacro{\endxD}{\endxL + \wD*\hor} \pgfmathsetmacro{\endxR}{\endxD + \wR*\hor} \pgfmathsetmacro{\hD}{\ver + \relhD} % Input PV source and capacitor \draw (0,0) to[pvmodule] (0,\ver) -- (\endxCin,\ver) to[C, l_=$C_{in}$] (\endxCin,0) -- (0,0); % Inductor branch \draw (\endxCin,\ver) to[L, l_=$L_1$] (\endxL,\ver); % Switch branch \draw (\endxL,\ver) to[switch, l=$S_1$] (\endxL,0) -- (\hor,0); % Diode branch \draw (\endxL,\ver) -- (\endxL, \hD) to[D*, l_=$D_1$] (\endxD, \hD); % Output capacitor and load \draw (\endxD, \hD) to[C, l_=$C_{out}$] (\endxD, 0) -- (\endxL,0); \draw (\endxD, \hD) -- (\endxR,\hD) to[R, l=$R$] (\endxR,0) -- (\endxD, 0); % nodes \fill (\endxCin,\ver) circle (2pt); \fill (\endxL,\ver) circle (2pt); \fill (\endxD,\hD) circle (2pt); \fill (\endxCin,0) circle (2pt); \fill (\endxL,0) circle (2pt); \fill (\endxD,0) circle (2pt); \end{circuitikz} \draw[red] (current bounding box.south west) rectangle (current bounding box.north east); \end{tikzpicture} \hfill\llap{\rule{\linewidth}{0.5pt}} boost_new.tex: \begin{tikzpicture} \begin{circuitikz}[american] \pgfmathsetmacro{\hor}{1.5} \pgfmathsetmacro{\ver}{2.5} \pgfmathsetmacro{\compW}{1} \pgfmathsetmacro{\relhD}{0} \pgfmathsetmacro{\wCin}{\compW} \pgfmathsetmacro{\wL}{\compW} \pgfmathsetmacro{\wD}{\compW} \pgfmathsetmacro{\wR}{\compW/2} \pgfmathsetmacro{\endxCin}{\wCin*\hor} \pgfmathsetmacro{\endxL}{\endxCin + \wL*\hor} \pgfmathsetmacro{\endxD}{\endxL + \wD*\hor} \pgfmathsetmacro{\endxR}{\endxD + \wR*\hor} \pgfmathsetmacro{\hD}{\ver + \relhD} % Input PV source and capacitor \draw (0,-\ver) to[pvmodule] (0,\ver) -- (\endxCin,\ver) to[C, l_=$C_{in}$] (\endxCin,0) -- (\endxCin,0) to[C, l_=$C_{in}$] (\endxCin,-\ver) -- (0,-\ver); % Inductor branch \draw (\endxCin,\ver) to[L, l_=$L_1$] (\endxL,\ver); \draw (\endxCin,-\ver) to[L, l^=$L_2$] (\endxL,-\ver); % Switch branch \draw (\endxL,\ver) to[switch, l_=$S_1$] (\endxL,0) -- (\hor,0); \draw (\endxL,0) to[switch, l_=$S_2$] (\endxL,-\ver); % Diode branch \draw (\endxL,\ver) -- (\endxL, \hD) to[D*, l_=$D_1$] (\endxD, \hD); \draw (\endxD, -\ver) to[D*, l_=$D_2$] (\endxL, -\ver); % Output capacitor and load \draw (\endxD, \hD) to[C, l_=$C_{out}$] (\endxD, 0) -- (\endxL,0); \draw (\endxD, 0) to[C, l_=$C_{out}$] (\endxD, -\ver); \draw (\endxD, \ver) -- (\endxR, \ver); \draw (\endxD, \ver) -- (\endxR, \ver); \draw (\endxD, \hD) -- (\endxR,\hD) to[R, l=$R$] (\endxR,-\ver) -- (\endxD, -\ver); \fill (\endxCin,\ver) circle (2pt); \fill (\endxL,\ver) circle (2pt); \fill (\endxD,\ver) circle (2pt); \fill (\endxCin,0) circle (2pt); \fill (\endxL,0) circle (2pt); \fill (\endxD,0) circle (2pt); \fill (\endxCin,-\ver) circle (2pt); \fill (\endxL,-\ver) circle (2pt); \fill (\endxD,-\ver) circle (2pt); \end{circuitikz} \draw[red] (current bounding box.south west) rectangle (current bounding box.north east); \end{tikzpicture} \hfill\llap{\rule{\linewidth}{0.5pt}}

  • how to remove header from some pages or chapters, legrand orangebook
    by SDe on July 5, 2025 at 3:27 pm

    I am using legrand orangebook for my thesis. It has usual Chapter headings for the 1st page of a chapter and usual headers for odd and even pages. For addendum chapter (which addresses reviewer comments) I need: a) only page number in header (how to begin the page numbering as 1, 2 and so on for this chapter) As I don't need chapter or section number so I have used in main.tex \usechapterimagefalse \thispagestyle{empty} \chapter*{Addendum} \input{ch8_addendum.tex} and in the file ch8_addendum.tex I have \section*{Purpose of the Addendum}. However, table numbers are shown as "Table 7.1: name of table", where "7" in "7.1" is the previous chapter number. Please help me .... Thank You.

  • In Lua, is there a way to require a file and drop the prefixes?
    by Jasper on July 5, 2025 at 3:02 pm

    I have made a lua module with a prefix (i.e., a file which returns a localized table). I can require this file from other file, and use the commands. However, I'd like not to use the prefix. Is there a way to require a file and drop the prefixes? I would like for the commands to remain local to the documents they are loaded in, and not make them global. -- test.lua local test = {} function test.func() print(7) end return test -- test_2.lua local test = require "test" test.func() -- I want to just call func() The reason for me asking is because I'm trying to get the user to input lua functions from tex, without using globals. In this way, the syntax will be similar enough to pgfmath that the user wont feel too unfamiliar.

  • pgfplots: Using color of colormap after another color is already selected
    by schtandard on July 5, 2025 at 2:20 pm

    Using the key color of colormap I can pick a plotting color from any existing colormap. However, this does not seem to work when a color has already been explicitly set. In the following example I try to set the color using the key three times, this should result in green plots. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis} \addplot+ [color of colormap=800 of viridis] {0}; \addplot [color of colormap=800 of viridis] {x}; \addplot [color=red, color of colormap=800 of viridis] {2 * x}; \end{axis} \end{tikzpicture} \end{document} In the first plot, the key has no effect at all. In the second plot it works, but I have to sacrifice all presets (like the markers in this example). In the third plot, it again does not have an effect. Why is this happening? How can I pick a color using color of colormap after another color has already been set?

  • `Biblatex` punctuation control for citations. Something like ‘Shortcitation, cit., [running text sentence continues]’
    by Francesco Contini on July 5, 2025 at 2:18 pm

    Is it possible, in biblatex, to impose a comma at the end of citation commands (just for a specific type of entry, e.g. @misc)? See an input example. La \cite{legge241-1990} è una delle più importanti del diritto amministrativo. See the desired output example. Premise I am looking for a solution that ensures compliance with a crucial italian logical analysis rule concerning punctuation and verbs: a comma must not separate the subject from the verb, nor the verb from its direct object. Another important rule is that, when parenthetical remarks are introduced with a comma, they should always be closed with another comma, unless followed by a full stop or another strong punctuation mark (such as a colon or semicolon), or if they are themselves a parenthetical remark. Fact Legal entries are typically formatted as a string with multiple fields. Essentially, this string is composed of several parts: authority, title + date, and the number. There are no commas between the first and second parts, unless the first part is complex. Instead, a comma is used between the second and third parts. On the other hand, verbose citation styles often abbreviate subsequent citations by using the string ‘cit.’ For any citation style that requires ‘cit.’ to be introduced by a comma (e.g., ‘Author, Short title, cit.’), grammatical rules dictate that while the sentence with a subsequent citation can continue, the ‘cit.’ string — already introduced by a comma — must be followed by another comma. Problem Biblatex does not automatically close the ‘cit.’ string with a second comma when it's introduced by a first comma. Furthermore, the package does not provide this functionality for legal entries, where the third part is introduced by a comma, but not subsequently closed with a second one. Legal entries also use the ‘cit.’ string in subsequent citations. I have a legal citation style similar to the one exemplified in the provided MWE. I am currently unable to implement these punctuation rules to ensure the running text appears as shown in section 2. Please, note that I manually added three commas in my example. While a writer could, of course, manually input something like ‘The \cite{key-x}, is good’ to get the comma I am looking for, I think this approach is highly undesirable. It is crucial to find the correct biblatex command to automate this, instead. P.S. Of course, the problem is likely more complex. For example, another issue is: What if a citation is followed by a parenthetical element before the main sentence continues? How can punctuation accuracy be guaranteed in such cases? In my view of fair (or plain) writing, it would be preferable to place such parenthetical asides at the end of the sentence. If it's truly necessary to embed them within the sentence, then the author should manually verify their punctuation accuracy. Here you are my MWE. \begin{filecontents*}{\jobname.bib} @misc{act1, title={\autocap{a}ct}, date={2025-01-07}, number={1}} @misc{act2, title={\autocap{a}ct}, date={2025-01-08}, number={2}} @misc{act3, title={\autocap{a}ct}, date={2025-07-04}, number={85}} @misc{case1, author={{\autocap{C}ourt of Cass\adddot}}, nameaddon={criminal chamber}, title={\autocap{s}entence}, date={2025-03-03}, number={1}} \end{filecontents*} \documentclass{article} \usepackage{color} \usepackage[style=verbose-trad1,alldates=short]{biblatex} \addbibresource{\jobname.bib} \renewcommand*{\newunitpunct}{\addcomma\space} \DefineBibliographyStrings{english}{% opcit={cit\adddot},} \DeclareBibliographyDriver{misc}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \ifnameundef{author}% {}% {\printnames{author}% \newunit% \printfield{nameaddon}% \newunit}% \printfield[default]{title}% \setunit{\addspace}% \usebibmacro{date}% \newunit% \bibstring{number}% \setunit{~}% \printfield{number}% \newunit\newblock% \usebibmacro{addendum+pubstate}% \setunit{\bibpagerefpunct}\newblock% \usebibmacro{pageref}% \newunit\newblock% \usebibmacro{finentry}} \newbibmacro*{cite:misc}{% \ifciteseen% {\ifnameundef{author}% {}% {\printnames{author}% \newunit}% \printfield[default]{title}% \setunit{\addspace}% \printfield{number}% \setunit{\addslash}% \printfield{year}% \newunit% \bibstring{opcit}}% {\usebibmacro{cite:full}}} \renewbibmacro*{cite}{% \ifentrytype{misc}% {\bibhypertarget{cite\the\value{instcount}}{% \usebibmacro{cite:misc}}}% {\usebibmacro{cite:citepages}% \global\togglefalse{cbx:loccit}% \bibhypertarget{cite\the\value{instcount}}{% \ifciteseen% {\iffieldundef{shorthand}% {\ifciteibid% {\usebibmacro{cite:ibid}}% {\ifboolexpr{test {\ifciteidem}% and not bool {cbx:noidem}}% {\usebibmacro{cite:idem}% \usebibmacro{cite:title}}% {\ifnameundef{labelname}% {\usebibmacro{cite:title}}% {\usebibmacro{cite:name}% \ifopcit% {\ifloccit% {\usebibmacro{cite:loccit}}% {\usebibmacro{cite:opcit}}}% {\usebibmacro{cite:title}}}}}% \usebibmacro{cite:save}}% {\usebibmacro{cite:shorthand}}}% {\usebibmacro{cite:full}% \usebibmacro{cite:save}}}}} \begin{document} \section{The actual example} The \cite{act1} holds that X is forbidden.\\ The \cite{act2} provides for some exceptions to the \cite{act1}.\\ Yesterday, the Parliament abrogated \cite{act2} \parencite{act3,case1}. So, X is forbidden in any case \parencite{case1}, because the \cite{act1} does not provide for any exception. \begin{description} \item[\Cite{act1}] no description here. \end{description} \section{The correct example} The act 01/07/2025\underline{, no\@. 1\textcolor{blue}{,}} holds that X is forbidden.\\ The act 01/08/2025\underline{, no\@. 2\textcolor{blue}{,}} provides for some exceptions to the act 1/2025, cit.\\ Yesterday, the Parliament abrogated act 2/2025, cit\@. (act 07/04/2025, no\@. 85; Court of Cass., criminal chamber, sentence 03/03/2025, no\@. 1). So, X is forbidden in any case (Court of Cass., sentence 1/2025, cit.), because the act 1/2025\underline{,} \underline{cit.\textcolor{blue}{,}} does not provide for any exception. \begin{description} \item[Act 1/2025, cit.] no description here. \end{description} \end{document}

  • pgfplots: Using set layers in an overlay picture
    by schtandard on July 5, 2025 at 1:58 pm

    Using pgfplots, I want to draw a plot as an overlay picture, making use of layers inside that plot. However, when I say \begin{tikzpicture} [overlay] \pgfplotsset{set layers} \begin{axis} \end{axis} \end{tikzpicture} I get two ! Dimension too large. errors. pgfplots seems to attempt to set both unit lengths (\pgf@x and \pgf@y) to -32000.0pt. Why is that and how can I avoid it? For tinkering, here is a slightly more useful MWE. Interestingly, the result looks fine in this example. (In larger pictures, the errors do cause havoc, though.) \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} [remember picture] \draw [green] coordinate (test) circle [radius=5cm]; \end{tikzpicture} \begin{tikzpicture} [remember picture, overlay] \pgfplotsset{set layers} \begin{axis} [at=(test), anchor=center, ymajorgrids] \addplot+ {x^2}; \begin{pgfonlayer}{axis grid} \fill [red] (axis cs:3,20) circle [radius=2cm]; \end{pgfonlayer} \end{axis} \end{tikzpicture} \end{document}

  • How do I export TikZ diagrams for both print and web without messing up the size?
    by S Vogue on July 5, 2025 at 10:50 am

    I am working on tikz diagrams for a paper and a poster. For the print version I am using cm and mm units in tikz to size things properly, and that is all ok. Now the tricky part is I also need versions of these diagrams for web in PNG to embed in a digital report and share on our project website. When I export from PDF to PNG or SVG, the sizes are not consistent, and the image gets scaled weirdly when I insert it in slides. \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[thick] (0,0) rectangle (10,5); \node at (5,2.5) {Salt march}; \end{tikzpicture} \end{document} Can anyone here help me out!

  • Changing section labels
    by New User on July 5, 2025 at 10:17 am

    So I'm currently in the process of writing multiple chapters for a book. I'm not using chapters though. I'm using sections. So I have a different file for each chapter. Is there a way to change the numbering of the sections? (Yes I can compile them all together in my main document, but if I want to change the number that comes in front of the section, can I do that manually?)

  • latest update of tex4ht gives DOM filter errors on thebibliography
    by Nasser on July 5, 2025 at 8:07 am

    I noticed after updating texlive about a week or so ago, I started seeing domfilter error which were not there before. After some debugging, it turns out they come when adding \begin{thebibliography}{1}. Here is a MWE. Using TL 2025, updated today. This file compiles with no errors in lualatex \documentclass[12pt]{book}% \begin{document} \part{Second and higher order differential equations} \chapter{Implemenation details for kovacic algorithm} \begin{thebibliography}{1} \bibitem{Kovacic86} Jerald J. Kovacic. \newblock An Algorithm for Solving Second Order Linear Homogeneous Differential Equations. \newblock {\em J. Symb. Comput.}, 2(1):3--43, 1986. % \bibitem{Smith84} Carolyn J. Smith. \newblock A DISCUSSION AND IMPLEMENTATION OF KOVACICS ALGORITHM FOR ORDINARY DIFFERENTIAL EQUATIONS. \newblock {\em Research Report CS-84-35}, October 1984. % \bibitem{Saunders} B. David Saunders. \newblock An Implementation of Kovacic's Algorithm for Solving Second Order Linear Homogeneous Differential Equations. \newblock {\em Proceedings of the 1981 ACM Symposium on Symbolic and Algebraic Computation}, 1981. % \end{thebibliography} \end{document} Compiled using make4ht -ulm default -a debug index.tex 'mathjax,htm,6' Gives .. [INFO] make4ht-lib: parse_lg process file: inch1.htm [WARNING] domfilter: XML DOM parsing of inch1.htm failed: [WARNING] domfilter: ...ive/2025/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=1240] [DEBUG] domfilter: Error context: tm#inch1.htm" >up</a>] </p></div> <!--l. 6--><p class="indent" > <a id="tailinch1.htm"></a> </p> </body> </html> [DEBUG] domfilter: Trying HTML DOM parsing [WARNING] domfilter: HTML DOM parsing OK, DOM filters will be executed [INFO] make4ht-lib: parse_lg process file: inch1.htm [INFO] make4ht: No output directory [INFO] make4ht-lib: parse_lg process file: inli1.htm [INFO] make4ht-lib: parse_lg process file: inli1.htm [WARNING] domfilter: XML DOM parsing of inli1.htm failed: [WARNING] domfilter: ...ive/2025/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/section) [char=1714] [DEBUG] domfilter: Error context: m on Symbolic and Algebraic</span> <span class="ec-lmri-12">Computation</span>, 1981.</dd></dl> </section> <!--l. 25--><div class="crosslinks"><p class="noindent">[<a href="inch1.htm" >prev</a [DEBUG] domfilter: Trying HTML DOM parsing [WARNING] domfilter: HTML DOM parsing OK, DOM filters will be executed [INFO] make4ht-lib: parse_lg process file: inli1.htm ... lualatex index.tex gives no warnings and no errors. Do I need to change something in my input latex file to handle this input different than what I am doing now? >which make4ht /usr/local/texlive/2025/bin/x86_64-linux/make4ht >make4ht --version make4ht version v0.4d >which lualatex /usr/local/texlive/2025/bin/x86_64-linux/lualatex > Link to tex4ht bug tracking

  • add an arrow above a line
    by Nicolas on July 5, 2025 at 7:46 am

    I'd like to be able to add a customizable arrow (size, to make it longer or shorter, possibly its position relative to other objects, to bring it a little closer to the blue circle) above the lines connecting two circles and parallel to the line. What is the best method? \documentclass[border=2mm]{standalone} \usepackage[modules={all}]{chemmacros}%le module orbital a été commenté (lignes 3816 à 3824 \usepackage{tikz} \usepgflibrary {shadings} \begin{document} \begin{tikzpicture} \coordinate (O) at (0,0) ; \coordinate (A) at (45:4) ; \coordinate (B) at (135:4) ; \shade[inner color=black, outer color=black!30](O) circle(1); \shade[inner color=blue, outer color=blue!20](A) circle(0.75); \shade[inner color=blue, outer color=blue!20](B) circle(0.75); \draw[line width=0.75mm](45:1) --node[above] {-} ($(A)+(-135:0.75)$); \draw[line width=0.75mm](135:1) -- ($(B)+(-45:0.75)$); \end{tikzpicture} \end{document}

  • Tikz - ! Missing number, treated as zero
    by Latexfan on July 5, 2025 at 5:48 am

    I get error: ! Missing number, treated as zero. <to be read again> { l.34 } Here is the code: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[norsk]{babel} \usepackage{tikz} \usetikzlibrary{arrows.meta, angles, quotes, calc} \usepackage{amsmath} \begin{document} \begin{center} \begin{tikzpicture}[scale=0.65] \draw[very thin,color=gray] (-13,-1.5) grid (13,1.5); % Akser \draw[->, thick] (-13,0) -- (13.5,0) node[right] {$x$}; \draw[->, thick] (0,-1.5) -- (0,1.7) node[above] {$y$}; % x-aksen merker (flere π-enheter) \foreach \x/\lab in {-4/-4\pi, -3/-3\pi, -2/-2\pi, -1/-\pi, 1/\pi, 2/2\pi, 3/3\pi, 4/4\pi} \draw ({\x*3.14},0.1) -- ({\x*3.14},-0.1) node[below] {\small$\lab$}; % y-aksen merker \foreach \y in {-1,1} \draw (0.1,\y) -- (-0.1,\y) node[left] {\small$\y$}; % Selve grafen \foreach \k in {-2,-1,0,1,2} { \draw[domain=-3.14:0, thick, samples=50] plot(\x + {2*3.14*\k}, {-1*\x/3.14}); \draw[domain=0:3.14, thick, samples=50] plot(\x + {2*3.14*\k}, {\x/3.14}); } % Åpne punkter (grensepunkter) \foreach \k in {-2,-1,0,1,2} { \draw[fill=white] ({3.14*\k},0) circle (3pt); \draw[fill=white] ({3.14*(2*\k+1)},1) circle (3pt); \draw[fill=white] ({3.14*(2*\k+1)},-1) circle (3pt); } \end{tikzpicture} \end{center} \end{document} What should I change in the code? Thanks

  • Implement pgfplotstable with longtable
    by Timmy on July 5, 2025 at 5:22 am

    I am making use of the wisdom of contributions from here. However, I need to have a table over multiple pages due to amount of rows/data. How might one go about adding longtable to the following contributed MWE? \documentclass[a4paper]{article} \usepackage{unicode-math} \setmainfont[Mapping=tex-text, Numbers=OldStyle]{TeX Gyre Pagella} \setmathfont[math-style=ISO]{TeX Gyre Pagella Math} \usepackage{siunitx} \usepackage{xcolor} \usepackage{booktabs,colortbl,array} \usepackage{pgfplotstable} \pgfplotsset{compat=newest} \definecolor{rulecolor}{RGB}{0,71,171} \definecolor{tableheadcolor}{gray}{0.92} % Following is taken from Werner: http://tex.stackexchange.com/a/33761/3061 % and modified for my needs % % Command \topline consists of a (slightly modified) % \toprule followed by a \heavyrule rule of colour tableheadcolor % (hence, 2 separate rules) \newcommand{\topline}{ % \arrayrulecolor{rulecolor}\specialrule{0.1em}{\abovetopsep}{0pt}% \arrayrulecolor{tableheadcolor}\specialrule{\belowrulesep}{0pt}{0pt}% \arrayrulecolor{rulecolor}} % Command \midline consists of 3 rules (top colour tableheadcolor, middle colour black, bottom colour white) \newcommand{\midtopline}{ % \arrayrulecolor{tableheadcolor}\specialrule{\aboverulesep}{0pt}{0pt}% \arrayrulecolor{rulecolor}\specialrule{\lightrulewidth}{0pt}{0pt}% \arrayrulecolor{white}\specialrule{\belowrulesep}{0pt}{0pt}% \arrayrulecolor{rulecolor}} % Command \bottomline consists of 2 rules (top colour \newcommand{\bottomline}{ % \arrayrulecolor{white}\specialrule{\aboverulesep}{0pt}{0pt}% \arrayrulecolor{rulecolor} % \specialrule{\heavyrulewidth}{0pt}{\belowbottomsep}}% \newcommand{\midheader}[2]{% \midrule\topmidheader{#1}{#2}} \newcommand\topmidheader[2]{\multicolumn{#1}{c}{\textsc{#2}}\\% \addlinespace[0.5ex]} \pgfplotstableset{normal/.style ={% header=true, string type, font=\addfontfeature{Numbers={Monospaced}}\small, column type=l, every odd row/.style={ before row= }, every head row/.style={ before row={\topline\rowcolor{tableheadcolor}}, after row={\midtopline} }, every last row/.style={ after row=\bottomline }, col sep=&, row sep=\\ } } \begin{document} \begin{table} \centering \caption{The bandgab of some semiconductors.} \pgfplotstabletypeset[normal, columns/eg/.style={ column name={$E_{\textup{g}}$ (\si{\electronvolt})}, dec sep align } ]{ % Material & Symbol & eg & Type \\ \topmidheader{5}{Elements} diamond & C & 5.46 & i \\ silicon & Si & 1.12 & i \\ germanium & Ge & 0.67 & i \\ selenium & Se & 1.74 & d \\ \midheader{5}{IV-IV Compounds} silicon carbide & SiC 3C & 2.36 & i \\ silicon carbide & SiC 4H & 3.28 & i \\ silicon carbide & SiC 6H & 3.03 & i \\ \midheader{5}{III-V Compounds} indium phosphide& InP & 1.27 & d \\ indium arsenide & InAs & 0.355& d \\ gallium nitride & GaN & 3.37 & d \\ gallium arsenide& GaAs & 1.42 & d \\ aluminium nitride & AlN & 6.2 & d \\ } \end{table} \end{document}

  • pgfplots: Math font for 'extra y tick labels'
    by cis on July 5, 2025 at 4:11 am

    What do I have to set so that the extra y tick labels are also set in math mode? Note: I left all other settings as they were. \documentclass[margin=5pt, tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \def\Ymin{-20} \def\Ymax{21} \pgfmathtruncatemacro\YminPre{\Ymin+5} \pgfmathsetlengthmacro\Yenlarge{3.25mm} \begin{tikzpicture}[] \begin{axis}[ xmin = -5, xmax=5, ymin =\Ymin, ymax = \Ymax, axis lines = middle, axis line style={->, >=latex}, xlabel={$x$}, ylabel={$y$}, x label style={at={(ticklabel* cs:1.00)}, inner sep=5pt, anchor=north}, y axis line style={shorten >=-\Yenlarge, shorten <=-\Yenlarge+1.5mm}, y label style={at={(ticklabel* cs:1.00)}, inner sep=2pt, anchor=east, yshift=\Yenlarge}, xtick={-5,-4,...,5}, enlarge x limits={0.075}, % y>0 ticks left ====================== ytick={20,15,...,-20}, yticklabel={\pgfmathprint{\tick>0 ? int(\tick) : {}} }, % y<0 ticks right =================== extra y ticks={\Ymin,\YminPre,...,-5}, extra y tick labels={\Ymin,\YminPre,...,-5}, extra y tick style = {tick label style={anchor=west, inner xsep=.5em}, /pgf/number format/assume math mode=true% no effect }, minor y tick num={4},% for complete y-axis! ] \addplot[red] {x}; \end{axis} \end{tikzpicture} \end{document}

  • I have a very large diagram and it doesn't compile properly
    by the topological beast on July 4, 2025 at 10:52 pm

    I made this code in TikZ-CD, but when I put it into Overleaf, it doesn't fit on the screen. I tried to make it smaller, but it doesn’t work — the diagram is too big, and I don’t know how to shrink it. I need it to look like this. \documentclass{article} \usepackage{tikz-cd} \usepackage{amsmath} \usepackage{graphicx} \begin{document} \scalebox{0.7}{ \begin{tikzcd}[row sep=small, column sep=small] & & \begin{matrix} 2 \\ 3 \\ 2 \end{matrix} \arrow[rd] & & \begin{matrix} 1 \\ 4 \end{matrix} \arrow[rd] & & 5 \arrow[rd] & & 4 \arrow[rd] & \\ & \begin{matrix} 3 \\ 2 \end{matrix} \arrow[ru] \arrow[rd] & & \begin{matrix} 2 \\ 3\ 1 \\ 2\ 4 \end{matrix} \arrow[ru] \arrow[rd] & & \begin{matrix} 1\ 5 \\ 4 \end{matrix} \arrow[ru] \arrow[rd] & & \begin{matrix} 4 \\ 5 \end{matrix} \arrow[ru] \arrow[r] & \begin{matrix} 5 \\ 4 \\ 5 \end{matrix} & \begin{matrix} 5 \\ 4 \end{matrix} \\ 2 \arrow[ru] \arrow[rd] & & \begin{matrix} 3\ 1 \\ 2\ 4 \end{matrix} \arrow[ru] & & \begin{matrix} 2 \\ 3\ 1\ 5 \\ 2\ 4 \end{matrix} \arrow[ru] \arrow[rd] & & \begin{matrix} 1\ 4 \\ 5 \\ 4 \end{matrix} \arrow[ru] \arrow[rd] & & \\ & \begin{matrix} 3 \\ 24 \end{matrix} \arrow[ru] & & & & \begin{matrix} 2\ 4 \\ 3\ 1\ 5 \\ 2\ 4 \end{matrix} \arrow[ru] \arrow[rd] & & 1 & & \\ & & & & & & \begin{matrix} 2 \\ 3\ 1 \\ 2 \end{matrix} \arrow[ru] \end{tikzcd} } \end{document}

  • Declaring a coordinate with an explicit name argument
    by tgkolda on July 4, 2025 at 6:23 pm

    I am wondering why I cannot use the syntax in Example 4 of the following MWE: \documentclass{article} \usepackage{tikz} \begin{document} Example 1: \begin{tikzpicture} \coordinate (A) at (0,0); \coordinate (B) at (3,0); \draw (A) -- (B); \end{tikzpicture} Example 2: \begin{tikzpicture} \path (0,0) coordinate[name=A]; \path (3,0) coordinate[name=B]; \draw (A) -- (B); \end{tikzpicture} Example 3: \begin{tikzpicture} \coordinate[name=A, at={(0,0)}]; \coordinate[name=B, at={(3,0)}]; \draw (A) -- (B); \end{tikzpicture} Example 4 (will not compile): \begin{tikzpicture} \coordinate[name=A] at (0,0); \coordinate[name=B] at (3,0); \draw (A) -- (B); \end{tikzpicture} \end{document}

  • Kerning error around "l" in purchased font ("Better Sans")
    by Keks Dose on July 4, 2025 at 5:45 pm

    I bought a font called "Better Sans" here: Better Sans at MyFonts . Used with LaTeX and LibreOffice, there is a kerning error, but used with Textmaker, Word and InDesign, no error occurs. Is there a way to get rid of the bad kerning around the "l"? I've only got the *.otf files. The seller refuses to concede the bug in the *.otf files. Any help appreciated! MWE: \documentclass[fontsize=24pt, DIV=30]{scrartcl} \usepackage{fontspec} %\defaultfontfeatures{Ligatures=TeX} \setmainfont{Better Sans Regular}[BoldFont=Better Sans Semibold,ItalicFont=Better Sans Italic] \setmainfont{Better Sans Regular}[BoldFont=Better Sans Semibold,ItalicFont=Better Sans Italic] \newfontfamily{\fettig}{Better Sans Black}[ItalicFont=Better Sans Black italic] \newfontfamily{\extraheavy}{Better Sans Heavy}[ItalicFont=Better Sans Heavy italic] \newfontfamily{\leicht}{Better Sans Light}[ItalicFont=Better Sans Light italic] \addtokomafont{title}{\fettig} \title{Bestellung\\ Helles Spüllicht} \date{} \begin{document} \maketitle \vspace*{-4cm} Südlicht Bestellung (Regular) \emph{Südlicht Bestellung} (Regular Italic) \extraheavy Spüllicht Bestellung (Heavy) \emph{Bestellung} (Heavy Italic) \leicht Spüllicht Bestellung (Light) \emph{Spüllicht Bestellung} (Light Italic) \fettig Spüllicht Bestellung (Black) \emph{Spüllicht Bestellung} (Black Italic) \end{document} % Local Variables: % TeX-engine: luatex % End: Result: But if I use TextMaker, no error. With LibreOffice, error there. Libre-Office, Writer: But with Textmaker (and apparently Word and InDesigner, as reported by the Seller of the fonts, MyFont):

  • PDF bookmarks for tables and figures not set correctly with lualatex in TeX Live 2025
    by tfran on July 4, 2025 at 5:26 pm

    After updating to TeX Live 2025, I noticed that PDF bookmarks for tables and figures are no longer set correctly when compiling with LuaLateX. I used LuaHBTeX, Version 1.22.0. In previous TeX Live version (up to TL 2024), the bookmarks for tables and figures appeared as expected in the PDF file, but now the compilation stops. The same was observed with LuaHBTeX, Version 1.22.0 (MiKTeX 25.4 Portable) (format=lualatex 2025.7.4). However, when compiling with pdflatex, the bookmarks are created correctly at the right place in the bookmarks hierarchy. Does anyone know the reason? Compilation with lualatex: \documentclass[ abstract=false, titlepage=true, fontsize=12pt, pagesize=auto, headings=normal, bibliography=totocnumbered, numbers=noenddot, parskip=half, toc=flat, listof=flat, toc=sectionentrywithdots ]{scrartcl} % lualatex: Language and font packages \usepackage{polyglossia} \setdefaultlanguage[variant=american]{english} \usepackage[times]{fontsetup} \setsansfont{Arial} \setmonofont{Courier New} \usepackage{graphicx} \usepackage{array,ragged2e,longtable} \usepackage[automark]{scrlayer-scrpage} \usepackage[hypcap=false, labelsep=endash, font={footnotesize,sf, bf}, labelfont={footnotesize,sf, bf}, justification =centering]{caption} \usepackage[ bookmarks=true, bookmarksopen=true, bookmarksnumbered=true, colorlinks=true, linkcolor=blue ]{hyperref} \usepackage{bookmark} \usepackage{etoolbox} %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \makeatletter \def\toclevel@figure{\inteval{\BKM@currentlevel+1}} \def\toclevel@table{\inteval{\BKM@currentlevel+1}} \AddToHook{env/figure/begin}{% \hypersetup{bookmarkstype=lof,bookmarksnumbered}% \def\Hy@numberline#1{\figurename{} #1 }% \bookmarksetup{keeplevel}} \AddToHook{env/table/begin}{% \hypersetup{bookmarkstype=lot,bookmarksnumbered}% \def\Hy@numberline#1{\tablename{} #1 }% \bookmarksetup{keeplevel}% } \makeatother %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \title{Title of the Article} \author{Your Name} \date{\today} \begin{document} \maketitle \section{Introduction} This is where the main content of the article begins. You can write your introduction here. \section{Main Part} You can elaborate the main part of your article here. \subsection{Example Table} \begin{table}[h] \centering \caption{Example Table} \label{tab:example} \begin{tabular}{|l|c|r|} \hline Name & Value & Status \\ \hline Alpha & 42 & Active \\ Beta & 13 & Inactive \\ Gamma & 7 & Active \\ \hline \end{tabular} \end{table} \subsection{Example Figure} \begin{figure}[h] \centering % Placeholder image, replace "example-image" with your filename \includegraphics[width=0.5\textwidth]{example-image} \caption{Example Figure} \label{fig:example} \end{figure} \subsection{Example Equation} An example equation for the Pythagorean theorem: \begin{equation} a^2 + b^2 = c^2 \end{equation} \section{Conclusion} In this section, you summarize the main points of your article. \end{document} Compilation with pdflatex: \documentclass[ abstract=false, titlepage=true, fontsize=12pt, pagesize=auto, headings=normal, bibliography=totocnumbered, numbers=noenddot, parskip=half, toc=flat, listof=flat, toc=sectionentrywithdots ]{scrartcl} % pdflatex: Language and font packages for Times \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{mathptmx} % for Times + mathematics \usepackage{graphicx} \usepackage{array,ragged2e,longtable} \usepackage[automark]{scrlayer-scrpage} \usepackage[hypcap=false, labelsep=endash, font={footnotesize,sf, bf}, labelfont={footnotesize,sf, bf}, justification =centering]{caption} \usepackage[ bookmarks=true, bookmarksopen=true, bookmarksnumbered=true, colorlinks=true, linkcolor=blue ]{hyperref} \usepackage{bookmark} \usepackage{etoolbox} %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \makeatletter \def\toclevel@figure{\inteval{\BKM@currentlevel+1}} \def\toclevel@table{\inteval{\BKM@currentlevel+1}} \AddToHook{env/figure/begin}{% \hypersetup{bookmarkstype=lof,bookmarksnumbered}% \def\Hy@numberline#1{\figurename{} #1 }% \bookmarksetup{keeplevel}} \AddToHook{env/table/begin}{% \hypersetup{bookmarkstype=lot,bookmarksnumbered}% \def\Hy@numberline#1{\tablename{} #1 }% \bookmarksetup{keeplevel}% } \makeatother %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \title{Title of the Article} \author{Your Name} \date{\today} \begin{document} \maketitle \section{Introduction} This is where the main content of the article begins. You can write your introduction here. \section{Main Part} You can elaborate the main part of your article here. \subsection{Example Table} \begin{table}[h] \centering \caption{Example Table} \label{tab:example} \begin{tabular}{|l|c|r|} \hline Name & Value & Status \\ \hline Alpha & 42 & Active \\ Beta & 13 & Inactive \\ Gamma & 7 & Active \\ \hline \end{tabular} \end{table} \subsection{Example Figure} \begin{figure}[h] \centering % Placeholder image, replace "example-image" with your filename \includegraphics[width=0.5\textwidth]{example-image} \caption{Example Figure} \label{fig:example} \end{figure} \subsection{Example Equation} An example equation for the Pythagorean theorem: \begin{equation} a^2 + b^2 = c^2 \end{equation} \section{Conclusion} In this section, you summarize the main points of your article. \end{document}

  • please explain the \centering markup
    by Oodini on July 4, 2025 at 5:01 pm

    In the following code, why is \par needed to center the date ? I don't understand the logic of \centering... \documentclass{article} \pagestyle{empty} \begin{document} { \centering \huge\bfseries Centered text \\ \Large\normalfont written by me \\ \normalsize\today\par } \end{document}

  • Is that mandatory requirement to put \RequirePackage after \LoadClass?
    by Explorer on July 4, 2025 at 4:53 pm

    Description In .tex, we should use \documentclass and \usepackage in order. However, in .cls, it seemed not mandatory. Consider the following examples: \LoadClass after \RequirePackage: \begin{filecontents*}[overwrite]{foo.cls} \RequirePackage{bm,booktabs} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{foo}[2025/07/05 My Custom Class] \LoadClass{article} \end{filecontents*} \documentclass{foo} \begin{document} \verb|bm| work \verb|booktabs| NOT $xyz\bm{xyz}xyz$ \bigskip \begin{tabular}{cc} \toprule A & B \\ \midrule C & D \\ C & D \\ \bottomrule \end{tabular} \end{document} \LoadClass before \RequirePackage(normal): \begin{filecontents*}[overwrite]{baz.cls} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{baz}[2025/07/05 My Custom Class] \LoadClass{article} \RequirePackage{bm,booktabs} \end{filecontents*} \documentclass{baz} \begin{document} \verb|bm| work \verb|booktabs| work $xyz\bm{xyz}xyz$ \bigskip \begin{tabular}{cc} \toprule A & B \\ \midrule C & D \\ C & D \\ \bottomrule \end{tabular} \end{document} Questions Is that out-of-documented behaviour to put \RequirePackage before \LoadClass? Why bm work but booktabs NOT work in the case above? Edit: Some more experiments: The origin of this post is from here: As cfr has mentioned that: Loading package code before loading your class is not generally supported But most packages assume the class is loaded and their code may depend on that. I have the following 10 packages test(all work!): \begin{filecontents*}[overwrite]{foo.cls} % use \RequirePackage before \LoadClass \RequirePackage{amsmath} \RequirePackage{amsthm} \RequirePackage{bm} \RequirePackage{amssymb} \RequirePackage{lipsum} \RequirePackage{ulem} \RequirePackage{xcolor} \RequirePackage{graphicx} \RequirePackage{tcolorbox} \RequirePackage{indentfirst} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{foo}[2025/07/05 My Custom Class] \LoadClass{article} \end{filecontents*} \documentclass{foo} \begin{document} Hello, world! \section{test amsmath: work} $ a \text{txt} b$ \[ \sideset{}{'} \sum_{n<k,\;\text{$n$ odd}} nE_n \] \section{test amsthm: work} \newtheorem{thm}{Theorem} \begin{thm} This is a thorem. \end{thm} \begin{thm} This is another thorem. \end{thm} \section{test bm: work} $ \alpha\quad \bm{\alpha} \quad \beta \quad \bm{\beta}$ \section{test amssymb: work} $\mathbb{R} \quad \mathcal{R}$ \section{test lipsum: work} \lipsum[1][1-4] \section{test ulem: work} abc \uline{xyz} abc \section{test xcolor: work} a \textcolor{magenta}{b} c \section{test graphicx: work} \includegraphics[width=3cm]{example-image} \section{test tcolorbox: work} \begin{tcolorbox} \lipsum[1][1-4] \end{tcolorbox} \section{test indentfirst: work} \lipsum[1][1-4] \lipsum[2][1-4] \end{document} Additional Questions: So "lucky" that my picky ten packages all worked to use before \LoadClass? Maybe in the theoretically, \RequirePackage should be after \LoadClass(and the authors assumed that they are used after documentclass loaded), but only small proportion of package(booktabs) expired?

  • Tweaking section and body text font size in class file for conference paper
    by Fendy Sion 04 on July 4, 2025 at 4:19 pm

    I was invited to submit conference paper for September 2025. I was instructed to follow the template / class cls file. However, it seems the class set up very small fonts which not so beautiful for science paper. I analyze the cls file and I could not find a clue how to change the font size. I have set it up to \Large size for section title but nothing changes in pdf output (kindly see attachment) I have contacted the conference officer but no feedback. So meanwhile I'm waiting the answer, I would like to ask : Why the font size did not change when I tweak the cls file? Is there any thing in the cls file I attach that hinders / surpress the \Large syntax I use? How to setup the font size for section and body text in cls file for my case? I have been using LaTeX for quite a long time but not for scientific paper. Moreover, this is the first time for me to use cls file. I attach the pdf output, the tex input and the cls file as reference Many thanks before

  • pgfplot: Gamma function for x<0 without y-gaps
    by cis on July 4, 2025 at 10:00 am

    I would like to pgfplot the Gamma function for x>0 and x<0 (in the x-interval as shown); but without these "y-gaps": In the following code I use the Stirling-approximation G(\x)=sqrt(2*pi)*\x^(\x-0.5)*exp(-\x)*exp(1/(12*\x)) for x>0; and Euler's reflection formula for x<0. But to avoid these y-gaps I need to set a very huge sample number. This needs long calculation durances. What could I do better. Is there maybe a trick? \documentclass[margin=5mm, tikz]{standalone} %\usepackage{pgfplotstable} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture}[ trig format=rad, declare function={ G(\x)=sqrt(2*pi)*\x^(\x-0.5)*exp(-\x)*exp(1/(12*\x));% x>0 gamma(\x)=(\x>=0 ? G(\x) : pi/(G(1 - \x)*sin(pi*\x));% x<0 - 2/2 } ] \begin{axis}[ %xmin = -4.9, xmax = 5.1, %ymin = -3.5, ymax = 3.5, restrict y to domain=-5.05:8.05, axis lines = middle, xlabel={$x$}, ylabel={$y$}, x label style={at={(ticklabel* cs:1.00)}, inner sep=5pt, anchor=north}, y label style={at={(ticklabel* cs:1.00)}, inner sep=2pt, anchor=south east}, ytick={-4,-2,...,4}, minor y tick num={1}, xtick={-5,...,5}, enlarge x limits={0.075}, %enlarge x limits={0.05, lower}, %enlarge y limits=0.125, ] % x>0: \addplot[blue, samples=222, smooth, domain =0:5] {gamma(x)}; % x<0: \addplot[color=red, samples=222, smooth, domain=-1:0] {gamma(x)}; \addplot[color=red, samples=444, smooth, domain=-2:-1] {gamma(x)}; \addplot[color=red, samples=777, smooth, domain=-3:-2] {gamma(x)}; \addplot[color=red, samples=888, smooth, domain=-4:-3] {gamma(x)}; %\addplot[color=red, samples=3333, smooth, domain=-5:-4] {gamma(x)}; \foreach \n in {0,...,-5}{% \addplot [densely dashed, thin] (\n, x); }% \end{axis} \end{tikzpicture} \end{document}

  • Switch ouput on / off with specific syntax
    by user2026844 on July 4, 2025 at 6:38 am

    I would like to define two switches such that this code \begin{document} \A This is text A Some more text A \B some text B \A again some text A \end{document} produces the following output: This is text A Some more text A again some text A if switch A is active and B is not, some text B if switch B is active and A is not, and This is text A Some more text A some text B again some text A if both are active. I'd like the syntax in the document to be exactly as described, in particular without braces {} and without extra commands. Edit: Comments suggested I give MWE instead of this vague description of my ideas. Here they are: (all should output A1 A2) Using \defs and arguments. Does not work (I believe) because first \A eats everything until last \Z, so \B has no \Z. \documentclass{article} \def\Z{} \long\def\A#1\Z{\Z#1} \long\def\B#1\Z{\Z} \begin{document} \A A1 \B B1 \A A2 \B B2 \Z %would be hidden in a new def of \end{document} \end{document} Using \ifs. Does not work (I believe) because the iffalse in \B eats everything until last \fi, and the \fi in \A is not expanded. \documentclass{article} \def\A{\fi\iftrue} \def\B{\fi\iffalse} \begin{document} \iftrue %would be hidden in a new def of \begin{document} \A A1 \B B1 \A A2 \B B2 \fi %would be hidden in a new def of \end{document} \end{document} Using \NewDocumentEnvironment. Does not work, but I'm not sure why. The first \A seems to expand fine, but the first \B seems to eat everything until last \end{myenv}. \documentclass{article} \NewDocumentEnvironment{myenv}{+b}{#1}{} \newcommand{\A}{\end{myenv}\RenewDocumentEnvironment{myenv}{+b}{##1}{}\begin{myenv}} \newcommand{\B}{\end{myenv}\RenewDocumentEnvironment{myenv}{+b}{}{}\begin{myenv}} \begin{document} \begin{myenv} %would be hidden in a new def of \begin{document} \A A1 \B B1 \A A2 \B B2 \end{myenv} %would be hidden in a new def of \end{document} \end{document} OLD: Here were my ideas so far: Use conditionals: Set \A to \iftrue and \B to \iffalse in the preamble. Something like \def\A{\fi\iftrue} \def\B{\fi\iffalse}. I can then redefine the document env to start with \iftrue and end with \fi. The problem is: the \iffalse skips over every token until \fi, even if it expands to \fi... And I don't want to have to type something like \fi\B! Define \A and \B as commands that take as argument everything until the next \A or \B (Something along the lines of \def\Z{} \def\A#1\Z{\Z#1} \def\B#1\Z{\Z#1}) I can then redefine one or the other to output #1 or nothing, if I want text A or not. The problem is (I can't seem to get it to scan past \par without braces...) Edit: this works now (see comments). The problem is that the token \Z coming from \B is not expanded, and never seen by the argument scanning of \A... I'm not really as fluent in TeX as I'd like to be, so perhaps I missed something obvious. I welcome any alternative!

  • Amazon KDP says file is corrupt
    by Matt.Vancouver on July 3, 2025 at 5:17 pm

    I wanted to publish my LaTex book using amazon KDP (Kindle Direct Publishing) via their print-on-demand service. However, after a few days of uploading the PDFs I keep getting e-mails from the “senior KDP support team” that either of the files is corrupted. I cannot figure out what they want and what the specific error messages are that they receive. I tried to obtain information from their help desk. They just sent back a standard seemingly ChatGPT-created message where they refer back to the superficial information on their website. Quote amazon e-mail: To proceed with printing, please make the following changes: Please create a new PDF from the native file, using a new PDF producer. This should be a new file, with a new name, and should not be a resave over the previous file. When creating a new PDF, please follow the "Print to PDF" section of the following resource: https://kdp.amazon.com/en_US/help/topic/G202145060 Quote end. Following the link, it specificies the following: PDF/X format is used. PDF/X-1a is preferred, but if you are submitting non-PDF/X files (for example, PDF/A), any comments, forms, or other non-printing objects could be removed during our review. Downsampling, or decreasing resolution, of images is disabled. Remove PDF creation logos or watermarks. Optimize PDFs. Optimization is useful to reduce your file size, allowing for higher performance when transferring, uploading, viewing, and printing the files. Background Amazon KDP wants users to upload two wiles: File 1: the book PDF File 2: the cover PDF Amazon KDP has a preview option where users can check for any errors. That preview function did not result in any errors. Users can then upload the files and can request a proof copy which I did. This is where I keep getting amazon messages via e-mail that my file is corrupt. What I tried to solve the problem Compiling I use TexStudio Version 4.8.7 Compiler (in TexStudio): TexStudio/Preferences/Standard compiler: txs:///pdflatex First attempt: In a first attempt, as amazon requested in their e-mail, I changed the compiler to compile my document using LuaLaTex. This did not resolve the issue. Second attempt: On amazon website it says to use PDF/X-1a. “PDF/X format is used. PDF/X-1a is preferred” To do this, I added the following package to the preamble (see MWE below): % PDF/X-1a:2001 compliance \usepackage[x-1a]{pdfx} This did also not resolve the issue. Third attempt: I understand that xcolor using RGB cannot be printed. So I added the CMYK option to the xcolor package (see MWE below): % Pass CMYK option to xcolor, which is loaded by TikZ later % xcolor not loaded separately because it is loaded by the TikZ package \PassOptionsToPackage{cmyk}{xcolor} This did also not resolve the issue. Fourth attempt Amazon said they cannot print any transparancies and color gradients. I used some in TikZ nodes. For example: \begin{tikzpicture} \node[ draw, fill=blue!20, top color=blue, bottom color=white, text=black, minimum width=4cm, minimum height=1cm ] {Gradient Node}; \end{tikzpicture} I removed all of those gradients and included only solid colors (not the options: top color, bottom color). This did also not resolve the issue. Fifth attempt I tried to “optimize” the PDF files using Adobe Acrobat. I opened the LaTex files in Adobe Acrobat (not just Adobe Reader). In Adobe Acrobat, I checked whether the fonts are embedded. Adobe Acrobat/File/Document properties/Fonts It says for the font: Embedded Subset. I understand this means that the fonts are embedded to the extent needed in the file. Adobe Acrobat/File/Document properties/Custom/Custom properties GTS_PDFXVersion Value: PDF/X-1a:2003 I understand this means that the PDF file is created in the demanded PDF/X format. Sixth attempt My last attempt was to optimize the PDF file before submitting it to amazon KDP. Adobe Acrobat/File/Compress a PDF I compressed the files. In addition, I checked whether there are any layers. I understand that all layers have been merged. I understand this can be done in Adobe Acrobat when by checking the layers. However, there are none and I assume that means that all layers are merged into one. Any help / ideas / suggestions what I need to do? My MWE: % Pass CMYK option to xcolor, which is loaded by TikZ later \PassOptionsToPackage{cmyk}{xcolor} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[ 9pt, paper=letter, ]{scrbook} % PDF/X-1a:2001 compliance \usepackage[x-1a]{pdfx} % Font settings (example for LuaLaTeX or XeLaTeX users) % Optional: TikZ for illustration \usepackage{tikz} \begin{document} \chapter{Sample Chapter} This is a test document for PDF/X-1a output using \texttt{pdfx}. \begin{center} \begin{tikzpicture} \draw[fill=cyan!30!white, draw=black] (0,0) rectangle (3,2); \node at (1.5,1) {\textbf{TikZ Box}}; \end{tikzpicture} \end{center} The following node can supposedly not be printed because of the gradient: \begin{tikzpicture} \node[ draw, fill=blue!20, top color=blue, bottom color=white, text=black, minimum width=4cm, minimum height=1cm ] {Gradient Node}; \end{tikzpicture} \end{document}