Month
- What does `\mathalpha` mean in unicode-math?by Andrew Stacey on May 15, 2025 at 8:37 pm
Looking through unicode-math-table.tex, the characters are defined via commands like: \UnicodeMathSymbol{"1D7BC}{\mbfitsanssigma}{\mathalpha}{mathematical sans-serif bold italic small sigma}% I'm trying to understand this, in particular the third argument. The possibilities for this argument are: \mathaccent \mathaccentoverlay \mathaccentwide \mathalpha \mathbin \mathbotaccent \mathbotaccentwide \mathclose \mathfence \mathop \mathopen \mathord \mathover \mathpunct \mathrel \mathunder Some of these I recognise, such as \mathord and \mathbin, and I know that these are used to determine the spacing between characters (amongst other things). But according to TeX by Topic, the options are just ord, op, bin, rel, open, close, punct, and inner. And the luatex manual also implies that these are the only categories (from Section 7.5.2 Pairwise Spacing which lists all the primitives that control the spacing between classes). So what do the rest represent and how are the interpreted with regard to spacing? I picked \mathalpha as an example, but also because it's the least comprehensible in the above list: I can imagine that the accents simply inherit their spacing from whatever the base character is, similarly with the over and under. But it feels like \mathalpha should just be \mathord. Why is it not?
- fancryref pluralby user26918948 on May 15, 2025 at 1:32 pm
Can I somehow generate the plural forms if multiple labels are referenced with fancyref? \documentclass[12pt,a4paper]{ltxdoc} \usepackage{fancyref} \begin{document} \begin{equation} \label{eq:pythagoras} a^2 + b^2 = c^2 \end{equation} \begin{equation} \label{eq:trivial} a = a \end{equation} \fref{eq:trivial} \fref{eq:pythagoras} leads to \enquote{equation (2) equation (1)} \hspace{-1.4em}but I need \enquote{equations (2) and (1)} \end{document}
- Is TeX output supposed to be vector or raster?by Shaikh Ammar on May 14, 2025 at 7:22 pm
I have heard that Metafont produces rasterized fonts. However, if I run the command tex on a plain text file containing this font is not rasterised!!! I get a dvi output where even after zooming pretty far in Skim, the text doesn't seem pixellated at all. Is it still raster but somehow really well optimised or did Metafont switch to vector fonts somewhere down the line? For comparison, I looked at some font samples on CTAN of fonts produced using Metafont, and they do seem to get pixellated when I zoom in. I also found a source code manual of LaTeX, where they also get pixellated when zoomed in. Digital versions of Donald Knuth's books also seem to be using vector fonts. I am assuming he uses TeX without any 3rd party modifications. What is going on here? Does Metafont have the support to make vector fonts as well. I am using TeX 3.141592653 (TeX Live 2024) The font samples I referenced were from here https://ctan.org/pkg/bookhands. Interestingly, while the others fonts in the file do get pixellated, Computer Modern doesn't.
- `.initial:n` leads to an error when after `.inherit:n`?by zpding on May 13, 2025 at 8:44 pm
This code originally from Inheritance of keys in expl3: \documentclass{article} \begin{document} \ExplSyntaxOn \keys_define:nn { a } { A .tl_set:N = \l__A_tl } \keys_define:nn { } { b .inherit:n = a, } \keys_define:nn { b } { B .tl_set:N = \l__B_tl, B .default:n = {DEFAULT}, % --> works B .initial:n = {INITIAL}, % --> error } \keys_set:nn { b } { A = x } \ExplSyntaxOff \end{document} output log: ! LaTeX Error: The key 'b/B' is unknown and is being ignored. For immediate help type H <return>. ... l.15 } why does .initial:n lead to an error when after a .inherit:n ?
- Is there a way to locally override the extra space before a colon in a tcolorbox title when using French babel?by cjorssen on May 13, 2025 at 1:18 pm
I am typesetting a document in French with the babel package and using tcolorbox for boxed environments. I have noticed that the colon in my box title is flanked by an unusually large space (as enforced by French typographical rules). In my case, this seems excessive and I suspect it may actually be a bug in how tcolorbox handles French spacing around punctuation. Here is a minimal example: \documentclass{article} \usepackage{tcolorbox} \usepackage[french]{babel} \begin{document} \begin{tcolorbox}[halign title = center, title = {Foo : bar}] Test \end{tcolorbox} \end{document} I would like to reduce the space between “Foo” and the colon only in this title, without altering the global French punctuation spacing rules elsewhere in my document. Is there a known workaround or key in tcolorbox to fine-tune or disable the French spacing around the colon in the title? If not, could this behavior be considered a bug in tcolorbox, and if so, is there an established fix or patch?
- How to draw variations of tikz pictures without copy and pasting?by Kenya on May 13, 2025 at 5:47 am
I want to create the following tikz images: For now, I've just copy and pasted variations of the code below: \begin{tikzpicture}[scale=0.5] \tikzstyle{vertex}=[circle,draw,minimum size=10pt,inner sep=0pt] \node[vertex] (S-8) at (1.34,-2.98) [minimum size=15pt, fill=white] {$*1$}; \node[vertex] (S-9) at (1.34,-1.34) [minimum size=15pt, fill=gray] {}; \node[vertex] (S-10) at (2.98,-1.34) [minimum size=15pt, fill=gray] {}; \node[vertex] (S-11) at (4.61,-1.34) [minimum size=15pt, fill=gray] {}; \node[vertex] (S-12) at (4.61,-2.98) [minimum size=15pt, fill=white] {$*1$}; \node[vertex] (S-13) at (4.61,-4.61) [minimum size=5pt, fill=white] {}; \node[vertex] (S-14) at (2.98,-4.61) [minimum size=5pt, fill=white, label={-90: \Large $0$}] {}; \node[vertex] (S-15) at (1.34,-4.61) [minimum size=5pt, fill=white] {}; \draw (S-8) -- (S-9);\draw (S-8) -- (S-15);\draw (S-9) -- (S-8);\draw (S-9) -- (S-10);\draw (S-10) -- (S-9);\draw (S-10) -- (S-11);\draw (S-11) -- (S-10);\draw (S-11) -- (S-12);\draw (S-12) -- (S-11);\draw (S-12) -- (S-13);\draw (S-13) -- (S-12);\draw (S-13) -- (S-14);\draw (S-14) -- (S-13);\draw (S-14) -- (S-15);\draw (S-15) -- (S-8);\draw (S-15) -- (S-14); \end{tikzpicture} It works, but there has to be a more elegant solution so I can make more of these pictures.
- Knuthian environment and Xparseby yannisl on May 12, 2025 at 12:17 am
Consider the following code which creates a delimited command that creates a "Knuthian environment". In days bygone the argument against this type of construction was it could consume to much memory. (Not really a concern now). How can I replace this code with xparse but keep the delimiters. I don't want to write \begin...\end. I am aware of the +b specifier. The command will load a latin->Greek transliterator. It is fine for very long texts to have have a LaTeX style environment, but in many cases is only a few words. Note the example just bold faces the text to avoid posting the longer code with the transliterator. \documentclass{article} \usepackage{xcolor} \usepackage{lipsum} \long\def\GR#1\GR {% \begingroup \bfseries #1 \endgroup } \begin{document} \GR \lipsum[1-2]\GR \GR Some words only\GR and more \GR \color{blue}some other words \GR \end{document}
- Add new glyph into an existing math fontby Stephen on May 11, 2025 at 2:39 am
I want to create a new glyph (parallel and equal to) into the Cambria Math font. So I proceed as follows: Copy Cambria Math.ttf Open it via fontforge Create a glyph in slot U+2427 (I don't know where is the proper place to put this new glyph into) Change the font name and font family name into CambriaMath-New and Cambria Math New respectively Generate new font CambriaMath-New.otf to the desktop Install it via fontbook Create mwe to test the font: % Compiler: lualatex \documentclass{article} \usepackage{unicode-math} \setmathfont{Cambria Math New} \begin{document} $\alpha$ \end{document} However, unicode-math complains that The first font loaded by unicode-math must be an (unicode-math) OpenType Math font (with script=math). and then uses Latin Modern Math instead. What should I do so that I can use the new font successfully? Thanks. Update Due to copyright reason, I tested again with latinmodernmath.otf, but the same result happened. Update I created a separate font called demo and put the glyph into slot U+E006 since it's in Unicode private use srea. After installing the demo font in my system, I tested the following example: \documentclass{article} \usepackage{unicode-math} \setmathfont{Cambria Math} \newcommand{\peq}{\mathrel{\hbox{\fontspec{demo}\char"E006}}} \begin{document} $\ell_1\peq\ell_2$ \end{document} I'm sure this is not the best practice. Any suggestions are welcome.
- Make a square frame of equal size around some distinct charactersby Jack on May 10, 2025 at 4:30 pm
In order to display cards (AKQJT98765432) in a frame I have macro Fbox. The frames should be quadratic and all of the same size, adapted to the fontsize. I encounter 2 problems: The ‘Q’ has a depth that makes its frame higher. I can think of 2 solutions, but neither works correct: Do a combination of raising the ‘Q’ a bit and diminishing its size a little Increase the frame of the others to the size of the ‘Q’ For the first it would be necessary to test if a ‘Q’ is to be processed (but also for other purposes I need to test on #1). This leads to another problem (expansion?) Both \Fbox{Q} and \Fbox{\myqueen} work as expected. But \Fbox{\MyQueen} doesn't. I appreciate any help to solve this \documentclass{article} \usepackage{xspace} \def\myqueen{Q} \def\DoSomething#1{#1} \NewDocumentCommand{\MyQueen}{s t!}{% \bgroup% \IfBooleanTF{#1}{% \IfBooleanTF{#2}{Q}{Queen}% }{% \IfBooleanTF{#2}{q}{queen}% }% \egroup% \xspace% }% MyQueen \def\Fbox#1{% \setlength{\fboxsep}{0.2ex}% set inner space \setlength{\fboxrule}{0.1ex}% set line width \fbox{% \makebox[\height]{% \rule{0mm}{0.75em}% set box height \if#1Q\DoSomething{Q}\else#1\fi }% makebox }% fbox }% Fbox \begin{document} \Huge \Fbox{A}\Fbox{Q}\Fbox{9}\\ \Fbox{\myqueen}\\ \Fbox{\MyQueen*!} \end{document}
- Table rule below cell spanby Parivalavan on May 10, 2025 at 9:03 am
The following table is constructued using sing tabularray and SetCell \documentclass{article} \usepackage[table]{xcolor} \usepackage{tabularray} \definecolor{jobcolor}{RGB} {0, 146, 207} \begin{document} \begin{tblr}{ colspec={|c| c| c| c| c| c |c|}, rowspec={Q[jobcolor] Q[jobcolor]}, } \hline % first header row \SetCell[r=2]{c} 2 Rows & \SetCell[c=2]{c} 2 Columns & & \SetCell[c=2]{c}\cellcolor{blue!25} next 2 Columns & & \SetCell[r=2,c=2]{c} 2 Rows\linebreak 2 Columns \\ \SetHline[1]{2-3}{fg=red,wd=0.5pt, leftpos=-0.5, rightpos=-0.5, endpos} \SetHline[1]{4-5}{fg=red,wd=0.5pt, leftpos=-0.5, rightpos=-0.5, endpos} % second header row & 2-2 & 2-3 & 2-4 & 2-5 & & \\ \hline % first data row 3-1 & 3-2 & 3-3 & 3-4 & 3-5 & 3-6 & 3-7 \\ \hline \end{tblr} \end{document} The output is as given below: The span rule is created using \SetHline[1]{2-3}{fg=red,wd=0.5pt, leftpos=-0.5, rightpos=-0.5, endpos}. If you look closely, there is a white rule that appears where the trimming is happening with leftpos and rightpos. I am not sure from where the white color/rule is coming from. Is this a challenge with the package or am i doing something wrong? EDIT: To make it clear, if i remove the colspec from the tblr block and remove the leftpos=-0.5, rightpos=-0.5, from the SetHline, then the output will look like the following: The rule below the spanned cells extend through the entire cell. i need them to not include the area of the column separator. This makes it look as if the columns 2,3 and 4,5 are merged together
- Recommended practices when creating CTAN archives for packages for inclusion in multiple TeX distributions?by cfr on May 10, 2025 at 6:04 am
How can I adapt the archives I upload to CTAN to avoid problems in MikTeX, while adhering to CTAN requirements and TeX Live recommendations? Judging by the issues tracker on GitHub, I am not the only author whose packages effectively require TeX Live or manual installation because the MikTeX packages are broken1. #15 (2018-01) #111 #231 #367 (2023-05) #368 #370 #372 #456 (2024-12) #477 (Just now.) In cases like mine, packages which used to work fine in MikTeX break following a change to the package archive provided to CTAN. For example, a change to docstrip and/or removal of a TDS archive. In others, the cause is less clear. These issues appear difficult to resolve, presumably due to lack of resources on the part of the MikTeX maintainer (i.e. time/energy). Once incorrect recipes are in place, it appears difficult to get them fixed. I've also been unable to find any documentation for the recipe file format. I tried, nonetheless, to provide at least a starting point for potentially correcting the issue for my packages (#469), but these efforts have so far proved a complete failure. TDS archives might help, but CTAN is reluctant to host these routinely and often deletes them when included in uploaded archives. Moreover, even in cases where a TDS is provided, it does not seem sufficient to correct an existing problem. Is there a list of what MikTeX wants package authors to provide, similar to the lists provided by TeX Live (here) and CTAN (here and here)? Or is there any other advice for package authors on ways to help prevent breakage and facilitate corrections? 1.I do realise this is a short list relative to the number of packages in MikTeX, but a high proportion of them are mine, so I obviously take a disproportionate interest in the matter.
- How can I adhere to the best practices when handling math for TikZ with Lua?by Jasper on May 9, 2025 at 10:24 pm
I use pgfmath for making 3D illustrations with TikZ, but want to convert it to Lua. I was informed that many people do not adhere to the most "bureaucratic" approach when incorporating Lua into Ti*kZ to handle the math. This question is exactly about that: I want to adhere to the proper practices for this. What I know: It is preferable to use a separate .lua file instead of writing everything inside \directlua. I am under the impression that it is preferable to use luatexbase instead of \directlua(require"...") and \directlua{myfunction(\parameterone,\parametertwo,...) My goal is to pass off some heavy math from pgfmath to Lua. This is an introductory question which I will probably elaborate on in future questions, because I am trying to incorporate Lua into some pretty elaborate commands that I've made. Here is an MWE I've built: .tex % arara: lualatex \documentclass[ tikz ,border = 1cm ]{standalone} \usepackage{package} \begin{document} \begin{tikzpicture} \getplaneTwo[ n1a = 1 ,n1b = -2 ,n1c = 3 ,n1d = 4 ]{a} \draw[spath/use=planea]; \end{tikzpicture} \end{document} .sty \usetikzlibrary{spath3} \newif\ifscaleAxes \pgfqkeys{/pline}{ .is family % normal equation of plane ,n1a/.store in = \pline@noa ,n1b/.store in = \pline@nob ,n1c/.store in = \pline@noc ,n1d/.store in = \pline@nod % 3D boundaries ,xmin/.store in = \pline@xmin ,xmax/.store in = \pline@xmax ,ymin/.store in = \pline@ymin ,ymax/.store in = \pline@ymax ,zmin/.store in = \pline@zmin ,zmax/.store in = \pline@zmax % size of the "cube" ,size/.store in = \pline@size ,scale axes/.is if = scaleAxes ,scale x/.store in = \plinescalex ,scale y/.store in = \plinescaley ,scale z/.store in = \plinescalez % ZYZ Euler angle rotation matrix ,alpha/.store in = \pline@alpha % Z ,beta/.store in = \pline@beta % Y ,gamma/.store in = \pline@gamma % Z ,n1a = 1 ,n1b = 1 ,n1c = 1 ,n1d = 0 ,xmin = -5 ,xmax = 5 ,ymin = -5 ,ymax = 5 ,zmin = -5 ,zmax = 5 ,size = 5 ,alpha = 0 ,beta = 0 ,gamma = 0 ,scale x = 1 ,scale y = 1 ,scale z = 1 } \directlua{require("pv-math.lua")} \directlua{require("pv-get_plane.lua")} \newcommand{\getplaneTwo}[2][]{ \pgfqkeys{/pline}{#1} \directlua{ get_plane( \pline@size ,{\pline@noa,\pline@nob,\pline@noc} ,\pline@nod ,\pline@xmax,\pline@xmin ,\pline@ymax,\pline@ymin ,\pline@zmax,\pline@zmin ,"#2" ) } } pv-math.lua function cross_product(u,v) local x = u[2]*v[3]-u[3]*v[2] local y = u[3]*v[1]-u[1]*v[3] local z = u[1]*v[2]-u[2]*v[1] local result = {x,y,z} return result end function dot_product(u,v) local result = u[1]*v[1] + u[2]*v[2] + u[3]*v[3] return result end function norm(u) local result = math.sqrt((u[1])^2 + (u[2])^2 + (u[3])^2) return result end function ZYZ_rotation_matrix(angles,vector) local c1 = math.cosd(angles[1]) local c2 = math.cosd(angles[2]) local c3 = math.cosd(angles[3]) local s1 = math.sind(angles[1]) local s2 = math.sind(angles[2]) local s3 = math.sind(angles[3]) local x = ( (c1*c2*c3-s1*s3)*vector[1] + (-c1*c2*s3-s1*c3)*vector[2] + c1*s2*vector[3] ) local y = ( (s1*c2*c3+c1*s3)*vector[1] + (-s1*c2*s3+c1*c3)*vector[2] + s1*s2*vector[3] ) local z = ( -s2*c3*vector[1] + s2*s3*vector[2] + c2*vector[3] ) local result = {x,y,z} return result end function sphere(longitude,latitude) local x = (math.cosd(latitude)*math.cosd(longitude)) local y = (math.cosd(latitude)*math.sind(longitude)) local z = math.sind(latitude) local result = {x,y,z} return result end function normalize_vector(u) local norm = norm(u) local x = u[1]/norm local y = u[2]/norm local z = u[3]/norm local result = {x,y,z} return result end function orthogonal_vector(u) local v if (u[1]~=0 and u[2]==0 and u[3]==0) then v = cross_product(u,{0,1,0}) else v = cross_product(u,{1,0,0}) end result = v return result end pv-get_plane.lua function plane(u,v) end local intersections = {} local sorted_intersections = {} function add_intersection(i) end function get_plane( size,normal,d_value ,xmax,xmin,ymax,ymin,zmax,zmin ,name ) function plane(u,v) local x = (d_value-normal[2]*u-normal[3]*v)/normal[1] local y = (d_value-normal[1]*u-normal[3]*v)/normal[2] local z = (d_value-normal[1]*u-normal[2]*v)/normal[3] local result = {x,y,z} return result end for index, value in ipairs(intersections) do intersections[index] = nil end function add_intersection(i) if ( i[1]>=xmin and i[1]<=xmax and i[2]>=ymin and i[2]<=ymax and i[3]>=zmin and i[3]<=zmax ) then table.insert(intersections,{i[1],i[2],i[3]}) end end for y = ymin, ymax, ymax-ymin do for z = zmin, zmax, zmax-zmin do local x = plane(y,z)[1] add_intersection({x,y,z}) end end for x = xmin, xmax, xmax-xmin do for z = zmin, zmax, zmax-zmin do local y = plane(x,z)[2] add_intersection({x,y,z}) end end for x = xmin, xmax, xmax-xmin do for y = ymin, ymax, ymax-ymin do local z = plane(x,y)[3] add_intersection({x,y,z}) end end local n = normalize_vector(normal) local u = orthogonal_vector(n) local u = normalize_vector(u) local v = cross_product(n,u) for index, value in ipairs(sorted_intersections) do sorted_intersections[index] = nil end local centroid = {0,0,0} local number_of_points = 0 for index, value in ipairs(intersections) do for index, value in ipairs(centroid) do centroid[index] = centroid[index] + value end number_of_points = number_of_points + 1 end local centroid = { centroid[1]/number_of_points ,centroid[2]/number_of_points ,centroid[3]/number_of_points } for index, value in ipairs(intersections) do local ax = dot_product( {value[1]-centroid[1] ,value[2]-centroid[2] ,value[3]-centroid[3]} ,{u[1],u[2],u[3]} ) local ay = dot_product( {value[1]-centroid[1] ,value[2]-centroid[2] ,value[3]-centroid[3]} ,{v[1],v[2],v[3]} ) local anglea = math.atan2(ay,ax) table.insert( sorted_intersections ,{anglea,value[1],value[2],value[3]} ) table.sort( sorted_intersections ,function(a, b) return a[1] < b[1] end ) local path_one = "" for index, value in ipairs(sorted_intersections) do path_one = string.format(path_one.." (%f,%f,%f) --",value[2],value[3],value[4]) end tex.print("\\path[spath/save = plane"..name.."]"..path_one.."cycle;") end end
- Single $ sign fixes an error in NewDocumentCommandby Nolord on May 7, 2025 at 10:08 pm
For some reason, this macro creates no error \documentclass{article} \usepackage{xparse} \usepackage{amsmath} \NewDocumentCommand{\ex}{e{!}m}{ \exists\IfValueTF{#1}{!#1$}{#2} } \begin{document} $\ex!{z > 0}$ No error $\ex{x > 0}$ No error \end{document} and outputs even though there's a single $ in its definition. That's actually the fix I found for the Missing $ inserted, but this looks obviously wrong. This is a (minimal working) concept for inserting a character between a command and it's argument (but a not a useful one). It is supposed to {...} if the argument is either {...} or !{...}, while keeping the !. What's the issue? and the fix?
- FiraMono and numbersby Kurt on May 6, 2025 at 3:50 pm
I am currently trying to use the FiraMono Font in my LaTeX project. However, the numbers are... not aligned and simply look bad or out of scale. Take this minimal example: \documentclass{article} \usepackage{FiraMono} \begin{document} \Huge\texttt{1234567890} \end{document} which produces: where you can clearly see that the scaling or alignment of these seems to be off. Are there any fixes? I want to stick to pdflatex, so using fontspec is not an option.
- How to prevent \chapter*{…} from appearing twice in EPUB table of contents?by obskyr on May 6, 2025 at 11:37 am
Using TeX4ebook, try compiling the following file (tex4ebook -f epub test.tex) \documentclass{book} \begin{document} \tableofcontents \chapter*{Introduction} \addcontentsline{toc}{chapter}{Introduction} Blah blah blah… \end{document} The resulting file will, in its meta table of contents, contain “Introduction” twice – though note that it only appears once (as it should) in \tableofcontents in the document: The resulting navMap in the NCX file reveals why – both \chapter* and \addcontentsline are adding entries to the navigation: <navMap> <navPoint id="navPoint-1" playOrder="1"> <navLabel><text><navmark type="likechapter"></navmark> Contents</text></navLabel> <content src="testli1.html#x2-1000" /> </navPoint> <navPoint id="navPoint-2" playOrder="2"> <navLabel><text><navmark type="likechapter"></navmark> Introduction</text></navLabel> <content src="testli2.html#x3-2000" /> </navPoint> <navPoint id="navPoint-3" playOrder="3"> <navLabel><text><navmark type="chapter"></navmark> Introduction</text></navLabel> <content src="testli2.html#Q1-3-3" /> </navPoint> </navMap> And the matching HTML: <h2 class='likechapterHead' id='introduction'><a id='x3-2000'></a>Introduction </h2> <p id='introduction1'><a id='Q1-3-3'></a></p> <p class='noindent'>Blah blah blah…</p> How does one make TeX4Ht’s (i.e. TeX4ebook’s) behavior match what LaTeX does, that is to say adding a navigation entry with \addcontentsline but not with \chapter*?
- Table with tabularx and multicolumn, unable to get correct cell widthsby mlidal on May 5, 2025 at 11:33 am
I'm trying to create a table which spans the entire page and where each row can have either one, two or three cells (each cell should have equal width.) I tried to use tabuarx with column type X and multicolumn but the cell widths aren't correct and the text in the wide cells (spanning the entire table) are wrapped on the smallest cell width. Do anyone know what I may be doing wrong? Here is an example: \documentclass{article} \usepackage{tabularx} \begin{document} \begin{tabularx}{\textwidth}{|X|X|X|X|X|X|} \hline \multicolumn{3}{|X|}{ asdf: } & \multicolumn{3}{|X|}{adsfasdfsadf asdf asdf } \\ \hline \multicolumn{6}{|X|}{asdfsadfs} \\ \multicolumn{6}{|X|}{ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea taki } \\ \hline \multicolumn{2}{|X|}{Tasldkjh } & \multicolumn{2}{|X|}{asdfasdf } & \multicolumn{2}{|X|}{fsadf }\\ \hline \multicolumn{6}{|X|}{fdsaa } \\ \hline \multicolumn{6}{|X|}{dasaf adsfasda asdf ads as fd} \\ \multicolumn{6}{|X|}{ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. D } \\ \hline \multicolumn{6}{|X|}{ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut la} \end{tabularx} \end{document} Example of how this ends up in overleaf: Ideally, here the two cells should cover half the width each and the text in the cells covering the entire table should fill the whole cell.
- Getting suit symbols with pdflatex and luatexby Jack on May 5, 2025 at 10:46 am
I have these questions: Running pdflatex I get black Clubs/Spades and white Diamonds/Hearts. Though I can live with that in my application, I wonder if it is possible to get them at wish black or white. Note: As I use them in a package, I must avoid loading fonts, if that would influence other parts of the document Running lualatex I gave to enter the math-mode explicitly. Is it possible to do without having to type the “$$” chars, as in pdflatex? I can use a macro like \Cl to do the work. Running lualatex causes a long delay setting up the math stuff. I need only these 8 characters. Can I tell lualatex to set up only these (or a limited range containing these) characters \documentclass{article} \usepackage{iftex} \ifpdftex \DeclareUnicodeCharacter{2660}{$\spadesuit$} \DeclareUnicodeCharacter{2661}{$\heartsuit$} \DeclareUnicodeCharacter{2662}{$\diamondsuit$} \DeclareUnicodeCharacter{2663}{$\clubsuit$} \DeclareUnicodeCharacter{2664}{$\spadesuit$} \DeclareUnicodeCharacter{2665}{$\heartsuit$} \DeclareUnicodeCharacter{2666}{$\diamondsuit$} \DeclareUnicodeCharacter{2667}{$\clubsuit$} \else \usepackage{unicode-math} \fi \begin{document} \ifpdftex ♣♦♥♠ ♧♢♡♤ \else $♣♦♥♠ ♧♢♡♤$ \fi \end{document}
- Adding comparators to siunitxby deder on May 5, 2025 at 9:40 am
I'm trying to use \lessapprox (⪅) within the SI package. It is not a default comparator, but there is the package option input-comparators described in the manuals. But I don't know how to use it. I tried: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[ input-comparators = \lessapprox %this doesn't work ]{siunitx} \begin{document} \SI{\leq 70}{\nano\meter} %this works fine \SI{\lessapprox 70}{\nano\meter} %this is what I want \end{document} Am I getting something wrong?
- Scalerel Angle Brackets: Horizontal Spacing Issuesby Grass on May 4, 2025 at 2:53 am
I found that \left\langle \right\rangle can only scale the angled brackets up to a certain limit. So, I used scalerel to give larger ones. But, we see that the horizontal spacing is not quite right: The corresponding code: \documentclass{article} \usepackage{amsmath,scalerel} \begin{document} \[ \begin{pmatrix} 0\\ 1\\ 0 \end{pmatrix} -\stretchleftright[700]{<}{ {\begin{pmatrix} 0\\ 1\\ 0 \end{pmatrix}}, \widehat{ \begin{pmatrix} 0\\ 0\\ 1 \end{pmatrix} } }{>} \widehat{ \begin{pmatrix} 0\\ 0\\ 1 \end{pmatrix} } \] \begin{center} versus \end{center} \[ \begin{pmatrix} 0\\ 1\\ 0 \end{pmatrix} -\left( \begin{pmatrix} 0\\ 1\\ 0 \end{pmatrix}, \widehat{ \begin{pmatrix} 0\\ 0\\ 1 \end{pmatrix} } \right) \widehat{ \begin{pmatrix} 0\\ 0\\ 1 \end{pmatrix} } \] \end{document} In addition, how can I make the angled brackets end 'sharply'?
- How can I write something like `$|-x|$` without excessive spacing?by Robin on May 2, 2025 at 4:29 pm
I want to write the absolute value of "negative x". When writing $|-x|$, I seem to get excessive spacing: Note how there is a lot of space between the vertical bars and the minus sign. How can I write it properly, i.e., with less whitespace?
- How do I insert glyphs belonging to different sytlistic sets from a font?by Apoorv Potnis on May 1, 2025 at 5:48 am
A recent release (v.0.060 https://github.com/cormullion/juliamono/releases/tag/v0.060) of the Julia Mono font contains monospace sans-serif or mono-linear script/calligraphic letters. How do I use these glyphs? For example, take the first glyph for A, as in the above image. FontForge shows the following info for the glyph in the top-left corner. How do I insert this in any variant of LaTeX? I am fine with any engine. I tried \char"1D49C, but this gives me a different glyph, and not the 'ballpoint' version. \documentclass{article} \usepackage{unicode-math} \setmainfont{JuliaMono-Regular.ttf} \begin{document} \char"1D49C \end{document}
- Siunitx formatting of dynamically loaded numbersby FooBar on April 28, 2025 at 10:01 am
I want siunitx's S column type to operate on dynamically-loaded data, i.e., data inserted into a cell via a \DTLfetch directive, where \DTLfetch is a macro provided by the datatool package. The formatting of the S column type "works" -- i.e., the number in question is rounded to the required number of digits -- if the data is provided statically; cf. the first cell in the following screenshot. In contrast, S doesn't work as expected if the datapoint comes from a datatable -- the number in question is simply reproduced, but isn't rounded/truncated. Am I doing something wrong? I'm using datatool 2025/04/25 v3.4.1 and siunitx 2025-04-19 v3.4.9. \documentclass{article} \begin{filecontents*}[overwrite]{data.csv} parameter,value c,0.024123123 \end{filecontents*} \usepackage{datatool} % for '\DTLfetch' and '\DTLloaddb' macros \DTLloaddb{baseline}{data.csv} \usepackage{siunitx} % for 'S' column type \sisetup{round-mode=places,round-precision=3, % perform rounding table-format=1.3} \begin{document} \begin{tabular}{ S S } 0.024123123 & \DTLfetch{baseline}{parameter}{c}{value} \\ \end{tabular} \end{document}
- Fill a space made by three arcsby Kawahiem on April 27, 2025 at 9:25 pm
I'd like to color this figure and even after a few hours trying to understand some similar posts I'm stuck... \documentclass[border=10pt]{standalone} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture}[rotate = -30] \tkzDefPoints{0/0/O, 8/0/A} \tkzDefPointsBy[rotation=center O angle 120](A){E} \tkzDefPointsBy[rotation=center O angle -120](A){C} \tkzDefPointsBy[rotation=center O angle 60](A,E,C){F,D,B} \tkzDrawCircle[thick](O,A) \tkzInterLL(A,C)(O,B) \tkzGetPoint{G} \tkzInterLL(C,E)(O,D) \tkzGetPoint{H} \tkzInterLL(A,E)(O,F) \tkzGetPoint{I} \tkzInterCC[common = A](G,A)(F,E) \tkzGetFirstPoint{J} \tkzInterCC[common = A](B,A)(I,E) \tkzGetFirstPoint{K} \tkzInterCC[common = E](D,E)(I,E) \tkzGetFirstPoint{L} \tkzInterCC[common = E](F,A)(H,E) \tkzGetFirstPoint{M} \tkzInterCC[common = C](B,A)(H,E) \tkzGetFirstPoint{N} \tkzInterCC[common = C](D,E)(G,C) \tkzGetFirstPoint{P} \tkzDrawArc[thick](B,A)(O) \tkzDrawArc[thick](B,K)(C) \tkzDrawArc[thick](G,A)(J) \tkzDrawArc[thick](G,H)(C) \tkzDrawArc[thick](D,C)(O) \tkzDrawArc[thick](D,P)(E) \tkzDrawArc[thick](H,C)(N) \tkzDrawArc[thick](H,I)(E) \tkzDrawArc[thick](F,E)(O) \tkzDrawArc[thick](F,M)(A) \tkzDrawArc[thick](I,E)(L) \tkzDrawArc[thick](I,G)(A) \tkzDrawPoints[shape=cross out](A,B,C,D,E,F,G,H,I,O) \tkzLabelPoints(A,B,G,I,O) \tkzLabelPoints[above](E,F) \tkzLabelPoints[left](H) \tkzLabelPoints[left](D,C) \tkzLabelPoints[](J,K,L,M,N,O,P) \end{tikzpicture} \end{document} I left all the points labels so it's easier to see what's happening. I'm using tkz-euclide but if you have a solution using plain Tikz I'm open for it. For reference, I trying using \tkzClipSector and \tkzFillSector as shown here : Fill between two arcs in tkz-euclide but I couldn't make it work. I'm not sure I understand how they work together...
- How to design a tcolorbox mimicking a paper remove spiral bound bookby Uncle C on April 26, 2025 at 6:54 am
My target is to have the image below: This MWE \documentclass{article} \usepackage[many]{tcolorbox} \usepackage{tikz} \usetikzlibrary{decorations.pathmorphing,shadows} \newtcolorbox{spiralnotebox}{ enhanced, breakable, frame hidden, colback=gray!30, coltitle=black, fonttitle=\bfseries, sharp corners, rounded corners=southeast, boxrule=0pt, arc=9pt, drop shadow={fill=black}, left=10pt, % Space for spiral holes overlay={ \foreach \y in {0.3, 0.8, 1.3, 1.8,2.3,2.8,...,\tcbtextheight-2.74cm} { \fill[white,drop shadow={fill=black,shadow xshift=-.03cm,shadow yshift=.03cm}] (0.2, \y) ellipse (0.13 and 0.13); % Elliptical holes \draw[white,line width=3pt,drop shadow] (.2,\y)--(-.2,\y); } }, } \begin{document} \begin{spiralnotebox} To study engineering designs to solve problems in daily life. \textbf{Instructions} \begin{enumerate} \item Work in groups \vspace*{3cm} \item Gather information on the engineering design process to: \begin{enumerate} \item produce materials to relieve muscle cramp \end{enumerate} \end{enumerate} \end{spiralnotebox} \end{document} Its output is below Any workaround, thanks in advance!
- How to tweak this widebar implementation to allow nesting?by ronno on April 24, 2025 at 12:42 am
I am using the definition of \widebar from this answer by Hendrik Vogt. However, as the comment by Mankka mentions, nested uses such as \widebar{\widebar{x}} do not behave ideally: the bars are different sized and placed at different horizontal offsets. I believe this is because the first character of the argument to the outer \widebar is not a letter, so it goes to the default fallback (to overline?) branch. Is there a way to fix this? I had the thought of making \widebar{x...} be an x for kerning purposes but with different dimensions, but I don't know how to achieve that or if that even makes sense as a workaround. The solution in Combining Vogt's widebar with bm and mathcal should also work but requires a new command for every combination so I'm hoping for something more automatically composable. Maybe there's a way to get the "first character after expanding the argument"? Here is example code (I haven't modified anything from the answer linked above): \documentclass{article} \usepackage{amsmath} %% Code for '\widebar' macro. Cf. https://tex.stackexchange.com/a/60253 \makeatletter \let\save@mathaccent\mathaccent \newcommand*\if@single[3]{% \setbox0\hbox{${\mathaccent"0362{#1}}^H$}% \setbox2\hbox{${\mathaccent"0362{\kern0pt#1}}^H$}% \ifdim\ht0=\ht2 #3\else #2\fi } %The bar will be moved to the right by a half of \macc@kerna, which is computed by amsmath: \newcommand*\rel@kern[1]{\kern#1\dimexpr\macc@kerna} %If there's a superscript following the bar, then no negative kern may follow the bar; %an additional {} makes sure that the superscript is high enough in this case: \newcommand*\widebar[1]{\@ifnextchar^{{\wide@bar{#1}{0}}}{\wide@bar{#1}{1}}} %Use a separate algorithm for single symbols: \newcommand*\wide@bar[2]{\if@single{#1}{\wide@bar@{#1}{#2}{1}}{\wide@bar@{#1}{#2}{2}}} \newcommand*\wide@bar@[3]{% \begingroup \def\mathaccent##1##2{% %Enable nesting of accents: \let\mathaccent\save@mathaccent %If there's more than a single symbol, use the first character instead (see below): \if#32 \let\macc@nucleus\first@char \fi %Determine the italic correction: \setbox\z@\hbox{$\macc@style{\macc@nucleus}_{}$}% \setbox\tw@\hbox{$\macc@style{\macc@nucleus}{}_{}$}% \dimen@\wd\tw@ \advance\dimen@-\wd\z@ %Now \dimen@ is the italic correction of the symbol. \divide\dimen@ 3 \@tempdima\wd\tw@ \advance\@tempdima-\scriptspace %Now \@tempdima is the width of the symbol. \divide\@tempdima 10 \advance\dimen@-\@tempdima %Now \dimen@ = (italic correction / 3) - (Breite / 10) \ifdim\dimen@>\z@ \dimen@0pt\fi %The bar will be shortened in the case \dimen@<0 ! \rel@kern{0.6}\kern-\dimen@ \if#31 \overline{\rel@kern{-0.6}\kern\dimen@\macc@nucleus\rel@kern{0.4}\kern\dimen@}% \advance\dimen@0.4\dimexpr\macc@kerna %Place the combined final kern (-\dimen@) if it is >0 or if a superscript follows: \let\final@kern#2% \ifdim\dimen@<\z@ \let\final@kern1\fi \if\final@kern1 \kern-\dimen@\fi \else \overline{\rel@kern{-0.6}\kern\dimen@#1}% \fi }% \macc@depth\@ne \let\math@bgroup\@empty \let\math@egroup\macc@set@skewchar \mathsurround\z@ \frozen@everymath{\mathgroup\macc@group\relax}% \macc@set@skewchar\relax \let\mathaccentV\macc@nested@a %The following initialises \macc@kerna and calls \mathaccent: \if#31 \macc@nested@a\relax111{#1}% \else %If the argument consists of more than one symbol, and if the first token is %a letter, use that letter for the computations: \def\gobble@till@marker##1\endmarker{}% \futurelet\first@char\gobble@till@marker#1\endmarker \ifcat\noexpand\first@char A\else \def\first@char{}% \fi \macc@nested@a\relax111{\first@char}% \fi \endgroup } \makeatother %% end of '\widebar' code block \begin{document} $\widebar{\widebar{x}}$ $\widebar{\widebar{A}}$ \end{document} This produces the following, whereas I would want each upper bar to be the same size and lined up with the respective lower one: It seems that the newtx package comes with a version of the same \widebar macro that actually errors out with TeX capacity exceeded ... if nested.
- Typeset a matrix with crossing linesby pigrammer on April 23, 2025 at 9:35 pm
Section 5.4, "Invariant Subspaces and the Cayley–Hamilton Theorem", of Friedberg, Insel, and Spence's Linear Algebra represents the direct sum of matrices like so: I'm interested in recreating the weird crossing lines thing, preferably with the standard amsmath matrix environments.
- l3draw diagram as a backgroundby azetina on April 23, 2025 at 3:25 pm
Consider the MWE below: \documentclass{article} \usepackage[vmargin=3cm]{geometry} \usepackage{l3draw} \usepackage{lipsum} \ExplSyntaxOn % Define color for notepad rules \color_set:nnn {notepadrulecolor} { RGB } { 217, 244, 244 } % Command to draw the notepad background \cs_new_protected:Nn \draw_notepad_background: { \draw_begin: \draw_linewidth:n { 1pt } \color_select:n { notepadrulecolor } \draw_path_moveto:n { 2cm, 2cm } \draw_path_lineto:n { 2cm , 27cm } \draw_path_use_clear:n { stroke } \draw_end: } % Hook to draw background on every page \AddToHook{shipout/background} { \draw_notepad_background: } \ExplSyntaxOff \begin{document} \lipsum[1-14] \end{document} What I am currently trying to achieve is to draw a vertical line that spans the height of the page and is on the left margin of the text area. I know this can be done via TikZ but am trying to recreate it with l3draw. Any assistance would be appreciated.
- Capitalisation of ligatures using \uppercaseby Troy W. on April 21, 2025 at 11:21 pm
Is there a way to force the \oe ligature to switch to \OE within an \uppercase ? I do not want to type œ and have it capitalised to Œ, but rather have \oe interpreted as \OE within an \uppercase.
- Load a single letter from a fontby Luluio on April 20, 2025 at 8:36 am
I recently noticed that in physics gluons are usually typeset with (what I believe is called) a single-story g. The default g that comes with STIX Two Math – the math font I am using – is the double-story g and I would like to keep it that way for any variables called "g" that are not representing a gluon. My idea was to store it in a command similar to how \ell creates a script version of the letter "l" for quick access. STIX Two Math has a single-story g when applying stylistic set ss02. How could I load this g and store it in a command? A minimal example to work with should be: \documentclass{scrartcl} \usepackage{fontspec} \usepackage{mathtools} \usepackage{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \begin{document} \[g\] \end{document}
- How to achieve a ragged-right text that alternates longer and shorter lines symmetrically?by TypographyConnoisseur on April 19, 2025 at 11:07 am
This was posted in reddit: https://www.reddit.com/r/typography/comments/1f9v2uc/how_is_this_kind_of_alignment_of_text_called_its/ Is there any way to achieve this in LuaLatex automatically?