Hot
- Lower the overline in Miller indicesby Georgian Ilie on October 19, 2026 at 4:31 pm
Good evening everyone, I am facing a problem when I designate crystallographic faces with the Miller notation (via the miller package). Typing the following code: \documentclass[varwidth=15cm, border=1pt, 11pt]{standalone} \usepackage{amsmath} %\usepackage{physics} \usepackage{fontspec} \usepackage{miller} \setmainfont{STIX Two Text} \usepackage[math-style=upright,mathbf=text,mathbf=sym,mathrm=text,mathrm=sym]{unicode-math} \setmathfont{STIX Two Math} \begin{document} \begin{equation*} \hkl(110)\equiv\hkl(11-20) \end{equation*} \end{document} Leads me to this: I am struggling in getting the bar over the "2" closer to the number. Can the distance between these two be set? Thank you in advance for your help.
- Marking a tail one, two, or four bars by folarrow package for commutative diagramsby Sebastiano on October 19, 2026 at 10:51 am
The folarrow package, available for amscd, xy-pic, and tikz-cd, provides the possibility of placing a marking or description at the center of the arrow's tail. I wonder whether it is possible to obtain markings of the same size, both for the tail and the arrow, with one, two, or four bars, similarly to the three-bar marking provided by folarrow. \documentclass{article} \usepackage{tikz-cd,amssymb} \usepackage{folarrow} \begin{document} \begin{tikzcd} A \arrow[r, foliated] \arrow[rd, "\smallsetminus" marking] & B \arrow[d, "///" marking] \\ & C \end{tikzcd} \end{document}
- longtable caption being tagged as TR > THby Paul J Hurtado on October 19, 2026 at 10:25 am
Here is a MWE where the caption of a longtable is being tagged as a table row (TR) and as a header row (TH) using lualatex (and lualatex-dev) with tagging=on. This leads to Regularity errors in the Adobe Acrobat checker. [I'm running the latest MikTeX updates with latex-tools updated as well.] Am I doing something incorrectly, or is there a longtable conflict with the tagging tools? It's listed as compatible at latex3.github.io/tagging-project/tagging-status/. Thanks! \DocumentMetadata{ lang = en-US, tagging = on, tagging-setup = {math/setup={mathml-SE,mathml-AF}}, check-tagging-status } % END \DocumentMetadata{} \documentclass[letterpaper,12pt,oneside]{report} \usepackage{longtable} \newcommand{\tn}{\tabularnewline} % Shorthand used for cleaner table entries \begin{document} \noindent This table is being tagged incorrectly. The caption as well as the desired header row were both tagged as TR, with the contents of each appearing in TH tags (on TH tag for the caption text, and one TH tag for each of Base 10 and Binary). \begin{longtable} {|c|c|} \caption{The longtable package can be used to split a table across multiple pages when it won't fit onto a single page, as illustrated with this table.}\label{t:long} \\ \hline \textbf{Base 10} & \textbf{Binary} \tn \hline \endhead % Caption still tagged as <TR> if this line commented out (no TH tags in the caption or row above) 1 & 1 \tn \hline 2 & 10 \tn \hline 3 & 11 \tn \hline 4 & 100 \tn \hline 5 & 101 \tn \hline 6 & 110 \tn \hline 7 & 111 \tn \hline 8 & 1000 \tn \hline 9 & 1001 \tn \hline 10 & 1010 \tn \hline 11 & 1011 \tn \hline 12 & 1100 \tn \hline 13 & 1101 \tn \hline 14 & 1110 \tn \hline 15 & 1111 \tn \hline 16 & 10000 \tn \hline 17 & 10001 \tn \hline 18 & 10010 \tn \hline 19 & 10011 \tn \hline 20 & 10100 \tn \hline 21 & 10101 \tn \hline 22 & 10110 \tn \hline 23 & 10111 \tn \hline 24 & 11000 \tn \hline 25 & 11001 \tn \hline 26 & 11010 \tn \hline 27 & 11011 \tn \hline 28 & 11100 \tn \hline 29 & 11101 \tn \hline 30 & 11110 \tn \hline \end{longtable} \end{document}
- A problem involves origdate and text citesby M. Logic on October 19, 2026 at 9:49 am
A minimal working sample is as follows. \documentclass[fontset=fandol]{ctexart} \usepackage[utf8, backend=biber, style=caspervector-ay, sorting=cenyt, sortcites=false, ugly]{biblatex} \makeatletter %change English commas for Chinese enumeration commas \renewcommand*{\bbx@citecomma}{\bbx@cnbcomma} \renewcommand*{\bbx@citebcomma}{\bbx@cnbcomma} %change English semicolons for Chinese commas \renewcommand*{\bbx@citescolon}{\bbx@cncomma} %forbiden p. and pp., and change , for : \renewcommand*{\postnotedelim}{\addcolon\space}% \DeclareFieldFormat{postnote}{\mknormrange{#1}}% \DeclareFieldFormat{multipostnote}{\mknormrange{#1}}% \DeclareFieldFormat{roundcnparens}{(#1)}%Chinese parenthesis \renewbibmacro*{cite:labeldate+extradate}{% \iffieldundef{origyear}% {}% {\printfield[roundcnparens]{origyear}%parens \setunit{\addspace}}% \iffieldundef{labelyear} {} {\printtext[bibhyperref]{\printlabeldateextra}}} \renewbibmacro*{textcite}{% \iffieldequals{namehash}{\cbx@lasthash} {\iffieldundef{shorthand} {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} {\setunit{\compcitedelim}% \iffieldundef{origyear}% {\usebibmacro{cite:extradate}}% {\setunit{\compcitedelim}% \usebibmacro{cite:labeldate+extradate}}}% {\setunit{\compcitedelim}% \usebibmacro{cite:labeldate+extradate}% \savefield{labelyear}{\cbx@lastyear}}} {\setunit{\compcitedelim}% \usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}} {\ifnameundef{labelname} {\iffieldundef{shorthand} {\usebibmacro{cite:label}% \setunit{% \printdelim{nonameyeardelim}\bbx@cnlparen}%Chinese left parenthesis \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \usebibmacro{cite:labeldate+extradate}} {\usebibmacro{cite:shorthand}}} {\printnames{labelname}% \setunit{% \printdelim{nameyeardelim}\bbx@cnlparen}% \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% \iffieldundef{shorthand} {\iffieldundef{labelyear} {\usebibmacro{cite:label}} {\usebibmacro{cite:labeldate+extradate}}% \savefield{labelyear}{\cbx@lastyear}} {\usebibmacro{cite:shorthand}% \global\undef\cbx@lastyear}}% \stepcounter{textcitecount}% \savefield{namehash}{\cbx@lasthash}}% } \newbibmacro*{textcite:init}{% \citetrackerfalse \pagetrackerfalse \global\undef\cbx@lasthash \global\undef\cbx@lastyear \setcounter{textcitecount}{0}% } \renewbibmacro*{textcite:postnote}{% \iffieldundef{postnote}% {}% {\setunit{\postnotedelim}\printfield{postnote}}% } \DeclareCiteCommand{\textcite} {\usebibmacro{textcite:init}} {\usebibmacro{citeindex}% \usebibmacro{textcite}} {\setunit{\multicitedelim}}% {\usebibmacro{textcite:postnote}% \bbx@cnrparen}%Chinese right parenthesis \newcommand*{\mkoutertextcitedelims}[1]{#1} \DeclareMultiCiteCommand{\textcites}[\mkoutertextcitedelims]{\textcite}{\multicitedelim} \makeatother \begin{filecontents*}{\jobname.bib} @book{bookot, location = {Place}, publisher = {ABC}, author = {Name, Given}, title = {One title}, year = {2001}, origyear = {1978}, } @book{bookat, location = {Place}, publisher = {ABC}, author = {Name, Given}, title = {Another title}, year = {2001}, origyear = {1976}, } \end{filecontents*} \addbibresource{\jobname.bib} \addbibresource{biblatex-examples.bib} \begin{document} 1. \textcite{bookot,bookat,worman,geer} NO 2. \textcites{bookot,bookat,worman,geer} NO 3. \textcites{bookot}{bookat}{geer} NO 4. \textcites[20]{bookot}[29--71]{bookat}{geer} NO %\printbibliography \end{document} As you see, to cite the references with original dates in texts, I define new \textcite and \textcites in my dcocument improved from the link. The commands could make some punctuations be Chinese in text citations (I have succeed defining \cite and \cites). As you see \textcite and \textcites do not work well. The following picture shows what I want. Then how to get the goal?
- A problem involves origdate and multiple citesby M. Logic on October 19, 2026 at 6:44 am
First a minimal working sample is as follows. \documentclass{ctexart} \usepackage[utf8, backend=biber, style=caspervector-ay, sorting=cenyt,sortcites=false,ugly]{biblatex} \DeclareFieldFormat{roundparens}{(#1)}% \makeatletter \newbibmacro{fciting:origdate}{% \iffieldundef{origyear}% {}% {\printtext[roundparens]{%parens \printfield{origyear}}}}% \newbibmacro{fciting:date}{% \printtext[bibhyperref]{% \printfield{year}% \printfield{extradate}}} \newbibmacro*{fciting:temporary-origdate}{% \usebibmacro{fciting:origdate}% \iffieldundef{origyear}% {}% {\setunit*{\addspace}}% } \newbibmacro*{fciting:date+extradate}{% \usebibmacro{fciting:temporary-origdate}% \printtext{\usebibmacro{fciting:date}}} %\newcommand{\ftextcitedelim}{\addcomma\addspace} \newcommand{\fcompcitedelim}{\addcomma\addspace} \newcommand{\fmulticitedelim}{\addsemicolon\addspace} \renewbibmacro*{fcite}{% \iffieldundef{shorthand} {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} {\usebibmacro{cite:label}% \setunit{\printdelim{nonameyeardelim}}% \usebibmacro{fciting:date+extradate}% \usebibmacro{cite:reinit}} {\iffieldequals{namehash}{\cbx@lasthash} {\iffieldundef{origyear} {} {\undef\cbx@lastyear}% \ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} {\setunit{\fcompcitedelim}% \usebibmacro{cite:extradate}} {\setunit{\fcompcitedelim}% \usebibmacro{fciting:date+extradate}% \savefield{labelyear}{\cbx@lastyear}}} {\printnames{labelname}% \setunit{\printdelim{nameyeardelim}}% \setunit*{\addspace}% \usebibmacro{fciting:date+extradate}% \savefield{namehash}{\cbx@lasthash}% \savefield{labelyear}{\cbx@lastyear}}}}% {\usebibmacro{cite:shorthand}% \usebibmacro{cite:reinit}}% \setunit{\fmulticitedelim}% } \DeclareCiteCommand{\fcite} {\usebibmacro{cite:init}% \usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{fcite}}% {}%\setunit{\fmulticitedelim} {\usebibmacro{postnote}}% \DeclareMultiCiteCommand{\fcites}[\usebibmacro{cite:init}]{\fcite}{\fmulticitedelim} \makeatother \begin{filecontents*}{\jobname.bib} @book{bookot, location = {Place}, publisher = {ABC}, author = {Name, Given}, title = {One title}, year = {2001}, origyear = {1978}, } @book{bookat, location = {Place}, publisher = {ABC}, author = {Name, Given}, title = {Another title}, year = {2001}, origyear = {1976}, } \end{filecontents*} \addbibresource{\jobname.bib} \addbibresource{biblatex-examples.bib} \begin{document} \fcite{bookot,bookat,worman,geer} YES \fcites{bookot,bookat,worman,geer} YES \fcites{bookot}{bookat}{geer} NO \fcites[20]{bookot}[29--71]{bookat}{geer} NO \printbibliography \end{document} As you see, to cite the references with original dates, I define new \fcite and \fcites (I also use \cite and \cites in my dcocument for some reseasons) improved from the link. As you see \fcite and \fcites work well in most cases, except: when I use \fcites{bookot}{bookat}{geer} and \fcites[20]{bookot}[29--71]{bookat}{geer} in this case, it produce semicolons between years with the same author, while they should be commas. Then how to solve the problem?
- What is the reason for starting preamble comment with a space in TeX and MF?by Igor Liferenko on October 19, 2026 at 2:35 am
Run commands: tex 'story \end' dvitype story Preamble comment is: ' TeX output 2026.10.18:0927' The leading space is added in §617 of tex.web. Why? Run commands: mf '\nodisplays; input cmr10' gftype cmr10.2602gf Preamble comment is: ' METAFONT output 2026.10.18:0928'
- Label over AVMs in langsci-avm packageby Liz C. on October 18, 2026 at 7:05 pm
Is there a way to get an abbreviation label centered over an AVM like the D over the AVM in the SPR list shown here? The code I had to do this using the AVM package was as follows (and admittedly I don't really understand it and usually just copy pasted it): \begin{avm} \avml\hfil D \\[-1ex] \[ COUNT & $+$ \\ \] \avmr \end{avm}
- On the Numerical Justification of Table of Contents Entries [duplicate]by Jethro on October 18, 2026 at 6:46 pm
MWE: \documentclass[openany]{book} \usepackage{tocloft} \renewcommand{\thechapter}{\Roman{chapter}} \setlength{\cftchapnumwidth}{3em}% Width of chapter numbers in ToC \renewcommand{\cftchapaftersnum}{.} % Add a period after each chapter number in ToC \renewcommand{\cftchapleader}{\dotfill} \begin{document} \tableofcontents \chapter{This is the First Chapter} \chapter{This is the Second Chapter} \chapter{This is the Third Chapter} \end{document} Hence, the Table of Contents: Notice that the three Contents entries are left justified according to the beginning of each Roman numeral. How may I produce these entries right justified according to the periods immediately after the Roman numerals?
- Latex References Not Resolving [closed]by Sanjeev N on October 18, 2026 at 6:33 pm
If I number a particular equation my compilation is not able to resolve the symbols and I see ?? Against all references
- Table lines and alignmentby azetina on October 18, 2026 at 3:57 pm
Consider the following MWE: \documentclass[11pt,border=6pt]{standalone} \usepackage{mathptmx} \usepackage{booktabs} \usepackage{array} \usepackage{multirow} \renewcommand{\arraystretch}{1.15} \begin{document} \setlength{\tabcolsep}{7pt} \begin{tabular}{c|cc|cc|cc|cc|cc} \toprule[1.2pt] \multirow{2}{*}{\begin{tabular}[c]{@{}c@{}}\textbf{Line}\\\textbf{number}\end{tabular}} & \multicolumn{10}{c}{\textbf{Column number}} \\ \cmidrule(l){2-11} & \multicolumn{2}{c|}{\textit{00--09}} & \multicolumn{2}{c|}{\textit{10--19}} & \multicolumn{2}{c|}{\textit{20--29}} & \multicolumn{2}{c|}{\textit{30--39}} & \multicolumn{2}{c}{\textit{40--49}} \\ \midrule \textit{00} & 15544 & 80712 & 97742 & 21500 & 97081 & 42451 & 50623 & 56071 & 28882 & 28739 \\ \textit{01} & 01011 & 21285 & 04729 & 39986 & 73150 & 31548 & 30168 & 76189 & 56996 & 19210 \\ \textit{02} & 47435 & 53308 & 40718 & 29050 & 74858 & 64517 & 93573 & 51058 & 68501 & 42723 \\ \textit{03} & 91312 & 75137 & 86274 & 59834 & 69844 & 19853 & 06917 & 17413 & 44474 & 86530 \\ \textit{04} & 12775 & 08768 & 80791 & 16298 & 22934 & 09630 & 98862 & 39746 & 64623 & 32768 \\ \addlinespace[4pt] \textit{05} & 31466 & 43761 & 94872 & 92230 & 52367 & 13205 & 38634 & 55882 & 77518 & 36252 \\ \textit{06} & 09300 & 43847 & 40881 & 51243 & 97810 & 18903 & 53914 & 31688 & 06220 & 40422 \\ \textit{07} & 73582 & 13810 & 57784 & 72454 & 68997 & 72229 & 30340 & 08844 & 53924 & 89630 \\ \textit{08} & 11092 & 81392 & 58189 & 22697 & 41063 & 09451 & 09789 & 00637 & 06450 & 85990 \\ \textit{09} & 93322 & 98567 & 00116 & 35605 & 66790 & 52965 & 62877 & 21740 & 56476 & 49296 \\ \addlinespace[4pt] \textit{10} & 80134 & 12484 & 67089 & 08674 & 70753 & 90959 & 45842 & 59844 & 45214 & 36505 \\ \textit{11} & 97888 & 31797 & 95037 & 84400 & 76041 & 96668 & 75920 & 68482 & 56855 & 97417 \\ \textit{12} & 92612 & 27082 & 59459 & 69380 & 98654 & 20407 & 88151 & 56263 & 27126 & 63797 \\ \textit{13} & 72744 & 45586 & 43279 & 44218 & 83638 & 05422 & 00995 & 70217 & 78925 & 39097 \\ \textit{14} & 96256 & 70653 & 45285 & 26293 & 78305 & 80252 & 03625 & 40159 & 68760 & 84716 \\ \addlinespace[4pt] \textit{15} & 07851 & 47452 & 66742 & 83331 & 54701 & 06573 & 98169 & 37499 & 67756 & 68301 \\ \textit{16} & 25594 & 41552 & 96475 & 56151 & 02089 & 33748 & 65289 & 89956 & 89559 & 33687 \\ \textit{17} & 65358 & 15155 & 59374 & 80940 & 03411 & 94656 & 69440 & 47156 & 77115 & 99463 \\ \textit{18} & 09402 & 31008 & 53424 & 21928 & 02198 & 61201 & 02457 & 87214 & 59750 & 51330 \\ \textit{19} & 97424 & 90765 & 01634 & 37328 & 41243 & 33564 & 17884 & 94747 & 93650 & 77668 \\ \bottomrule[1.2pt] \end{tabular} \end{document} How can I: Ensure the vertical lines and horizontal line connect beside "Line number"; that is form like a T. See image. "Line number" should be bottom aligned with 00-09. As is, it is centered vertically using multirow. Everything else should remain the same.
- Typesetting Variations in xskakby Reinhard Neuwirth on October 18, 2026 at 1:02 pm
The example in 2. Introduction on page 5 of the xskak document suggests to define variations as alternatives to a move defined in the starting board, as for example 3...a6 being a kind of standard first Black move in the Ruy Lopez, and 3...Bc5, 3...Nd4, etc. being variations of it. While this works, it is somewhat illogical. Who is to say which one of the possibilities is to be regarded the "standard" first continuation move? Also, the situation becomes increasingly messy as one progesses down the tree of moves and has to deal with nested variations. Attempting not to define the initial "standard continuation" as in \mainline{1.e4 e5 2.Nf3 Nc6 3.Bb5} leads to the error: White, not Black to move (a6). Purely by chance I found that \mainline{1.e4 e5 2.Nf3 Nc6 3.Bb5 *} or putting some other character where Black's first move should be, improved the issue but needs fixing by getting rid of the spurious ZZ*. Could someone address this please. \documentclass{article} % RN. 18/10/2026 % BRIEF DESCRIPTION: % An alternative to typesetting variations in xskak. %======================= \usepackage{xskak} \begin{document} \usetextfig \setchessboard{smallboard} \section{Ruy Lopez 1} \newchessgame[id=main] \mainline{1.e4 e5 2.Nf3 Nc6 3.Bb5 a6} \chessboard \newchessgame[newvar=main,id=var1] \hspace{15mm}\textbf{Variation 1: }\mainline[invar]{3...Bc5} \hspace{15mm}\chessboard[smallboard] \resumechessgame[id=main] \newchessgame[newvar=main,id=var2] \hspace{15mm}\textbf{Variation 2: }\mainline[invar]{3...Nd4} \resumechessgame[id=main] \newchessgame[newvar=main,id=var3] \hspace{15mm}\textbf{Variation 3: }\mainline[invar]{3...f5} \resumechessgame[id=main] \newchessgame[newvar=main,id=var4] \hspace{15mm}\textbf{Variation 4: }\mainline[invar]{3...Nf6} \resumechessgame[id=main] \newchessgame[newvar=main,id=var5] \hspace{15mm}\textbf{Variation 5: }\mainline[invar]{3...d6} \hspace{15mm}\chessboard[smallboard] \section{Ruy Lopez 2} \newchessgame[id=main] \mainline{1.e4 e5 2.Nf3 Nc6 3.Bb5 *} \chessboard \newchessgame[newvar=main,id=var1] \hspace{15mm}\textbf{Variant 1: }\mainline[invar]{3...a6} \hspace{15mm}\chessboard[smallboard] \resumechessgame[id=main] \newchessgame[newvar=main,id=var2] \hspace{15mm}\textbf{Variant 2: }\mainline[invar]{3...Bc5} \resumechessgame[id=main] \newchessgame[newvar=main,id=var3] \hspace{15mm}\textbf{Variant 3: }\mainline[invar]{3...Nd4} \resumechessgame[id=main] \newchessgame[newvar=main,id=var4] \hspace{15mm}\textbf{Variant 4: }\mainline[invar]{3...f5} \resumechessgame[id=main] \newchessgame[newvar=main,id=var5] \hspace{15mm}\textbf{Variant 5: }\mainline[invar]{3...Nf6} \resumechessgame[id=main] \newchessgame[newvar=main,id=var6] \hspace{15mm}\textbf{Variant 6: }\mainline[invar]{3...d6} \hspace{15mm}\chessboard[smallboard] \end{document}
- Why are end-of-lines commented out, but lines can be indented?by ltcomdata on October 17, 2026 at 11:46 pm
Looking over many examples of LaTeX code in macro definitions, I often find a % at the end of a line --- so that no extraneous spaces are somehow imported into the macro by the end of line character. However, at the same time, I notice that these same macros often have many lines starting wit indentations --- presumably to make the code readable. How come the code can be indented at all? Why should every line in the macro have any opening spaces at all? Isn't the point of % to avoid extraneous spaces? Why do we care about that at the end of the line, but do not care about it at the beginning of the line?
- hyperref package: error after update "\??? doesn't match its definition" "key-value input"by Bernd on October 17, 2026 at 9:17 pm
I have updated MikTex, and now I get this error when I compile my tex files with pdflatex: ! Use of \??? doesn't match its definition. <argument> \??? ! Latex Error: Misplaced '=' in key-value input on line 59. The pdf file produced looks good, it has the hyperlinks that I expect. When I comment out the hyperref package, no error is thrown, but then of course, the expected hyperlinks the hyperref package produces are not there. I have found a post referring to a similar issue, where a re-installation has solved the problem. However, this did not work for me. Here is a minimum working example: \documentclass[a5paper,fontsize=9pt, twoside, DIV=17, BCOR=1mm]{scrbook} \usepackage [bookmarks, colorlinks=true, linkcolor=blue, citecolor=magenta, urlcolor=cyan, pdfpagelayout=TwoPageRight, pdfpagelayout=SinglePage, pagebackref, pdfusetitle ] {hyperref} \usepackage[chorded, noshading]{songs} \baselineadj=-1.8ex plus 0.3ex minus 1.0ex \versesep=0.5ex plus 0.5ex minus 0.5ex \renewcommand{\colbotglue}{0pt plus .5\textheight minus 0pt} \songpos{3} \settowidth{\versenumwidth}{10.} \setlength{\songnumwidth}{7.5ex} \newcommand{\sieben}{\textsuperscript{7}} \begin{document} \chapter{Preface} \label{label} \chapter{Songs} \begin{songs}{} \beginsong{The drunken sailor} [ by = {Traditional} ] \beginverse \[d]What shall we do with the drunken sailor, \[C]what shall we do with the drunken sailor, \[d]what shall we do with the drunken sailor \[C]early in the \[d]morning? \endverse \beginchorus \[d]Hooray! And up she rises. \[C]Hooray! And up she rises. \[d]Hooray! And up she rises \[C]early in the \[d]morning. \endchorus \chordsoff \beginverse Take him and shake ihm and try to awake him! \endverse See Chapter \ref{label} \endsong \end{songs} \end{document} The log file contains this information, which I don't understand: chapter 2. ! Use of \??? doesn't match its definition. <argument> \??? ! LaTeX Error: Misplaced '=' in key-value input on line 59 l.59 \endsong If you say, e.g., `\def\a1{...}', then you must always put `1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it. Any ideas for a fix or a workaround? Thanks in advance for your help!
- How to make the `\ddots` centering of the bounding box?by Explorer on October 17, 2026 at 4:37 pm
This post is similar to this one, but not exactly the same... With the following code: \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{matrix} \setlength{\fboxsep}{0pt} \begin{document} \[ \begin{tikzpicture} \matrix (magic) [ matrix of math nodes, nodes={circle,draw=magenta,minimum size=1cm}, left delimiter=(, right delimiter=) ] { 1 \\ & 1 \\ & & \ddots \\ & & & \fbox{$\ddots$} \\ & & & & 1 \\ }; \draw[teal,dashed] (magic-1-1.center) -- (magic-5-5.center); \end{tikzpicture} \] \end{document} What I want was the following: only typeset three dots, thus \Ddots with nicematrix was not so flexible; I want the "slope" of \ddots was parallel with the teal,dashed line; I want to ellnimate the extra height of the bounding box of \ddots(why?It looks not good...) It recalled the classical \rvdots here, and we know: $ latexdef \ddots \ddots: macro:->\protect \ddots \ddots : macro:->\mathinner {\mkern 1mu\raise 7\p@ \vbox {\kern 7\p@ \hbox {.}}\mkern 2mu \raise 4\p@ \hbox {.}\mkern 2mu\raise \p@ \hbox {.}\mkern 1mu} I guessed slightly modify the commands could help? Any suggestions? \makeatletter % \DeclareRobustCommand{\rvdots}{% % \vbox{ % \baselineskip4\p@\lineskiplimit\z@ % \kern-\p@ % \hbox{.}\hbox{.}\hbox{.} % }} \DeclareRobustCommand{\rddots}{% \mathinner {% \mkern 1mu\raise 7\p@% \vbox{\kern 1\p@ \hbox {.}}% \mkern 0.4mu \raise 4\p@ \hbox {.}% \mkern 0.4mu\raise \p@ \hbox {.}% \mkern 1mu% }% } \makeatother Edit1 If I zoomed in with with cfr's answer: \makeatletter \newcommand\exddots {% \mathinner {% \mkern 1mu\raise 3.5\p@ % 7 -> 3.5 \vbox {\kern 0\p@ \hbox {.}}% 7 -> 0 \mkern 2mu \raise -0.5\p@ \hbox{.}% 4 -> -0.5 \mkern 2mu \raise -4\p@ \hbox{.}% \p@ -> -4 \mkern 1mu }% } \makeatother Edit2 Just to show the example of cfr's comment: Is the content or, at least, the size of the content in the matrix fixed? because the angle of the diagonal obviously will vary if that varies. so unless you want this only as a one-off, you maybe need to think about how this should work. should \exddots really look different each time and different from any use in maths mode? or do you want to fix the matrix dimensions to keep the angle constant? or ...? I don't think it will look so good if the dots look different in different cases. at least, that is not how it usually would work in latex? \documentclass{article} \usepackage{amsmath} \usepackage{nicematrix} \usepackage{tikz} % \usepackage{kpfonts-otf} \begin{document} \[ \begin{pNiceMatrix} 3 & & & \\ & 555 & & \\ & & \ddots & \\ & & & 66666 \CodeAfter \tikz{ \draw[teal, ultra thin] (1-1.center) -- (4-4.center); \draw[magenta, ultra thin] (2-2.south east) -- (4-4.north west); } \end{pNiceMatrix}\qquad \begin{pNiceMatrix} 3 & & & \\ & 555 & & \\ & & \Ddots & \\ & & & 66666 \CodeAfter \tikz{ \draw[teal, ultra thin] (1-1.center) -- (4-4.center); \draw[magenta, ultra thin] (2-2.south east) -- (4-4.north west); } \end{pNiceMatrix} \] \[ \begin{pNiceMatrix} a & & & \\ & b & & \\ & & \ddots & \\ & & & d \CodeAfter \tikz{ \draw[teal, ultra thin] (1-1.center) -- (4-4.center); \draw[magenta, ultra thin] (2-2.south east) -- (4-4.north west); } \end{pNiceMatrix}\qquad \begin{pNiceMatrix} a & & & \\ & b & & \\ & & \Ddots & \\ & & & d \CodeAfter \tikz{ \draw[teal, ultra thin] (1-1.center) -- (4-4.center); \draw[magenta, ultra thin] (2-2.south east) -- (4-4.north west); } \end{pNiceMatrix} \] \[ \begin{pNiceMatrix} x & & & & \\ & x+y & & & \\ & & \ddots & & \\ & & & \sqrt{x-y} & \\ & & & & \dfrac{x}{y} \CodeAfter \tikz{ \draw[teal, ultra thin] (1-1.center) -- (4-4.center); \draw[magenta, ultra thin] (2-2.south east) -- (4-4.north west); } \end{pNiceMatrix}\qquad \begin{pNiceMatrix} x & & & & \\ & x+y & & & \\ & & \Ddots & & \\ & & & \sqrt{x-y} & \\ & & & & \dfrac{x}{y} \CodeAfter \tikz{ \draw[teal, ultra thin] (1-1.center) -- (4-4.center); \draw[magenta, ultra thin] (2-2.south east) -- (4-4.north west); } \end{pNiceMatrix} \] \end{document} With latin-modern-math: With kpfonts-otf:
- How to perform vector operations and print the result directly in luacas?by minthao_2011 on October 17, 2026 at 5:29 am
I am using the luacas package to handle symbolic math and compute coordinates. Currently, to display the vector $\vec{AB}$ from two points $A$ and $B$, I have to subtract and print each component individually like this: \documentclass[12pt]{article} \usepackage{amsthm} \theoremstyle{definition} \newtheorem{ex}{Example} \usepackage{luacas} \usepackage{esvect} \begin{document} \begin{ex} \begin{CAS} A = {sqrt(2), -2/7, 3/5} B = {sqrt(8), -14/29, 3*sqrt(3)} \end{CAS} \[\displaystyle A=\left(\print{A[1]};\print{A[2]};\print{A[3]} \right), \quad B=\left(\print{B[1]};\print{B[2]};\print{B[3]} \right).\] \[ \vv{AB}=\left(\print{simplify(B[1]-A[1])};\print{B[2]-A[2]};\print{B[3]-A[3]} \right) .\] \end{ex} \end{document} This approach makes the code repetitive and messy. I would like to simplify the workflow by computing the vector directly within the CAS environment and printing it in one go, like this: \begin{CAS} A = {sqrt(2), -2/7, 3/5} B = {sqrt(8), -14/29, 3*sqrt(3)} vAB = B - A \end{CAS} \[\vv{AB} = \print{vAB}\] However, doing this directly does not work as expected. I got the massage: [string "A = {sqrt(Integer('2')), -Integer('2')/Intege..."]:1: attempt to perform arithmet ic on a table value (global 'B') stack traceback: [string "A = {sqrt(Integer('2')), -Integer('2')/Intege..."]:1: in local 'exe' ...26/texmf-dist/tex/lualatex/luacas/test/luacas-parser.lua:329: in function ' CASparse' [\directlua]:1: in main chunk. \luacode@dbg@exec ...code@maybe@printdbg {#1} #1 } l.15 \end {CAS} ? Is there a way to define a custom function, a macro, or use a specific luacas command/method so that I can compute $vAB = B - A$ (or simplify it) and print it cleanly without accessing each index manually?
- How do I typeset castling in xskak?by Reinhard Neuwirth on October 16, 2026 at 10:42 am
The obvious way to typeset castling would be 0-0 (and 0-0-0 for long castling), but \chessboard shows no sign of it, and the move record shows ZZ0-0. I have tried all sorts of options, to no avail. Puzzled. \documentclass{article} % RN. 16/10/2026 % BRIEF DESCRIPTION: % Typesetting castling moves in xskak %======================= \usepackage{xskak} \begin{document} \usetextfig \newchessgame \mainline{1.e4 e5 2.Nf3 Nc6 3.Bb5 a6 4.Ba4 Nf6 5.0-0} \chessboard \end{document}
- How to define a default maxwidth maxheight when including graphics?by muggi on October 16, 2026 at 9:40 am
Sometimes I have floats filling more than the half page, which isn't that nice. I have defined a custom command for my images, which have different sizes and aspect ratios. \documentclass[a4paper,12pt]{scrreprt} % writing things \usepackage[T1]{fontenc} \usepackage{inputenc} \usepackage[ngerman]{babel} \usepackage{paralist} % document class things \usepackage[headsepline=1pt,autooneside=false]{scrlayer-scrpage} \usepackage{scrhack} % images \usepackage{graphicx} \usepackage[figurename=Abb.,tablename=Tab.]{caption} \usepackage{float} \usepackage{here} \usepackage[section]{placeins} % rest \usepackage{lipsum} \usepackage{hyperref} \usepackage[all]{hypcap} % commands \newcommand{\n}{\newline} \newcommand{\bild}[4][width=\textwidth]{ \begin{figure}[!hbt]\centering \makebox[\textwidth][c]{ \includegraphics[#1]{#2} } \caption{#3}\label{#4} \end{figure} } \clearmainofpairofpagestyles \cfoot[\pagemark]{\pagemark} \ohead{\scshape\rightmark} \automark{chapter} \renewcommand{\chaptermark}[1]{\markright{\ #1}} \begin{document} \thispagestyle{empty} \pagenumbering{Roman} \tableofcontents \listoffigures \pagestyle{scrheadings} \cleardoubleoddpage \pagenumbering{arabic} \chapter{first}\label{first} Lipsum.\n So so so... \chapter{one} \section{one} \lipsum\ref{b0} \bild{picture-15x21}{Picture. Height: 15 cm. Width: 21 cm.}{b0} \bild{picture-15x21}{The same picture. Height: 15 cm. Width: 21 cm.}{b1} \bild[height=0.45\textheight]{picture-15x21}{The same picture. Height: 15 cm. Width: 21 cm.}{b3} \bild[height=0.45\textheight]{picture-15x21}{The same picture. Height: 15 cm. Width: 21 cm.}{b4} \lipsum \section{two} \lipsum \end{document} I'd like to tell my MiKTeX: When I don't specify #1 explicitly and if you compile an image which is broader than \textwidth or higher than 0.45\textheight, resize it that \imagewidth <= \textwidth and \imageheight <= 0.45\textheight. Always keep the aspect ratio. EDIT: Actually, I'd like to have "0.5 * (\textheigt - height of the two captions)" instead of 0.45\textheight so that two graphics fill one page. But I think this is either too complex to write, too fault-prone to use or not realisable.
- \TblrNote eats spaceby user20478285 on October 15, 2026 at 10:32 pm
\documentclass{article} \usepackage{tabularray} \UseTblrLibrary{booktabs} \begin{document} \begin{table} \centering \small \begin{talltblr}[ note{a} = {Foo!}, caption = {Some Table.} ]{colspec={ll}} \toprule A & B \\ \midrule Foo\TblrNote{a} Bar & 1 \\ Foo\TblrNote{a}~Bar & 2 \\ Foo\TblrNote{a}{} Bar & 3 \\ Foo\TblrNote{a}\ Bar & 4 \\ \bottomrule \end{talltblr} \end{table} \end{document} How can I get normal space between the words Foo and Bar (like I would with \footnote) when using \TblrNote? None of the 3 approaches I tried seems to work.
- How to make a particular exponent larger when compiling with make4ht?by wmora2 on October 15, 2026 at 4:46 pm
I'm compiling a document with make4ht (MathJax output) that contains several worked examples on indeterminate forms. In these examples, some exponents are themselves fractions or expressions, and I need to enlarge only those particular exponents, not all of them. The usual LaTeX approach — wrapping the exponent in \textstyle or \displaystyle — works fine with pdflatex, but has no effect when compiling with make4ht. Here is a minimal example: \documentclass[fontsize=18pt, paper=letter]{scrartcl} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{mathtools} \usepackage{amssymb,amsthm} \usepackage{latexsym,stmaryrd} \begin{document} $\displaystyle \lim_{u\rightarrow 0} \left(\dfrac{\sin u}{u}\right)^{\textstyle u^{-2}} $\\ $\displaystyle \lim_{u\rightarrow 0} \left(\dfrac{\sin u}{u}\right)^{\displaystyle u^{-2}} $\\ \end{document} I compile with: make4ht text.tex "mathml,mathjax,svg,Gin-dim" Questions: Is there a way to make make4ht preserve \displaystyle / \textstyle inside an exponent so MathJax honors it? If not, is there a recommended way (custom macro, MathJax config, CSS with a unique class, etc.) to enlarge a single exponent without affecting the rest? Is this a known limitation of make4ht's math handling? If so, is there a workaround that is robust across MathJax versions? I'm attaching two screenshots showing that the two formulas render identically despite the different style commands. Any help is appreciated. Thanks! This screenshot shows the PDF output generated with pdfLaTeX using TeX Live 2026 on Ubuntu Linux. As you can see, the exponent containing the limit is displayed at a reasonable size and is clearly readable. However, in the HTML output generated by make4ht, the same exponent appears considerably smaller after MathJax finishes rendering the expression. My goal is to make the HTML rendering look as close as possible to the pdfLaTeX output, particularly regarding the size of complex exponents. test.html https://wimate.org/test
- Where are scan@allowed and pfill defined for makeindex gind.istby Frisket on October 15, 2026 at 10:34 am
A long time ago I used makeindex -s gind.ist to get A-Z sections in my index. I revisited it just now for a very large document using hyperref. The distribution version of the file on my system is /usr/share/texlive/texmf-dist/makeindex/latex/gind.ist and there are no others. It starts the .ind file with \begin{theindex} \makeatletter\scan@allowedfalse This causes an Undefined control sequence error for \scan@allowedfalse. It presumably meand what it says, but I have failed to find anywhere that it is defined, or why one would want to use it. If I \let\scan@allowedfalse\relax it then comes up with errors like ! Undefined control sequence. <argument> \textbf@ \textit {ampersand} l.83 ...rindexformat{\textbf@\textit{ampersand}}{27} so I can see what it's doing but I don't know why it should want to. The command \pfill is also created as the filler in each entry, eg \item accents\pfill \hyperpage{29} This also triggers an Undefined control sequence, but I find that this command is defined in ltxdoc.cls so I can borrow that for my document. Makeindex without the gind.ist creates the .ind file without problems. Before I start cutting code down to create a MWE, does anyone know anything about \scan@allowed?
- Can we somehow replicate the image with boy, kite, tree?by MS-SPO on October 15, 2026 at 7:47 am
Here's an other fun-competition: replicate the drawing below somehow (boy, kite, tree, i.e. WITHOUT the blue lines, intended for Mr. Pythagoras) describe your approach good enough so others can repeat it (at least try to) Forgot to put my thought in writing: Where somehow means including quite exact reproductions, as many of the first AI-answers showed, but not limited to. E.g. just using strokes would be fine as well. Use yor imagination. IF you use AI for code creation, please consider giving more, at least enough details. As indication see e.g. Explorer's answer, which improved and evolved via comments to add what's missing. Minimum I'd expect in this case: prompt (if it's just a single shot) history of prompts (if it was more an interactive work) AI-machine/-provider, AI-models used other tools used, like oh-my-pi etc. required setups etc. In the original post the drawing was included via graphicx, but wasn't uploaded. So let's take the opportunity to replicate it with your favorite approach for or with LaTeX.
- Why is an appendix referenced as chapter in TeXLive 2024 or above?by miticollo on October 15, 2026 at 3:21 am
Let's consider the following MWE \documentclass{report} \usepackage{cleveref} \begin{document} \appendix \chapter{Title}\label{t} This is a \namecref{t} \end{document} Now compile it using TeXLive 2026 and 2023. Then compare them. TeXLive 2026 TeXLive 2023 Well, I don't understand why in TeXLive 2023 (or 2022) appears appendix while in TeXLive 2024 and above is chapter. I also noticed another thing. Inspecting foo.aux I found \newlabel{t@cref}{{[chapter][1][]A}{[1][1][]1}{}{}{}} in TexLive 2026 \newlabel{t@cref}{{[appendix][1][2147483647]A}{[1][1][]1}} in TeXLive 2023 As always I compiled this MWE with latexmk -Werror -halt-on-error -file-line-error -lualatex ./foo.tex I tried also with -pdflatex but I got the same result.
- minted caption above reduced spacingby user20478285 on October 14, 2026 at 11:57 pm
\documentclass{article} \usepackage{caption} \usepackage[newfloat]{minted} \setminted{frame=lines} \captionsetup[listing]{position=top} \begin{document} \begin{listing} \caption{Hello World in C} \label{listing:2} \begin{minted}{c} #include <stdio.h> int main() { printf("Hello, World!"); /*printf() outputs the quoted string*/ return 0; } \end{minted} \end{listing} \begin{table} \caption{Caption} \label{tab:placeholder} \centering \begin{tabular}{ |c|c|c| } \hline cell1 & cell2 & cell3 \\ cell4 & cell5 & cell6 \\ cell7 & cell8 & cell9 \\ \hline \end{tabular} \end{table} \end{document} How do I properly reduce the space between the listing caption and the actual listing? I know I can manually insert \vspace or skip values, but I also don't want to guess what a 'good' value could be, it just feels like the default spacing for listing captions is way too much?
- How to deal with error from `mtp2otf` conversion of MathTime Pro 2 Type 1 fonts to otf?by murray on October 14, 2026 at 8:32 pm
I'm using the mtp2otf package (https://ctan.org/pkg/mtp2otf?lang=en) to convert MathTime Pro 2 Type 1 fonts to OpenType .otf format, I accumlated all the necessary files as the docs specified, and indeed the package's build command gives no error about missing files. But running the command ./build.sh --roman-regular=mtpro2/donors/ztm-Reg.otf --roman-bold=mtpro2/donors/ztm-Med.otf give error report: error: validate.py error: U+20D6: uni2190.vector.end.acc→uni2212.hconnLR.vector.ex.acc: gap at minimum overlap: 56.0u What's wrong and how should it be fixed? Here's the complete build.log: FontForge Python 3.10 support Copyright (c) 2000-2026. See AUTHORS for Contributors. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE. Version: 20230101 Based on sources from 2026-08-02 10:01 UTC-ML-D-GDK3. Core python package 'pkg_resources' not found: Cannot discover plugins audit_roman_donor_contract.py FontForge build Copyright (c) 2000-2026. See AUTHORS for Contributors. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE. Version: 20230101 Based on sources from 2026-08-02 10:01 UTC-ML-D-GDK3. Core python package 'pkg_resources' not found: Cannot discover plugins Lookup subtable kern-1 had to be split into several subtables because it was too big. validate.py error: U+20D6: uni2190.vector.end.acc→uni2212.hconnLR.vector.ex.acc: gap at minimum overlap: 56.0u Updates 1: The same sort of error occurs if I use instead as the "donors" NimbusRoman-Regular.otf and NimbusRoman-Bold.otf. But building just MathTime Pro 2 Lite (using option --edition=lite) completes OK. Update 2: Building from the complete font set with the default donors, and using the latest version of mtp2otf (from https://github.com/satom-zk/mtp2otf) give a new error under macOS Golden Gate: building MTPro2 Math error: FontForge build: Windows String: NimbusRoman-Regular The following table(s) in the font have been ignored by FontForge Ignoring 'PCLT' PCL 5 data table Warning: Mac and Windows entries in the 'name' table differ for the Fullname string in the language English (US) Mac String: Nimbus Roman Bold Windows String: NimbusRoman-Bold error: native large variants: missing morphed source exa:182
- Which "donor" Nimbus clone fonts for mtpro2otfby murray on October 14, 2026 at 7:42 pm
The answer https://tex.stackexchange.com/a/711737/13492 mentions the mtpro2otf package for converting MathTime Pro 2 Type 1 fonts to .otf format. The instructions describe a donors directory which by default contains inputs NimbusRoman-Regular.otf and NimbusRoman-Bold. No such fonts are in texlive/2026/texmf-dist/fonts/opentype. But texlive/2026/texmf-dist/fonts/opentype/public does include the nimbusfon5 subdirectory. Exactly which files from nimbus5 should be used in place of the defaults for donors?
- Make numbers in exponential vertical fractions be equally sized to normal superscriptsby Georgian Ilie on October 14, 2026 at 7:41 am
Good morning everyone, I am using the following code to write an equation: \documentclass[varwidth=true, border=1pt, 11pt]{standalone} \usepackage{amsmath} \usepackage{physics} \usepackage{fontspec} \usepackage{scalerel} \usepackage{gensymb} \setmainfont{STIX Two Text} \usepackage[math-style=upright,mathbf=text,mathbf=sym,mathrm=text,mathrm=sym]{unicode-math} \setmathfont{STIX Two Math} \begin{document} \begin{equation*} F(v) = 4\pi \left[\dfrac{M}{2\pi RT}\right]^{\frac{3}{2}} v^2 \exp\left(-\frac{Mv^2}{2RT}\right) \end{equation*} \end{document} which gives out this expression: I would like to make the "2" in the vertical fraction "3/2" equally sized to the "2" in the other exponentials. Is there a way to achieve this? Or is it better to move to an horizontal exponential fraction? Thank you in advance for the help.
- Why should I continue learning LaTeX?by Sourav on October 13, 2026 at 6:11 pm
I started learning (and using) LaTeX almost two years ago. But I see now that AI can produce the code for whatever I may want in a few seconds. This has demotivated me to continue learning more about LaTeX. Should I continue learning it ? If yes, why ? Just for the sake of enjoyment ? Or, are there more practical reasons ?
- Choose closed theta shape in fontsetup with lxby Ethan Duckworth on October 13, 2026 at 11:56 am
I would like to use the fontsetup package, with lx option, and get the closed theta shape 𝜃 but it gives ϑ instead. Here's my minimal file \input{iftex.sty} \RequireLuaTeX \documentclass{article} \usepackage[lx]{fontsetup} \begin{document} test $\theta$ \end{document} I tried adding the hooks from the newcomputermodern documentation \AddToHook{begindocument/end}{% \addfontfeature{RawFeature={-ss06}}} but it didn't help. Any suggestions?
- When to create a new command vs. a code snippetby wjmccann on October 12, 2026 at 7:31 pm
I have been using VS Code in order to type up my documents in Latex, and the terminal to compile/render them. In VS Code, I have various code snippets, such as "Real Numbers": { "prefix": "RR", "body": "\\mathbb{R}", "description": "Real numbers" }, that populate \mathbb{R} whenever I type RR. However, I could have also created a new command \RR in my tex file via \newcommand that does the same thing. I was wondering if y'all had any insight into when it would be better to use one over another. Question: Are there practical reasons to prefer using \newcommand over code fill snippets, or vice versa for certain applications?
- TikZ: good method to add dimension arrowsby cis on October 11, 2026 at 6:03 pm
I would like to add dimension arrows like the ones shown here. What is the most elegant way to do this in common? (Note that I am showing an example here; however, a good general method would be interesting.) So, for instance, the dimension arrows and labels should be placed evenly and systematically. Here is my own rather clumsy attempt: \documentclass[margin=5pt, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} %% Values \pgfmathsetmacro{\R}{2.0} \pgfmathsetmacro{\a}{1.9} \pgfmathsetmacro{\b}{sqrt(\R^2 - \a^2) + \R} \pgfmathsetmacro{\x}{\R+(sqrt(2)*sqrt(\R*(2*\R-\b)) +\b -2*\R)-\b} \begin{tikzpicture}[scale=1.5, font=\footnotesize, >={Triangle[length=0pt 2*4,width=0pt 4]}, ] %% Coordinates on the main segment \coordinate[label=below:$M$] (M) at (0,0); \coordinate[label=below:$O$] (O) at (-\R,0); \coordinate[label=below:$A$] (A) at (\R,0); \coordinate[label=below:$C$] (C) at (\R-\b,0); %% Draw main segment OA \draw[] (O) -- (A); %% Solution elements on the main segment \coordinate[label=below:$X$] (X) at (\x,0); % Dimension arrows \foreach \P in {C,M,X,A}{%% \path[draw=none, shorten <=1em] (\P) -- +(0,-1.125) coordinate[pos=0.3] (\P-1) coordinate[pos=0.6] (\P-2) coordinate[pos=0.8] (\P-3) coordinate[pos=1.0] (\P-4); }%% \draw[shorten <=1em] (X) -- (X-2); \draw[<->] (C-1) -- (X-1) node[midway, fill=black!1]{$r$}; \draw[shorten <=0.25em] (M-1) -- (M-2); \draw[<->] ([yshift=0.5em]M-2) -- ([yshift=0.5em]X-2) node[midway, below]{$x$}; \draw[shorten <=1em] (C) -- (C-4); \draw[shorten <=1em] (A) -- (A-4); \draw[<->] (C-3) -- (A-3) node[midway, fill=black!1]{$b$}; %% Draw points on the axis (solution) \foreach \P in {A, X} \draw[fill=black!1] (\P) circle (1.5pt); %% Draw points on the axis (task) \foreach \P in {C, M} \draw[fill=black!1] (\P) circle (1.5pt); \draw[fill=black!1] (O) circle (1.5pt); \end{tikzpicture} \end{document}