Hot
- How to thicken the subpath's segment with specific position?by Explorer on January 27, 2026 at 12:37 pm
This question is similar to this question, but not exactly the same. I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \begin{tikzpicture} \draw[help lines] (-1,-1) grid (7,2); \draw[thick,magenta] (0,0) .. controls (3,3) and (4,-1) .. % coordinate[pos=.3] (A) %<- point start of thick line % coordinate[pos=.5] (B) %<- point end of thick line (6,0); \clip (2,0) rectangle (3,3); \draw[line width=3pt,cyan] (0,0) .. controls (3,3) and (4,-1) .. (6,0); \end{tikzpicture} \end{document} Noted that the GREEN cut is what I was after, the cut should along the path, but not the \clip-ed rectangle. What I saied is not the same as Paul Gaborit's solution, is that I want to control the proportion of (says 0.3 and 0.5, and coloe them thicker) the "subpath". The solution with: decoration={ show path construction, curveto code={ \addtocounter{pos}{1} \pgfmathtruncatemacro{\min}{#1 - 1} \ifthenelse{\thepos < #2 \AND \thepos > \min}{ \draw[#3] (\tikzinputsegmentfirst) .. controls (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb) .. (\tikzinputsegmentlast); }{} } } points here \tikzinputsegmentfirst, \tikzinputsegmentsupportX and \tikzinputsegmentlast looks not easy to control two points position as pos=0.3, is there any better solution? Any possible(plain-TikZ,tkz-elements,luadraw) are all welcome!
- How to use multiple arguments together with `cmd` command in tabularray?by Explorer on January 27, 2026 at 11:30 am
I want the following result: There are two features I want to control: The columns: First Col to be itshape Second Col to add cmdA left Third Col to add cmdB right The rows: What's more, every line's content is the same, replicated for THREE times. It could be achieved by: \documentclass[border=1cm]{standalone} \usepackage{tabularray} \DeclareRobustCommand{\cmdA}[1]{cmdA#1}% \DeclareRobustCommand{\cmdB}[1]{#1cmdB}% \newcommand\columnA[1]{\textit{#1}} \newcommand\columnB[1]{\cmdA{#1}} \newcommand\columnC[1]{\cmdB{#1}} \NewExpandableDocumentCommand{ \addcols }{ m }{ {#1} & {#1} & {#1} \\} \begin{document} \begin{tblr}[expand=\addcols]{ colspec = {*{3}{X[c,m,5cm]}}, row{1} = {font=\Large\bfseries}, cell{2-Z}{1} = {cmd=\columnA}, cell{2-Z}{2} = {cmd=\columnB}, cell{2-Z}{3} = {cmd=\columnC}, hlines={1.5pt}, vlines={1.5pt}, } ColA & ColB & ColC \\ % \addcols{Line1} % \addcols{Line2} % \addcols{Line3} Line1 & Line1 & Line1 \\ Line2 & Line2 & Line2 \\ Line3 & Line3 & Line3 \end{tblr} \end{document} Now, assuming that there are too many columns(for example,10 columns), it's diffcult to type it for so many times. So I tried with \addcols, but the expand and cell{...}={cmd=...} complained with: ! Misplaced alignment tab character &. \addcols code #1-> {#1} & {#1} & {#1} \\ l.26 \end {tblr} ? Is that possible to achieve this at the same time?
- Calculation error when setting up a thumb index with LaTeX3by lukascbossert on January 27, 2026 at 10:37 am
I am currently trying to rewrite the code of @Tobi (https://tex.stackexchange.com/a/57317/98739) for a thumb index using LaTeX3-syntax. So far so good, my code works for the position of the first thumb index. Coming to position the second thumb index I get ! Illegal unit of measure (pt inserted). <to be read again> - l.162 \clearpage I assume it is burried within ($ (current~page.north\c_space_tl #1)~ -~ (0,\dim_eval:n{ \l_thumb_top_margin_dim + (\l_thumb_index_int - 1) * \l_thumb_height_dim }) $) but I cannot figure it out. \documentclass[twoside]{scrbook} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{xparse} \usepackage{scrlayer-scrpage} % optional, for header macros \usepackage{xcolor} \colorlet{thumbIndexBG}{blue!50} \colorlet{thumbIndexFont}{black!50} \ExplSyntaxOn \bool_new:N \l_custom_thumbindex_bool \int_new:N \l_thumb_pattern_int \int_new:N \l_thumb_index_int \int_set:Nn \l_thumb_pattern_int { 7 } % <-- change to your own value \int_zero:N \l_thumb_index_int % start at 0 % margins and calculated dimensions \dim_new:N \l_thumb_top_margin_dim \dim_new:N \l_thumb_bottom_margin_dim \dim_new:N \l_thumb_height_dim \dim_new:N \l_thumb_width_dim % initialise the simple values (you can change them later) \dim_set:Nn \l_thumb_top_margin_dim {6cm} \dim_set:Nn \l_thumb_bottom_margin_dim {3cm} \dim_set:Nn \l_thumb_width_dim {1cm} % ----------------------------------------------------------------- %----------------------------------------------------------------- % 2. Helper to recompute \l_thumb_height_dim %----------------------------------------------------------------- \cs_new_protected:Npn \thumb_compute_height: { % (\paperheight - top - bottom) / pattern \dim_set:Nn \l_thumb_height_dim { (\int_use:N \paperheight - \int_use:N \l_thumb_top_margin_dim - \int_use:N \l_thumb_bottom_margin_dim) / \int_use:N \l_thumb_pattern_int } } % call it once (you can also call it again after you change any of the % three quantities above) \thumb_compute_height: %----------------------------------------------------------------- % 3. TikZ style (still in normal LaTeX syntax – no harm in an % expl3 block) %----------------------------------------------------------------- \tikzset { thumb/.style= { fill = thumbIndexBG , % colour may be changed later text = thumbIndexFont, minimum~ height = \dim_use:N \l_thumb_height_dim, text~ width = \dim_use:N \l_thumb_width_dim, outer~ sep = 0pt, font = \bfseries\Huge, inner~ xsep = .75cm, } } %----------------------------------------------------------------- % 4. Low‑level node placement helpers %----------------------------------------------------------------- % The <even/odd> macros are now tiny wrappers around a single % protected function that does the arithmetic in expl3. % \cs_new_protected:Npn \thumb_place_node:nnn #1#2#3 { % #1 = west|east (anchor direction) % #2 = left|right (text alignment) % #3 = node contents \begin{tikzpicture}[remember~ picture,overlay] \node[ thumb, align = #2, anchor = base~ #1, ] % --------------------------------------------------------- % absolute position = (current page.north <west/east>) – % (0 , vertical offset) % The whole thing must be inside $ … $. % --------------------------------------------------------- at ($ (current~page.north\c_space_tl #1)~ -~ (0,\dim_eval:n{ \l_thumb_top_margin_dim + (\l_thumb_index_int - 1) * \l_thumb_height_dim }) $) { #3 }; \end{tikzpicture} } \NewDocumentCommand{\evenpageletterthumb}{m} { \thumb_place_node:nnn {west}{left}{#1} } \NewDocumentCommand{\oddpageletterthumb}{m} { \thumb_place_node:nnn {east}{right}{#1} } \prop_new:N \g_thumb_project_color_prop \prop_put:Nnn \g_thumb_project_color_prop {A}{blue} \prop_put:Nnn \g_thumb_project_color_prop {B}{green} \prop_put:Nnn \g_thumb_project_color_prop {Q}{red} %----------------------------------------------------------------- % 6. The user command \thumbIndex %----------------------------------------------------------------- % #1 (optional) – colour definition used when no project is given % #2 (mandatory) – the letter (or any material) to be printed % #3 (optional) – project ID → colour taken from the property list % \NewDocumentCommand{\thumbIndex}{ O{thumbIndexBG} m o } { \bool_if:NT \l_custom_thumbindex_bool { % ---- colour handling ------------------------------------------------ \IfNoValueTF{#3} { \colorlet{thumbIndexBG}{#1} } % no project → use #1 { % try to fetch a colour name from the prop list; if the key is % missing we simply keep the current definition \prop_get:NnNTF \g_thumb_project_color_prop {#3} \l_tmpa_tl { \colorlet{thumbIndexBG}{\l_tmpa_tl} } { % fallback for unknown project ID \colorlet{thumbIndexBG}{#1} } } % ---- reset index if we have reached the bottom of the column ----- \int_compare:nNnT { \l_thumb_index_int } = { \l_thumb_pattern_int } { \int_zero:N \l_thumb_index_int } % ---- step to the *next* position ----------------------------------- \int_incr:N \l_thumb_index_int % ---- actually place the thumb on the current page ------------------ % (the same node is put into both the header and the foot, so it % appears on the page no matter which page‑style you use) \lehead[\evenpageletterthumb{#2}]{\evenpageletterthumb{#2}} \lohead[\oddpageletterthumb{#2}]{\oddpageletterthumb{#2}} } } \ExplSyntaxOff % -------------------------------------------------------------- \begin{document} \ExplSyntaxOn \bool_set_true:N \l_custom_thumbindex_bool \ExplSyntaxOff \thumbIndex{1} %<-default color X \clearpage \thumbIndex{2}[B] Y \clearpage \thumbIndex{3}[Q] Z \end{document}
- Deleting the title and cover gpges used in yathesis.cls without breaking PDF/A Compatibilityby Kevin on January 27, 2026 at 7:17 am
I am writing my thesis using the yathesis.cls class, and I want to remove the default title and cover pages generated by yathesis.cls in order to use a title page mandated by my university for my manuscript. I first tried commenting out the \maketitle command in the main these.tex file, but the compiled PDF was no longer archivable in PAC. Then, I tried removing the title and cover pages directly from the generated PDF, but the file still wasn’t archivable. Is it possible to perform this modification without corrupting the generated PDF and while maintaining PDF/A compliance?
- Showcase of beautiful 'electrical circuit diagrams' done in TeX & friendsby cis on January 27, 2026 at 7:03 am
When I saw this thread How to customize CircuiTikz ac - dc symbols or this one Showcase of beautiful typography done in TeX & friends, I had the idea to add a showcase for electrical circuit diagrams. The package would typically be circuitikz. Feel free to post your large, small, or elegant circuit diagrams here in the community wiki. (I will also add some examples occasionally.) Attach your codes (if possible); this would be a great opportunity to learn from your coding and your style. \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \begin{circuitikz}[european resistors] \draw[] (0,0) to[R=$R_1$, a_=$1\Omega$, name=R1, invert] (3,0); \end{circuitikz} \end{document}
- Cover Page with Border in LaTeX (With decorations)by Ngô Văn Quyền on January 27, 2026 at 6:24 am
(Overleaf) I am trying to make a page border for cover page only (the first page) as shown in the figure. Any idea to achieve this?
- How to confine the dimensions of an overlay used as a frame's background to that of the frame?by Gary on January 27, 2026 at 4:43 am
In the example below, how can the linear-gradient overlay be confined to within the black frame without having to tinker around with the dimensions in \defineoverlay? I suppose that the outer frame and the overlay are siblings in the page box rather than the overlay being a child of the frame, although the overlay is the background of the frame which might be expected to be bound by the frame's size. Is there an equivalent concept as CSS clip or overflow hidden, such that if the text in the frame changes the size of the frame, the overlay will be adjusted automatically? Thank you. \starttext \defineoverlay [OL2] [ \startMPcode % fill fullsquare xyscaled (TextWidth,TextHeight) fill fullsquare xyscaled (35mm,25mm) withshademethod "linear" withshadedirection (3.5,.5) withshadecolors("darkgreen","darkblue"); \stopMPcode ] \framedtext[ width=fit, align=middle, background=OL2, rulethickness=3pt, offset=2mm, ] { \framedtext[ width=fit, align=middle, background=color, backgroundcolor=yellow, frame=off, ] { Some lines of text. }} \stoptext Added If the line is changed to fill fullsquare xyscaled (OverlayWidth,OverlayHeight) the result is that the width of the overlay still excedes the frame on the right. I'm still doing something wrong. Thanks. I was very sloppy in declaring the commands for the overlay, and forget that I'm not writing code but markup with code in it; and those returns after the [ and the line before the ] can't be left like that. Sorry. After fixing that, it works fine.
- Changing \Xstanzaseparator case by caseby muk.li on January 27, 2026 at 12:10 am
In the following MWE \documentclass{article} \usepackage{reledmac} \setlength{\stanzaindentbase}{\leftmargin} \setstanzaindents{4,1,2,1,2,3,3,1,2,1} \setstanzapenalties{1,10000,5000,10000,0} \numberstanzatrue \renewcommand{\stanzanumwrapper}[1]{} \newcounter{stanzanum} \Xstanza \Xstanzaseparator[A]{.} \Xstanzaseparator[B]{\textbf{S}} \Xstanzaseparator[C]{.} \Xstanzaseparator[D]{.} \Xarrangement[]{paragraph} \begin{document} \setcounter{stanza}{0} \beginnumbering \setcounter{firstlinenum}{1000} \linenumberstyle{alph} \stanza Imagine this is a verse.& Here, I would like the verse \edtext{number}{\Bfootnote{em.; nummer MS.}}.& Another line,& and yet \edtext{another}{\Bfootnote{A; one more B.}} line. \& \endnumbering \end{document} I have defined the \Xstanzaseparator for the \Bfootnote series to be a bold S. But I have done so globally. How could I achieve changing it within the verse, such that for example the first apparatus entry begins with 1Sb and the second one with 1Pd? The use case is for bilingual poetry, where the same text can be read in two languages, with different segmentation and meaning. 1S stands for Sanskrit, i.e. verse 1 read as Sanskrit, and 1P for Prakrit.
- decoration.markings arrowheads breaking, Dimension too large error on parametric plotby humanoferth on January 26, 2026 at 9:32 pm
I am trying to graph a parametric equation but I'm getting a "dimension too large error" upon output. The arrowheads on the lefthand side of the graph seem not to be working as well. Any ideas what's breaking? Thanks! \documentclass{report} \usepackage{amsmath} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usetikzlibrary{decorations.markings} \begin{document} \[ \begin{matrix} x=2\cos(t)\\ y=1+2\sin(t)\\ 0\leq{}t\leq\pi\\ \end{matrix}\implies\begin{tikzpicture}[baseline={(0,3)}] \begin{axis}[axis lines = center,xlabel = $x(t)$,ylabel = $y(t)$,grid=both,minor x tick num=3,minor y tick num=3,major grid style={gray},minor grid style={gray!20},axis equal, trig format=rad] \addplot [domain=0:pi,samples=50,black,variable=t,thick,decoration={markings,mark=between positions 0.1 and 0.99 step 2em with {\arrow [scale=1.5]{stealth}}}, postaction=decorate] ({2*cos(t)},{1+2*sin(t)}); \end{axis} \end{tikzpicture} \] \end{document}
- Automatic numbering of multiple imagesby Sebastiano on January 26, 2026 at 9:26 pm
I would like to number the following images as shown in the reference image, but what I have so far is only an idea. Other (better) suggestions are more than welcome. Is there perhaps a specific package that can automatically number images in this way? \documentclass[a4paper]{article} \usepackage{graphicx} \usepackage[export]{adjustbox} \usepackage{array} \begin{document} \begin{table}[htbp] \centering \begin{tabular}{|c|>{\raggedright\arraybackslash\hspace{0pt}}p{2.5cm}|} \hline \textbf{Immagini} & \textbf{Commento} \\ \hline \includegraphics[width=0.5\textwidth, margin=0pt 1ex 0pt 1ex,valign=m]{example-image} & P1\\ \hline \includegraphics[width=0.5\textwidth,valign=m]{example-image} & P2 \\ \hline \end{tabular} \caption{Un titolo} \label{label1} \end{table} \end{document}
- Install Casio font series FX-CG 50by Sebastiano on January 26, 2026 at 8:26 pm
I wanted to understand how to assign names to fonts GraphicSeriesFontSet from CASIO website https://edu.casio.com/education/fontset/dl/GraphicSeriesFontSet.zip in order to use them without installing them, by copying them directly into a folder on the desktop. My .tex document must be located inside the same folder. The goal is to include the fonts in the document without installing them on the system, for my work. In the folder, I have the following fonts available: CFX06.ttf, CFX01.ttf, CFX02.ttf, CFX04.ttf, CFX05.ttf. I am not sure how to use them correctly in both mathematical mode and regular text mode. Note that I have not able to see the font of the package casiofont (https://github.com/amunn/casiofont?tab=readme-ov-file). In fact I noticed this mistake: \documentclass[12pt]{standalone} \usepackage{casiofont} \begin{document} \Abs \end{document} This is LuaHBTeX, Version 1.24.0 (MiKTeX 25.12) restricted system commands enabled. luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "CASIOClassWiz" not found. ! Package fontspec Error: (fontspec) The font "CASIOClassWiz" cannot be found; this may (fontspec) be but usually is not a fontspec bug. Either there (fontspec) is a typo in the font name/file, the font is not (fontspec) installed (correctly), or there is a bug in the (fontspec) underlying font loading engine (XeTeX/luaotfload). For immediate help type H <return>. ... l.32 \DeclareTextFontCommand {\textcasio}{\casio} ? Any screenshots are welcome.
- How can I accessibly make my pdf have an H1 heading?by Teepeemm on January 26, 2026 at 7:03 pm
My accessibility checker (Ally) complains that the following "PDF does not have headings": \DocumentMetadata{tagging=on,lang=en-US,pdfstandard=ua-2, tagging-setup={ math/setup=mathml-SE, % role/new-tag=Title/H1, } } \documentclass{article} \usepackage{lipsum} \title{Title} \begin{document} \maketitle \lipsum[1-9] \end{document} I saw elsewhere that uncommenting the role line would cause the title to become an H1, satisfying the need for headings. This satisfies Ally, but now the compilation gives a warning Parent-Child 'pdf2:H1' --> 'pdf2:P'. Relation is not allowed! and VeraPDF says that the PDF is no longer UA-2. Is there a way to make the title become H1 and not P?
- How to define a LaTeX command with multiple \replacecmpd inputs?by palloc on January 26, 2026 at 5:13 pm
I have the following LaTeX code using the chemstyle and chemnum packages: \documentclass{article} \usepackage{graphicx} \usepackage{chemstyle} \usepackage{chemnum} \begin{document} \begin{scheme} \replacecmpd{PhH} \replacecmpd{PhMe} \includegraphics[scale=0.8]{chem.eps} \caption{Caption I} \label{sch:first} \end{scheme} % In my real project the chemicals are different \begin{scheme} \replacecmpd{PhNH2} \replacecmpd{PhNO2} \includegraphics[scale=0.8]{chem.eps} \caption{Caption II} \label{sch:second} \end{scheme} \end{document} I would like to define a new command, for example \schCall, that wraps this structure into a single macro. Desired syntax example: \schCall[0.6]{chem}{PhH, PhMe}{Caption I}{first} Where: the optional argument is the scale (default = 0.8) the first mandatory argument is the image filename (without .eps) the second mandatory argument is a comma-separated list of arguments for \replacecmpd the third argument is the caption text the fourth argument is used for the label
- how to create sectioned/combined invoices?by user242047 on January 26, 2026 at 3:20 pm
I'm writing up a financing proposal for which I'd like to list the expenses by category, providing each invoice block with its own subtotal, and then a separate line at the end giving a combined total for all. I'm using the invoice2 package. For example, I have the following: \begin{invoice}[currency-symbol={€{}}, currency-in-header=true, included-vat=true] % count contents rate/unit \invoiceitem{1}{Zoom H6Studio Aufnahmegerät}{433} \invoiceitem{1}{Zoom EXH-6e Adapter}{105} \invoiceitem{1}{Zoom APH-6st case}{64} \invoiceitem{6}{Roadworx Mic Stand plus 10m Kabel}{22} \invoiceitem{6}{Shure SM 7 B EVA Microphone Case Bundle}{413} \invoiceitem{1}{R{\o{}}de Stereo Bar SB20}{36} \invoiceitem{1}{Zoom Q8n-4k Video Camera}{389} \invoiceitem{2}{Manfrotto MVKBFRT-LIVE Befree Alu Tripod}{185} \end{invoice} (this is the a/v equipment). The total returned is €4.007,00. I would like to pull this total, and combine it with the totals from other invoice blocks, to give a grand total combining all categories. Is there any way to do that? Is the output of a given invoice block stored as a variable anywhere that can be called up by a later function? Is there any way to refer to it? Cheers
- How to insert a conditional row in a tabularray?by lukascbossert on January 26, 2026 at 3:11 pm
I am building all my tabular things these days with tabularray. However I come across a new issue that is (I guess) due the expansion thing. I cannot insert condidtionally a new row. The condition comes from \compareEntry{}{}{}{} which I was now building using L3 commands. The command itself works fine, but I cann ot put e.g. & in the true-branch. Here is the error message: ! Misplaced alignment tab character &. <argument> & conditional question if first question is 'true'& \getEntry {01}... l.99 \myProject{01} How can I fix it? \documentclass{article} % needed packages ------------------------------------------------ \usepackage{expl3} % LaTeX3 programming layer \usepackage{datatool} % simple key‑value database \usepackage{tabularray,xcolor} \ExplSyntaxOn \msg_new:nnn { dfg } { database-name-not-given } { The~database~name~(`~#1~`)~is~empty. } \msg_new:nnn { dfg } { database-not-found } { The~database~`#1`~does~not~exist. } \cs_new_protected:Npn \dfg_compare_entry:nnnnnn #1#2#3#4#5#6 { % #1 optional DB name (may be empty) % #2 row identifier (value of the primary key “id”) % #3 field name (column we want to read) % #4 reference value (value we compare against) % #5 true‑branch code % #6 false‑branch code %--- 1) Is the DB name empty? -------------------------------- \tl_if_blank:nTF {#1} { \msg_warning:nnn { dfg } { database-name-not-given } {#1} } { %--- 2) Does the DB really exist? ------------------------- \DTLifdbexists{#1} { %--- 3) Pull the wanted field from the row -------------- % The macro \thevalue will contain the field’s content. \DTLgetvalueforkey \thevalue {#3} {#1} {id} {#2} %--- 4) Compare the (fully expanded) field with #4 ----- % \exp_args:Nx expands the first argument completely, % exactly what \edef used to do. \exp_args:Nx \tl_if_eq:nnTF { \thevalue } {#4} {#5} % true branch {#6} % false branch } { \msg_warning:nnn { dfg } { database-not-found } {#1} } } } \NewDocumentCommand \compareEntry { O{\tmpLocalDB} m m m m m } { \dfg_compare_entry:nnnnnn {#1}{#2}{#3}{#4}{#5}{#6} } \DTLnewdb{project} \DTLnewrow{project} \DTLnewdbentry{project}{id}{01} \DTLnewdbentry{project}{Q1}{true} % <- this will trigger a second/conditional row \DTLnewdbentry{project}{Q1a}{yes} \DTLnewdbentry{project}{Q2}{false} \NewDocumentCommand{\getEntry}{O{\tmpLocalDB} m m O{id}}{% % #1 database name % #2 name of the ID-field % #3 name of the field you want to get the data from % #4 field for an alternative id \DTLifdbexists{#1}{% \DTLgetvalueforkey{\thevalue}{#3}{#1}{#4}{#2}% \DTLifnullorempty{\thevalue} {} {\thevalue}% }{% \textcolor{red}{database~missing:~#1}% }} \NewDocumentCommand{\myProject}{m} { \def\tmpLocalDB{project} \tl_clear:N \l_tblr_body_tl \tl_gput_right:Nx \l_tblr_body_tl { 1. & {first~ question } & \getEntry{#1}{Q1} \\ \compareEntry{#1}{Q1}{true}{ & conditional~ question~ if~ first~ question~ is~ 'true' &\space \getEntry{#1}{Q1a} \\ }{} 2. & second~ question &\getEntry{#1}{Q2}\\ } \begin{tblr}[ expand=\l_tblr_body_tl, ]{ rowhead = 0, hline{2}={0pt}, rows = {bg=white, halign={l},font=\footnotesize}, column{1} = {halign={r}}, colspec={t{.25cm}X[t]t{1cm}} } \tl_use:N \l_tblr_body_tl \end{tblr} } \ExplSyntaxOff \begin{document} \section*{Conditional rows inside \texttt{tabularray}} Some pretext\\ \myProject{01} \end{document}
- ConTeXt: insert in the list abbreviations the first page at which an abbreviation is mentionedby Georgian Ilie on January 26, 2026 at 2:16 pm
Good afternoon, I am trying to print my list of abbreviations. At the right side of the abbreaviation I would like to place the first page wherein said abbreviation is mentioned. I tried the code reported below without success: \definesynonyms[abbreviation][abbreviations][\infull] \abbreviation{SCE}{Special carbon electrode} \abbreviation{BFF}{Best friends forever} \setupsynonyms[abbreviation][ pages=yes, referencemethod=first] \starttext \subject[title=Hello] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \infull{SCE} \blank[small] \par Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \infull{BFF} \page \subject[title=Hello1] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \infull{SCE} \blank[small] \starttitle[title=list of abbreviations] \placelistofabbreviations[criterium=all] \stoptitle \stoptext How can I solve this issue? Thank you in advance for your time and help. EDIT I I tried to rewrite partly the code by the advises received so far: \definesynonyms[acro][acros][\myfull] \acro{SCE}{Special carbon electrode} \acro{BFF}{Best friends forever} \setupsynonyms[acro][pages=yes,style=bf] \starttext \subject[title=Hello] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \myfull {SCE}. \blank[small] \par Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \myfull {BFF} \page \subject[title=Hello1] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam id maximus lorem, vitae sagittis massa. Sed non euismod turpis. Vestibulum aliquet augue magna, sed aliquet enim consectetur laoreet. Quisque egestas sed ante ut lobortis. In laoreet mauris nisi, nec vehicula nibh fermentum vitae. Cras nec ultricies diam. Aliquam ipsum sapien, facilisis vitae augue ut, consectetur suscipit magna. Praesent nec nunc posuere eros hendrerit placerat. \myfull {SCE}. \blank[small] \starttitle[title=list of abbreviations] \placelistofacros[criterium=all] \stoptitle \stoptext And I still face issues (now the abbreviations are not displayed when invoked with \myfull.
- Grouped bibliography without citationby Peter Flynn on January 26, 2026 at 2:12 pm
I need to group or segment the entries in a reading list (so there are no separate citations: I just use \nocite{*}). The examples in the biblatex docs all seem to require individual citation in a refsegment or refsection, and create a subheading in the references output. Is there a field I can add to each entry that can be passed by (eg) \nocite{value} to biber so it can use it to group the output? (Instead of having to use \nocite with a list of keys within each refsegment.) [edit] I did try Sets, but they all come out as a single paragraph.
- Simplifying an Asymptote figure for spherical coordinatesby Sebastiano on January 26, 2026 at 12:58 pm
I refer to the second code by the user Chris Chudzicki: % Source - https://tex.stackexchange.com/a/160528 % Posted by Chris Chudzicki, modified by community. See post 'Timeline' for change history % Retrieved 2026-01-26, License - CC BY-SA 3.0 \documentclass{article} \usepackage{asymptote} \begin{document} \begin{asy}[width=\textwidth] settings.render=6; settings.prc=false; import three; import graph3; import grid3; currentprojection=obliqueX; //Draw Axes pen thickblack = black+0.75; real axislength = 1.0; draw(L=Label("$x$", position=Relative(1.1), align=SW), O--axislength*X,thickblack, Arrow3); draw(L=Label("$y$", position=Relative(1.1), align=E), O--axislength*Y,thickblack, Arrow3); draw(L=Label("$z$", position=Relative(1.1), align=N), O--axislength*Z,thickblack, Arrow3); //Set parameters of start corner of polar volume element real r = 1; real q=0.25pi; //theta real f=0.3pi; //phi real dq=0.15; //dtheta real df=0.15; //dphi real dr=0.15; triple A = r*expi(q,f); triple Ar = (r+dr)*expi(q,f); triple Aq = r*expi(q+dq,f); triple Arq = (r+dr)*expi(q+dq,f); triple Af = r*expi(q,f+df); triple Arf = (r+dr)*expi(q,f+df); triple Aqf = r*expi(q+dq,f+df); triple Arqf = (r+dr)*expi(q+dq,f+df); pen thingray = gray+0.33; draw(A--Ar); draw(Aq--Arq); draw(Af--Arf); draw(Aqf--Arqf); draw( arc(O,A,Aq) ,thickblack ); draw( arc(O,Af,Aqf),thickblack ); draw( arc(O,Ar,Arq) ); draw( arc(O,Arf,Arqf) ); draw( arc(O,Ar,Arq) ); draw( arc(O,A,Af),thickblack ); draw( arc(O,Aq,Aqf),thickblack ); draw( arc(O,Ar,Arf) ); draw( arc(O,Arq,Arqf) ); pen thinblack = black+0.25; //phi arcs draw(O--expi(pi/2,f),thinblack); draw("$\varphi$", arc(O,0.5*X,0.5*expi(pi/2,f)),thinblack,Arrow3); draw(O--expi(pi/2,f+df),thinblack); draw( "$d\varphi$", arc(O,expi(pi/2,f),expi(pi/2,f+df) ),thinblack ); draw( A.z*Z -- A,thinblack); draw(L=Label("$r\sin{\theta}$",position=Relative(0.5),align=N), A.z*Z -- Af,thinblack); //cotheta arcs draw( arc(O,Aq,expi(pi/2,f)),thinblack ); draw( arc(O,Aqf,expi(pi/2,f+df) ),thinblack); //theta arcs draw(O--A,thinblack); draw(O--Aq,thinblack); draw("$\theta$", arc(O,0.25*length(A)*Z,0.25*A),thinblack,Arrow3); draw(L=Label("$d\theta$",position=Relative(0.5),align=NE) ,arc(O,0.66*A,0.66*Aq),thinblack ); // inner surface triple rin(pair t) { return r*expi(t.x,t.y);} surface inner=surface(rin,(q,f),(q+dq,f+df),16,16); draw(inner,emissive(gray+opacity(0.33))); //part of a nearly transparent sphere to help see perspective surface sphere=surface(rin,(0,0),(pi/2,pi/2),16,16); draw(sphere,emissive(gray+opacity(0.125))); // dr and rdtheta labels triple V= Af + 0.5*(Arf-Af); draw(L=Label("$dr$",position=Relative(1.1)), V--(1.5*V.x,1.5*V.y,V.z),dotted); triple U=expi(q+0.5*dq,f); draw(L=Label("$rd\theta$",position=Relative(1.1)), r*U ---r*(1.66*U.x,1.66*U.y,U.z),dotted ); \end{asy} \end{document} The code uses asymptote package to represent a volume element in spherical coordinates. Asymptote appears to be correctly installed in my MiKTeX distribution; however, the document does not compile and produces the following error: Package asymptote Warning: file `spy-1.pdf' not found on input line 15. (spy.aux)) No pages of output. Transcript written on spy.log. Sorry, but "MiKTeX Compiler Driver" did not succeed. I do not use Asymptote very often, so I am not sure about the cause of the problem. It is possible that the solution is related to what is discussed in the following TeX.StackExchange threads: 'filename-1.pdf' not found Asymptote Asymptote Code Generates .asy Files, But Asymptote Execution Fails In particular, I have not yet tried the solution proposed by the user user279206, and I do not know whether there is an alternative approach that would allow me to compile the document correctly with my MiKTeX distribution. In a previous question, I also asked whether it is possible to obtain the same arrow tip styles provided by Asymptote using TikZ: Arrows with spherical (conical) tips Since I do not understand Asymptote code, I kindly ask whether it would be possible to modify the original code by removing everything that is not strictly necessary, in order to obtain only the figure related to spherical coordinates, without the volume element and without additional unnecessary details to obtain this with the portion of a sphere. In TikZ there is a result: https://tikz.net/spherical_1/ This is my goal:
- longtable inside \chapter* with KOMA-Script scrreprt breaks headers/footersby Felix Lindner on January 26, 2026 at 12:07 pm
I'm writing a report using KOMA-Script (scrreprt) and want to include a "Nomenclature" chapter. This chapter is unnumbered (\chapter*{Nomenclature}) and should appear in the table of contents. It contains multiple unnumbered sections like "Latin symbols", "Greek symbols", "Indices", and "Abbreviations". Each section has tables spanning multiple pages, so I’m using longtable. Here is a minimal working example: \documentclass[12pt,twoside,headsepline]{scrreprt} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[automark,plainheadsepline]{scrlayer-scrpage} \clearpairofpagestyles \automark[section]{chapter} \ihead{\leftmark} \ohead*{\pagemark} \pagestyle{scrheadings} \usepackage{booktabs,longtable,array} \begin{document} \pagenumbering{Roman} \pagestyle{scrheadings} \cleardoublepage \listoffigures \addcontentsline{toc}{chapter}{List of Figures} \cleardoublepage \begingroup \chapter*{Nomenclature} \addcontentsline{toc}{chapter}{Nomenclature} \markboth{Nomenclature}{Nomenclature} \section*{Latin Symbols} \begin{center} \begin{longtable}{c p{7cm} c} \toprule Symbol & Description & Unit \\ \midrule \endfirsthead \multicolumn{3}{c}{{\bfseries Continued from previous page}} \\ \toprule Symbol & Description & Unit \\ \midrule \endhead \midrule \multicolumn{3}{r}{{Continued on next page}} \\ \endfoot \bottomrule \endlastfoot $A$ & Area & m$^2$ \\ $a$ & Fraction & - \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ $c$ & Velocity & m/s \\ \end{longtable} $c$ & Velocity & m/s \\ \end{center} \endgroup \end{document} The Problem is: The headers (\ihead) on the Nomenclature pages are incorrect, it uses the last chapter(abbildungsverzeichnis) for the headline. This happens even though I use \markboth{Nomenclature}{Nomenclature} right after \chapter*
- Why does LaTeX suppress the numbering of my `lstlisting` environment when it spans more than one page?by Jacob Morales Gonzalez on January 26, 2026 at 11:30 am
I am using the listings package to display code in my document, configured as follows: \documentclass[12pt,letterpaper,twoside]{book} \usepackage{listings} \usepackage{inconsolata} \usepackage{xcolor} \renewcommand{\lstlistingname}{Listado} \lstdefinelanguage{SystemVerilog}{ morekeywords={ module,endmodule,interface,endinterface,package,endpackage, program,endprogram, input,output,inout, logic,bit,byte,shortint,int,longint, wire,reg, always,always_ff,always_comb,always_latch,always_ff@, initial,final, if,else,case,casex,casez,endcase,unique, for,foreach,while,do,repeat,break,continue, begin,end, typedef,enum,struct,union,packed, parameter,localparam, function,endfunction, task,endtask, import,export, generate,endgenerate,genvar, assert,assume,cover, property,endproperty, sequence,endsequence, assign }, sensitive=true, morecomment=[l]{//}, morecomment=[s]{/*}{*/}, morestring=[b]", } \lstset{literate= {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1, language=SystemVerilog, basicstyle=\ttfamily\small, keywordstyle=\ttfamily\bfseries, commentstyle=\itshape\color{black!45}, stringstyle=\color{black!65} numbers=left, numberstyle=\tiny\color{gray}, stepnumber=1, numbersep=8pt, tabsize=2, showstringspaces=false, breaklines=true, breakindent=1.5em, breakatwhitespace=false, columns=fullflexible, keepspaces=true, frame=single, framerule=0.5pt, captionpos=t, aboveskip=8pt plus 2pt minus 2pt, belowskip=8pt plus 2pt minus 2pt, float=false } \begin{document} \begin{lstlisting}[language=SystemVerilog, caption={Boletera},label={lst:boletera}] /*Boletera que recibe monedas de $10 o billetes de $20*/ //Interfaz I/O del módulo module boletera( input logic clk, input logic reset, input logic Min, input logic Bin, output logic boleto, output logic err ); //definicion de estado typedef enum logic[2:0]{ INICIO = 3'b001, S10 = 3'b010, ERR = 3'b100 } estado; //estado interno del sistema estado s; //estado siguiente estado s_next; //asignacion del estado interno always_ff@(posedge clk, negedge reset) begin if(reset == 1'b0) s <= INICIO; else s <= s_next; end \pagebreak //funcion de estado siguiente always_comb begin unique case(s) INICIO: begin if(Min == 1'b1 && Bin == 1'b0) s_next = S10; else if(Min == 1'b0 && Bin == 1'b1) s_next = INICIO; else if(Min == 1'b0 && Bin == 1'b0) s_next = INICIO; else s_next = ERR; end S10: begin if(Min = = 1'b1 && Bin = = 1'b0) s_next = INICIO; else if(Min = = 1'b0 && Bin = = 1'b0) s_next = S10; else s_next = ERR; end ERR: begin s_next = ERR; end endcase end //funcion de salida boleto always_comb begin boleto = 1'b0; if(s == INICIO && Bin == 1'b1) boleto = 1'b1; else if (s == S10 && Min == 1'b1) boleto = 1'b1; end \newpage //funcion de salida error assign err = (s == ERR)? 1'b1: 1'b0; endmodule: boletera \end{lstlisting} \end{document} Here is how the error is reported in the log: [281 <./imagenes/bendingMachine.pdf>] LaTeX Info: Redefining \. on input line 98. LaTeX Info: Redefining \% on input line 98. ! Argument of à has an extra }. <inserted text> \par l.98 begin I've run across a `}' that doesn't seem to match anything. For example, `\def\a#1{...}' and `\a}' would produce this error. If you simply proceed now, the `\par' that I've just inserted will cause me to report a runaway argument that might be the root of the problem. But if your `}' was spurious, just type `2' and it will go away. Runaway argument? ! Paragraph ended before à was complete. <to be read again> \par l.98 begin I suspect you've forgotten a `}', causing me to apply this control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best. [282] Underfull \vbox (badness 10000) has occurred while \output is active [] LaTeX Info: Redefining \. on input line 139. LaTeX Info: Redefining \% on input line 139. ! Argument of à has an extra }. <inserted text> \par l.139 \n ewpage I've run across a `}' that doesn't seem to match anything. For example, `\def\a#1{...}' and `\a}' would produce this error. If you simply proceed now, the `\par' that I've just inserted will cause me to report a runaway argument that might be the root of the problem. But if your `}' was spurious, just type `2' and it will go away. Runaway argument? ! Paragraph ended before à was complete. <to be read again> \par l.139 \n ewpage I suspect you've forgotten a `}', causing me to apply this control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best. I considered breaking the code using \pagebreak or \newpage, but inside the lstlisting environment these commands are not executed; instead, they are treated as literal text (as shown in the example code). How can I preserve line numbering in a multi-page listing?
- How can I show Overleaf comments in the compiled PDF or embed them in the LaTeX source? [duplicate]by BeNavon on January 26, 2026 at 11:17 am
I’m using Overleaf and have added comments to my document using Overleaf’s comment feature. Is there a way to make these comments appear in the compiled PDF, or to embed them directly into the LaTeX file itself? I’d like the comments to be visible to others who only have access to the PDF or the .tex source. I found an answer to this, but it’s from several years ago and might be outdated: Printing PDF from overleaf with comments included
- Theorem environments without parenthesis? [closed]by Frode Alfson Bjørdal on January 26, 2026 at 5:16 am
How may one avoid the parentheses enclosing Test, and the period sign? The goal is to get "Definition of the circle." after writing \begin{df}[of the circle.], and Definition (First) after writing \begin{df}[(First)] without a period sign. \documentclass{article} \usepackage{amsthm} \begin{document} \begin{dfn}[Test] \end{dfn} \end{document}
- Vary shading by letter in a draw lmt_outline?by Gary on January 26, 2026 at 4:21 am
Obviously, I don't know what I'm doing, here, but just experimenting with Ch. 4 of metafun xl. The first frame in the example below has one string of text, such that the shading applies to the whole string. In attempt at varying the shading direction/colors by letter, I tried building each letter separately in the second frame and find that: the first letter "J" no longer drops below the line the middle "m" appears slighlty higher than the rest of the letters and to get spacing between the letters, I hackishly added an \hskip{-0.65mm}. Question is, Is there a better way to vary shading by letter; and, if not, how can I fix these items such that the by-letter version looks as close to the single-string version but with varied shading. Also, please, is it possible to both draw and shade the fill? It appears that if kind=outline cannot draw and if kind=draw cannot shade because an error is thrown of unknown path mfun_shade_path. Thank you. \setupbodyfont[libertinus] \setupMPinstance [metafun] [textstyle={\smallcaps}] \definecolor[GoldFoil1][r=.878,g=.69,b=.424] \definecolor[GoldFoil2][r=.827,g=.557,b=.173] \definecolor[GoldFoil3][r=.702,g=.475,b=.145] \definecolor[DarkGreen1][r=.145,g=.255,b=.424] \definecolor[DarkGreen2][r=.012,g=.208,b=0] \definecolor[DarkBlue1][r=.169,g=.196,b=275] \definecolor[DarkBlue2][r=.106,g=.161,b=.294] \definecolor[DarkBlue3][r=0,g=.2,b=.4] \starttext \framed[ width=50mm, align=middle, location=middle, background=color, backgroundcolor=DarkBlue3, ]{ \startMPcode draw lmt_outline [ text="Jeremiah", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 24pt withshademethod "linear" withshadedirection (2.,1.) withshadecolors("GoldFoil1","GoldFoil2") ; \stopMPcode } \framed[ width=50mm, % location=hanging, background=color, backgroundcolor=DarkBlue3, ]{ \startMPcode draw lmt_outline [ text="J", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 24pt withshademethod "linear" withshadedirection (2.,1.) withshadecolors("GoldFoil1","GoldFoil2") ; \stopMPcode\hskip{-.65mm} \startMPcode draw lmt_outline [ text="e", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 14pt withshademethod "linear" withshadedirection (3.5,1.5) withshadecolors("GoldFoil1","GoldFoil2") ; \stopMPcode\hskip{-.65mm} \startMPcode draw lmt_outline [ text="r", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 14pt withshademethod "linear" withshadedirection (1.5,3.5) withshadecolors("GoldFoil1","GoldFoil2") ; \stopMPcode\hskip{-.65mm} \startMPcode draw lmt_outline [ text="e", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 14pt withshademethod "linear" withshadedirection (.5,2.5) withshadecolors("GoldFoil1","GoldFoil2") ; \stopMPcode\hskip{-.65mm} \startMPcode draw lmt_outline [ text="m", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 14pt withshademethod "linear" withshadedirection (2.,1.) withshadecolors("GoldFoil1","GoldFoil2") ; \stopMPcode\hskip{-.65mm} \startMPcode draw lmt_outline [ text="i", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 14pt withshademethod "linear" withshadedirection (3.5,1.5) withshadecolors("GoldFoil1","GoldFoil2") ; \stopMPcode\hskip{-.65mm} \startMPcode draw lmt_outline [ text="a", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 14pt withshademethod "linear" withshadedirection (2.,1.) withshadecolors("GoldFoil1","GoldFoil2") ; \stopMPcode\hskip{-.65mm} \startMPcode draw lmt_outline [ text="h", kind="outline", %drawcolor="", %fillcolor="", %rulethickness=1/4, ] ysized 14pt withshademethod "circular" withshadecenter (.25,.25) % withshadedirection (1.,2.) withshadecolors("GoldFoil2","GoldFoil1") ; \stopMPcode } \stoptext
- Tikz diagram barycentric label of a triangleby Maxim Wan on January 26, 2026 at 2:43 am
I am still new to LaTeX and I am trying to label the areas of my economics diagram in LaTeX. To do this, I am trying to label the areas using barycentric coordinates, because I want the label to appear in the centre of the triangle. To do this I am calculating the intersections of the lines and using barycentric coordinates. However, I am getting the error message. What would be the correct way to do this? Package pgf Error: No shape known as `Q3` is known. Package pgf Error: No shape known as `A3` is known. Here is my code: \documentclass[tikz, border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{calc, intersections, decorations.pathreplacing} \usepackage{eurosym} \begin{document} \begin{tikzpicture}[ scale=1.2, axis/.style={thick, ->, >=stealth}, curve/.style={thick}, dashed_line/.style={dashed, thin}, important_line/.style={dashed, thick} ] % --- Y INTERCEPTS --- \coordinate (A1) at (0,8); % Y-intercept of Demand \coordinate (A3) at (0,6); % Y-intercept of Pw+sub %AXES \draw[axis, name path=YAxis] (0,0) -- (0,9) node[left, align=center] {Price of Citrus\\(\euro)}; \draw[axis, name path=XAxis] (0,0) -- (9,0) node[below, align=center, xshift=-1cm] {Quantity of citrus\\(tonnes)}; % CURVES % Demand Curve \draw[curve, name path=Demand] (A1) -- (7,1) node[right] {$D_d$}; % Domestic Supply Curve \draw[curve, name path=SupplyDom] (0,0) -- (7,7) node[right] {$S_d$}; % Shifted Supply Curve \draw[curve, name path=SupplySub] (1.5,0) -- (8.5,7) node[right, align=left] {$S_d +$\\$sub$}; % PRICE LINES % World Price \draw[thick, name path=Pw] (0,4.5) -- (8,4.5) node[right] {$S_{world}$}; \node[left] at (0,4.5) {$P_w$}; % Subsidized Price \path[name path=PwSub] (A3) -- (8,6); \draw[important_line] (A3) -- (6,6); \node[left, align=center] at (A3) {$P_w+sub$}; % INTERSECTIONS \path [name intersections={of=Demand and Pw, by=Q1}]; \path [name intersections={of=SupplyDom and Pw, by=Q2}]; \path [name intersections={of=Demand and PwSub, by=Q3}]; \path [name intersections={of=SupplyDom and PwSub, by=Q4}]; \path [name intersections={of=SupplySub and Pw, by=Q4_projected}]; % DROP LINES \draw[dashed_line] (Q1) -- (Q1 |- 0,0) node[below] {$Q_1$}; \draw[dashed_line] (Q2) -- (Q2 |- 0,0) node[below] {$Q_2$}; \draw[dashed_line] (Q3) -- (Q3 |- 0,0) node[below] {$Q_3$}; \draw[dashed_line] (Q4) -- (Q4 |- 0,0) node[below] {$Q_4$}; % SUBSIDY SIZE \draw[<->, thick] (Q4) -- (Q4_projected) node[midway, right] {Size of Subsidy (90{\euro}/tonne)}; % BRACES \draw [decorate,decoration={brace,amplitude=5pt,mirror,raise=5pt}] (Q1 |- 0,-0.6) -- (Q2 |- 0,-0.6) node[midway,yshift=-2em, font=\small] {Exports under free trade}; \draw [decorate,decoration={brace,amplitude=5pt,mirror,raise=5pt}] (Q3 |- 0,-1.6) -- (Q4 |- 0,-1.6) node[midway,yshift=-2em, font=\small, align=center] {Exports under export\\subsidy}; % AREA LABELS \node at (barycentric cs:A1=1, Q3=1, A3=1) {a}; %.. More labels \end{tikzpicture} \end{document} This is the outputted diagram And I am trying to get the 'a' label to be:
- How do I get a stable \noteta?by Frode Alfson Bjørdal on January 26, 2026 at 1:32 am
In some theories on predication \eta is used instead of set theoretical \in. How do I get a useful symbol for \noteta which is to \eta as \notin is to \in? The solutions should be compilable both with pdfLaTeX and LuaLaTeX. \documentclass{article} \begin{document} $\not\eta$ \end{document}
- Why is my METAFONT code wrong?by Grzegorz Brzęczyszczykiewicz on January 25, 2026 at 9:11 pm
mode_setup; thick#:=10pt#; thin#:=5pt#; xoo#:=15pt#; yoo#:=20pt#; dot#:=4pt#; slant#:=0pt#; define_pixels(thick, thin, xoo, yoo, dot, slant); ascender:=3; descender:=1; def be(expr x, y) = (x*xoo+y*slant, y*yoo) enddef; path bowl; bowl := be(1, 0) .. controls be(1.6, 0) and be(2, 0.4) .. be(2, 1) .. controls be(2, 1.6) and be(1.6, 2) .. be(1, 2) .. controls be(0.4, 2) and be(0, 1.6) .. be(0, 1) .. controls be(0, 0.4) and be(0.4, 0) .. cycle; def stick(expr height, length) = be(0-length, height)--be(0, height)--be(0, 0) enddef; def serif(expr length) = be(0-length, 0)--be(length, 0) enddef; pen thinP; thinP := pencircle scaled thin; %a thin, circular pen pen thickP; thickP := pencircle xscaled thick yscaled thin; %a thick, elliptical pen numeric theta_v, theta_n, A, k; theta_v := angle(slant, yoo); A := theta_v / 2; theta_n := angle(yoo, -slant); k := sqrt( 25 - (2.5*sin(theta_n - A))**2 ) / ( 5*cos(theta_n - A) ); pen p; p := thickP xscaled k rotated A; beginchar("o", 3*xoo#, 2*yoo#, 0); pickup thickP; draw bowl; endchar; beginchar("l", 1.9*xoo#, ascender*yoo#, 0); pickup thickP; draw (stick(ascender, 0.5)) shifted be(0.5, 0); draw (serif(0.5)) shifted be(0.5, 0); endchar; beginchar("b", 3.2*xoo#, ascender*yoo#, 0); pickup thinP; draw bowl shifted be(0.25, 0); pickup thickP; draw (subpath (2, 0) of bowl) shifted be(0.25, 0); draw (stick(ascender-1, 0.5)) shifted be(0.25, 1); pickup p; draw be(0.25, 1.5)--be(0.25, 0.1) endchar; beginchar("d", 3.3*xoo#, ascender*yoo#, 0); pickup thinP; draw bowl; pickup thickP; draw subpath (4, 2) of bowl; draw be(1.5, ascender)--be(2, ascender)--be(2, 0)--be(2.5, 0); endchar; beginchar("p", 3.2*xoo#, ascender*yoo#, descender*yoo#); pickup thinP; draw bowl shifted be(0.25, 0); pickup thickP; draw (subpath (2, 0) of bowl) shifted be(0.25, 0); draw (stick(2+descender, 0.5)) shifted be(0.25, 0-descender); draw (serif(0.5)) shifted be(0.25, 0-descender); endchar; beginchar("q", 3.1*xoo#, ascender*yoo#, descender*yoo#); pickup thinP; draw bowl; pickup thickP; draw subpath (4, 2) of bowl; draw be(2, 1)--be(2, 0-descender); draw (serif(0.5)) shifted be(2, 0-descender); pickup p; draw be(2, 1.9)--be(2, 0.75) endchar; beginchar("i", 1.9*xoo#, ascender*yoo#, 0); pickup thickP; draw (stick(2, 0.5)) shifted be(0.5, 0); draw (serif(0.5)) shifted be(0.5, 0); pickup pencircle scaled (thick+dot); draw be(0.425, 2.75) endchar; beginchar("h", 3.6*xoo#, ascender*yoo#, 0); pickup thinP; draw (subpath (3, 1) of bowl) shifted be(0.375, 0); pickup thickP; draw ((subpath (2, 1) of bowl)--be(2, 0)) shifted be(0.375, 0); draw (stick(ascender, 0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(2.375, 0); endchar; beginchar("n", 3.6*xoo#, ascender*yoo#, 0); pickup thinP; draw (subpath (3, 1) of bowl) shifted be(0.375, 0); pickup thickP; draw ((subpath (2, 1) of bowl)--be(2, 0)) shifted be(0.375, 0); draw (stick(2, 0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(0.375, 0); draw (serif(0.5)) shifted be(2.375, 0); endchar; end there are errors and it should be correct, it throws "Missing )" and "Extra tokens will be flushed" errors. For slant = 0, k should work out to sqrt(1.75) = 1.32287565553..., and A = 45°, however due to a bug, the k is a few eyelets shy of the expected sqrt(1.75), and the line becomes too thin. As for the A, it maybe is correct but I don't know if it is. There are bugs and I don't know how to fix them.
- Different column alignment of first-rowby Werner on January 25, 2026 at 5:19 pm
I like my matrix indices to be center-aligned while numbers within the matrix should be right-aligned for better visual clarity of scale. However, none of my attempts to achieve both have been successful. In the example below, the first option is closest, but fails to align the lost column index. \documentclass{article} \usepackage{nicematrix,xcolor} \newcommand{\mc}{\multicolumn{1}{c}} \begin{document} Manual formatting without \texttt{first-row} - last column index not centered: \[ \begin{NiceArray}{ *{6}{r} } \mc{\color{red}\scriptstyle 0} & \mc{\color{red}\scriptstyle 1} & \mc{\color{red}\scriptstyle 2} & \mc{\color{red}\scriptstyle 3} & \mc{\color{red}\scriptstyle 4} & \mc{\color{red}\scriptstyle 5} \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{\string\RowStyle} - no centering of indices: \[ \begin{NiceArray}{ *{6}{r} } \RowStyle[nb-rows=1]{\color{red}\scriptstyle} 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{2-1}{6-6}] \end{NiceArray} \] Using \texttt{first-row} - no centering of indices: \[ \begin{NiceArray}{ *{6}{ r } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] Using \texttt{first-row} with \texttt{c}entered columns - no right-aligned matrix elements: \[ \begin{NiceArray}{ *{6}{ c } }[first-row,code-for-first-row=\color{red}\scriptstyle] 0 & 1 & 2 & 3 & 4 & 5 \\ 8 & 5 & 16 & 19 & 10 & 5 \\ 12 & 5 & 12 & 15 & 9 & 14 \\ 19 & 13 & 6 & 2 & 12 & 3 \\ 7 & 18 & 13 & 0 & 0 & 17 \\ 6 & 10 & 2 & 7 & 11 & 16 \CodeAfter \SubMatrix[{1-1}{5-6}] \end{NiceArray} \] \end{document} How can I achieve a different alignment for the first row (indices) compared to the rest of the matrix?
- How to recursively import .tex files in LaTeX with correct hierarchical ordering?by leonardo cesar on January 25, 2026 at 4:11 pm
I'm working on large LaTeX projects with structured directories containing numbered files: project/ ├── 01-introduction.tex ├── 02-background.tex ├── 03-methodology/ │ ├── 01-experimental.tex │ ├── 02-analysis.tex │ └── 03-validation.tex ├── 04-results/ │ ├── 01-figures.tex │ └── 02-tables.tex └── 05-conclusion.tex Currently, I manually write \import{} commands: \import{project/01-introduction} \import{project/02-background} \import{project/03-methodology/01-experimental} \import{project/03-methodology/02-analysis} \import{project/03-methodology/03-validation} \import{project/04-results/01-figures} \import{project/04-results/02-tables} \import{project/05-conclusion} This approach is: Verbose - requires li sting every file Error-prone - easy to miss files or get order wrong Hard to maintain - adding new files requires manual updates Question: What's the most robust way to automate .tex file imports while ensuring correct hierarchical and numerical ordering? Ideally, I'd like a solution that works with a simple command like: \importAll{path=./project/, recursive=true}
- Where does this 1pt extra space between paragraphs come from, and how to configure it?by H. Weirauch on January 25, 2026 at 2:09 pm
In the MWE \documentclass{article} \usepackage{lua-visual-debug} \setlength{\parindent}{0pt} \setlength{\parskip}{0pt} \begin{document} \rule{6mm}{6mm} \rule{7mm}{6mm} \end{document} the code contains an empty line (= new paragraph) between the two \rules. This is what it looks like in the output: Between the paragraphs, some vertical spacing is inserted. As far as I can tell, it is exactly 1pt. Where does this come from, and how am I supposed to modify it? This space does not occur when using minimal document class; it apparently is limited to article (or other high-level classes like KOMA).
- Vertical centering in table cellsby bubba on January 25, 2026 at 6:35 am
I'm trying to typeset the following table. I'm having trouble with the vertical centering of each cell's contents, plus the obvious horizontal alignments. ChatGPT's numerous attempts were all hopelessly wrong, and I eventually created the image below in Powerpoint, which (sadly) might have to be my solution, if all else fails.