Hot
- How to tweak the exact positon in the normal direction of the path by `anchor`?by Explorer on April 28, 2026 at 6:28 am
As the follow-up of my previous question, the code below comes from cfr's solution: % Source - https://tex.stackexchange.com/a/762315 % Posted by cfr % Retrieved 2026-04-28, License - CC BY-SA 4.0 \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \makeatletter \newcommand\dualharpoon{} \newcommand\dualharpoon@aux{} \newcommand\dualharpoon@noaux{} \protected\def\dualharpoon{% \@ifnextchar[\dualharpoon@aux\dualharpoon@noaux } \protected\def\dualharpoon@noaux{% \dualharpoon@aux[]% } \long\protected\def\dualharpoon@aux[#1]#2#3#4#5{% \path (#4.center); \pgfgetlastxy{\temp@ax}{\temp@ay} \path (#5.center); \pgfgetlastxy{\temp@bx}{\temp@by} \pgfmathsetmacro\temp@angle{atan2(\temp@by-\temp@ay,\temp@bx-\temp@ax)} \draw[-foo,mystyle] (#4.{\temp@angle - 10}) -- % node[ % draw=blue, % % anchor={90+\temp@angle}, % sloped,inner sep=0pt,#1 % ] {#2} node[ draw, % draw=red, anchor={90+\temp@angle},%<- sloped,inner sep=0pt,#1 ] {#2} (#5.{190 + \temp@angle}); %%%%%%%%%%%%%%%%%%%% \draw[foo-,mystyle] (#4.{\temp@angle + 10}) -- node[ draw, anchor={270+\temp@angle},%<- sloped,inner sep=0pt,#1 ] {#3} (#5.{170 + \temp@angle}); } \makeatother \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]},scale=1.5, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \foreach \i in {0,20,...,340}{ \node[draw,circle,fill=teal] (In-\i) at (\i:3) {}; \node[draw,circle,fill=magenta] (Out-\i) at (\i:5) {}; \dualharpoon[scale=.8]{$\Delta$}{$\nabla$}{In-\i}{Out-\i} } \end{tikzpicture} \end{document} And I tweaked some label arguments, but I found that the label position is not exactly what I want with anchor={90+\temp@angle}, I want every angles gives the alignment with the normal direction: To show the anchor's behavior more clearly: % Source - https://tex.stackexchange.com/a/762315 % Posted by cfr % Retrieved 2026-04-28, License - CC BY-SA 4.0 \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \makeatletter \newcommand\dualharpoon{} \newcommand\dualharpoon@aux{} \newcommand\dualharpoon@noaux{} \protected\def\dualharpoon{% \@ifnextchar[\dualharpoon@aux\dualharpoon@noaux } \protected\def\dualharpoon@noaux{% \dualharpoon@aux[]% } \long\protected\def\dualharpoon@aux[#1]#2#3#4#5{% \path (#4.center); \pgfgetlastxy{\temp@ax}{\temp@ay} \path (#5.center); \pgfgetlastxy{\temp@bx}{\temp@by} \pgfmathsetmacro\temp@angle{atan2(\temp@by-\temp@ay,\temp@bx-\temp@ax)} \draw[-foo,mystyle] (#4.{\temp@angle - 10}) -- node[ draw=blue, % anchor={90+\temp@angle}, sloped,inner sep=0pt,#1 ] {#2} node[ draw=red, anchor={90+\temp@angle},%<- sloped,inner sep=0pt,#1 ] {#2} (#5.{190 + \temp@angle}); %%%%%%%%%%%%%%%%%%%% % \draw[foo-,mystyle] (#4.{\temp@angle + 10}) -- node[ % draw, % anchor={270+\temp@angle},%<- % sloped,inner sep=0pt,#1 % ] {#3} (#5.{170 + \temp@angle}); } \makeatother \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]},scale=1.5, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \foreach \i in {0,20,...,340}{ \node[draw,circle,fill=teal] (In-\i) at (\i:3) {}; \node[draw,circle,fill=magenta] (Out-\i) at (\i:5) {}; \dualharpoon[scale=.8]{$\Delta$}{$\nabla$}{In-\i}{Out-\i} } \end{tikzpicture} \end{document} It also reminded me of Jasper Habicht's another solution, but..., I found it not quite easy to decide the position of the midpoint of path from A to B... Any suggestions on this?
- How to display content vertically in a merged cell in the tabularry package?by Vincent on April 28, 2026 at 3:53 am
The code: \documentclass{ctexart} \usepackage{tabularray} \begin{document} \begin{tblr}{ colspec={*{3}{Q[c]}X[l]}, hlines, vlines, cell{2}{1}={r=2}{c}, cell{4}{1}={r=3}{c}, } 班级&姓名&特长\\ 高三(1)班&陈墨&程序设计(信息学奥林匹克竞赛省级一等奖)、围棋(业余五段)\\ &赵雨萱&篮球(校队主力控卫)、素描\\ \parbox{1em}{高二(3)班}&林清音&小提琴(十级)、英文演讲(市级比赛冠军)\\ &周逸飞&数学建模、长跑(校运会1500米纪录保持者)\\ &王启明&机器人设计与编程(全国青少年科技创新大赛二等奖)\\ 高一(2)班&苏小曼&书法(软笔楷书)、播音主持、视频剪辑\\ \end{tblr} \end{document} The produce:
- How to make sidenote enviroment in tcolorbox proof enviroment with kaobook classby 조문수 on April 27, 2026 at 11:31 pm
How to make sidenote enviroment in tcolorbox proof enviroment with kaobook class ** proof enviroment in tcolorbox source code \tcolorboxenvironment{proof}{% `proof' from `amsthm' blanker,breakable,left=5mm, before skip=10pt,after skip=10pt, borderline west={1mm}{0pt}{red}}
- Modern CV Skill-matrix items uniform vertical height and #Legend-itemsby mathuser1234 on April 27, 2026 at 8:04 pm
in the Latex-Code attached, I want to: adjust the vertical height of the items in the skill matrix so that the text starts on the same height as the skill-boxes. Reduce the number of Legend items to three, in particular to "basic knowledge", "skilled" and "project exp.". \documentclass[a4paper, 11pt, color, final]{moderncv} \usepackage[scaled=.92]{helvet} \renewcommand{\familydefault}{\sfdefault} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} %moderncv themes \definecolor{darkgreen}{rgb}{0.290196, 0.394314, 0.384314} \definecolor{darkgrey}{rgb}{0.45,0.45,0.45} \colorlet{color1}{darkgreen} \colorlet{color2}{darkgrey} \moderncvstyle{classic} %character encoding \usepackage[utf8]{inputenc} %adjust page margins \usepackage[scale = 0.8]{geometry} \recomputelengths \usepackage{graphicx} \graphicspath{ {images/} } %Personal Data \firstname{John} \familyname{Doe} \born{\normalfont 01. 01. 2000} \title{\textcolor{black}{Curriculum Vitae}} \email{\normalfont abc.def@hij.com} \address{\normalfont abc street 1}{\normalfont 12345 city} \nopagenumbers{} \makeatletter \renewcommand*{\makecvhead}{% % recompute lengths (in case we are switching from letter to resume, or vice versa) \recomputecvlengths% % optional detailed information (pre-rendering) \@initializebox{\makecvheaddetailsbox}% \if@details% \def\phonesdetails{}% \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% \def\socialsdetails{}% \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% \savebox{\makecvheaddetailsbox}{% \addressfont\color{color0}% \if@left\begin{tabular}[b]{@{}l@{}}\fi% \if@right\begin{tabular}[b]{@{}l@{}}\fi% \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet% \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}% \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol{\@email}}% \ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol{\@born}}% \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}% \end{tabular} }\fi% % optional photo (pre-rendering) \@initializebox{\makecvheadpicturebox}% \savebox{\makecvheadpicturebox}{% \ifthenelse{\isundefined{\@photo}}% {}% {% \if@left% \hspace*{\separatorcolumnwidth}\fi% \color{color0}% \setlength{\fboxrule}{\@photoframewidth}% \ifdim\@photoframewidth=0pt% \setlength{\fboxsep}{0pt}\fi% \framebox{\includegraphics[width=\@photowidth]{\@photo}}}% \if@right% \hspace*{\separatorcolumnwidth}\fi}% % name and title (pre-rendering) \@initializelength{\makecvheaddetailswidth}\settowidth{\makecvheaddetailswidth}{\usebox{\makecvheaddetailsbox}}% \@initializelength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}% \ifthenelse{\lengthtest{\makecvheadnamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvheadnamewidth=0pt) {\setlength{\makecvheadnamewidth}{\textwidth-\makecvheaddetailswidth-\makecvheadpicturewidth}}% {}% \@initializebox{\makecvheadnamebox}% \savebox{\makecvheadnamebox}{% \begin{minipage}[b]{\makecvheadnamewidth}% \if@left\raggedright\fi% \if@right\raggedleft\fi% \namestyle{\@firstname\ \@lastname}% \ifthenelse{\equal{\@title}{}}{}{\\[8.4em]\titlestyle{\@title}}% \end{minipage}}% % rendering \if@left% \usebox{\makecvheadnamebox}% \hfill% \usebox{\makecvheadpicturebox}\\[-3cm]% \usebox{\makecvheaddetailsbox}\fi% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced \if@right% \usebox{\makecvheadpicturebox}% \rlap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced \hfill% \usebox{\makecvheadnamebox}\fi% \\[5em]% % optional quote \ifthenelse{\isundefined{\@quote}}% {}% {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[1.5em]}}% \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvhead % --- Benötigte Pakete --- \usepackage{calc} \usepackage{enumitem} \begin{document} %CURRICULUM VITAE \maketitle \section{Skills} \cvitemwithcomment[0.5em]{abc}{\cvskill{1}}{\normalfont \mdseries \begin{itemize}[leftmargin=1em, nosep, label=\textbullet] \item Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text TextText Text Text Text Text Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text Text \item Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text TextText Text Text Text Text Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text Text \item Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text TextText Text Text Text Text Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text Text \end{itemize}} \cvitemwithcomment[0.5em]{abc}{\cvskill{1}}{\parbox{\linewidth}{\normalfont \mdseries Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text TextText Text Text Text Text Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text TextText Text Text Text}} \cvitemwithcomment[0.5em]{abc}{\cvskill{3}}{\parbox{\linewidth}{\normalfont \mdseries text abcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa. }} \vspace{0.1cm} \cvskillplainlegend[0.2em][basic knowledge][skilled][project-exp.][in-depth knowledge][Expert]{Legende} \closesection{} \begin{flushleft} city, \today \end{flushleft} \end{document}
- tcolorbox across multiple pages - the title is not fully the sameby Doc on April 27, 2026 at 7:15 pm
I have had some assistance with tcolorbox before, and I am trying to get a box (when it naturally follows from one page to the next), with the same heading but, in the MWE below, the formatting of the header changes. \documentclass[]{report} \newcommand\rub[1]{% {\noindent\normalsize\itshape\textcolor{red}{#1}\normalsize}%} \usepackage[skins,breakable]{tcolorbox} % changed <<<<<<<<<<<< \tcbset{% changed <<<<<<<<<<<<mytitle/.style={% enhanced, overlay={ \node [rotate=90, anchor=south, fill=tcbcolframe!25, text width=\tcbtextheight, align=center] at (frame.west) {\itshape#1}; }, }, breakable } \newtcolorbox{mybox}[2][]{% mytitle={#2}, toprule=0pt, bottomrule=0pt, rightrule=0pt, sharp corners, valign=center,#1} \title{Test} \author{} \begin{document} \maketitle \chapter{Weekday Evening Prayers} \section*{Introductory Prayers} \rub{Having awakened from sleep, before any other act, rise from your bed without laziness and, having gathered your thoughts, stand before the All-seeing God and make the Sign of the Cross, saying:}\\ In the name of the Father, and the Son, and the Holy Spirit. Amen.\\ \rub{Afterwards, stand in silence for a few moments until all your senses are calmed and your thoughts have laid aside all earthly cares. At that point, begin with the Prayer of the Publican without haste and with heartfelt attentiveness.}\\ O God, be merciful to me, a sinner. \rub{(thrice)}\\ \rub{Then, we continue:}\\ O Lord Jesus Christ, Son of God, for the sake of the prayers of Thy most pure Mother and all the saints, have mercy on us. Amen.\\ Glory to Thee, our God, glory to Thee.\\ O heavenly King, the Comforter, the Spirit of truth, who art everywhere present and fillest all things, Treasury of blessings and Giver of life: Come and abide in us, and cleanse us from every impurity, and save our souls, O Good One.\\ \begin{mybox}[colframe=yellow,breakable]{Paschaltide} \rub{From Bright Monday through the Leavetaking of Pascha, after the initial ``Amen", we immediately say:}\\ Christ is risen from the dead, trampling down death by death, and upon those in the tombs bestowing life. \rub{(thrice)}\\ \rub{Then continue with ``Holy God" $\ldots$ (below).}\\ \rub{Also, the prayer ``O Heavenly King $\ldots$" is not read until Pentecost. From the Apodosis (Leavetaking) of Pascha until the Sunday of Pentecost, we begin with ``Holy God $\ldots$"} \end{mybox} \end{document}
- Alignment of vscodeicons and vectorlogos icons with respect to surrounding textby Sebastiano on April 27, 2026 at 6:47 pm
I am using the vscodeicons and vectorlogos packages to include small icons in my document. Consider this MWE: \documentclass{article} \usepackage{vscodeicons,vectorlogos} \begin{document} Inline \vscodeicon[filetype]{wolfram} version Geogebra \vectorlogo[icon]{geogebra} \end{document} To my eyes, the icons appear slightly shifted downwards with respect to the surrounding text. Are they already correctly aligned in the packages, or would it be better to tweak them (e.g., with \raisebox or package options such as height=auto/dstrut=false) so that they sit exactly on the baseline like the surrounding text? If some adjustment is recommended, what would be a robust way to align them in inline text without breaking the line spacing?
- How to format the spacing of the captions of figures and tables properly?by Simon on April 27, 2026 at 5:51 pm
I am asked to format the spacing of the captions of figures and tables as follows: captions of figures above: 6 pt below: 18 pt captions of tables above: 18 pt below: 9 pt I tried implementing this as shown in the following MWE, yet, the result seems odd, especially the gap below the caption of the figure and below the table, respectively, and the proceeding text. Why is that or, alternatively, how can this be formatted properly? \LoadClass[a4paper,12pt,parskip=full-]{scrreprt} \RequirePackage[font=footnotesize,labelfont=bf,singlelinecheck=false]{caption} \captionsetup[figure]{aboveskip=6pt,belowskip=18pt} \captionsetup[table]{belowskip=18pt,aboveskip=9pt} \RequirePackage{float} \begin{document} This text refers to Figure \ref{figure}: \begin{figure}[H] \caption{Caption of Figure} \label{figure} \end{figure} This text refers to Table \ref{table}: \begin{table}[H] \caption{Caption of Table} \label{table} \begin{tabular}{ |c| } \hline Table\\ \hline \end{tabular} \end{table} Text. \end{document}
- How to add two-sided harpoon arrows with proper label position elegantly?by Explorer on April 27, 2026 at 5:14 pm
Learning from the link here and here, I have the following code: \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]}, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \node[draw,circle,fill=teal] (A) at (0,1) {A}; \node[draw,circle,fill=magenta] (B) at (0,-1) {B}; \node[draw,circle,fill=cyan] (C) at (2.5,.5) {C}; \draw[-foo,mystyle,transform canvas={xshift=-0.3ex}] (A) -- node[left] {$\Delta$} (B); \draw[foo-,mystyle,transform canvas={xshift=+0.3ex}] (A) -- node[right] {$\nabla$} (B); % \draw[dualharpoon={$\Delta$}{$\nabla$}] (A) -- (B); % ? \draw[-foo,mystyle,transform canvas={yshift=-0.3ex}] (B) -- node[below right=-3pt] {$f(x)$} (C); \draw[foo-,mystyle,transform canvas={yshift=+0.3ex}] (B) -- node[above left=-3pt] {$g(x)$} (C); % \draw[dualharpoon={$f(x)$}{$g(x)$}] (B) -- (C); % ? \end{tikzpicture} \end{document} I want more smartly syntax like: \draw[dualharpoon={$\Delta$}{$\nabla$}] (A) -- (B); \draw[dualharpoon={$f(x)$}{$g(x)$}] (B) -- (C); which control exactly how much to xshift/yshift moved towards in the direction perpendicular to the connection between the two nodes, in addition, I also don't want to decide the node's position by above left=-3pt manually. Any suggestions on how to support such two-sided harpoon arrow with label? Edited after cfr's answer(first edition): % Source - https://tex.stackexchange.com/a/762315 % Posted by cfr % Retrieved 2026-04-28, License - CC BY-SA 4.0 \documentclass[tikz,border=5pt]{standalone} \usetikzlibrary{arrows.meta} \makeatletter \newcommand\dualharpoon{} \newcommand\dualharpoon@aux{} \newcommand\dualharpoon@noaux{} \protected\def\dualharpoon{% \@ifnextchar[\dualharpoon@aux\dualharpoon@noaux } \protected\def\dualharpoon@noaux{% \dualharpoon@aux[]% } \long\protected\def\dualharpoon@aux[#1]#2#3#4#5{% \path (#4.center); \pgfgetlastxy{\temp@ax}{\temp@ay} \path (#5.center); \pgfgetlastxy{\temp@bx}{\temp@by} \edef\temp@angle{\fpeval{(atan((\temp@by-\temp@ay)/(\temp@bx-\temp@ax)))*(180/pi)}} \draw[-foo,mystyle] (#4.{\temp@angle - 5}) -- coordinate (temp@1) (#5.{185 + \temp@angle}); \node[anchor={90+\temp@angle}] at (temp@1) {#2} ; \draw[foo-,mystyle] (#4.{\temp@angle + 5}) -- coordinate (temp@2) (#5.{175 + \temp@angle}); \node[anchor={270+\temp@angle}] at (temp@2) {#3}; } \makeatother \begin{document} \begin{tikzpicture}[ foo/.tip={Stealth[harpoon,swap]}, mystyle/.style={thick, shorten >=2pt,shorten <=2pt}, ] \node[draw,circle,fill=teal] (A) at (0,1) {A}; \node[draw,circle,fill=magenta] (B) at (0,-1) {B}; \node[draw,circle,fill=cyan] (C) at (2.5,.5) {C}; \node[draw,circle,fill=olive] (D) at (-3,1) {D}; \dualharpoon{$\Delta$}{$\nabla$}{A}{B} \dualharpoon{$g(x)$}{$f(x)$}{B}{C} \dualharpoon{$p$}{$q$}{B}{D} \end{tikzpicture} \end{document}
- Creating hyperref links which continue working when PDF document is split into chaptersby Frisket on April 27, 2026 at 3:14 pm
I use lualatex and hyperref to create a large PDF file of documentation with extensive crossreferencing to figures, tables, sections, list items, pages, etc using hyperref and varioref. The file then gets split (by a script which writes pdftk commands) into separate PDF files for prelims, chapters, appendices, references, etc. Is there a way to rewrite the crossreferencing commands so that they will work both in the monolithic document and between the split documents? Or do I need to create both the single-file PDF and the separate PDFs using LaTeX, rather than by splitting the big one?
- biblatex-chicago: Inconsistent spacing between volumes and pages of articles?by user1362373 on April 27, 2026 at 1:57 pm
I'm using biblatex-chicago and find that the spacing between volumes and pages of articles is inconsistent. What I mean by this is that the spacing depends on whether the issue number is present. Consider this MWE: \documentclass{article} \usepackage{filecontents} \usepackage[authordate,backend=biber]{biblatex-chicago} \addbibresource{refs-mwe.bib} \begin{filecontents}{refs-mwe.bib} @article{Other2021, author={A. N. Other}, title={Some title}, journal={Nature}, volume={2}, number={3}, pages={4-5}, year={2021} } @article{Bloggs2022, author={J. Bloggs}, title={Some title}, journal={Science}, volume={3}, pages={5-6}, year={2022} } \end{filecontents} \begin{document} \textcite{Other2021,Bloggs2022} \printbibliography \end{document} which gives How do I get rid of the spaces before and after the issue number? That is, how do I get rid of the spaces before and after the "(3):" in the second reference? Note: It is possible to add a space before the pages in the first reference by adding \renewcommand{\postvolpunct}{\addcolon\addspace}, but this is not what I want.
- MathType equations convert into LaTeX using Pandocby GowriSaro on April 27, 2026 at 1:07 pm
I'm having a MS-Word file with more Math, and the Math are in MathType format, I need to convert this into LaTeX format. Is Pandoc supports to convert MathType into LaTeX format or please suggest any other suitable converter do this work. Need all your advise, as I'm new to Word to LaTeX conversion mode.
- Raise subscript position in lualatexby Alexander Voigt on April 27, 2026 at 8:25 am
I am typesetting the following matrix equation (MWE): \documentclass[preview]{standalone} \usepackage{iftex} \ifLuaTeX \usepackage{unicode-math} \else \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \fi \begin{document} \[ \begin{pmatrix} \underline{v}_1^T \\ \underline{v}_3^T \\ \underline{v}_3^T \end{pmatrix} = \begin{pmatrix} v_{11} & v_{12} & v_{13} \\ v_{21} & v_{22} & v_{23} \\ v_{31} & v_{32} & v_{33} \end{pmatrix} \] \end{document} When I compile with pdflatex, the matrix elements on the l.h.s. look good to me. In particular, both the subscripts (indices) and the superscripts (T) are properly set and readable: However, when I compile with lualatex, the subscripts overlap with the succeeding line: I've also created a gif for a better comparison: My question is: How can I avoid the overlap? (My wish would be to consistently raise the subscripts. I'd like to avoid increasing the row distance, because then the rows on the l.h.s. would not properly align with the rows on the r.h.s.)
- How to make head and headlineby HH D on April 27, 2026 at 8:09 am
In default \makepagestyle{outerpage} \makeevenhead{outerpage}{\thepage}{}{} \makeoddhead{outerpage}{}{}{\thepage} \makeheadrule{outerpage}{\textwidth}{0.4pt} is good. But in my case I make active use of margin notes. I thinks it is not good idea: \makeoddhead{outerpage}{}{}{% \makebox[0pt][r]{% \rule{\dimexpr\textwidth+\marginparsep+\marginparwidth\relax}{0.4pt}% }\\ \thepage } Remark that I use memoir class, and not use geometry package (geometry makes problem in my document)
- Add stereographically spaced longitudinal lines to 4D surface that is embedded in R3by Jasper on April 26, 2026 at 10:13 pm
I looking back on an old stereographic projection gif that I made. It is created by revolving Steiner circles about an axis of symmetry. In the illustration, the steiner circles form the latitudinal lines for tori and spheres. I noticed that the intersections of these circles and tori, beyond just being orthogonal, actually form longitudinal rings for the spheres and tori, and that these rings, when spaced stereographically, would form a beautiful four-dimensional surface (4 parameters, due to having two surfaces each with latitudinal and longitudinal lines) embedded in 3-space. I'm having trouble getting these new longitudinal lines to be stereographically spaced. Currently, they are arithmetically spaced. I want to obtain a truly 4-dimensional pair of surface families, and I think this is possible by stereographically spacing the new longitudinal lines that we plan to add. I believe that the correct solution will involve actually using the stereographic projection formula, instead of plane derivations based on it. See https://en.wikipedia.org/wiki/Stereographic_projection. \documentclass[ tikz ,border = 3.14mm ]{standalone} \usepackage{tikz-3dplot} \pgfmathdeclarefunction{sphereX}{2}{% % #1 - longitude % #2 - latitude \pgfmathparse{cos(#2)*cos(#1)}% } \pgfmathdeclarefunction{sphereY}{2}{% \pgfmathparse{cos(#2)*sin(#1)}% } \pgfmathdeclarefunction{sphereZ}{2}{% \pgfmathparse{sin(#2)}% } \pgfmathdeclarefunction{toruscenter}{1}{% % #1 - \animationparameter \pgfmathparse{1/cos(#1)}% } \pgfmathdeclarefunction{torusradius}{1}{% % #1 - \animationparameter \pgfmathparse{-sin(#1)/cos(#1)}% } \pgfmathdeclarefunction{projectionx}{3}{% % #1 - \animationparameter % #2 - \longitude % #2 - \latitude \pgfmathparse{ torusradius(#1) * sphereX(#2,#3) + toruscenter(#1) * cos(#2) }% } \pgfmathdeclarefunction{projectiony}{3}{% % #1 - \animationparameter % #2 - \longitude % #2 - \latitude \pgfmathparse{ torusradius(#1) * sphereY(#2,#3) + toruscenter(#1) * sin(#2) }% } \pgfmathdeclarefunction{projectionz}{3}{% % #1 - \animationparameter % #2 - \longitude % #2 - \latitude \pgfmathparse{ torusradius(#1) * sphereZ(#2,#3) }% } % \pgfmathsetmacro{\animationparameter}{60} \begin{document} \tdplotsetmaincoords{60}{120} \begin{tikzpicture}[tdplot_main_coords,ultra thin] % This clips and adds struts to a rectangle % which mimicks the size of a Beamer frame. \path[tdplot_screen_coords] (-12.8/2,-9.6/2) rectangle (12.8/2,9.6/2); \clip[tdplot_screen_coords] (-12.8/2,-9.6/2) rectangle (12.8/2,9.6/2); \foreach \animationparameter in {1,30,60,120,150,180} { \pgfmathsetmacro{\startlatitude}{0} \pgfmathsetmacro{\endlatitude}{360} \pgfmathsetmacro{\sampleslatitude}{20} \pgfmathsetmacro{\steplatitude}{ (\endlatitude - \startlatitude) / \sampleslatitude } \foreach \latitude[ parse = true ,count = \count ] in {% \startlatitude% ,\startlatitude+\steplatitude% ,...% ,\endlatitude% } { \pgfmathparse{\count != \sampleslatitude + 1} \ifnum\pgfmathresult=1 \pgfmathsetmacro{\startlongitude}{0} \pgfmathsetmacro{\endlongitude}{360} \pgfmathsetmacro{\sampleslongitude}{20} \draw[ smooth ,domain = \startlongitude:\endlongitude ,samples = \sampleslongitude ,variable = \longitude ] plot ( { projectionx( \animationparameter ,\longitude ,\latitude ) } ,{ projectiony( \animationparameter ,\longitude ,\latitude ) } ,{ projectionz( \animationparameter ,\longitude ,\latitude ) } ) plot ( { toruscenter(\animationparameter) * sphereX(\longitude,\latitude) } ,{ toruscenter(\animationparameter) * sphereY(\longitude,\latitude) } ,{ toruscenter(\animationparameter) * sphereZ(\longitude,\latitude) + torusradius(\animationparameter) } ); \fi } \pgfmathsetmacro{\startlongitude}{0} \pgfmathsetmacro{\endlongitude}{360} \pgfmathsetmacro{\sampleslongitude}{20} \pgfmathsetmacro{\steplongitude}{ (\endlongitude - \startlongitude) / \sampleslongitude } \foreach \longitude[ parse = true ,count = \count ] in {% \startlongitude% ,\startlongitude+\steplongitude% ,...% ,\endlongitude% } { \pgfmathparse{\count != \sampleslongitude + 1} \ifnum\pgfmathresult=1 \pgfmathsetmacro{\startlatitude}{0} \pgfmathsetmacro{\endlatitude}{360} \pgfmathsetmacro{\sampleslatitude}{20} \draw[ smooth ,domain = \startlatitude:\endlatitude ,samples = \sampleslatitude ,variable = \latitude ] plot ( { projectionx( \animationparameter ,\longitude ,\latitude ) } ,{ projectiony( \animationparameter ,\longitude ,\latitude ) } ,{ projectionz( \animationparameter ,\longitude ,\latitude ) } ) plot ( { toruscenter(\animationparameter) * sphereX(\longitude,\latitude) } ,{ toruscenter(\animationparameter) * sphereY(\longitude,\latitude) } ,{ toruscenter(\animationparameter) * sphereZ(\longitude,\latitude) + torusradius(\animationparameter) } ); \fi } } \end{tikzpicture} \end{document}
- Horizontal rule in CV europass without alterate layoutby Sebastiano on April 26, 2026 at 9:44 pm
I am working on a personalized CV-class and I have need to add a horizontal header line manually positioned, that not use TikZ and not shift horizontally or vertically text and gray box like the image below I already use a grey background with \AddToShipoutPictureBG \AddToShipoutPictureBG*{% \AtPageUpperLeft{% \raisebox{-.29\paperheight}{% \color{gray!15}\rule{\paperwidth}{.29\paperheight}% }% }% } I have tried \noindent\hrulefill or with \hskip-1em\vtop{\vskip0.5cm\hsize=2in \hrulefill} or \makebox but it does not permit me to create a rule without shift vertically/horizontally text and gray box. Here a minimal working example using another similar class. You can see that the rule \noindent\hrulefill that moves the text downwards: \documentclass[italian,a4paper]{europasscv} \usepackage[italian]{babel} \usepackage{graphicx,array,booktabs,fontawesome6,xcolor,tikz} \usepackage{eso-pic} \DeclareRobustCommand\ebseries{\fontseries{eb}\selectfont} \DeclareTextFontCommand{\texteb}{\ebseries} \ecvname{%\fontseries{b}\selectfont %\textbf{ \sffamily{\ebseries Marco Bellini } %} } \ecvaddress{\!Via delle Rose, 25 40123 Apuleia} \ecvmobile{\,(+39) } \ecvtelephone{(+39) } \begin{document} \AddToShipoutPictureBG*{% \AtPageUpperLeft{% \raisebox{-.29\paperheight}{% \color{gray!15}\rule{\paperwidth}{.29\paperheight}% }% }% } \begin{europasscv} \noindent\hrulefill \sffamily \ecvpersonalinfo{} \ecvbigitem{Posizione ricoperta}{ingegnere} \ecvsection{ingegnere} \ecvtitle{2011 – in corso}{Impresa edile Zante} \ecvitem{}{Bla bla bla} \ecvtitle{2024}{Docente a contratto} \ecvitem{}{Matematica II} \ecvitem{\ecvhighlight{Attività o settore}}{Dipartimento di Scienze Chimiche – Università degli Studi di Modena.} \end{europasscv} \end{document} What is the best way to add a line as per my instructions?
- Table header text dropped when including pgfplotstable inside tikzpicture graphby Kevin Zembower on April 26, 2026 at 4:52 pm
I notice a strange phenomenon when trying to create a data table side-by-side with its graph. The header text of the table next to the graph disappears, while a stand-alone table is fine. Here's my MWE: \documentclass[]{article} \usepackage{pgfplots} \pgfplotsset{ scale only axis, compat=1.18, } \usepackage{pgfplotstable} %To read data files once \pgfplotstableset{ %Setting for data table appearance every head row/.style={before row=\hline,after row=\hline}, every last row/.style={after row=\hline} } \begin{document} \pgfplotstableread{ x y 1 2 2 4 3 6 4 8 }\datatable Table standing alone: \pgfplotstabletypeset{\datatable} Table and graph side by side (pfgtabletypeset inside tikzpicture): \begin{figure}[h] \begin{tikzpicture} \begin{axis} \addplot table {\datatable}; \end{axis} \hskip 10cm \pgfplotstabletypeset{\datatable} \end{tikzpicture} \caption{Graph and datatable side-by=side} \end{figure} \end{document} Here's what I see: My two questions are: How to restore the table header text? How to position the table vertically so it's centered on the graph? Thanks so much for your suggestions and advice. -Kevin
- How can we obtain a smoother sphere when cutting it with a plane and moving the cut portion?by minthao_2011 on April 26, 2026 at 11:11 am
I am using this code in luadraw to cut a sphere with a plane and move one of the cut parts to another position. Currently, the surface of the sphere is not really smooth. If I increase the number in this line local S = sphere(Origin, R, 60, 60) to a larger value, the compilation becomes slower. How can I make the sphere smoother? \documentclass[border=5pt]{standalone} \usepackage[svgnames]{xcolor} \usepackage[3d]{luadraw} \begin{document} \begin{luadraw}{name=sphere_clip3d_fixed} local R = 3 local g = graph3d:new{window={-R-2, R+1, -R-1, R}, viewdir={110, 60}, size={10, 10}} Hiddenlinestyle = "dashed" local S = sphere(Origin, R, 60, 60) local Box = parallelep(M(-5,-5,1.5), 10*vecI, 10*vecJ, 10*vecK) local S_top = clip3d(S, Box) local S_bottom = clip3d(S, Box, true) local vector = 2*vecK + 5*vecJ local S_top_shifted = shift3d(S_top, vector) local I_bottom = border(S_bottom) local I_top_shifted = border(S_top_shifted) g:Dscene3d( g:addFacet(S_bottom, {draw="ball color=orange", color="orange", backcull=true}), g:addFacet(S_top_shifted, {draw="ball color=orange", color="orange", backcull=true}), g:addPolyline(I_bottom, {color="Navy", hidden=true}), g:addPolyline(I_top_shifted, {color="Navy", hidden=true}) ) g:Show() \end{luadraw} \end{document}
- Is there a way to arbitrarily stack mathematical formatting in LaTeX? For example: 𝑨 \mathbf{\mathit{A}}, 𝘼 \mathsf{\mathbf{\mathit{A}}}by mathrm alpha on April 26, 2026 at 10:15 am
Why does the LaTeX example 𝑨 \mathbf{\mathit{A}} become italic but not bold italic font?, or 𝙂 \mathsf{\mathbf{\mathit{G}}} remain sans serif and bold italic? I'd like to use the sans serif italic/bold italic options from the \usepackage{isomath} to represent this. It must have the function of stacking LaTeX math fonts, It would be better to mix and match LaTeX math font formats randomly. For example in font format glyphs display: 𝑨 \mathbf{\mathit} and 𝕬 \mathbf{\mathfrak}/ 𝗔 \mathbf{\mathsf}please use \bm{} + \mathit/\mathfrak/\mathsf in working this command style 𝓐 \mathbf{\mathscr} or 𝓐 \mathscr{\mathbf} please use \pmb{} + \mathscr in working this command style
- Conflict between "siunitx" package and TikZ library "math"by pejsek on April 26, 2026 at 8:46 am
I am using the code from this answer in my project. My project also uses the package siunitx. The code no longer works when siunitx is loaded. I am just a regular user with no knowledge of internals of siunitx or TikZ. What can I do to use the code and siunitx at the same time? In the code below, all I did was add \usepackage{siunitx}. % Source - https://tex.stackexchange.com/a/586432 % Posted by loved.by.Jesus, modified by community. See post 'Timeline' for change history % Retrieved 2026-04-26, License - CC BY-SA 4.0 \documentclass{article} \usepackage{siunitx} % if removed, the code works just fine \usepackage{tikz} \usetikzlibrary{math} \begin{document} \begin{tikzpicture} %Two points (A) and (B) \coordinate (A) at (0,0); \coordinate (B) at (2,2); %--Computing the distance between (A) and (B) %Creating a math coordinate \tikzmath{coordinate \C; %Storing coordinates difference \C = (B)-(A); %Computing the length of C = (Cx,Cy) from its components Cx and Cy %Note the length \distAB is in points (pt) \distAB = sqrt((\Cx)^2+(\Cy)^2); } %--Drawing %line A -- B \draw (A) node [above] {A} -- (B) node[above] {B} node[midway]{\distAB pt}; %Circle with center in (A) and radius \distAB points \draw (A) circle (\distAB pt); \end{tikzpicture} \end{document} Thank you for any help.
- Changing greeks (in math mode) with XeLaTeXby Ryan Kong on April 26, 2026 at 7:22 am
I want to change the greek font into STEP while keeping all other math font in TeX Gyre Termes Math and text font in Times New Roman. The following is my MWE: %! TEX program = xelatex \documentclass{article} \usepackage{amsmath,amssymb,amsthm} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{Times New Roman} \setmathfont{TeX Gyre Termes Math} \setmathfont{STEP}[ range={upgreek, uprightgreek, itgreek, italicgreek}, script=greek ] \begin{document} $\alpha \beta \Gamma \Delta$\\ $f(x) = x^2$ \end{document} It gives me some error messages: undefined Transcript written on test.log. Missing number, treated as zero. <to be read again> Use of \??? doesn't match its definition. <argument> \??? I don't know where went wrong. I downloaded all the fonts I need, and I can run the code if I remove the code: \setmathfont{STEP}[ range={upgreek, uprightgreek, itgreek, italicgreek}, script=greek ] but it gives me this instead. Any help would be much appreciated.
- why \begin{align*}..\end{align*} spacing is different inside tikz Matrix node than outside?by Nasser on April 26, 2026 at 4:33 am
I am learning how to use tikz Matrix to layout few things. Notice that inside tikz matrix node, the alignment is not the same as outside tikz using standard &= for align math environment. I had to to put align environment inside a minipage to make it work inside tikz matrix node. It will not let me just use align directly since not paragraph mode. But the issue is the spacing between left side of &= and right side is different than outside tikz. \documentclass[12pt,varwidth]{standalone} %need varwidth to use align inside standalon \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{matrix} \begin{document} \fbox{\begin{minipage}{1.5in} \vspace{0pt} % Fixes top spacing issues \noindent % Ensures no paragraph indentation {\small All plots used the same initial conditions \begin{align*} x(0) &=1\\ x'(0) &=1\\ \end{align*} } \end{minipage} } \begin{tikzpicture} \matrix (m) [matrix of math nodes, nodes={anchor=center}, row sep=3.5em, column sep=2.5em, nodes in empty cells, draw] { 1& 2& \begin{minipage}{1.5in} \vspace{0pt} % Fixes top spacing issues \noindent % Ensures no paragraph indentation {\small All plots used the same initial conditions \begin{align*} x(0) &=1\\ x'(0) &=1\\ \end{align*} } \end{minipage} &4 \\ 5& 6 & 7 & 8 \\ }; \foreach \i in {1,2,3,4} \foreach \j in {1,2} \draw [help lines] (m-\j-\i.south west) rectangle (m-\j-\i.north east); \end{tikzpicture} \end{document} Compiled with lualatex gives lualatex, TL 2026
- How to fully center text inside tikz Matrix node, which spans multiple columns?by Nasser on April 26, 2026 at 3:02 am
I need to make a node in tikz matrix which spans multiple columns. After much struggle and trial and error, this is the result \documentclass[12pt]{standalone} \usepackage{tikz} \usetikzlibrary{positioning,arrows,chains,matrix,scopes,fit} \usetikzlibrary{backgrounds} \begin{document} \begin{tikzpicture} \matrix (m) [matrix of math nodes, nodes={anchor=center}, row sep=3.5em, column sep=2.5em, nodes in empty cells, draw] {1 & 2 & 3 & 4 \\ 5 & & & \\ 9 & 10 & 11 & 12\\ }; \node[fit=(m-2-2)(m-2-4),align=center,text centered,draw,fill=yellow]{spans cols 2 to 4}; \end{tikzpicture} \end{document} Compiled using lualatex gives Which is what I want, except I do not know how to make the text "spans cols 2 to 4" to be fully centered inside the node that spans the columns. I tried adding align=center and text centered as you see, but this had no effect on vertical centering inside the node. What is correct way to do this? Now the baseline as you see of the text inside, is not aligned with the baseline of the other nodes in the tikz matrix. TL 2026
- Linebreak: Strange word protrusion into the margin without hyphenating word "impedance" interacted with `microtype`?by Explorer on April 26, 2026 at 1:58 am
Claim: I believe that the code example could be simplified further. However, I don't find it easy to construct... : Here below is the original case: % lualatex \documentclass[zihao=-4,fontset=none]{ctexbook} \RequirePackage[ papersize={210mm,297mm}, margin=25mm,showframe, ]{geometry} \RequirePackage{enumitem} \usepackage{txfonts} \usepackage[T1]{fontenc} \begin{document} \begin{enumerate}[label={[}\arabic*{]}, labelindent=\parindent, leftmargin=*] \item Tao Y, \textbf{Liu H}, Wang X, et al. Probabilistically Informed Motion Primitives for Impedance Control in Contact-Rich Manipulation Tasks[J]. xxxx. \end{enumerate} \end{document} If we add microtype, with lualatex, it works: % lualatex \documentclass[zihao=-4,fontset=none]{ctexbook} \RequirePackage[ papersize={210mm,297mm}, margin=25mm,showframe ]{geometry} \RequirePackage{enumitem} %%%%%%%%% \usepackage{txfonts} \usepackage[T1]{fontenc} \usepackage{microtype} \begin{document} \begin{enumerate}[label={[}\arabic*{]}, labelindent=\parindent, leftmargin=*] \item Tao Y, \textbf{Liu H}, Wang X, et al. Probabilistically Informed Motion Primitives for Impedance Control in Contact-Rich Manipulation Tasks[J]. xxxx. \end{enumerate} \end{document} But with xelatex, it doesn't: I found it hard to remove the \documentclass[zihao=-4]{ctexbook} dependency to simplifiy the code, which change fontsize internally... Learning from this link, there are many better alternatives to txfonts: \usepackage{newtxtext} \usepackage{tgtermes} \usepackage[T1]{fontenc} \setmainfont{Times New Roman} \setmainfont{TeX Gyre Termes} But all confront with the word "Impedance" protrusion without microtype... My questions are: What caused the word "Impedance" protrusion here? Is this the expected bahavior? And is microtype the recommended package to tweak here (while failed with xelatex😔)?
- ClawXiv package on MikTeXby Sebastiano on April 25, 2026 at 12:08 pm
I can’t really understand how this package works. When I miss some .sty files related to a package on CTAN, MikTeX asks me and I authorise the installation. I have the following error. ! LaTeX Error: File `clawxiv.sty' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: \documentclass[12pt]{article} \usepackage{clawxiv} \begin{document} \begin{seniorquote}{25 aprile 2026}{}[] My test \end{seniorquote} \end{document}
- Images plus spacer to fit exactly text widthby user1850133 on April 25, 2026 at 11:34 am
How can I fill horizontally the whole space with e.g. 2 images and a spacer in between? Here's my try using \textwidth, but it crosses the text area. \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage[showframe]{geometry} \setlength\parindent{0pt} \begin{document} \includegraphics[width=.45\textwidth]{example-image-9x16} \hspace{.1\textwidth} \includegraphics[width=.45\textwidth]{example-image-9x16} \end{document}
- How are tone letters defined internally in T3 and TIPA?by Grzegorz Brzęczyszczykiewicz on April 24, 2026 at 8:34 pm
There are component parts used to build them in the T3 encoding chart, but how are they exactly built when this encoding is used in the tipa package? There are 5 distinct heights, which should means 25 parts used to build tones (or 50 when short variants are included). But there are only 9 (18) parts. This must mean the program that generates the tone letters has to reposition them vertically. How does it calculate the exact value to reposition the tone letter components? A basic example: \documentclass{article} \usepackage[tone]{tipa} \begin{document} \tone{54} \end{document} An extreme example: \documentclass{article} \usepackage[tone]{tipa} \begin{document} \tone{13243435}a \end{document} Made with: \tone{13243435}a (this command is only accessible using \usepackage[tone]tipa) How does it know how to raise each component part of the complex "bumpy" shape so that their ends will meet in the right place? Here is the code that yields this result. After looking at the T3 encoding table (which appears to be what tipa uses, it appears that this complex shape is composed of many simple lines, all of which are separate glyphs/characters in T3. I'm asking the question: how does it know how much to raise each component to make this shape?
- Ungrouped alternatives to \foreach which are still canonical to use with tikzby Jasper on April 24, 2026 at 7:51 pm
Are there ungrouped alternatives to \foreach which are still canonical to use with tikz? I need to define a color in a loop and use it outside. Maybe expl3? \documentclass{article} \usepackage{pgffor,xcolor} \begin{document} \foreach \i in {1,2} {\colorlet{blah}{blue!\i}} \textcolor{blah}{blah} \end{document}
- Songbook with chordsby Cupora on April 24, 2026 at 12:58 pm
I'm about to make a guitar song book with LaTeX, which means, song lyrics with chords written above the lines: Gm Remember when you were young, Gb Bb You shone like the sun. Eb Dm Cm Bb F Shine on you crazy diamond. I found several packages doing this, and also some other ideas for custom LaTeX commands (for example here). However, I do not like the way the chords are added to the lyrics, since one needs to integrate the chord commands into the song lyrics: \chord{Eb}Shine\chords{Dm} y\chord{Cm}ou cr\chord{Bb}azy di\chord{F}amond which is a hell lot of work to format the lyrics copied from some website. I would prefer to be able to format the lines similar to this: \textlinewithchords{Eb Dm Cm Bb F}{^Shine^ y^ou cr^azy di^amond} so that the lyrics just contain the placeholders for the chords, and the chords input is separated. I would be glad if somebody had an idea how I could implement this behaviour 🙂
- Is \textit now long, instead of short?by rallg on April 24, 2026 at 1:25 am
In the past, something such as \textit{this\par that} would throw an error, because the \textit command was "short" (it could not span paragraphs). But I now see (TeXlive 2026) that is is "long" (can span paragraphs). This is verified by inspecting code in file latex.ltx even though that file is not necessarily loaded. Even AI did not know that! Or did I hack something, and forgot about it?
- Next odd-numbered physical pageby Elayson Abreu on April 23, 2026 at 7:19 pm
I need to create a page break command called \nextoddphysicalpage that moves the current point to the next odd-numbered page, considering the physical numbering of the document, not the logical numbering. My near-solution was based on the \checkoddpage command, but it takes into account the logical numbering, not the physical one: \documentclass{article} \usepackage[strict]{changepage} \def\checkifodd{\checkoddpage \ifoddpage Odd\else Even\fi} \addtocounter{page}{1} \begin{document} Logical page: \checkifodd. \end{document}