Month
- Unexpected roundoff with fpeval length comparisonby 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.
- 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 LaTeXby 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 TikZby 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 nestedby 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:NNby 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 marginby 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_eby 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,
- Why can't \lq and \rq be defined using \let?by palapapa on January 19, 2025 at 2:04 pm
In the answer to exercise 8.7 in The TeXbook, it is mentioned that if \lq and \rq were to be defined as \let\lq=` and \let\rq=', they will no longer work with constants, aka getting the ASCII code of a character or converting octal to decimal, because "\lq will not expand into a character token, nor is it a character token." What does this mean? I have tried this: \let\lq=` \char\lq1 But TeX gave me the following error: ! Missing number, treated as zero. <to be read again> \lq l.2 \char\lq 1 Plain TeX defines them using \def\lq{`} and \def\rq{'} and that works. Why?
- Text fractions in Cambria have too much space around solidusby 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-/superscriptsby 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 commandby 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, luahbtexby 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?
- stix font outputs different vertical possition of sub(sup)script nucleus in \fracby Linuxss on January 13, 2025 at 5:43 pm
Using STIX font I noticed that in \frac numerator part sup(sub)script nucleus (base) is placed in different vertical position. In denominator it aligns both equally. Here is an example: \documentclass{article} %\usepackage{lmodern} \usepackage{stix} \begin{document} \begin{equation} \frac{A_{a}}{A_{a}} \frac{A^{a}}{A^{a}} \end{equation} \end{document} If I use lmodern then output is correct: I tried to add _{} and ^{} but the baseline off both nucleus looks a bit too high. And document is huge fixing by hand every symbol is the last option. It seams like a font bug. Is there a way to get like lmodern using luatex?
- How can I make scheme to typeset the addition of two polynomials?by Laurenso on January 12, 2025 at 11:50 am
I am trying to make scheme to add two polynomials 123 x^3 + 456 x^2 -789 x - 10 and -12x^3 - 178 x^2 + 129x + 500. I tried by my hand. \documentclass[12pt,a4paper]{article} \usepackage{bigintcalc} \usepackage{tabularray} \usepackage{ninecolors} \UseTblrLibrary{amsmath, booktabs, counter, diagbox, siunitx, varwidth} \begin{document} \newcommand{\mya}{123} \newcommand{\myb}{456} \newcommand{\myc}{-789} \newcommand{\myd}{-10} \newcommand{\mym}{-12} \newcommand{\myn}{-178} \newcommand{\myp}{129} \newcommand{\myq}{500} \begin{tblr}{ cells={mode=dmath,halign=r}, hline{Y} = {solid,blue}, colsep = 0.5mm } \SetCell[r=2]{fg=blue}+ &\mya x^3 & + &\myb x^2&-&\bigintcalcMul{-1}{\myc} x& - &\bigintcalcMul{-1}{\myd} \\ &\mym x^3 & - &\bigintcalcMul{-1}{\myn} x^2& +&\myp x & +&\myq\\ &\bigintcalcAdd{\mya}{\mym} x^3 & + & \bigintcalcAdd{\myb}{\myn}x^2& -&\bigintcalcMul{-1}{\bigintcalcAdd{\myc}{\myp}}x&+&\bigintcalcAdd{\myd}{\myq}\\ \end{tblr} \end{document} I got How can I make scheme add two polynomials automatically?
- Box style edition Calculus: eighth edition by James Stewartby 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.
- When reading (La)TeX output, do you usually read it online or on paper?by barbara beeton on January 8, 2025 at 3:06 am
(I'm aware that this question is opinion-based, but I'm trying to determine what is preferred so that I can decide whether a potential modification for TUGboat is worth considering.) Assuming that if a document is produced with (La)TeX, it can be read either on paper, online as a PDF file, or online as a (competent) text equivalent (HTML, XML, ...), which form would be preferred, assuming that it would be read online on a full-size screen? Assume also that all fonts are embedded, so that a PDF file would appear the same on both paper and screen; an *ML output may not, in fact, probably would not. In a source file, the tilde (that I see in the editor I use) is placed at about the same height as the hyphen: - ~. On PDF output, if the font used is Knuth's cm, the tilde is at a height appropriate for a diacritic; this is understandable, given the limitations under which the cm fonts were created. (I haven't investigated non-TeX fonts.) In the context of verbatim input code for a nonbreaking space, I find the appearance a bit distracting. So I would like to learn whether other readers notice such anomalies or are bothered by them. (I should note that it's not being contemplated to process TUGboat to *ML output.)
- path doesn't go through a point...why?by Kawahiem on January 7, 2025 at 11:15 pm
I drew this with TikZ and I don't understand why the path I drew doesn't go through O: \documentclass[10pt, a4paper]{article} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture}[] \draw (0,0) rectangle (5,3); \filldraw[gray] (0,0)--(1.5,1.5) arc (180:360:0.5) arc (180:0:0.5)--(5,3)--(5,0)--cycle; \filldraw[black] (0,0)--(1.5,1.5) arc (180:360:0.5) arc (180:0:0.5)--(5,3)--(0,3)--cycle; \tkzDrawPoint[shape=cross out, very thin, white](O) \tkzLabelPoints[right, white](O) \end{tikzpicture} \end{document} When I compile, here's what I get: and when I zoom in on O: As you can see the path doesn't go through O and I don't know why... Is it my code?
- pst-solides3d coloring the heliceby Antonis on January 7, 2025 at 7:26 am
I need to draw a helice like the one in the pst-solides3d documentation, page 72, section 7.3. The code documentation gives fails to color the helice and is always white. The code they give is: \documentclass{standalone} \usepackage{pstricks,pst-solides3d} \begin{document} \psset{unit=0.5} \begin{pspicture}(-6,-3)(6,8) \psframe*[linecolor=blue!50](-6,-3)(6,8) \psSolid[object=grille,base=-4 4 -4 4,linecolor=red,linewidth=0.5\pslinewidth]% \axesIIID(0,0,0)(4,4,7) \defFunction[algebraic]{helice}(t){3*cos(4*t)}{3*sin(4*t)}{t} \psSolid[object=courbe, r=0, range=0 6, linecolor=blue,linewidth=0.1, resolution=360, function=helice]% \end{pspicture} \end{document} The expected result, as the documentation says is: but the actual result (latex+dvips or xelatex or lualatex) is: I can probably correct the Decran and viewpoint, but the color of the helice is supposed to be blue. No matter what I tried it comes out white. Any idea how to fix this? The code as you see is directly from the documentation. I guess this is a bug.