Hot
- scrreprt: blank page before the cover pageby Akira on July 18, 2025 at 7:56 pm
I have a tex file \documentclass[ chapterprefix=true, headings=optiontohead, twoside=true, headings=openleft ]{scrreprt} \usepackage{pdfpages} \begin{document} \begin{titlepage} \includepdf[pages=1]{cover} \end{titlepage} \chapter*{Acknowledgment} \chapter*{Abstract} \tableofcontents \chapter{Introduction} \section{Motivation} \end{document} I want to use a separate cover.pdf as the cover, so I set \begin{titlepage} \includepdf[pages=1]{cover} \end{titlepage} In the resulted PDF, the first page (right before the cover page) is a blank page: Could you elaborate on this issue and how to solve it?
- Tcolorbox - How can I adjust the positions from side-by-side boxes so that they are at the same height?by user2379123 on July 18, 2025 at 7:03 pm
This is my code: \documentclass{standalone} \usepackage{amssymb, amsfonts, dsfont} \usepackage{tcolorbox} \tcbuselibrary{raster} \begin{document} \begin{tcolorbox}[boxrule=5pt, title={}] \begin{tcbraster}[raster columns=2, raster equal height] \begin{tcolorbox}[colback=green] \begin{center} \begin{huge} Optimization \end{huge} \end{center} \begin{tcbitemize}[raster columns=1, raster equal height, halign=flush center, valign=center] \tcbitem \tcbitem \tcbitem \tcbitem \end{tcbitemize} \end{tcolorbox} \begin{tcolorbox}[colback=green] \begin{center} \begin{huge} Constraint Satisfaction \end{huge} \end{center} \begin{tcbitemize}[raster columns=1, raster equal height, halign=flush center, valign=center] \tcbitem \tcbitem \tcbitem \tcbitem \end{tcbitemize} \end{tcolorbox} \end{tcbraster} \end{tcolorbox} \end{document} This is my result: The boxes on the left side should be at the same height like the boxes on right side. The black arrows in the image show how the left-sided boxes should be moved to fit the heights from the right-sided boxes. How can I achieve that? Thanks in advance!
- Problem with TOC with tex4ht when using `accent` and `hyperref` with `\texorpdfstring`by Nasser on July 18, 2025 at 5:41 pm
I found I need to use \texorpdfstring in sections titles in order to work around a compile error with lualatex. see tex-capacity-exceeded. But now I find the table of content in HTML generated by tex4ht is corrupted. Here is MWE \documentclass[12pt]{article}% \usepackage{accents} \usepackage{hyperref} \begin{document} \tableofcontents %must use \texorpdfstring to workaround compile error with lualatex \section{Deformation gradient tensor \texorpdfstring{$\tilde{Q}$}{Q}}% test \end{document} The above compiles OK now with lualatex. But with tex4ht it gives this make4ht -ulm default -a debug foo.tex "mathjax,htm" The HTML source code is <h3 class='likesectionHead' id='contents'><a id='x1-1000'></a>Contents</h3> <div class='tableofcontents'> <span class='sectionToc'>1 <a href='#deformation-gradient-tensor-accent-e-q' id='QQ2-1-2'>Deformation gradient tensor <span class='mathjax-inline'> \(\cc@accent {"707E\relax }{Q}\)</span></a></span> </div> <h3 class='sectionHead' id='deformation-gradient-tensor-accent-e-q'> <span class='titlemark'>1 </span> <a id='x1-20001'></a>Deformation gradient tensor <span class='mathjax-inline'>\(\tilde {Q}\)</span></h3> <!-- l. 12 --><p class='noindent'>test </p> Why does this happen and how to correct it? TL 2025 on Linux. Reference tex4ht tracking
- why adding package accents with hyperref causes TeX capacity exceeded?by Nasser on July 18, 2025 at 5:30 pm
This MWE \documentclass[12pt]{article}% \usepackage{hyperref} \usepackage{accents} \begin{document} \tableofcontents \section{Deformation gradient tensor $\tilde{Q}$} test \end{document} Compiled on TL 2025 using lualatex gives TeX capacity exceeded, sorry [parameter stack size=20000]. \let #1-> \expandafter \expandafter \expandafter \HyPsd@@LetCommand \expandaf... l.10 ...der rigid body transformation $\tilde{Q}$} I can workaround this by adding \texorpdfstring in the title as follows \section{Deformation gradient tensor \texorpdfstring{$\tilde{Q}$}{Q}} Now the pdf is compiled OK giving However, this workaround causes another problem with tex4ht (will post separate , question on this, as this could be a bug in tex4ht) and I do not want to mix issues in same question. Question is: why adding accents package with hyperref causes this error using lualatex? Is this expected?
- How to check if a macro exists when its name is constructed from a user-defined macro in LaTeX?by slimguat on July 18, 2025 at 5:00 pm
Problem I'm writing a LaTeX macro system to manage acronyms in Overleaf, and I need to dynamically check whether a macro like \acronym@CH@used exists. The acronym key (e.g., CH) is stored in another user-defined macro called \acBase. I tried the following logic inside my macro: \documentclass{article} \usepackage{xstring} \usepackage{etoolbox} \makeatletter \newcommand{\newacronym}[3]{% \expandafter\newcommand\csname acronym@#1@long\endcsname{#2}% \expandafter\newcommand\csname acronym@#1@short\endcsname{#3}% \expandafter\newcommand\csname acronym@#1@used\endcsname{0}% } \newcommand{\myac}[1]{% \def\acBase{#1}% % I want this to check whether \acronym@CH@used exists \expandafter\ifcsname acronym@\acBase@used\endcsname FOUND % If first time called use this structure (long (short, citation if provided) % else only write short \else ACRONYM NOT DEFINED \fi } \makeatother \newacronym{CH}{Coronal Hole}{CH} \begin{document} \myac{CH} \end{document} But this always falls into the \else branch, as if the macro \acronym@CH@used does not exist — even though it is clearly defined using: \newacronym{CH}{Coronal Hole}{CH} I also tried pre-building the name using \edef: \edef\checkmacro{acronym@\acBase@used} \expandafter\ifcsname\checkmacro\endcsname But this doesn’t work either. LaTeX seems to treat \checkmacro and \acBase literally, instead of expanding them into the name. If I replace \acBase with its original value CH, or use the macro argument #1 directly, it does work. The Question: Is there a way to expand user-defined macros like \acBase in our case so that I can check for the existence of macros inside \ifcsname?
- Margin notes direction in memoir class with xepersian packageby Jafar Manteghi on July 18, 2025 at 4:42 pm
I am writing a book using the memoir class and the xepersian package. The memoir class automatically creates a space around the page for writing margin notes. I want this space to be on the right side of the page on odd pages and on the left side of the page on even pages, and by default it is the opposite. \documentclass[a4paper,12pt,twoside]{memoir} \usepackage{tikz, tkz-euclide, xcolor, graphicx, amsmath, etoc, indentfirst, fontawesome, newtxmath, textcomp, mathtools, showframe, wrapfig} \setlength{\intextsep}{0pt} \setlength{\columnsep}{0pt} \usepackage[most]{tcolorbox} \usetikzlibrary{positioning,angles, quotes} \tikzset{node distance=0pt} \usepackage{xepersian} \setlatintextfont{Times New Roman} \settextfont{XB Zar} % \sidebarmargin{outer} % not working % \marginparmargin{outer} % not working % \reversemarginpar % not working \checkandfixthelayout \begin{document} \cleardoublepage \pagestyle{nostyle} \frontmatter \tableofcontents \cleardoublepage \pagestyle{headings} \mainmatter % texts... \marginpar{ random text... } \end{document} I tried to change the direction using the \reversemarginpar, \marginparmargin{outer}, and \sidebarmargin{outer} commands, but none of them worked . What is the problem?
- Inline stackrel-like behaviorby John on July 18, 2025 at 3:48 pm
Following advice gleaned here, I managed to make a nice version of an equals-sign with a letter on top and a \wedge underneath, as in this little clip from a book on projective geometry: This works beautifully in displayed equations, but not in inline equation, as you can see here: \documentclass{book} \usepackage{graphicx} % Required for inserting images \usepackage{amsmath} \newcommand{\persp}[1]{\mathrel{\operatorname*{=}_{\wedge}^{\mbox{#1}}}} \begin{document} In symbols we write $l \persp{O} l ' ,$ or $$ l \persp{O} l ' , $$ \end{document} which produces this: Is there a way to make this lovely bit of latex magic work inline just as it does in displayed equations? Because a few lines later, I need to define an analogous, but simpler, thing and make it work inline, like this:
- biblatex - sortcites with different sorting orderby Bruno on July 18, 2025 at 3:08 pm
I have two bibliographies. One is sorted by year, the other one by author. I also use the option sortcites of biblatex to sort the citations within each \cite command. But I am unable to get the correct order for the \cite commands. Below is an example of what I tried: I use a presort to group the references by bibliographies (cf for instance BibLaTeX: Citation Sorting with Split Bibliographies and Filters); I define another sorting scheme that is put as \localrefcontext for every cite (\AtEveryCite, cf https://tex.stackexchange.com/a/361042/7269); The sorting scheme look for an existing keyword that is added automatically, and sort either by year or by author, depending on the case. I think that my third bullet is the one that does not work, but I am not sure. So my questions are: Can I fix the third bullet? Is there another option to achieve my goal? \documentclass{article} \usepackage[style=numeric-comp,defernumbers,backend=biber,sortcites]{biblatex} \DeclareSourcemap{ \maps[datatype=bibtex]{ \map{ \pertype{article} \step[fieldset=presort, fieldvalue = {A}] } \map{ \pertype{inproceedings} \step[fieldset=presort, fieldvalue = {B}] \step[fieldset=keyword, fieldvalue = {x}] } } } \DeclareSortingTemplate{citeorder}{% \sort{\field{presort}} \sort{ \field{keyword} \field{year} } \sort{ \field{author} } } \AtBeginRefsection{\GenRefcontextData{sorting=citeorder}} \AtEveryCite{\localrefcontext[sorting=citeorder]} \usepackage{filecontents} \begin{filecontents}{jobname.bib} @inproceedings{aa, author = {AA, A.}, title = {A title}, year = {2025} } @article{bb, author = {BB, B.}, title = {B title}, year = {2024} } @article{cc, title = {C title}, author = {CC, C.}, year = {2023} } @inproceedings{dd, author = {DD, D.}, title = {D title}, year = {2022} } \end{filecontents} \addbibresource{jobname.bib} \begin{document} Citations: \cite{dd,bb,cc,aa} \newrefcontext[sorting=ynt] \printbibliography[title={Article sorted by year}, type=article] \newrefcontext[sorting=nty] \printbibliography[title={Inproceedings sorted by names}, type=inproceedings] \end{document} The result is as follows, while I would like to obtain "Citations: [1-4]."
- microtype producing dozens of Unknown slot number warnings for Lete Sans Mathby Teepeemm on July 18, 2025 at 2:51 pm
microtype is producing dozens of unknown slot number warnings. Here is an MWE: % !TEX program = LuaLaTeX \documentclass{article} %\usepackage{lete-sans-math} \usepackage{unicode-math} \setmathfont{LeteSansMath.otf} \usepackage{microtype} \begin{document} \parbox{100pt}{text} % must be in a parbox \end{document} This produces dozens of warnings, starting with these two: Package microtype Warning: Unknown slot number of character (microtype) `\`A' (microtype) in font encoding `TU' in inheritance list (microtype) `microtype.cfg/424(protrusion)'. Package microtype Warning: Unknown slot number of character (microtype) `\'A' (microtype) in font encoding `TU' in inheritance list (microtype) `microtype.cfg/424(protrusion)'. The list goes all the way to z, and might include every accented character. If I take the text out of the parbox, then the problem doesn't happen. This is definitely related to microtype producing dozens of Unknown slot number warnings (I've copied some of that question to here), but that problem was solved by an update years ago, and my packages are up to date. Also relevant is "microtype Warning: Unknown slot number of character" with Lato font, but I can't get any of those solutions to work (which may mean I'm not using the correct font name; it may also be related to the parbox mystery).
- Is that exists general method to plot ellipse without multiple intersections?by Explorer on July 18, 2025 at 2:49 pm
I have a command \mydrawellipse in this link to draw slanted ellipses: \newcommand*\mydrawellipse[4][]{% % #2=pointA;#3==pointB;#4= ratio of y on x \tkzCalcLength(#2,#3)% \tkzGetLength{tmpdistance}% \tkzFindSlopeAngle(#2,#3) % \tkzGetAngle{tmpangle}% \begin{scope}[rotate=\tmpangle] \draw[dashed,thick,#1] (#3) arc [start angle=0,delta angle=180,x radius=\fpeval{\tmpdistance/2} cm,y radius=\fpeval{\tmpdistance * (#4) / 2}cm] (#2); \draw[thick,#1] (#2) arc[start angle=180,delta angle=180,x radius=\fpeval{\tmpdistance/2} cm,y radius=\fpeval{\tmpdistance * (#4) / 2}cm] (#3); \end{scope} } But when I use it to plot slanted ellipse in cylinders and cone: \documentclass[tikz,border=1cm]{standalone} \usetikzlibrary{spy} \usepackage{tkz-euclide} \usepackage{amsmath} \newcommand*\mydrawellipse[4][]{% % #2=pointA;#3==pointB;#4= ratio of y on x \tkzCalcLength(#2,#3)% \tkzGetLength{tmpdistance}% \tkzFindSlopeAngle(#2,#3) % \tkzGetAngle{tmpangle}% \begin{scope}[rotate=\tmpangle] \draw[thick,#1] (#3) arc [start angle=0,delta angle=180,x radius=\fpeval{\tmpdistance/2} cm,y radius=\fpeval{\tmpdistance * (#4) / 2}cm] (#2); \draw[thick,#1] (#2) arc[start angle=180,delta angle=180,x radius=\fpeval{\tmpdistance/2} cm,y radius=\fpeval{\tmpdistance * (#4) / 2}cm] (#3); \end{scope} } \begin{document} \tikzset{% every picture/.style={ spy using outlines={% circle,size=4cm, magnification=3, connect spies, } } }% \begin{tikzpicture} \tkzDefPoints{2/0/A,-2/0/B,2/6/C,-2/6/D} \tkzDrawSegments(A,C B,D) \mydrawellipse{A}{B}{0.5} \mydrawellipse{C}{D}{0.5} \tkzDefPoints{-2/2/P,2/4/Q} \tkzLabelPoints[left](P,Q) \mydrawellipse{P}{Q}{0.3} \spy[red] on (P) in node [left] at (-3,4); \spy[blue] on (Q) in node [right] at (4,3); \end{tikzpicture} \begin{tikzpicture} \tkzDefPoints{2/0/A,-2/0/B,0/6/C} \tkzDrawSegments(A,C B,C) \mydrawellipse{A}{B}{0.5} \tkzDefPoints{-1.5/1.5/P,.5/4.5/Q} \tkzLabelPoints[left](P,Q) \mydrawellipse{P}{Q}{0.15} \spy[red] on (P) in node [left] at (-3,4); \spy[blue] on (Q) in node [right] at (4,3); \spy[red] on (B) in node [left] at (-3,-2); \spy[blue] on (A) in node [right] at (4,-1.5); \end{tikzpicture} \end{document} The ellipse intersect with TWO tangent points, for which the major-axis's vertex of slanted ellipse is NOT at P and Q. I want to know is that elegant solution to refine the ellipse's plot to avoid this case?
- Text area size doesn't update after I change page layoutby postcoital.solitaire on July 18, 2025 at 2:07 pm
I want to manually change page layout using the built-in lengths like \textwidth, \topmargin and others. I've done that successufully, and showframe package confirms that. However, text paragraphs are still using the old dimensions. Here's a minimal example: \documentclass[a5paper,oneside]{article} \usepackage{showframe} \usepackage{blindtext} \begin{document} \blindtext % use the default page layout \clearpage \setlength{\textwidth}{1.2\textwidth} % change layout \setlength{\textheight}{1.2\textheight} \blindtext % this still uses old layout! \end{document} This produces the result: You can see the first page is fine, but after I change the layout on the second one, text area is bigger, yet the text is still the same width. The same can be said about the footer, it seems to use the old page layout (however, footer seems to respect the changed width, since it's now moved slightly to the right to where the new page center is). How can I make the document respect the new dimensions I set up? Note that I'm not that familiar with TeX or LaTeX. According to the output of Latexmk, my compile line seems to be: xelatex -8bit -synctex=1 -interaction=nonstopmode -file-line-error -recorder ".../document.tex" So I guess I'm using XeLaTeX. I should say that I specifically try to avoid using geometry package, because I need to have some pages of my document to be of different size, and geometry doesn't play nice with that. I also cannot use KOMA-Scripts (which seem to support changing paper size mid-document) for my own reasons. I'm not using fancyhdr, but I'm open to trying it out, if it helps my problem.
- scrbook: reverse the left-right margins for even-odd pagesby Akira on July 18, 2025 at 1:34 pm
I have a tex file \documentclass[ chapterprefix=true, headings=optiontohead, twoside=true ]{scrbook} \usepackage{kantlipsum} \usepackage[autooneside=false,automark]{scrlayer-scrpage} % Clear all page styles \clearpairofpagestyles % On even (left) pages: show the section mark (\rightmark) \lehead{\rightmark} % On odd (right) pages: show the chapter mark (\leftmark) \rohead{\leftmark} % Page number at bottom center \cfoot*{\pagemark} \begin{document} \chapter{Introduction} \kant[1-2] \section{Motivation} \kant[1-2] \chapter{Well-posedness of MV-SDEs with density-dependent drift} \kant[1-3] \section{Existence and regularity of a solution} \kant[1-2] \section{Optimal transport} \kant[1-2] \end{document} I want to print the PDF into a two-sided book. When I open the book, the odd pages are on the right and the even pages are on the left. With this binding, it makes sense that the left margin should be bigger then the right margin for odd pages; and vice versa, the left margin should be smaller then the right margin for even pages. However, the configuration of twoside=true is opposite of what I desire: Could you explain how to interchange the margin setup for even and odd pages?
- How to properly space out text in table?by Kong on July 18, 2025 at 1:28 pm
How do I properly space/center the text and numbers ? I am experiencing two main problems: (a) the table is quite a bit wider than the text block; (b) columns 5, 9, 13, and 17 seem unnecessarily wide. \documentclass[twocolumn]{article} \usepackage{graphicx} \usepackage{tabularray} \UseTblrLibrary{booktabs} \usepackage{subcaption} % <-- correct package \usepackage[colorlinks]{hyperref} \usepackage{multirow} % For multi-row cells \begin{document} \begin{table*}[!t] \centering \footnotesize \setlength{\tabcolsep}{2pt} \caption{Gaze classification and object prediction on the GIMO and GTA-IM datasets. Top-K values denote classification accuracy, and lower MSE is better. A dash (‘–’) indicates that the metric cannot be computed for the corresponding method.} \begin{tabular}{ l| c c c c| c c c c| c c c c| c c c c } \toprule \multirow{3}{*}{\textbf{Method}} & \multicolumn{8}{c|}{\textbf{GIMO}} & \multicolumn{8}{c}{\textbf{GTA-IM}} \\ \cmidrule{2-17} & \multicolumn{4}{c|}{\textbf{Gaze Classification (\%)}} & \multicolumn{4}{c|}{\textbf{Object Prediction (\%)}} & \multicolumn{4}{c|}{\textbf{Gaze Classification (\%)}} & \multicolumn{4}{c}{\textbf{Object Prediction (\%)}} \\ & Acc & Prec & Rec & F1 & Top-1 & Top-2 & Top-3 & Dist. (m) & Acc & Prec & Rec & F1 & Top-1 & Top-2 & Top-3 & Angle ($^\circ$) \\ \midrule BiFU & 44.5 & 57.7 & 0.04 & 0.07 & 79.8 & 87.1 & 100 & 0.49 & 22.0 & 91.5 & 0.04 & 0.08 & 73.4 & 80.1 & 100 & 29.2 \\ SIF3D & 49.3 & 63.6 & 0.04 & 0.08 & 82.7 & 89.8 & 100 & 0.46 & 21.6 & 92.3 & 0.04 & 0.09 & 75.1 & 82.7 & 100 & 28.7 \\ DiMoP3D & -- & -- & -- & -- & 9.09 & 33.3 & 42.4 & -- & -- & -- & -- & -- & 17.2 & 38.5 & 50.1 & -- \\ GAP3DS & -- & -- & -- & -- & 86.8 & 94.3 & 100 & 0.30 & -- & -- & -- & -- & 75.5 & 82.2 & 100 & 28.5 \\ Ours (Gaze) & 77.0 & 86.1 & 69.3 & 76.8 & 83.3 & 93.3 & 100 & 0.37 & 93.9 & 94.2 & 94.7 & 93.4 & 76.2 & 81.0 & 100 & 29.0 \\ Ours (Gaze + Scene) & 86.7 & 87.8 & 91.0 & 89.4 & 93.2 & 96.2 & 100 & 0.22 & -- & -- & -- & -- & -- & -- & -- & -- \\ \midrule GT Gaze & 100 & 100 & 100 & 100 & 100 & 100 & 100 & 0.16 & 100 & 100 & 100 & 100 & 76.2 & 80.9 & 100 & 28.9 \\ \bottomrule \end{tabular} \label{tab:gaze_classification_and_object_prediction} \end{table*} \end{document}
- How to draw an array like this?by Sunshine on July 18, 2025 at 1:15 pm
Notice that the bracket is beside the content: \documentclass{article} \usepackage{amsmath} \begin{document} $$ \begin{array}{l} \omega_1 \omega_2^2, \omega_2^3 \\ i = 3, \ldots, g, \\ i = 3, \ldots, g, \\ i = 3, \ldots, g, \text{basis of } \overline{W}\\ \text{basis of } H^0(C, K^3(-2D))\\ i = 3, \ldots, g, \text{basis of } H^0(C, K^3(-D))\\ i = 3, \ldots, g,\text{basis of } H^0(C, K^3) \end{array} $$ \end{document}
- scrbook: make right and left margins equal [duplicate]by Akira on July 18, 2025 at 1:13 pm
I have a tex file (from this answer) \documentclass[ chapterprefix=true, headings=optiontohead, twoside=true ]{scrbook} \usepackage{kantlipsum} \usepackage[autooneside=false,automark]{scrlayer-scrpage} % Clear all page styles \clearpairofpagestyles % On even (left) pages: show the section mark (\rightmark) \lehead{\rightmark} % On odd (right) pages: show the chapter mark (\leftmark) \rohead{\leftmark} % Page number at bottom center \cfoot*{\pagemark} \begin{document} \chapter{Introduction} \kant[1-2] \section{Motivation} \kant[1-2] \chapter{Well-posedness of MV-SDEs with density-dependent drift} \kant[1-3] \section{Existence and regularity of a solution} \kant[1-2] \section{Optimal transport} \kant[1-2] \end{document} For header, I want chapter title on odd pages and section title on even pages. This is the option twoside=true is anabled. As a consequence, the right and left margins are different. I do not print the PDF but read it on the screen. Can we keep the right and left margins equal?
- Drawing lines in an AVM with tikzby Stefan Müller on July 18, 2025 at 1:04 pm
I want to draw the following image for a beamer presentation. The code that should do the trick follows: \documentclass{beamer} \usepackage{array} \usepackage{tikz} \usetikzlibrary{tikzmark} \newcommand{\ms}[2][]{% \mbox{% \delimiterfactor=1000 \delimitershortfall=0pt \tabcolsep=0pt $\left[% \begin{tabular}{>{\upshape\scshape}l@{}>{\hspace*{5pt}\normalfont\itshape}l} \if\relax\detokenize{#1}\relax\else \multicolumn{2}{>{\normalfont\itshape}l}{#1}% \\ \fi #2% \end{tabular}% \right]$% }% \vspace{1mm}% } \newcommand{\sliste}[1]{% \mbox{% $\langle$\mbox{\upshape\scshape #1}$\rangle$}% } \begin{document} \frame{ \begin{tikzpicture}[overlay, remember picture] \ms{ subj & \subnode{subj2}{\ms{ gend & masc\\ num & sg\\ pers & 3\\ case & nom\\ pred & `PRO'}}\\ tense & pres\\ pred & \upshape `\textsc{seem-to}\sliste{(\textsc{xcomp})(\textsc{obl}\textsubscript{GO})}(\textsc{subj})'\\ obl\textsubscript{GO} & \ms{ pcase & \upshape \textsc{obl}\textsubscript{GO}\\ case & \upshape \textsc{acc}\\ gend & \upshape \textsc{fem}\\ num & \upshape \textsc{sg}\\ pers & 3\\ pred & \upshape `\textsc{pro}'}\\ xcomp & \ms{ subj & \subnode{subj1}{~}\\ prd & `sick\sliste{(\textsc{subj})}'}} \draw (subj1) -- (subj2); \end{tikzpicture} } \end{document} But I somehow do not get this to work.
- Header in scrbook: chapter title on odd pages and section title on even pagesby Akira on July 18, 2025 at 11:52 am
I have a tex file (taken from here): \documentclass[ chapterprefix=true, headings=optiontohead, twoside=false ]{scrbook} \usepackage{kantlipsum} \usepackage[autooneside=false,automark]{scrlayer-scrpage} \clearpairofpagestyles \ihead{\leftmark} \ohead{\Ifstr{\leftmark}{\rightmark}{}{\rightmark}} \cfoot*{\pagemark} \begin{document} \chapter{Introduction} \kant[1-2] \section{Motivation} \kant[1-2] \chapter{Well-posedness of MV-SDEs with density-dependent drift} \kant[1-3] \section{Existence and regularity of a solution} \kant[1-2] \section{Optimal transport} \kant[1-2] \end{document} As you can see, the (long) header texts are overlapped. To remedy this problem, I would like to put in header: on odd pages, only chapter title. on even pages, only section title. Could you explain how to do so?
- Creating a macro out of a tabulararray commandby Colas on July 18, 2025 at 9:05 am
I would like to define a command that changes the background color of a specific table cell. The following minimal working example (MWE) does not work as intended. How can I properly define a macro like \makeTheCellGreen to achieve this? \documentclass{article} \usepackage{tabularray} \UseTblrLibrary{siunitx} \begin{document} \def\makeTheCellGreen{\SetCell{green}} This does not work. \begin{tblr}{ colspec={|c|c|}, cells={mode=text} } \hline \makeTheCellGreen 1 & 2 \\ \hline 3 & 4 \\ \hline \end{tblr} But this works. \begin{tblr}{ colspec={|c|c|}, cells={mode=text} } \hline \SetCell{green} 1 & 2 \\ \hline 3 & 4 \\ \hline \end{tblr} \end{document}
- Line spacing in author block when using authblk and mathpazoby amoeba on July 18, 2025 at 8:47 am
I get a weird issue with line spacing inside the author block when I am using authblk and mathpazo at the same time. If an author name contains letters with descenders such as "p", then an ugly between-line space appears after that line. \documentclass[twocolumn]{article} \usepackage[utf8]{inputenc} \usepackage{mathpazo} \usepackage{authblk} \title{Title} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. pon Author} % PROBLEM HERE \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \author[1]{Author A. von Author} \affil[1]{Affiliation} \begin{document} \maketitle \end{document} This only happens with I use mathpazo (for the Palatino font). Without mathpazo there are no issues in the above document. Can this be fixed? Update: Loading mathpazo via \usepackage[sc,osf]{mathpazo} which uses "old-school figures" (i.e. numbers) fixes the issue in the above snippet, but does not fix the issue in general, e.g. if one of the authors in the next line has \'A in the name.
- Is there a way to embed animated svg in dvisvgm export?by dsacre on July 18, 2025 at 8:41 am
Important: This is an academic question, so no MWE can be provided (at least at this point in time). Preamble After looking into the media4svg package for inclusion of videos into the svg export of a presentation via dvisvgm, I was wondering if there is a way to include other data types. E.g. (taken from the media4svg example) inclusion of a YouTube video in LaTeX via \includemedia[width=18em,height=10.125em,youtube,loop,autoplay,muted]{}{OSPyXTjIrnk,9HQfauGJaTs} results in an <iframe> being inserted in the exported svg <iframe allow='fullscreen;autoplay;clipboard-write;encrypted-media;gyroscope;accelerometer' frameborder='0' height='100%' src='https://www.youtube-nocookie.com/embed/OSPyXTjIrnk?modestbranding=1&rel=0&playlist=OSPyXTjIrnk,9HQfauGJaTs&controls=1&autoplay=1&loop=1&mute=1' title='YouTube video player' width='100%'/> So consequently, there is logic in both media4svg and dvisvgm to handle the correct interpretation, parsing and exporting of non-standard-LaTeX compliant data formats. My question is: How much more can it do? Goal Consider the following animated svg displaying a simple rotation animation: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <svg id="animatedSvgTest" version="1.1" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg"> <defs> <style> #rotator { animation: rotation 4s infinite linear; } @keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> </defs> <g transform = "translate(64,64)"> <g id = "rotator"> <rect width="72" height="64" x="-36" y="-32" rx="20" ry="20" fill="blue" /> </g> </g> </svg> which looks like this: This file should be included into a beamer presentation as follows: \begin{frame}[fragile]{Animated svg} An animated svg that was embedded in \LaTeX\\[2ex] \includeSVG[width=18em,height=10.125em,controls]{PATH/TO/SVG} \end{frame} Questions Is there already a way that this can be done with existing packages? Is there a way that with some coding effort this can be achieved? Or is the dvisvgm backend not capable to achieve this? If this should be achievable, can there be also added animation controls via JavaScript like with the animate package? Pseudo Code The pseudo code is derived from the official media4svg example: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% CODE TAKEN FROM media4svg EXAMPLE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[dvisvgm,hypertex,aspectratio=169]{beamer} \usetheme{default} \makeatletter \defbeamertemplate*{frametitle}{mydefault}{% \nointerlineskip% \usebeamerfont{frametitle}\vskip0.8ex\baselineskip=0.9\baselineskip\insertframetitle\par% \ifx\insertframesubtitle\@empty\else\vrule width 0pt height \ht\strutbox% {\usebeamerfont{framesubtitle}\insertframesubtitle\par}\fi% \vskip-0.9ex% } \makeatother \setbeamersize{text margin left=0.0333\paperheight,text margin right=0.0333\paperheight} \usefonttheme{serif} \usepackage[british]{babel} \usepackage{media4svg} \usepackage{menukeys,siunitx,calc,fancyvrb,booktabs} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % slide navigation via keyboard and mouse click/mouse wheel, mouse cursor % autohide on idle; navigation symbols <--, --> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{fontawesome5} \setbeamertemplate{navigation symbols}{} \AddToHook{shipout/before}{\xdef\currentPageNumber{\inteval{\ReadonlyShipoutCounter+1}}} \AddToHook{shipout/foreground}{% \put(0,0){% \raisebox{-\dimexpr\height+0.5ex\relax}[0pt][0pt]{\makebox[\paperwidth][r]{% \normalsize\color{structure!40!}% \ifnum\currentPageNumber>1% \href{\jobname-\zeroPad{\PreviousTotalPages}{\the\numexpr\currentPageNumber-1\relax}.svg}{\faArrowLeft}% \else% \textcolor{lightgray}{\faArrowLeft}% \fi\hspace{0.5ex}% \ifnum\currentPageNumber<\PreviousTotalPages% \href{\jobname-\zeroPad{\PreviousTotalPages}{\the\numexpr\currentPageNumber+1\relax}.svg}{\faArrowRight}% \else% \textcolor{lightgray}{\faArrowRight}% \fi% \hspace{0.5ex}% }}% }% \special{dvisvgm:raw <style>svg{cursor: none}</style>% <defs>% <script type="text/javascript">% <![CDATA[% var cursorTimer;% var downOnLink=false;% var downOnRoot=false;% function islink(tg){return (tg.tagName=='a') ? true : tg.parentNode ? islink(tg.parentNode) : false;};% function ismmedia(tg){return (tg.tagName=='video'||tg.tagName=='audio') ? true : tg.parentNode ? ismmedia(tg.parentNode) : false;};% document.addEventListener('mousemove', function(e){% if(islink(e.target)||ismmedia(e.target)||e.target.getAttribute('class')=='annot'){% e.target.style.cursor='pointer';}else{e.target.style.cursor='default';}% try{clearTimeout(cursorTimer);}catch(err){};% cursorTimer=setTimeout(function(){e.target.style.cursor='none';},3000);% });% window.addEventListener('contextmenu', function(e){% capture right click if(!islink(e.target)&&!ismmedia(e.target)) e.preventDefault();% });% document.addEventListener('mousedown', function(e){% if(islink(e.target)||ismmedia(e.target)) downOnLink=true;% else downOnRoot=true;% });% document.addEventListener('mouseup', function(e){% if(downOnLink||!downOnRoot){downOnLink=false;return;}% downOnRoot=false;% \ifnum\currentPageNumber<\PreviousTotalPages if(!e.shiftKey&&e.button==0) document.location.replace('\jobname-\zeroPad{\PreviousTotalPages}{\the\numexpr\currentPageNumber+1\relax}.svg');% \fi% \ifnum\currentPageNumber>1 if(e.shiftKey||e.button>1) document.location.replace('\jobname-\zeroPad{\PreviousTotalPages}{\the\numexpr\currentPageNumber-1\relax}.svg');% \fi% });% document.addEventListener('wheel', function(e){% \ifnum\currentPageNumber<\PreviousTotalPages if(e.deltaY>0){% document.location.replace('\jobname-\zeroPad{\PreviousTotalPages}{\the\numexpr\currentPageNumber+1\relax}.svg');% }% \fi% \ifnum\currentPageNumber>1 if(e.deltaY<0){% document.location.replace('\jobname-\zeroPad{\PreviousTotalPages}{\the\numexpr\currentPageNumber-1\relax}.svg');% }% \fi% });% document.addEventListener('keydown',function(e){% \ifnum\currentPageNumber<\PreviousTotalPages if(e.key=='PageDown'||e.key=='ArrowDown'||e.key=='ArrowRight')% document.location.replace('\jobname-\zeroPad{\PreviousTotalPages}{\the\numexpr\currentPageNumber+1\relax}.svg');% \fi% \ifnum\currentPageNumber>1 if(e.key=='PageUp'||e.key=='ArrowUp'||e.key=='ArrowLeft')% document.location.replace('\jobname-\zeroPad{\PreviousTotalPages}{\the\numexpr\currentPageNumber-1\relax}.svg');% \fi% if(e.key=='Home') document.location.replace('\jobname-\zeroPad{\PreviousTotalPages}{1}.svg');% if(e.key=='End') document.location.replace('\jobname-\PreviousTotalPages.svg');% });% ]]>% </script>% </defs>% }% }% % helper macro \zeroPad : zero-pads integer according to template, % e. g. 123 --> 00123 if template is `99999` % #1: arbitrary integer number as template specifying the % width, e. g. `987654' for a width of 6 digits % #2: the number to be formatted \def\zeroPad#1#2{\zeroPadI{\zeroTemplate{0}{#1}}{#2}} %low level macros used by \zeroPad \def\zeroPadI#1#2{% #1: string of zeros specifying width, #2 number \ifnum1#2<1#1 \zeroPadI{#1}{0#2}% \else% #2% \fi% }% \def\zeroTemplate#1#2{% create template (string of zeros) from given num \ifnum10#1>1#2 #1% \else% \zeroTemplate{0#1}{#2}% \fi% }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% CODE ADDED FOR THIS QUESTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\includeSVG}[2][]{} % REMARK: Pseudo macro for illustration purposes \begin{filecontents*}{./animated.svg} <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <svg id="animatedSvgTest" version="1.1" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg"> <defs> <style> #rotator { animation: rotation 4s infinite linear; } @keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } </style> </defs> <g transform = "translate(64,64)"> <g id = "rotator"> <rect width="72" height="64" x="-36" y="-32" rx="20" ry="20" fill="blue" /> </g> </g> </svg> \end{filecontents*} \begin{document} \begin{frame}[fragile]{Animated svg} An animated svg that was embedded in \LaTeX\\[2ex] \includeSVG[width=18em,height=10.125em,controls]{./animated.svg} \end{frame} \end{document}
- Make minitoc appear as a bulleted list of sectionsby Dan Sanderson on July 18, 2025 at 8:34 am
I want a minitoc at the beginning of each chapter that lists all of the sections in a simple bulleted list (or something that appears like one), without changing the appearance of sections in the main table of contents. It could be an itemize environment. I had thought to use \mtcsetfeature{minitoc}{before}{\begin{itemize}} and \mtcsetfeature{minitoc}{after}{\end{itemize}}, but I couldn't figure out how to get a simple \item before each item. It could also just be something that resembles a bulleted list, such as replacing the section number with a bullet. I tried to use \renewcommand{\thesection}{\textbullet} but I couldn't figure out how to get that to only apply to the minitoc. Below is a partly working version of the second idea. I imagine I'm just missing a simple scoping technique. Thoughts? \documentclass{book} % \setcounter{secnumdepth}{0} \renewcommand{\thesection}{\textbullet} \usepackage[undotted]{minitoc} \mtcsetfont{minitoc}{section}{\large\bfseries} \mtcsettitle{minitoc}{} \mtcsetrules{*}{off} \mtcsetpagenumbers{minitoc}{off} \begin{document} \dominitoc \tableofcontents \chapter{First Chapter} \minitoc Chapter intro. \section{Section Alpha} Section text. \section{Section Beta} Section text. \section{Section Gamma} Section text. \end{document}
- Is it possible to do this with LaTeX? How would you go about it?by Barnabas on July 17, 2025 at 11:49 pm
I am a beginner. I would like to know if it is possible to do the following with TeX / LaTeX. The page would be laid out like a book title; then, a couple of paragraphs filling the top page; then, two columns of text on the majority of the page and footnotes at the bottom. How would you go about it? Examples of commands? This is what it would look like on the beginning page of the biblical book (except for A Quick Look...): \documentclass[9pt,twoside,twocolumn,openany,extrafontsizes,dvipsnames]{memoir} %\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype} \usepackage{geometry} \usepackage[colorlinks=true,linkcolor=blue, urlcolor=blue]{hyperref} \geometry{paperwidth=6.69in,paperheight=9.61in} \chapter*{Genesis} \begin{document} \textbf{Primeval history (1–11)}: Genesis creation narratives (1:1–2:3, 2:4–25), Adam and Eve & Fall of man (3), Serpents in the Bible & Cain and Abel (4), Genealogies of Genesis (5:1–6:8, 11:10–26), Genesis flood narrative (6:1–9:28), Sons of God & Noah's Ark Curse of Ham (9:20–27), Generations of Noah & the origin of nations (10:1–11:9); Tower of Babel (11:1–9) \textbf{\emph{Patriarchal age (12–50)}:} Abraham (12–23), Abraham and Lot's conflict & Battle of Siddim (14:1–17), Covenant of the pieces (15), Sodom and Gomorrah (19:1–28), Isaac (21–35), Binding of Isaac (22), Jacob and his sons (25–50), Jacob's Ladder (28), Jacob wrestling with the angel (32:22–32), Joseph and the coat of many colors (37–50); Blessing of Jacob (49) \end{document} \begin{document} 1 In the beginning, God created the heavens and the earth. 2 The earth was formless and empty. Darkness was on the surface of the deep and God’s Spirit was hovering over the surface of the waters. [. . .] \begin{document} \chapter*{Matthew} 1 The book of the genealogy of Jesus Christ, the son of David, the son of Abraham. 2 Abraham was the father of Isaac. Isaac the father of Jacob. Jacob the father of Judah and his brothers. 3 Judah was the father of Perez and Zerah by Tamar being their mother. Perez was the father of Hezron. Hezron was the father of Ram. 4 Ram was the father of Amminadab. Amminadab was the father of Nahshon. Nahshon was the father of Salmon. 5 Salmon was the father of Boaz by Rahab. Boaz was the father of Obed by Ruth. Obed was the father of Jesse. 6 Jesse was the father of King David. David the king was the father of Solomon by her who had been Uriah’s wife. 7 Solomon was the father of Rehoboam. Rehoboam was the father of Abijah. Abijah was the father of Asa. 8 Asa was the father of Jehoshaphat. Jehoshaphat was the father of Joram. Joram was the father of Uzziah. 9 Uzziah was the father of Jotham. Jotham was the father of Ahaz. Ahaz was the father of Hezekiah. 10 Hezekiah was the father of Manasseh. Manasseh was the father of Amon. Amon was the father of Josiah. 11 Josiah was the father of Jechoniah and his brothers at the time of the exile to Babylon. [. . .] \end{document} On https://app.crixet.com/ Extraneous information, The Contemporary English Version with Deuterocaonicals / Apocrypha (see image above) does this for example and was published by ABS in 1995 / 1999. So there's a possibility it was done with LaTeX. Now, I know well that the United Bible Societies use XeTeX as a backend for PTXprint (SIL Global, former sponsors of XeTeX) that automatically generates page layouts but you need a program called Paratext, which requires a restriction code with approval from UBS. I am interested in typesetting / self-publishing a Bible based on World English Bible British Edition with Apocrypha / Deuterocanonicals, dedicated to the public domain by its editor and contributors (see, eBible.org here or check out the FAQ). Of course, it will have corrections and revisions.
- Display index in document bodyby ReRunner on July 17, 2025 at 7:44 pm
Is the following structure possible? I have keywords marked like this: \trackword{dog}. I'd like to display the page numbers where this keyword appears in the document body (not as an index) using the \showpages{dog} command. For example: \begin{document} In this text, \trackword{cat} appears. Here, \trackword{dog} appears again. One more time about \trackword{cat} and another about \trackword{dog}. And now \trackword{cat} for the third time. \newpage Here, \trackword{dog} barks. And \trackword{cat} meows. \trackword{cat} appears again. \trackword{cat} appears again on the same page. \newpage The word **cat** appears on the following pages: \showpages{cat} Lorem ipsum The word **dog** appears on the following pages: \showpages{dog} Lorem ipsum. \newpage Do you remember that the word cat appears on the page \showpages{cat}? Lorem ipsum. \end{document} AI suggests using the zref package. Unfortunately, compilation in overleaf fails with an error. \documentclass{article} \usepackage{zref-user,zref-abspage} \usepackage{xstring} \usepackage{pgffor} \usepackage{etoolbox} \usepackage{expl3} % For filtering duplicates % Open a file to record occurrences \newwrite\wordlistfile \immediate\openout\wordlistfile=wordlist.dat % Recording a word with a page number \newcommand{\trackword}[1]{% \zref@labelbyprops{word:#1:\thepage}{abspage}% \immediate\write\wordlistfile{#1:\zref@extract{word:#1:\thepage}{abspage}}% #1% } % Auxiliary: removing a comma initial \newcommand{\removestartcomma}[1]{% \IfBeginWith{#1}{, }{\StrGobbleLeft{#1}{2}}{#1}% } % Function for removing duplicates from a list \ExplSyntaxOn \newcommand{\removeDuplicates}[1]{% \clist_set:Nn \l_tmpa_clist {#1}% \clist_set:Nn \l_tmpb_clist {}% \clist_map_inline:Nn \l_tmpa_clist {% \clist_if_in:NnF \l_tmpb_clist {##1} { \clist_put_right:Nn \l_tmpb_clist {##1} } }% \clist_use:Nn \l_tmpb_clist {, }% } \ExplSyntaxOff % Displays a list of unique pages where a given word appears. \newcommand{\showpages}[1]{% \def\pageslist{}% \begingroup \newread\tempreader \openin\tempreader=wordlist.dat \loop \read\tempreader to \temp \unless\ifeof\tempreader \StrBefore{\temp}{:}[\tempword]% \StrBehind{\temp}{:}[\temppage]% \IfStrEq{\tempword}{#1}{% \edef\pageslist{\pageslist, \temppage}% }{}% \repeat \closein\tempreader \endgroup \removeDuplicates{\removestartcomma{\pageslist}}% } LaTeX displays error: LaTeX Warning: Reference `@' on page 1 undefined on input line 60. ! Use of \\zref doesn't match its definition. \kernel@ifnextchar ...rved@d =#1\def \reserved@a { #2}\def \reserved@b {#3}\f... The error disappears after making this change, but the program does not display the page numbers. \makeatletter \newcommand{\trackword}[1]{% \zref@labelbyprops{word:#1:\thepage}{abspage}% \immediate\write\wordlistfile{#1:\zref@extract{word:#1:\thepage}{abspage}}% #1% } \makeatother
- tikz / tikzlibrary{calc,intersections}: draw a tangent line that intersects secant at right angleby Oregon Math Tutor on July 17, 2025 at 5:22 pm
I need to draw a tangent line that intersects a secant line at a right angle outside the circle. The MWE below correctly renders a circle and a secant line, and labels the intersection points. However, I can't figure out how to reorient the tangent line so it intersects the secant at a 90° angle outside the circle. Questions: ❓ Questions: Is my secant line and labeling code efficient? How do I modify the code so the tangent intersects the secant at a right angle outside the circle? Thank you for taking time to assist me. mwe: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,intersections} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[scale=1.5] % Draw the circle with a name for intersection calculations \draw[thick, name path=circle] (0,0) circle (2); % Mark the center \fill (0,0) circle (1.5pt); \node at (0.2,-0.2) {$O$}; % Define the secant line path (extend beyond circle) \path[name path=secant] (-1,3) -- (3,-2); % Find intersection points automatically and store them \path[name intersections={of=circle and secant}] (intersection-1) coordinate (A) (intersection-2) coordinate (B); % Extend the secant line beyond the circle in both directions \draw[thick, red] (-1,3) -- (3,-2); % Mark intersection points \fill[red] (A) circle (1.5pt) (B) circle (1.5pt); % Labels for intersection points \node at (A) [above right] {$A$}; \node at (B) [below left] {$B$}; % Define tangent point on the circle \coordinate (T) at (1.6, 1.2); % Point on circle where tangent touches % Draw tangent line (perpendicular to radius at T) % The radius to T has direction (1.6, 1.2), so perpendicular direction is (-1.2, 1.6) \draw[thick, blue] ($(T) + 2*(-1.2, 1.6)$) -- ($(T) + 2*(1.2, -1.6)$); % Mark the tangent point \fill[blue] (T) circle (1.5pt); \node at (T) [above left] {$T$}; \end{tikzpicture} \end{document}
- Making an initial toc without the frontmatter chapters, and and final toc withby youyou on July 17, 2025 at 3:59 pm
As part of my thesis, I am trying to create a final table of contents listing all the titles that appear in my thesis (the basic format suits me fine), but I also want to display a summary at the beginning, which is a simplified table of contents where only the \part, \chapter and \section found in the \mainmatter are displayed, nothing else. I tried shorttoc, titletoc, minitoc, etc., with varying degrees of success, and never managed to remove what is in the \fontmatter or \backmatter (at least, without removing it from the toc at the same time). If I understand correctly, minitoc only allows you to display toc at the beginning of each chapter, not at the start, and shorttoc doesn't really provide any options... \documentclass[12pt, oneside]{book} \begin{document} \frontmatter \chapter{Introduction} %Here, the partial toc with all parts, chapters and sections that are in the mainmatter and only these% \mainmatter \part{Part 1} \chapter{Chapter 1} \section{Section 1} \section{Section 2} \part{Part 2} \chapter{Chapter 2} \section{Section 1} \section{Section 2} \backmatter \chapter{Conclusion} \tableofcontents %Which is perfect% \end{document} Please let me know which package would be able to do this and how!
- Second kind of Surface Integral with P,Q,R optionalby HelenBurns on July 17, 2025 at 1:17 pm
I want to use \dss[\Sigma][P][Q][R] or \dss[\Sigma]{P,Q,R} or \dss{\Sigma,P,Q,R} to generate \[ \iint_{\Sigma} P\mathrm{d}y\mathrm{d}z+Q\mathrm{d}z\mathrm{d}x+R\mathrm{d}x\mathrm{d}y \] \documentclass{article} %\usepackage{xparse,expl3} \usepackage{amsmath} %\ExplSyntaxOn \NewDocumentCommand{\dss}{O{\Sigma}ooo}{\iint_{#1}% \IfValueT{#2}{#2\,\mathrm{d}y\mathrm{d}z}% \IfValueT{#3}{+#3\,\mathrm{d}z\mathrm{d}x}% \IfValueT{#4}{+#4\,\mathrm{d}x\mathrm{d}y}% } %\ExplSyntaxOff \begin{document} $\dss[D][(x+y+z)][xy][(x-y-z)]$ $\dss[D][][xy][(x-y-z)]$ $\dss[D][][][x-y-z]$ $\dss[D][(x+y+z)][][]$ %or $\dss{D,x+y+z,xy,x-y-z}$. \end{document} But if we only have Q and R, then there is no + sign with Q. However, there are many situations and I don't know how to deal with it. \dss[D][][][x-y-z] indicates P and Q empty but actually those are T under the test of \IfValueTF. But I can't use \dss[D][x-y-z] since x-y-z will presents P instead of R.
- \tcbitemize[raster columns=n] - How can I change the widths from n-1 \tcbitem nodes so that they fit to the width of a separate \tcbitem box?by user2379123 on July 17, 2025 at 10:26 am
What I have tried so far shows following code: \documentclass{standalone} \usepackage{amssymb, amsfonts, dsfont} \usepackage{tcolorbox} \tcbuselibrary{raster} \begin{document} %gray "IBM" box \begin{tcboxedraster}[raster columns=1]{title={IBM}} %smaller gray box "Qiskit Functions Catalog \begin{tcbitemize}[raster columns=1, colback=gray!40] \tcbitem Qiskit Functions Catalog %nested nodes "Circuit Functions" and "Application Functions" \begin{tcbitemize}[raster columns=2, colback=gray!80] \tcbitem Circuit Functions \tcbitem Application Functions \end{tcbitemize} \end{tcbitemize} %violet nodes with same widths and heights \begin{tcbitemize}[raster columns=4, colback=violet!20] \tcbitem Qiskit SDK \tcbitem Qiskit addons \tcbitem Qiskit Transpiler Service \tcbitem Qiskit Code Assistant \end{tcbitemize} \end{tcboxedraster} \end{document} This is my result: Let's take a look on the second row with the violet items. They have same widths and heights which is the desirect effect caused by raster columns=4. What will happen if I put three items in the row but with the same option raster columns=4? In that case this would be the output: I want to change the widths from the violet items so that they perfectly fit to the width size of the upper gray box. How can I obtain this goal? Thanks in advance!
- Creating a table in XeLaTeX in a Hebrew documentby Coenraad van Schoor on July 17, 2025 at 10:10 am
I'm compiling a document completely in Hebrew using XeLaTeX, but I'm having an issue creating a table: using polyglossia, the columns just don't compile...it just gives a string of words. How can I go about fixing this? Here's the MWE: \documentclass[14pt]{memoir} \usepackage[paperwidth=5in, paperheight=8in,top=2cm,bottom=1cm,left=1cm,right=1cm ]{geometry} \setlength{\parindent}{0cm} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage{hebrew} \newfontfamily\hebrewfont[Script=Hebrew]{Frank Ruhl Libre} \begin{document} הזן אותנו \begin{tabular}{l l} בטוב & בחסד \\ \end{tabular} הזן את הכל. \end{document}
- Inquiry on a letterby mathex on July 17, 2025 at 5:56 am
How to write the following specific version of a letter in LaTeX?
- Table split into two parts but not vertically alignedby katiecat0196 on July 16, 2025 at 9:41 pm
I have a long but narrow table that I would like to fit onto one page by splitting it into two parts side-by-side but still under the same table environment. I have somewhat achieved this using two tabularx environments. However, as the two parts of the table have different lengths, they are slightly vertically offset on the page. Does anyone know how to get these tables vertically aligned with each other? I am quite new to using LaTeX but I've not been able to figure this out with my googling. This is the code I am using: \begin{table}[t] %\centering \caption[List of compounds in mixed stock solution.]{List of compounds in mixed stock solution. iso = isoprene, mt = monoterpene, omt = oxygenated monoterpene, sqt = sesquiterpene, osqt = oxygenated sesquiterpene, dt = diterpene, tt = triterpene.} \small \begin{tabularx}{0.5\textwidth}{ L R R} \hline Compound & Type & Formula \\ \hline\hline Isoprene & iso & C$_{5}$H$_{8}$ \\ \hline $\upalpha$-Pinene & mt & C$_{10}$H$_{16}$ \\ \hline Camphene & mt & C$_{10}$H$_{16}$ \\ \hline Sabinene & mt & C$_{10}$H$_{16}$ \\ \hline $\upbeta$-Pinene & mt & C$_{10}$H$_{16}$ \\ \hline $\upbeta$-Myrcene & mt & C$_{10}$H$_{16}$ \\ \hline $\upalpha$-Phellandrene & mt & C$_{10}$H$_{16}$ \\ \hline 3-Carene & mt & C$_{10}$H$_{16}$ \\ \hline $\upalpha$-Terpinene & mt & C$_{10}$H$_{16}$ \\ \hline \textit{m}-Cymene & mt & C$_{10}$H$_{14}$ \\ \hline \textit{p}-Cymene & mt & C$_{10}$H$_{14}$ \\ \hline Ocimene & mt & C$_{10}$H$_{16}$ \\ \hline Eucalyptol & omt & C$_{10}$H$_{18}$O \\ \hline \textit{D}-Limonene & mt & C$_{10}$H$_{16}$ \\ \hline \textit{o}-Cymene & mt & C$_{10}$H$_{14}$ \\ \hline $\upgamma$-Terpinene & mt & C$_{10}$H$_{16}$ \\ \hline Sabinene Hydrate & omt & C$_{10}$H$_{18}$O \\ \hline Terpinolene & mt & C$_{10}$H$_{16}$ \\ \hline Linalool & omt & C$_{10}$H$_{18}$O \\ \hline Fenchol & omt & C$_{10}$H$_{18}$O \\ \hline Isopulegol & omt & C$_{10}$H$_{18}$O \\ \hline \end{tabularx} \begin{tabularx}{0.5\textwidth} { L R R} \hline Compound & Type & Formula \\ \hline\hline Isoborneol & omt & C$_{10}$H$_{18}$O \\ \hline (-)-Borneol & omt & C$_{10}$H$_{18}$O \\ \hline (+)-Borneol & omt & C$_{10}$H$_{18}$O \\ \hline Menthol & omt & C$_{10}$H$_{20}$O \\ \hline Terpinen-4-ol & omt & C$_{10}$H$_{18}$O \\ \hline $\upalpha$-Terpineol & omt & C$_{10}$H$_{18}$O \\ \hline Citronellol & omt & C$_{10}$H$_{20}$O \\ \hline Carvacrol & omt & C$_{10}$H$_{14}$O \\ \hline Geraniol & omt & C$_{10}$H$_{18}$O \\ \hline Thymol & omt & C$_{10}$H$_{14}$O \\ \hline (-)-$\upalpha$-Cedrene & sqt & C$_{15}$H$_{24}$ \\ \hline Caryophyllene & sqt & C$_{15}$H$_{24}$ \\ \hline trans-$\upbeta$-Farnesene & sqt & C$_{15}$H$_{24}$ \\ \hline Humulene & sqt & C$_{15}$H$_{24}$ \\ \hline Valencene & sqt & C$_{15}$H$_{24}$ \\ \hline Nerolidol & osqt & C$_{15}$H$_{26}$O \\ \hline Guaiol & osqt & C$_{15}$H$_{26}$O \\ \hline Cedrol & osqt & C$_{15}$H$_{26}$O \\ \hline (-)-$\upalpha$-Bisabolol & osqt & C$_{15}$H$_{26}$O \\ \hline Farnesol & osqt & C$_{15}$H$_{26}$O \\ \hline Phytane & dt & C$_{20}$H$_{42}$ \\ \hline Squalene & tt & C$_{30}$H$_{50}$ \\ \hline \end{tabularx} \end{table}