• Access Kurier upright calligraphic letters
    by Xorios on February 7, 2025 at 9:43 pm

    Is there an easier way to access Kurier's upright calligraphic letters than entering their unicode value? \documentclass[11pt,a4paper]{scrartcl} \usepackage[math]{kurier} \usepackage{fontspec} \setmainfont{Kurier} \begin{document} The font Kurier (or its sister Iwona) has calligraphic letters (uppercase Latin) accessible for example via the \verb|\mathcal| command. \begin{displaymath} \mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \end{displaymath} Those letters are italic (slanted/sloped), included in the italic OTF file. \medskip The Regular font file contains the same calligraphic letters but \textbf{upright} in the Private Use Area of the font. Is there a way to access them easier than entering their unicode value \symbol{"EB00} \symbol{"EB06} \symbol{"EB0B} etc. \symbol{"EB79} ? (\textsc{afaics} there is no OTF feature to access them, contrary to the hollow "out" \texttt{ss02}) \end{document}

  • Negative thin space causes error when using unicode-math
    by Matthew Leingang on February 6, 2025 at 2:47 pm

    I want to use a relation symbol that is a heart suit composed with a slash. In my prior work, I could accomplish it with \mathrel{\not\!\heartsuit}. The negative thin space \! is needed to make the slash and heart overlap well. But now that I'm slowly migrating to the unicode-math package, I'm getting an error I didn't get before. Here is a MWE: \documentclass{standalone} %\usepackage{unicode-math} \begin{document} \( a \mathrel{\not\!\heartsuit} b \) \end{document} As written with unicode-math unloaded, everything works fine. But if I load unicode-math, I get a missing { inserted error at the point of the \! command. If I take out the \! while using unicode-math, it compiles without error and looks fine. So I can solve the problem with a search-and-replace. Or, I can write a command \nloves which tests for unicode-math and defines the relation symbol accordingly. But I'm curious what the real source of the error is, and the best way to work around it.

  • Make Plain TeX file execute \bye unless it's \input to another file
    by Jonathan Levi on February 6, 2025 at 2:09 am

    I have two plain TeX files, file1.tex and file2.tex. I want file2.tex to execute a \bye statement if it's run standalone, but not if it's run as \input to file1.tex, i.e., file1.tex: file1 was entered.\par \input file2 file2.tex: file2 was entered. \bye % Make this conditional!

  • What to do about rivers once detected?
    by Gaussler on February 5, 2025 at 6:44 pm

    This question has a lovely example of a river: \documentclass{article} \usepackage{mathptmx} \usepackage{microtype} \textwidth 247pt \parindent 23pt \frenchspacing \begin{document} Though the Pearl measures less than 50~miles in total length from its modest source as a cool mountain spring to the screaming cascades and steaming estuary of its downstream reaches, over those miles, the river has in one place or another everything you could possibly ask for. You can roam among lush temperate rain forests, turgid white water canyons, contemplative meanders among aisles of staid aspens (with trout leaping to slurp all the afternoon insects from its calm surface), and forbidding swamp land as formidable as any that Humphrey Bogart muddled through in \emph{The African Queen}. \end{document} As mentioned in the accepted answer, there is even a package that can help you automatically detect rivers. But then what? What are the right methods to remove them once they are detected? Importantly, I am looking for methods that do not involve changing the wording of the paragraph. In the comments section of that question, @egreg suggests writing contem\-pla\-tive, and indeed, that solves it in this case. Is randomly inserting \- around the paragraph the only way to go? In the case of InDesign, this page suggests simply changing the line breaking parameters. What would be the right interface for doing that in TeX? Should I simply change \hyphenpenalty and the related penalties?

  • Faster and more robust alternatives to pgfmath [duplicate]
    by Jasper on February 5, 2025 at 8:53 am

    I have been working in pgfmath for a while, but it is proving to be too slow for some diagrams. I want to know what some faster alternatives to pgfmath are. For example: luacode, gnuplot, matplotlib, external software, etc. In particular, the following code both takes forever to run, and runs into dimensions too large issues. I would like to make vector fields which are more complicated, but finding thousands of vectors, with each being based on several charged points, is quite resource intensive. [Note: There is a typeout in the log which will tell you how far along the code is. It takes several seconds to complete one iteration of the inner for-loop (of which there are 15 for each iteration of the outer one). The outer one loops 15 times as well. I intend to make this bigger once I get my hands on faster software. So an estimate of the time this takes is (15*4)*15/60 seconds ~ >13 minutes] \documentclass[tikz, border=3.14mm]{standalone} \usepackage{tikz-3dplot} % https://tex.stackexchange.com/a/734099/319072 \ExplSyntaxOn % Create a new named segment list % #1: name of the new list \NewDocumentCommand \NewSegmentList { m } { \seq_new:c { g__jasper_segment_list_#1_seq } } % Add a segment to a named segment list % #1: name of the list % #2: sorting data (should be a float) % #3: additional data you want to retrieve (should include assignments storing % your data into locally used variables) \NewDocumentCommand \AddSegment { m m m } { \seq_gput_right:ce { g__jasper_segment_list_#1_seq } { { \fp_eval:n {#2} } { \exp_not:n {#3} } } } % Sort a named segment list % #1: > for ascending order, < for descending order (might be counter intuitive) % #2: name of the list \NewDocumentCommand \SortSegmentList { O{>} m } { \seq_gsort:cn { g__jasper_segment_list_#2_seq } { \fp_compare:nNnTF { \use_i:nn ##1 } #1 { \use_i:nn ##2 } \sort_return_swapped: \sort_return_same: } } % Loop over the elements of a list. Each item will be used inside of groups. % #1: name of the list % #2: code to execute inside each elements group after whatever was stored was % run \NewDocumentCommand \LoopOverSegmentList { m m } { \seq_map_inline:cn { g__jasper_segment_list_#1_seq } { \group_begin: \use_ii:nn ##1 #2 \group_end: } } % For debugging purposes, show the contents of a named segment list. % #1: name of the list \NewDocumentCommand \ShowSegmentList { m } { \seq_show:c { g__jasper_segment_list_#1_seq } } \ExplSyntaxOff \NewSegmentList{helix} \begin{document} \tdplotsetmaincoords{60}{130} \begin{tikzpicture}[tdplot_main_coords] \foreach[parse=true,count=\i] \t in {0,60,...,6*360} { \pgfmathsetmacro{\px}{cos(\t)} \pgfmathsetmacro{\py}{sin(\t)} \pgfmathsetmacro{\pz}{\i/40} \pgfmathsetmacro{\ppx}{cos(\t+10)} \pgfmathsetmacro{\ppy}{sin(\t+10)} \pgfmathsetmacro{\ppz}{\i/40} \ExpandArgs{nne}\AddSegment{helix} {} {% \def\noexpand\px{\px}% \def\noexpand\py{\py}% \def\noexpand\pz{\pz}% \def\noexpand\ppx{\ppx}% \def\noexpand\ppy{\ppy}% \def\noexpand\ppz{\ppz}% }% } \draw[smooth,samples=300,domain=0:6*360,red] plot ({cos(\x)},{sin(\x)},{\x/60/40}); \foreach \x in {-3,-2.5,...,3} { \typeout{X is \x} \foreach \y in {-3,-2.5,...,3} { \typeout{Y is \y} \foreach \z in {-3,-2.5,...,3} { \pgfmathsetmacro{\vx}{0} \pgfmathsetmacro{\vy}{0} \pgfmathsetmacro{\vz}{0} \LoopOverSegmentList{helix} { \pgfmathsetmacro{\xpx}{\x-\px} \pgfmathsetmacro{\ypy}{\y-\py} \pgfmathsetmacro{\zpz}{\z-\pz} \pgfmathsetmacro{\length}{% \fpeval{sqrt((\xpx)^2+(\ypy)^2+(\zpz)^2)}% } \pgfmathparse{\length!=0} \ifnum\pgfmathresult=1 \pgfmathsetmacro{\xpx}{\xpx/\length} \pgfmathsetmacro{\ypy}{\ypy/\length} \pgfmathsetmacro{\zpz}{\zpz/\length} \pgfmathsetmacro{\pxppx}{\ppx-\px} \pgfmathsetmacro{\pyppy}{\ppy-\py} \pgfmathsetmacro{\pzppz}{\ppz-\pz} \tdplotcrossprod(\pxppx,\pyppy,\pzppz)(\xpx,\ypy,\zpz) \pgfmathsetmacro{\vx}{\vx+\tdplotresx/\length^2} \pgfmathsetmacro{\vy}{\vy+\tdplotresy/\length^2} \pgfmathsetmacro{\vz}{\vz+\tdplotresz/\length^2} \global\let\vx\vx \global\let\vy\vy \global\let\vz\vz \fi } \pgfmathsetmacro{\vl}{\fpeval{sqrt((\vx)^2+(\vy)^2+(\vz)^2)}} \pgfmathparse{\vl!=0} \ifnum\pgfmathresult=1 \draw[->] (\x,\y,\z) -- ++(0.2*\vx/\vl,0.2*\vy/\vl,0.2*\vz/\vl); \fi } } } \end{tikzpicture} \end{document} The output should be like this, but with more samples, and a bigger solenoid.

  • Unexpected roundoff with fpeval length comparison
    by rallg on February 4, 2025 at 8:01 pm

    This MWE shows it all. Same with pdflatex or lualatex: \documentclass{article} \newlength\mytemplength \setlength\mytemplength{8.5in} \newlength\myotherlength \setlength\myotherlength{8.5in} \edef\myresulta{\fpeval{\mytemplength<8.499in}} % expect 0, meaning false \edef\myresultb{\fpeval{\mytemplength<8.5in}} % expect 0, meaning false \edef\myresultc{\fpeval{\mytemplength<8.5001in}} % expect 1, meaning true \edef\myresultd{\fpeval{\mytemplength<\mytemplength}} % expect 0, meaning false \edef\myresulte{\fpeval{\mytemplength<\myotherlength}} % expect 0, meaning false \typeout{MYRESULTA=\myresulta} % provides 0, as expected \typeout{MYRESULTB=\myresultb} % provides 1, NOT expected \typeout{MYRESULTC=\myresultc} % provides 1, as expected \typeout{MYRESULTD=\myresultd} % provides 0, as expected \typeout{MYRESULTE=\myresulte} % provides 0, as expected \begin{document} foo \end{document} I realize that the length is not stored as inches. Nevertheless, I expect that when I retrieve the stored length, and compare it to 8.5in, the conversion of 8.5in should use the same algorithm as was used when a length is stored. But it seems that this is not the case. Thus, a roundoff error occurs. I can handle this by creating additional lengths, so that I compare stored values to stored values. I can handle this by comparing a stored length to a tweaked value. But I am mystified as to why the stored length is not equal to its unstored value.

  • LuaLaTeX ignores kerning pairs among math glyphs
    by FKranhold on February 3, 2025 at 8:44 pm

    (This issue might be somewhat related to this question.) Consider the following MWE: \documentclass{scrartcl} \usepackage{unicode-math} \setmathfont{MinionMath-Regular} \begin{document} $abcff,$ \end{document} When compiled with LuaLaTeX (you need the Minion Math font for this), the result looks as follows: Clearly, some kerning information is either missing or ignored here. However, it looks as if this is not an issue of the font: A quick inspection with FontForge shows that the font contains information for many kerning pairs, including “ff” and “f,” (the “italic f” being the unicode character U+1D453): I believe there must be a way to tell LuaLaTeX all these values. Even if LuaLaTeX cannot get these values from the OTF file itself (which would surprise me), I’d expect that one can tell LuaLaTeX all these kerning values manually, similar to this solution, but somehow adapted to the math font. (For completeness, I should mention that staircaise kerning for subscripts and superscripts works fine.) Update: I have just noticed that with TeX Gyre Pagella Math as math font, there is a quite noticable kerning effect at “cf” and “ff” – so apparently, the concept of kerning math glyphs is something LuaLaTeX is (in principle) perfectly capable of:

  • How to write nested curly brackets with alligned cases?
    by MarcoM on February 2, 2025 at 3:18 pm

    I'm trying to write this chart I have to make it as close as possible as it is a transcription of a manuscript, so the text must be aligned as in the picture. I can omit the underscores. I tried using cases in equation mode but the cases at the right side are not aligned vertically. This is the code: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \text{Idee} \begin{cases} \text{variabili} & \text{(lettere)}\\ \text{costanti} \begin{cases} \text{generali} & \text{(idee deduttive)}\\ \text{particolari} \begin{cases} \text{non definite} & ({}_{"} \text{primitive})\\ \text{definite} & ({}_{"} \text{derivate})\\ \end{cases} \end{cases} \\ \end{cases} \] \end{document} I also tried using the shemata package but I couldn't even write the "cases" on the right. Any suggestions? Thanks

  • How can I remove spaces after multicols?
    by D G on January 31, 2025 at 4:18 pm

    I want to remove the spaces after multicols. \documentclass[12pt]{article} \usepackage[a6paper,hmargin=5mm,vmargin=12mm]{geometry} \usepackage{fouriernc} \usepackage{multicol} \columnsep=5mm\relax \AtBeginEnvironment{multicols}{\vspace{-0.5cm}} % Space before multicols \AtEndEnvironment{multicols}{\vspace{-1.5cm}} % Space after multicols \usepackage{enumitem} \setlist[enumerate,1]{leftmargin=5mm,label=\arabic*.,nosep} \setlist[enumerate,2]{leftmargin=8mm,label=\alph*.,nosep} \newcounter{globalenumerate} \newenvironment{genumerate} {\begin{enumerate}\setcounter{enumi}{\value{globalenumerate}}} {\setcounter{globalenumerate}{\value{enumi}}\end{enumerate}} \begin{document} \begin{genumerate} % 1 \item Quick brown fox jumps over a crazy dog. \begin{multicols}{2} \begin{enumerate} \item It is not funny! \item Almost funny! \item Not sure! \item Hahaha! \end{enumerate} \end{multicols} % 2 \item Who invented $E=mc^2$? \begin{multicols}{2} \begin{enumerate} \item Mr.~Bean \item Mrs.~Bean \end{enumerate} \end{multicols} \end{genumerate} \end{document} My attempt with \AtEndEnvironment{multicols}{\vspace{-1.5cm}} does not work.

  • Is there a reason why people use \begin and \end with tikz, when you can load it with way fewer letters with \tikz{}?
    by Jasper on January 29, 2025 at 10:01 pm

    I want to make an inquiry into why people commonly use \begin{tikzpicture} and \end{tikzpicture}, instead of just \tikz{}. The reason for me asking is that I would prefer when making an MWE to use the smaller syntax, as it is less cumbersome to type. Most posts declare the environment using the \begin{tikzpicture} and \end{tikzpicture} syntax. This makes me question whether there is a reason for this. Are there any specific reasons that it is commonly done like this? Are there downsides to using \tikz{}? For example, take this classic bug report (posted first by @Zarko, and followed by many others): Why arc with angles given by "trig format=rad" gives wrong result? \documentclass[tikz]{standalone} \begin{document} \tikz{ \draw[trig format=rad, red] (1,0) arc[start angle=0, end angle=pi, radius=1]; \draw[domain=-1:1, samples=100, blue] plot (\x,{sqrt(1-(\x)^2)}); } \end{document} I simply don't like how much we have to write just to use tikz. I would prefer to use the smaller syntax which is less prone to typing errors. Can I safely do this?

  • A problem with the justification of a paragraph in LaTeX
    by Eugene Zhang on January 29, 2025 at 4:38 pm

    I have met with a problem with the justification of a paragraph in LaTeX. The MWE LaTeX code is as below: \documentclass[11pt,twoside]{article}% \usepackage{amssymb} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{geometry} \newtheorem{theorem}{Theorem}[section] \newtheorem{corollary}[theorem]{Corollary} \geometry{margin=1in,top=1.25in,bottom=1.25in} \begin{document} \begin{theorem} \label{43}\ Suppose for each $n<\omega,\,Q_{n}$ is a finitely generated set and $Q_{n}=\{\ast G_{n},Q_{n-1}\}$ with $Q_{0}\,=\,G_{0}\in V_{\omega}$ where $\{G_{n}\}$ form a finite cycle of length $l$ with $|G_{1}|<|G_{2}|<\cdots<|G_{l}|$ and $R_V(G_0)\geqslant\max\limits_{1\leqslant i\leqslant l}\{R_V(G_i)\}$\footnote{If $R_V(G_0)< R_V(G_j)$, let $G_0=\{*G_l,\cdots\{G_1,G_0\}\cdots\}$.}. Let $\mathcal{Q}_n=\langle\{Q_{n}\},\in,G_0,G_1,\cdots,G_l\rangle$, $\mathfrak{Q}_{n_p}=\left\langle\allowbreak\left\{ Q_{n_j}\colon j\leqslant p\wedge n_j\leqslant n_p\right\},\in,G_0,G_1\cdots,G_l \right\rangle$, $\mathfrak{Q}_q=\bigcup_{n_p<\omega}\mathfrak{Q}_{n_{p}(q)}= \left\langle\left\{Q_{{n_{p}(q)}}\colon p<\omega\right\},\in,G_0,G_1\cdots,G_l\right\rangle$, and $\mathfrak{Q}=\bigcup_{0\leqslant q< l}\mathfrak{Q}_{q}=\langle\{Q_{n}\colon n<\omega\},\in,G_0,G_1\cdots,G_l\rangle$. Then \end{theorem} \end{document} The problem happens inside $\mathfrak{Q}_{n_p}=\left\langle\allowbreak\left\.... I have tried to break the bracket to make alignment work by adding allowbreak or \\ but both fail. I wonder how to break the bracket to make alignment work. Thanks.

  • How to make sphere in TikZ
    by Mr.Price on January 27, 2025 at 1:42 pm

    I'm learning to make 3D figures like cone, triangle, sphere etc in TikZ and hopefully I managed to make nicely looking cones and triangels but the problem is with Sphere. This how I currently managed to make my simple sphere: \documentclass[border=2mm,12pt,tikz]{standalone} \usetikzlibrary{angles, quotes} \usepackage{amssymb} \usetikzlibrary {arrows.meta, shapes.geometric, trees, shapes, backgrounds,intersections, patterns} \usepackage{pgfplots} \usepgfplotslibrary{units} \usetikzlibrary{positioning} \usepackage{amsmath, amssymb} \usepackage{siunitx} \usepackage{tikz-3dplot} \begin{document} \def\myr{3} \tdplotsetmaincoords{75}{90} \begin{tikzpicture}[tdplot_main_coords] \begin{scope} [canvas is xy plane at z=0] % O \coordinate (O) (0,0); \node[right] at (O) {$O$}; % Back half circle (dashed) \draw[dashed] (\tdplotmainphi:\myr) arc(\tdplotmainphi:\tdplotmainphi+180:\myr) coordinate(R); % Front half circle (solid) + BL \draw[thick] (\tdplotmainphi:\myr) arc(\tdplotmainphi:\tdplotmainphi-180:\myr) coordinate(L); \end{scope} \begin{scope} [canvas is yz plane at x=0] \draw[thick] (O) circle(\myr); \end{scope} \fill (O) circle(1pt); \draw (O) -- (R) node[midway, above]{$r$}; \end{tikzpicture} \end{document} But I'm wondering how can I do this kind of sphere with circles across various axes, nicely filled in color, with some points and arrow indicating the rotation. Is it possible to extend my approach to obtain this effect or it will be more complicated?

  • How may two title lines be aligned?
    by Frode Alfson Bjørdal on January 27, 2025 at 5:28 am

    Consider the MWE \documentclass{article} \title{A line written firstly\\ succeeded by another} \date{} \begin{document} \maketitle \end{document} The first line has almost the same length as the second. Is there a way to make the lines align and get the same length, short of mechanically inserting \hspace instructions?

  • In LaTeX3, how to iterate on all tokens, including spaces?
    by Vincent on January 26, 2025 at 5:17 pm

    In LaTeX3, token lists collapse spaces. Is there a way to avoid that and call a function on all tokens, without collapsing spaces. For example, I would like the following function to display the catcode of every token of the input, including spaces \cs_new:Nn \myfunction:n{ % Call "\token_to_catcode:N" on every single token of the input, including spaces } I would prefer to do that in an expandable way (still interested by a non-expandable way if the expandable version is way harder or impossible).

  • TeX macro expansion incorrect when nested
    by nick2225 on January 26, 2025 at 7:27 am

    I am trying to create my own 2-pass table of contents implementation like LaTeX but I am using just plain TeX (technically LuaTeX). Though I am having some problems with the intermediate macros I am trying to create to help me with this. Mainly detecting if a contents.toc file has been created or not. Here is my helper file which defines all my macros I will use. % helper.tex \def\True{1} \def\False{0} \newread\FileCheck \def\DoesFileExist#1{ \immediate\openin\FileCheck=#1\relax % If an end of file is reached, then the file does not exist. \ifeof\FileCheck \closein\FileCheck \False \else \closein\FileCheck \True \fi } \def\CreateToc{ \edef\Result{\DoesFileExist{contents.toc}} \ifx\Result\True % \input{contents.toc} \relax \else \relax \fi } And here is my main file \input helper.tex % \DoesFileExist{contents.toc} % This works correctly to defect if the file exists or not \CreateToc \bye My macro DoesFileExist works, in that it expands to 1 or 0 if the contents.toc file does exist or not respectively. The problem is that the CreateToc macro does not work. When I try to expand the macro DoesFileExist inside of it, it always expands to false. What am I doing wrong here? For reference here is my trace output after setting \tracingonline=1\tracingcommands=2\tracingmacros=2. % Log output {vertical mode: \tracingmacros} \CreateToc -> \edef \Result {\DoesFileExist {contents.toc}} \ifx \Result \True \relax \else \relax \fi {blank space } {\edef} \DoesFileExist #1-> \immediate \openin \FileCheck =#1\relax \ifeof \FileCheck \ closein \FileCheck \False \else \closein \FileCheck \True \fi #1<-contents.toc {\ifeof} {true} \False ->0 {\else} {blank space } {\ifx} {false} {\relax} {\fi}

  • How to Optimize a TikZ Animation of Quicksort?
    by Emanuele Nardi on January 22, 2025 at 3:11 pm

    While revisiting some old notes on algorithms, I came across a code snippet illustrating the sorting of a vector using quicksort. I’m dissatisfied with how the nodes are defined relative to each other, requiring some nodes to be repeated to maintain references. Additionally, I had to draw them in reverse order to ensure the edges overlapped correctly. One potential optimization I considered is ensuring the "examining" styled node always displays \(i\) above it. How can I optimize the code to avoid repetition? % arara: pdflatex % arara: latexmk: { clean: partial } \documentclass[tikz, border=.2cm]{standalone} \usetikzlibrary{positioning} \tikzset{ vector/.style = { draw = black, rectangle, align = center, anchor = west, fill = yellow!40, font = \ttfamily\bfseries, minimum height = 0.7cm, minimum size = 0.7cm }, label/.style = { node distance = 0pt, font = \scriptsize, }, % cells styles undiscovered/.style = { fill = teal!20, draw = teal, dashed, }, examining/.style = { very thick, fill=teal!50, }, pivot/.style = { fill = purple!60, }, smallerPivot/.style = { fill = red!20, }, greaterPivot/.style = { fill = gray!20, draw = gray!80, dashed, }, } \begin{document} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 11, undiscovered] (10) {25}; \node[vector, left=-1pt of 10, undiscovered] (9) {21}; \node[vector, left=-1pt of 9, undiscovered] (8) {30}; \node[vector, left=-1pt of 8, undiscovered] (7) {12}; \node[vector, left=-1pt of 7, undiscovered] (6) {27}; \node[vector, left=-1pt of 6, undiscovered] (5) {15}; \node[vector, left=-1pt of 5, undiscovered] (4) {29}; \node[vector, left=-1pt of 4, undiscovered] (3) {28}; \node[vector, left=-1pt of 3, examining] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; % NOTE I have to repeat it otherwise I don't have the reference to node 2 for node 1 \node[vector, right=-1pt of 1, examining] (2) {14}; \node[label, above=of 2] (index-i) {\(i\)}; \node[label, below=of 1] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 11, undiscovered] (10) {25}; \node[vector, left=-1pt of 10, undiscovered] (9) {21}; \node[vector, left=-1pt of 9, undiscovered] (8) {30}; \node[vector, left=-1pt of 8, undiscovered] (7) {12}; \node[vector, left=-1pt of 7, undiscovered] (6) {27}; \node[vector, left=-1pt of 6, undiscovered] (5) {15}; \node[vector, left=-1pt of 5, undiscovered] (4) {29}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, right=-1pt of 2, examining] (3) {28}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 3] (index-i) {\(i\)}; \node[label, below=of 2] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 11, undiscovered] (10) {25}; \node[vector, left=-1pt of 10, undiscovered] (9) {21}; \node[vector, left=-1pt of 9, undiscovered] (8) {30}; \node[vector, left=-1pt of 8, undiscovered] (7) {12}; \node[vector, left=-1pt of 7, undiscovered] (6) {27}; \node[vector, left=-1pt of 6, undiscovered] (5) {15}; \node[vector, left=-1pt of 4, greaterPivot] (3) {28}; \node[vector, right=-1pt of 3, examining] (4) {29}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 4] (index-i) {\(i\)}; \node[label, below=of 2] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 11, undiscovered] (10) {25}; \node[vector, left=-1pt of 10, undiscovered] (9) {21}; \node[vector, left=-1pt of 9, undiscovered] (8) {30}; \node[vector, left=-1pt of 8, undiscovered] (7) {12}; \node[vector, left=-1pt of 7, undiscovered] (6) {27}; \node[vector, left=-1pt of 5, greaterPivot] (4) {29}; \node[vector, right=-1pt of 4, examining] (5) {15}; \node[vector, left=-1pt of 4, greaterPivot] (3) {28}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 5] (index-i) {\(i\)}; \node[label, below=of 2] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 11, undiscovered] (10) {25}; \node[vector, left=-1pt of 10, undiscovered] (9) {21}; \node[vector, left=-1pt of 9, undiscovered] (8) {30}; \node[vector, left=-1pt of 8, undiscovered] (7) {12}; \node[vector, left=-1pt of 6, greaterPivot] (5) {28}; \node[vector, right=-1pt of 5, examining] (6) {27}; \node[vector, left=-1pt of 5, greaterPivot] (4) {29}; \node[vector, left=-1pt of 4, smallerPivot] (3) {15}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 6] (index-i) {\(i\)}; \node[label, below=of 3] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 11, undiscovered] (10) {25}; \node[vector, left=-1pt of 10, undiscovered] (9) {21}; \node[vector, left=-1pt of 9, undiscovered] (8) {30}; \node[vector, left=-1pt of 7, greaterPivot] (6) {27}; \node[vector, right=-1pt of 6, examining] (7) {12}; \node[vector, left=-1pt of 6, greaterPivot] (5) {28}; \node[vector, left=-1pt of 5, greaterPivot] (4) {29}; \node[vector, left=-1pt of 4, smallerPivot] (3) {15}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 7] (index-i) {\(i\)}; \node[label, below=of 3] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 11, undiscovered] (10) {25}; \node[vector, left=-1pt of 10, undiscovered] (9) {21}; \node[vector, left=-1pt of 8, greaterPivot] (7) {29}; \node[vector, right=-1pt of 7, examining] (8) {30}; \node[vector, left=-1pt of 7, greaterPivot] (6) {27}; \node[vector, left=-1pt of 6, greaterPivot] (5) {28}; \node[vector, left=-1pt of 5, smallerPivot] (4) {12}; \node[vector, left=-1pt of 4, smallerPivot] (3) {15}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 8] (index-i) {\(i\)}; \node[label, below=of 4] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 11, undiscovered] (10) {25}; \node[vector, left=-1pt of 9, greaterPivot] (8) {30}; \node[vector, right=-1pt of 8, examining] (9) {21}; \node[vector, left=-1pt of 8, greaterPivot] (7) {29}; \node[vector, left=-1pt of 7, greaterPivot] (6) {27}; \node[vector, left=-1pt of 6, greaterPivot] (5) {28}; \node[vector, left=-1pt of 5, smallerPivot] (4) {12}; \node[vector, left=-1pt of 4, smallerPivot] (3) {15}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 9] (index-i) {\(i\)}; \node[label, below=of 4] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, undiscovered] (11) {13}; \node[vector, left=-1pt of 10, greaterPivot] (9) {21}; \node[vector, right=-1pt of 9, examining] (10) {25}; \node[vector, left=-1pt of 9, greaterPivot] (8) {30}; \node[vector, left=-1pt of 8, greaterPivot] (7) {29}; \node[vector, left=-1pt of 7, greaterPivot] (6) {27}; \node[vector, left=-1pt of 6, greaterPivot] (5) {28}; \node[vector, left=-1pt of 5, smallerPivot] (4) {12}; \node[vector, left=-1pt of 4, smallerPivot] (3) {15}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 10] (index-i) {\(i\)}; \node[label, below=of 4] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, greaterPivot] (10) {25}; \node[vector, right=-1pt of 10, examining] (11) {13}; \node[vector, left=-1pt of 10, greaterPivot] (9) {21}; \node[vector, left=-1pt of 9, greaterPivot] (8) {30}; \node[vector, left=-1pt of 8, greaterPivot] (7) {29}; \node[vector, left=-1pt of 7, greaterPivot] (6) {27}; \node[vector, left=-1pt of 6, greaterPivot] (5) {28}; \node[vector, left=-1pt of 5, smallerPivot] (4) {12}; \node[vector, left=-1pt of 4, smallerPivot] (3) {15}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 11] (index-i) {\(i\)}; \node[label, below=of 4] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, greaterPivot] (11) {28}; \node[vector, left=-1pt of 11, greaterPivot] (10) {25}; \node[vector, left=-1pt of 10, greaterPivot] (9) {21}; \node[vector, left=-1pt of 9, greaterPivot] (8) {30}; \node[vector, left=-1pt of 8, greaterPivot] (7) {29}; \node[vector, left=-1pt of 7, greaterPivot] (6) {27}; \node[vector, left=-1pt of 6, smallerPivot] (5) {13}; \node[vector, left=-1pt of 5, smallerPivot] (4) {12}; \node[vector, left=-1pt of 4, smallerPivot] (3) {15}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, pivot] (1) {20}; \node[label, above=of 11] (index-i) {\phantom{\(i\)}}; \node[label, below=of 5] (index-j) {\(j\)}; \end{tikzpicture} \begin{tikzpicture} \node[vector, greaterPivot] (11) {28}; \node[vector, left=-1pt of 11, greaterPivot] (10) {25}; \node[vector, left=-1pt of 10, greaterPivot] (9) {21}; \node[vector, left=-1pt of 9, greaterPivot] (8) {30}; \node[vector, left=-1pt of 8, greaterPivot] (7) {29}; \node[vector, left=-1pt of 7, greaterPivot] (6) {27}; \node[vector, left=-1pt of 6, pivot] (5) {20}; \node[vector, left=-1pt of 5, smallerPivot] (4) {12}; \node[vector, left=-1pt of 4, smallerPivot] (3) {15}; \node[vector, left=-1pt of 3, smallerPivot] (2) {14}; \node[vector, left=-1pt of 2, smallerPivot] (1) {13}; \node[label, above=of 11] (index-i) {\phantom{\(i\)}}; \node[label, below=of 5] (index-j) {\(j\)}; \end{tikzpicture} \end{document}

  • \NewDocumentCommand, \NewExpandableDocumentCommand versus \cs_new_protected:Npn, \cs_new:Npn, and \cs_new_eq:NN
    by User23456234 on January 22, 2025 at 1:39 pm

    When should expl3 programmers define user-level document commands using \NewDocumentCommand,\NewExpandableDocumntCommand, and friends versus using \cs_new_protected:Npn \cs_new:Npn, or \cs_new_eq:NN? Currently, I always use \NewDocumentCommand, \NewExpandableDocumntCommand, and friends, but I have observed that the kernel sometimes prefers using \cs_new_protected:Npn, \cs_new:Npn, or \cs_new_eq:NN. Examples of user-level document commands defined in the kernel without \NewDocumentCommand, \NewExpandableDocumntCommand, and friends: The argument processors: \ReverseBoolean, \SplitArgument, \SplitList, \TrimSpaces, \ProcessList Some hook commands: \ShowHook, \LogHook, \DebugHooksOn, \DebugHooksOff Some socket commmands: \NewSocket, \ShowSocket, \LogSocket, \NewSocketPlug, \AssignSocketPlug, \UseSocket, \DebugSocketsOn, \DebugSocketsOff Some xtemplate commands: \NewTemplateType, \DeclareTemplateInterface, \DeclareTemplateCode, \DeclareTemplateCopy, \EditTemplateDefaults, \UseTemplate, \DeclareInstance, \DeclareInstanceCopy, \EditInstance, \UseInstance Are \NewDocumentCommand, \NewExpandableDocumntCommand, and friends for commands that users may use between \begin{document} and \end{document}?

  • Left-aligning section numbers in the margin
    by MrI2C on January 22, 2025 at 10:56 am

    In the example underneath all the numbering of section, subsection and subsubsection is in the margin, but I'd like the numbering to be aligned on the left (like a virtual vertical line, as shown with the blue line in the picture underneath). I could play with the \hskip values, but that doesn't seem to be the LaTeX way... \documentclass{article} \usepackage{titlesec} \usepackage{lipsum} % for dummy text % Adjust the format of \section, \subsection, and \subsubsection \titleformat{\section}[hang]{\normalfont\Large\bfseries}{\llap{\thesection.\hskip 9pt}}{0pt}{} \titleformat{\subsection}[hang]{\normalfont\large\bfseries}{\llap{\thesubsection\hskip 9pt}}{0pt}{} \titleformat{\subsubsection}[hang]{\normalfont\normalsize\bfseries}{\llap{\thesubsubsection\hskip 9pt}}{0pt}{} \begin{document} \section{First Section} \lipsum[1] \subsection{Subsection} \lipsum[2] \subsubsection{Subsubsection} \lipsum[3] \end{document}

  • How to execute multiple statements in \str_case_e
    by Bubaya on January 21, 2025 at 4:10 pm

    I observed that the line \setbeamercolor{itemize item}{fg=green} in \documentclass{beamer} \def\X{a} \ExplSyntaxOn \str_case_e:nnF{\X}{ {a}{ \setbeamercolor{structure}{fg=red} \setbeamercolor{itemize item}{fg=green} }{b}{ \setbeamercolor{structure}{fg=green} \setbeamercolor{itemize item}{fg=red} } }{\PackageError{}{Specified \X.}{}} \ExplSyntaxOff \begin{document} \begin{frame} \begin{itemize} \item 1 \item 2 \item 3 \end{itemize} \end{frame} \end{document} has no effect when appearing inside the \str_case_e:nnF, but of course does so when issued after. I therefore assume that I am using \str_case_e:nnF in a wrong way, but I don't really know what the problem is. Since I'm not 100% sure if the problem is not about beamer, I include the beamer tag, too.

  • Best practices: How to tag a tikzpicture (and other things)
    by Gaussler on January 21, 2025 at 9:09 am

    According to the PDF tagging project, I can tag graphics included using \includegraphics via the alt key. What about graphics generated with TikZ? In general, what is the recommended approach to getting tagging for the cases where this cannot be automated? And where can I find documentation for these tagging commands? The tagpdf manual explicitly states that it is “not meant for direct use in (normal) documents”. \DocumentMetadata{pdfstandard=A-2b,lang=en} \documentclass{article} \usepackage{graphicx, tikz} \begin{document} \includegraphics[alt={Example}]{example-image-a} \bigskip \begin{tikzpicture} \draw (0,0) circle (1cm); \end{tikzpicture} \end{document}

  • How can one typeset an upright hash symbol?
    by The Substitute on January 20, 2025 at 1:11 am

    I want my hash to appear as it does in the image below (from https://mathworld.wolfram.com/Primorial.html). I tried \# \text{\#} \textitt{\#} but these lead to, respectively,

  • Text fractions in Cambria have too much space around solidus
    by dedded on January 17, 2025 at 12:36 am

    Text fractions look bad in Cambria for me. I haven't had this problem in other fonts that support them, and they look fine even in Cambria if I use bold, italics, or bold italics. Is there a way that I can get rid of the ugly, too wide spacing between the digits and the solidus? Unfortunately not everyone will have Cambria which does not come with Latex. But is there anyone who has it who can make this work? I'm using Lualatex. \documentclass{article} \usepackage{fontspec} \setmainfont{Cambria}[ BoldFont=CambriaB.ttf, ItalicFont=CambriaI.ttf, BoldItalicFont=CambriaZ.ttf, ] \newcommand\myfrac[2]{\addfontfeature{RawFeature=+frac} #1/#2} \begin{document} % These look terrible (but OK with other fonts) \myfrac{1}{11} \myfrac{2}{22} \myfrac{3}{33} \myfrac{4}{44} \myfrac{5}{55} % These look good {\itshape % or bfseries, or both \myfrac{1}{11} \myfrac{2}{22} \myfrac{3}{33} \myfrac{4}{44} \myfrac{5}{55} } \end{document}

  • Using LaTeX3 keys causes issues with nesting and sub-/superscripts
    by Werner on January 16, 2025 at 5:29 am

    I'd like to add options to a listing function to make them more comprehensive. These include: Setting left/right delimiters (using a delims key; example would be delims = \lbrace\rbrace which sets {...} outside my list) Setting the delimiter size (using a delim-size key; example would be delim-size = big which results in setting \bigl...\bigr outside my list) I've done so below using LaTeX3 syntax for \mathlist[<opts>]{<clist>}. However, I run into problems with my current definition when the following is added as list elements: Subscripts and/or superscripts Nesting another \mathlist inside \mathlist Moreover, I feel like the \relaxed definitions of \normall and \normalr seems out-of-place for the default unsized delimiters. There must be a better way to do that... How can I update \mathlist so it can accommodate the above settings and not have the listed issues? \documentclass{article} \usepackage{amsmath, amsfonts} \ExplSyntaxOn \keys_define:nn { macros }{ item-sep .tl_set:N = \l_macro_item_sep_tl, delim-size .tl_set:N = \l_macro_delimiter_size_tl, delims .tl_set:N = \l_macro_delimiter_tl, item-func .tl_set:N = \l_macro_item_func_tl } \clist_new:N \l_macro_list_clist \int_new:N \l_list_count_int \int_new:N \l_list_count_total_int \NewDocumentCommand{\normall}{}{\relax} \NewDocumentCommand{\normalr}{}{\relax} \NewDocumentCommand{\mathlist}{ O{} m }{% \group_begin: % Store list in clist variable \clist_set:Nn \l_macro_list_clist { #2 } % Store count of items \int_set:Nn \l_list_count_int { 0 } \int_set:Nn \l_list_count_total_int { \clist_count:N \l_macro_list_clist } % Set keys \keys_set:nn { macros }{ item-sep = {,}, delim-size = normal, item-func = {}, #1 } % Set left delimiter \tl_if_empty:NF \l_macro_delimiter_tl { \exp_args:Noo \cs_if_exist_use:c { \l_macro_delimiter_size_tl l } { \tl_item:Nn \l_macro_delimiter_tl { 1 } } } % Cycle through items and set them \clist_map_inline:Nn \l_macro_list_clist { \int_incr:N \l_list_count_int \tl_if_in:nnTF { \ldots \dots \dotsc } { ##1 } % Apply item-func only to certain items { ##1 } % Don't apply item-func to item { \tl_use:N \l_macro_item_func_tl { ##1 } } % Apply item-func to item \int_case:nnF { \int_use:N \l_list_count_int } { { \int_use:N \l_list_count_total_int - 1 } { , } % Penultimate item separation { \int_use:N \l_list_count_total_int } { } % Final item } { , \allowbreak } % All other items (allow for a line-break) } % Set delimiter delimiter \tl_if_empty:NF \l_macro_delimiter_tl { \exp_args:Noo \cs_if_exist_use:c { \l_macro_delimiter_size_tl r } { \tl_item:Nn \l_macro_delimiter_tl { -1 } } } \group_end: } \NewDocumentCommand{\specialFunc}{ O{} m }{% \mathlist[delims = (), #1]{ #2 } } \ExplSyntaxOff \begin{document} % Basic usage $\{ \mathlist{ a, b, c, d } \} = \mathlist[delims = \lbrace\rbrace]{ a, b, c, d }$ % Works \bigskip % Delimiter sizing $\bigl\{ \mathlist{ a, b, c, d } \bigr\} = \mathlist[delims = \lbrace\rbrace, delim-size = big]{ a, b, c, d }$ % Works \bigskip % Macro application $( \mathlist{ \texttt{a}, \texttt{b}, \dots, \texttt{z} } ) = \specialFunc[delims = (), item-func = \texttt]{a, b, \dots, z}$ \bigskip % Subscripts $\bigl[ \mathlist{ a_b, c_d } \bigr] = \mathlist[delims = {[]}, delim-size = big]{ a_b, c_d }$ \bigskip % Macros with subscripts $\bigl[ \mathlist{ \texttt{a}_b, c_d } \bigr] = \mathlist[delims = {[]}, delim-size = big]{ \texttt{a}_b, c_d }$ (problem) \bigskip % Macros with superscripts $\bigl[ \mathlist{ \texttt{a}^b, c_d } \bigr] = \mathlist[delims = {[]}, delim-size = big]{ \texttt{a}^b, c_d }$ (problem) \bigskip % Macros with subscripts and superscripts $\bigl\{ \mathlist{ a, b, \texttt{c}_d^e } \bigr\} = \mathlist[delims = \lbrace\rbrace, delim-size = big]{ a, b, \texttt{c}_d^e }$ (problem) \bigskip % Nesting %$\Bigl( \mathlist{ a, b, \bigl[ \mathlist{c, d} \bigr], e } \Bigr) = \mathlist[delims = (), delim-size = Big]{ a, b, \mathlist[delims = {[]}, delim-size = big]{ c, d }, e }$ (problem) \end{document} Additional keys that I've added are item-sep (to change the list separator) item-func (to apply a function to each element in the list, like \texttt or \mathcal) Any updates should still accommodate these.

  • Drawing a matrix with TikZ using a parametric command
    by Emanuele Nardi on January 15, 2025 at 8:39 pm

    How can I create a LaTeX command that allows me to draw matrices with parameterizable content, configurable colored cells, and customizable cell colors? I would like to define the matrix values, specify which cells should be highlighted, and easily customize the color used for highlighting. The desired syntax for the command would be: \DrawMatrix[<color>]{1:3, 2:2-8, 3:2-4, 3:7}{<matrix>} Could you guide me in designing such a command? Additionally, here is the output I aim to achieve and the code I have attempted so far. \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{tikz} \usepackage{caption} \usepackage{subcaption} \NewDocumentCommand{\DrawMatrix}{ m m }{% % Highlight shaded cells \foreach \x/\y in { 3/8, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7, 8/7, 2/6, 3/6, 4/6, 7/6 } { \fill[#1] (\x-1,\y-1) rectangle (\x,\y); } % Draw the grid \foreach \x in {0,1,...,8} { \draw (\x,0) -- (\x,8); \draw (0,\x) -- (8,\x); } % Populate the matrix \foreach \y [count=\i from 8] in { #2 } { \foreach \x [count=\j from 1] in \y { \node at (\j-0.5, 15.5-\i) {\x}; } } % Add row numbers \foreach \i in {1,...,8} { \node[left] at (-0.1, 8-\i+0.5) {\footnotesize\sffamily\i}; } % Add columns numbers \foreach \j in {1,...,8} { \node[above] at (\j-0.5, 8.1) {\footnotesize\sffamily\j}; } } \begin{document} \begin{figure} \begin{subfigure}{.5\textwidth}\centering \begin{tikzpicture}[scale=0.6] \DrawMatrix{WildStrawberry!40}{ {7,5,3,4,4,6,7,8}, {6,3,3,3,3,3,3,5}, {4,3,3,3,2,1,3,4}, {4,5,2,1,7,8,2,3}, {5,2,1,3,3,3,3,4}, {2,2,2,2,2,2,2,2}, {1,4,1,4,1,4,1,4}, {4,1,1,4,4,1,8,8}, } \end{tikzpicture} \end{subfigure}% \begin{subfigure}{.5\textwidth}\centering \begin{tikzpicture}[scale=0.6] \DrawMatrix{PineGreen!40}{ {7,5,5,4,4,6,7,8}, {6,5,5,5,5,5,5,5}, {4,5,5,5,2,1,5,4}, {4,5,2,1,7,8,2,3}, {5,2,1,3,3,3,3,4}, {2,2,2,2,2,2,2,2}, {1,4,1,4,1,4,1,4}, {4,1,1,4,4,1,8,8}, } \end{tikzpicture} \end{subfigure} \end{figure} \end{document}

  • mysterious delay when downloading fonts, difference between luatex, luahbtex
    by wipet on January 15, 2025 at 10:18 am

    OpTeX in TeXlive 2024 is linked to luatex, i.e. the luatex engine is used. I am considering to re-link optex from luatex to luahbtex in new TeXlive 2025, so I started to do some tests. But I noted a mystery. Maybe someone here can explain this. I suppose that if mode=harf is never used in \font loading then luatex behaves exactly like luahbtex. Is it true? I apologize, I am not able to show a minimal example because we have to load hundreds fonts in order to show the issue. I tried new binaries 1.20/dev of luatex,luahbtex but exactly the same behavior is with 1.18 version currently used in TeXlive 2024. I created a new OpTeX format for luahbtex by luahbtex -ini optex.ini mkdir -p ~/.texlive2024/texmf-var/web2c/luahbtex/ mv optex.fmt ~/.texlive2024/texmf-var/web2c/luahbtex/ Now, OpTeX with luatex is run by optex command (this is default) and optex with luahbtex is run by luahbtex -fmt optex command. I created a simple file catalog.tex for fonts catalog generating: \fontfam[catalog] \bye Now, try to run optex catalog. The first run may take few minutes because some fonts have to be found and saved to the font cache used by luaotfload. Try to run this command secondly. It takes about 16 s at my computer. It seems to be OK. Try to run luahbtex -fmt optex catalog. It takes similar time and gives the same result. It seems to be OK. If you do grep WARNING: grep WARNING catalog.log WARNING l.7: Family [Besley] skipped, font "[Besley-Regular]" not found. WARNING l.7: Family [BodoniModa] skipped, font "[BodoniModa11pt-Regular]" not f WARNING l.6: Family [DraftingMono] skipped, font "[DraftingMono-Regular]" not f WARNING l.7: Family [Jost] skipped, font "[Jost-400-Book]" not found. WARNING l.7: Family [Fraunces] skipped, font "[Fraunces-VariableFont_SOFT,WONK, WARNING l.6: Family [Technika] skipped, font "[Technika-Regular]" not found. you can see, that OpTeX tries to insert more font families not included in TeXlive. Try to install the first family Besley from this page unzip Besley*.zip mkdir -p ~/texmf/fonts/opentype/besley/ mv Besley/static/* ~/texmf/fonts/opentype/besley/ and run again optex catalog. Besley is included, because grep WARNING doesn't list it. Try to run luahbtex -fmt optex catalog. When the second phase of downloading fonts is processed at the end of the document and all included fonts are listed on the terminal (after the message see the transcript file for additional information) then you may notice a significant delay (1~s per font) on the terminal, when Besley fonts are downloaded. Why? I know that ~/texmf tree is un-hashed. But why luatex downloads external fonts from the ~/texmf/ tree quickly but luahbtex not? Where is difference? When you try to load fewer fonts, i.e. add the addtional line to the catalog.tex file: \catalogonly{besley} \fontfam[catalog] \bye then no 1~s delay is visible although luahbtex -fmt optex catalog is run. This is reason why I am unable to present a minimal example of this problem. When I try to run whole catalog and have Besley fonts in the current directory (i.e. no ~/texmf tree is used), then there is no delay with luahbtex too. The described behavior is similar with some other external fonts from ~/texmf/fonts tree: Besley, Frances, Jost, for example. OpTeX uses variable fonts for Fraunces family, but the issue is not about variable fonts, because OpTeX loads Besley fonts from its static variants. Can someone explain this mystery? OpTeX never uses mode=harf in its macros, so there should be no difference between luatex and luahbtex. OK, there is no difference in the PDF result but we can see the difference with delays when loading huge amount of fonts.

  • Is it possible to change the voltmeter index in a circuit using circuitikz?
    by Sebastiano on January 14, 2025 at 1:32 pm

    I am trying to insert a voltmeter in a circuit using circuitikz, as shown in the following example: \documentclass[12pt]{article} \usepackage{circuitikz} \begin{document} \begin{tikzpicture} \draw (5.5, 6) to[smeter, t=V, l={$\Delta V_{BC}$}, label distance=0.02cm] (6.5, 6); \end{tikzpicture} \end{document} I would like to know if it is possible to change the voltmeter index (see the red box). Thank you very much.

  • New command with named arguments [duplicate]
    by J...S on January 14, 2025 at 7:17 am

    I wanted to make a command which accepted named boolean arguments like: \mycmd{foo=true, bar=false} So, I tried using keyval package and tried: \documentclass{article} \usepackage{keyval} \makeatletter \define@key{my}{foo}{\def\my@foo{#1}} \define@key{my}{bar}{\def\my@bar{#1}} \makeatother \newcommand\my[1]{% \setkeys{my}{#1} \ifx\my@foo\true Yes foo \else No foo \fi \\ \ifx\my@bar\true Yes bar \else No bar \fi } \begin{document} \my{foo=true,bar=false} \end{document} I was expecting Yes foo No bar but it gave No foo No bar. Where am I going wrong? Is \ifx\name\true the right way to check boolean equality here?

  • Box style edition Calculus: eighth edition by James Stewart
    by Sebastiano on January 10, 2025 at 10:50 pm

    I would like to create a box with the tcolorbox package that has the following requirement: Automatic numbering (1, 2, 3) be enclosed in a square and the style of the box recalls that of the book Calculus: Eighth Edition by James Stewart, with well-defined borders and a professional look like to page 138 and after the number (Definition). My output is: and my code is: \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amssymb} \usepackage[most,breakable,skins]{tcolorbox} \newtcolorbox[auto counter,number format=\arabic]{defn}[1][]{ colframe=white, colback=cyan, boxed title style={colback=cyan}, enhanced, rounded corners, boxsep=1pt, attach boxed title to top left={yshift=-\tcboxedtitleheight, yshifttext=-.75\baselineskip}, boxed title style={boxsep=1pt, rounded corners}, title={\textcolor{black}{\textbf{\boxed{\thetcbcounter}}}}, colframe=cyan, colback=white, } \begin{document} \begin{defn} Sia $f \colon [a,b]\subseteq \mathbb{R}\to \mathbb{R}$ continua in $[a,b]$: se $f(a) \cdot f(b) < 0$, allora esiste $\xi \in ]a, b[$ tale che $f(\xi) = 0$. Se $f$ è anche \textit{monotòna} crescente o decrescente, lo zero è unico. \end{defn} \begin{defn} Sia $f$ una funzione continua su un intervallo chiuso $[a, b]$ e derivabile su $(a, b)$ tale che $f(a) = f(b)$. Se queste condizioni sono soddisfatte, allora esiste almeno un punto $\xi \in (a, b)$ tale che la derivata della funzione in $\xi$ è zero, cioè: \[ f'(\xi) = 0. \] \end{defn} \end{document}

  • How to draw the ribbon shape as decoration in TikZ?
    by Explorer on January 10, 2025 at 4:31 pm

    What I want is to draw the following shape with TikZ and make it as a node, I have tred my attempt.And I have consulted some related tape link on TSE,but none of them satisfied my ideal result. I didn't find it in tikz.shapes, I wonder is there exists any wheels to achieve it as a node? My Final result is to draw a shape wrapped-tape as if the shapes in the tikz.shapes library, that means I can use SYNTAX like \node[shape=wrapped-tape,align=left] {\lipsum[2]}; to typeset the shape. My very first attempt is as below: \documentclass[tikz,border=1cm]{standalone} \begin{document} \def\mydraw{% \draw[cyan] (O.north) -- (O.north west) arc (270:90:.05cm) -- ([xshift=.3cm,yshift=.1cm]O.north west) arc (270:450:.05cm) -- ++(-1.5cm,0) -- ([xshift=-.5cm,yshift=.1cm]O.west) -- ([xshift=-1.2cm,yshift=.1cm]O.south west) -- ([xshift=-.05cm,yshift=.1cm]O.south west);% \draw[magenta] ([yshift=.05cm,xshift=-.05cm]O.north west) -- ([xshift=-.05cm]O.south west) arc (180:270:.05cm) --([yshift=-.05cm]O.south);% \filldraw[fill=gray!50,draw=cyan] ([yshift=.15cm,xshift=.35cm]O.north west) -- ++(0,-.15cm) -- ++(-.35cm,0) arc (270:90:.05cm) -- ([xshift=.3cm,yshift=.1cm]O.north west) arc (270:360:.05cm);% } \begin{tikzpicture}[line cap=round] \node[minimum size=1cm,inner sep=5pt,style=dashed,draw] (O) {Hello, world!}; \begin{scope} \mydraw \end{scope} \begin{scope}[transform canvas={xscale=-1}] \mydraw \end{scope} \end{tikzpicture} \end{document} And it turn out to be as below: But there remains some flaws: transform canvas didn't totally show inside the standalone documentclass some coordinates are fixed, and it's hard to be extended if the text in node is lipsum but not Hello, world! the arc used maybe replaced by some control points, but it may make it hard to locate their exact coordiate for the latter points How can I make the style into tikz.shape(declare a new one style)? I didn't find it in tikz manual. I want to know any possible thoughts, advise or tunning of the case.Best wishes! some maybe relative wrap-tape style in M$Office

  • How can I create an asterisk with eight spokes?
    by Dave R on January 10, 2025 at 3:43 pm

    The Unicode character “✳” (U+2733) looks like an asterisk with eight spokes. How can I create this symbol in a LaTeX document? I haven't found it in any lists of TeX/LaTeX symbols.