Hot
- Styled read out example for a value from a pgfplotstable (TikZ-spy?)by cis on February 12, 2026 at 4:04 pm
I have a pgfplotstable: I would like to create a reading out example for a value, with the red lines and the framed cell. This could look like this then: How could I do that best way? My immediate idea would be a TikZ-spy. But maybe there's a completely different/easier way. %\documentclass[paper=a5]{scrarticle} %\usepackage[margin=14mm, showframe]{geometry} \documentclass[margin=5pt, varwidth]{standalone} \usepackage{diagbox} \usepackage{colortbl} \usepackage{pgfplotstable} \pgfplotsset{compat=1.18} \usetikzlibrary{spy} \pgfplotstableread[col sep=comma]{ n, k, 0.1, 0.2, 0.3, 0.4 1, 0, 1.1, 1.2, 1.3, 1.4 1, 1, 2.1, 2.2, 2.3, 2.4 2, 0, 2.1, 2.2, 2.3, 2.4 2, 1, 3.1, 3.2, 3.3, 3.4 2, 2, 4.1, 4.2, 4.3, 4.4 3, 0, 3.1, 3.2, 3.3, 3.4 3, 1, 4.1, 4.2, 4.3, 4.4 3, 2, 5.1, 5.2, 5.3, 5.4 3, 3, 6.1, 6.2, 6.3, 6.4 }{\mytable} \begin{document} \pgfplotstabletypeset[ every head row/.style={before row=\hline, after row=\hline}, columns/k/.style = {% k column column name={\diagbox{$k$}{$p$}}, column type={|>{\cellcolor{pink}}c|}, },% ]{\mytable} \begin{tikzpicture}[ spy using outlines={rectangle, magnification=1, connect spies} ] \spy [blue, width=2cm, height=1cm] on (0,1) in node [fill=white] at (3,0.5); \end{tikzpicture} \end{document}
- Bold small caps in Times New Romanby rensemil on February 12, 2026 at 2:27 pm
I am using fontspec in order to write in Times New Roman. The authors of cited literature are always set in small caps. This initially made problems because the font has no small caps, but I solved those by googling and finding a solution on stackexchange. However, the small caps don't work when they are also bold, e.g. in a section heading. This is my MWE: \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{fontspec} \setmainfont{Times New Roman}[ SmallCapsFont={TeX Gyre Termes}, SmallCapsFeatures={Letters=SmallCaps}, ] \begin{document} \section{Regel von \textsc{Ritschl}} Regel von \textsc{Ritschl} \end{document} Which produces: As you can see, the small caps in the text body work just fine. In the heading, however, the small caps are not set bold. When using the ebgaramond package, this issue does not occur and everything looks as it should and very pretty, but, of course, in Garamond: I actually prefer the looks of Garamond but unfortunately I have to write in Times New Roman. Does anyone know how this could be fixed? Thanks in advance! If relevant: I am using LaTeX with LaTeX workshop in VSCode on a MacBook Air.
- reversed bracket in Awami font (Texlive 2024ff)by dietz on February 12, 2026 at 12:30 pm
In an example like (کتاب 1:4) Awami is reversing the second bracket since Texlive 2024. Is this a bug, and can I get around it? In the following example, Lateef works fine but Awami does not. \documentclass[fontsize=12pt]{scrbook} \usepackage[a6paper]{geometry} \usepackage{fontspec} \usepackage[RTLdocument]{bidi} \setmainfont[Renderer=Graphite,RawFeature={Short forms=All}]{Awami Nastaliq} \newfontfamily\lateef[Script=Arabic]{Lateef-Regular} \TeXXeTstate=1 \begin{document} (کتاب 1:4) {\lateef (کتاب 4:1)} \end{document}
- Crossed branches in tikz [closed]by Uri Lifshitz on February 12, 2026 at 11:11 am
I am having trouble figuring out how to have a drawed line crossed out and a dotted line in tikzpicture to have a desired result which will look something like thanks!
- Counters do not increase when againframe'ing a hidden frameby scottkosty on February 12, 2026 at 9:37 am
I'm running into a problem that Beamer is behaving exactly as it should :). I am using a solution that begins a frame with \begin{frame}<beamer:0|handout:0> and then recalls the frame with \againframe. The purpose of this approach is to get miniframes and frame numbers to increase, as desired here: How to adapt miniframes to increasing pagenumber in overprint However, any theorems or other numbered environments do not have their numbers increased. I can increase them manually, but I don't want to keep track of manually increasing counters. Is there any way to make these hacks any smoother? % example adapted from: https://tex.stackexchange.com/a/759437 % original example (before adaptation): by jlab % Retrieved 2026-02-11, License - CC BY-SA 4.0 \documentclass[compress]{beamer} % \documentclass[compress,handout]{beamer} \setbeamertemplate{footline}[frame number]{} \beamerdefaultoverlayspecification{<+-| alert@+>} \usecolortheme{crane} \useoutertheme[ subsection=false ]{miniframes} \setbeamertemplate{theorems}[numbered] % from Sam's answer at https://tex.stackexchange.com/a/758177/12212 \setbeamertemplate{mini frame}{% \ifnum\insertframeendpage=\thepage \color{green}% \fi \begin{pgfpicture}{0pt}{0pt}{0.1cm}{0.1cm} \pgfpathcircle{\pgfpoint{0.05cm}{0.05cm}}{0.05cm} \pgfusepath{fill,stroke} \end{pgfpicture}% } \makeatletter \begin{document} \section{My subsection} \begin{frame} \begin{theorem} Here is Theorem 1. \end{theorem} \end{frame} \begin{frame} \begin{theorem} Here is Theorem 2. \end{theorem} \end{frame} \begin{frame}<beamer:0|handout:0>[label=myframe, noframenumbering] Definitition: Let $X$ be a rv. Then, $X$ is a \emph{continuous rv} if there exists a function, $f_{X}:\mathbb{R}\mapsto[0,\infty)$,% dummy ] for code indent called a \emph{probability density function (pdf)}, such that for any numbers $c_{1}\le c_{2}$, \[ Pr(X\in[c_{1},c_{2}])=Pr({c_{1}}\le X\le c_{2})=\int^{c_{2}}_{c_{1}}f_{X}(x)dx. \] \pause \begin{overprint} \onslide<2|handout: 1> \begin{block}{} Here I show a graph of a pdf. (place holder for the graph) \end{block} \onslide<3-5|handout: 2> Here are some properties: \begin{itemize} \item one \item two \item three \end{itemize} \onslide<6-|handout: 3> Some important implications: \begin{itemize} \item Implication 1 \item Implication 2 \end{itemize} \begin{theorem} Here is Theorem 3. \end{theorem} \end{overprint} \end{frame} \mode<beamer>{% \againframe<beamer:-2>[<alert@+|+->]{myframe} \againframe<beamer:3-5>[<alert@+|+->]{myframe} \againframe<beamer:6->[<alert@+|+->]{myframe} } \mode<handout>{% \againframe<handout:1>{myframe} \againframe<handout:2>{myframe} \againframe<handout:3>{myframe} } % Gives desired behavior, but I do not want to manually keep track of counters. %\refstepcounter{theorem} \begin{frame} \begin{theorem} Here is Theorem 4. \end{theorem} \end{frame} \begin{frame} \begin{theorem} Here is Theorem 5. \end{theorem} \end{frame} \end{document} The problem is "Here is Theorem 4" is numbered as Theorem 3. Here is the output (showing the problem):
- Loading and using SQLiteby Gary on February 12, 2026 at 7:24 am
I'm trying to use SQLite and cannot get it to even initialize. I tried to follow the instructions at https://www.pragma-ade.nl/general/manuals/luametatex.pdf pages 701-702. Do I need to do something with pages 695-696 first to get sqlite loaded? Thank you. function library.load ( <t:string> filename, <t:string> openname ) return <t:function>, -- target <t:string> -- foundname end but there are no guarantees that it will work. local UserData = UserData or { } function UserData.CallBack (nofcolumns,values,fields) context("Reached the callback.") context.par() end context.startTEXpage { offset = "1ex" } local init = optional.sqlite.initialize() if init == true then context("Initialize successful") else context("Initialize failed") end context.par() local instance = optional.sqlite.open ( ":memory:" ) local query = "select 1 as id, 'a' as key;" local result = optional.sqlite.execute ( instance, query, UserData.CallBack ) if result == true then context("Execution succeeded") else context("Execution failed") end context.par() context.stopTEXpage() optional.sqlite.close(instance)
- Formatting ToC and chapters in a tagged PDFby wsmith on February 12, 2026 at 4:54 am
I have been tasked with designing a template for creating a tagged PDF that meets certain formatting requirements. The only major obstacle I have encountered is in generating a Table of Contents that meets these (rather stringent) demands. Normally, I would use tocloft for this; however, as it has been pointed out in other posts, this is currently not an option. I have tried working around this, but I must admit that I am out of my depth. Between the default settings and some things I have found on this forum, I have been able to get the ToC to a place that I like. There are three things I still can't figure out: I would like to set the font (italic or boldface) for the chapters, sections, subsection, etc. I would like to force chapter titles to appear uppercase in the ToC. I need to add the word "Page" above the page numbers in the ToC, list of figures, and list of tables. I have a cheap workaround for (2) which is just to make a new command: \newcommand{\Chapter}[1]{\chapter[\MakeUppercase{#1}]{#1}} but this is quite stupid. To acheive (3), I write \makeatletter \newcommand{\pageheaderlabel}{ \hfill\makebox[\@pnumwidth][c]{Page}\par\smallskip } \let\old@starttoc\@starttoc \renewcommand{\@starttoc}[1]{ \pageheaderlabel \old@starttoc{#1} } \makeatother but this is quite hacky (and is slightly off-center). On a somewhat related note, I have been using titlesec as I normally would; e.g, \usepackage[rm, tiny, center, compact]{titlesec} \titleformat{\chapter} {\ifdefined\boldheadings\bfseries\fi\centering\normalsize} {\thechapter.}{1em}{\makeuppercase} \titlespacing*{\chapter} {0pt} {0pt} {20pt} and I have not encountered any issues, despite the fact it is currently marked as incompatible with tagging. If it is breaking something, I cannot tell what. If there are any known workarounds to achieve this without titlesec, that would be much appreciated. ADDENDUM: Here is a stripped down example: % !TeX program = lualatex \DocumentMetadata{uncompress,lang=en, tagging=on, pdfstandard=ua-2,pdfstandard=a-4f} \documentclass[12pt]{report} \usepackage{lipsum} \usepackage[hidelinks]{hyperref} \usepackage{etoolbox} \usepackage[doublespacing]{setspace} \usepackage[letterpaper]{geometry} \geometry{verbose, margin=1in} \usepackage[rm, tiny, center, compact]{titlesec} % FORMATTING OPTIONS: %\def\BoldHeadings{} % <- uncomment to make chapters boldface (Goal: toggle consistently with ToC) \titleformat{\chapter} {\ifdefined\BoldHeadings\bfseries\fi\centering\normalsize} {\thechapter.}{1em}{\MakeUppercase} \titlespacing*{\chapter} {0pt} {0pt} {20pt} % To make "Page" appear above page #'s in TOC \makeatletter \newcommand{\pageheaderlabel}{ \hfill\makebox[\@pnumwidth][c]{Page}\par\smallskip } \let\old@starttoc\@starttoc \renewcommand{\@starttoc}[1]{ \pageheaderlabel \old@starttoc{#1} } \makeatother % add dots, courtesy of linked post \AddToHookWithArguments{contentsline/text/after}{ \ifnum#1=0 \dotfill \fi } % stupid trick to force chapter titles to be uppercase in TOC \newcommand{\Chapter}[1]{\chapter[\MakeUppercase{#1}]{#1}} \begin{document} \chapter*{TABLE OF CONTENTS} \addcontentsline{toc}{chapter}{TABLE OF CONTENTS} \begin{singlespace} \renewcommand\contentsname{\normalfont} {} \begingroup \let\clearpage\relax \let\cleardoublepage\relax \tableofcontents \endgroup \end{singlespace} \newpage % similar for LoF, LoT \Chapter{Fake Chapter} \section{Fake Section} \subsection{Fake Subsection 1} \subsubsection{Fake Subsubsection} \lipsum[3] \subsection{Fake Subsection 2} \lipsum[1] \end{document}
- How can I geometrically translate a line segment on a line?by Jasper on February 12, 2026 at 4:17 am
How can I geometrically translate a line segment on a line? I want to move the pink segment so that it starts at three and goes to four. I don't just want to teleport it. I want a geometric construction for this - Euclidean style. \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[thick,->] (-1,0) -- (5,0) node[below left] {\(x\)}; \draw[ preaction = { draw = black, line width = 4pt }, postaction = { draw = pink, line width = 2pt } ] (0,0) -- (1,0); \fill (0,0) circle[radius = 3pt] node[below=3pt] {\(0\)}; \fill (1,0) circle[radius = 3pt] node[below=3pt] {\(1\)}; \fill (3,0) circle[radius = 3pt] node[below=3pt] {\(3\)}; \end{tikzpicture} \end{document}
- First row in table is too high, how to reduce the height automatically? How to employ values I have to derive later?by MBE on February 11, 2026 at 10:30 pm
How to employ values I have to derive later?(For skipping spaces in a table)The only way I can think of is to reflect the first column(x) of any row into a dummy column(0) to get the value before using it. But at which point of the code I may do this? ( This table is made of boxes. Crazy code it is,but I think you know me by now) \def\newcounts[#1]{% \csname newcount\expandafter\endcsname\csname start#1\endcsname \csname newcount\expandafter\endcsname\csname stop#1\endcsname} \newcounts[A] \newcounts[B] \newcounts[C] \newcounts[D] \def\newdimens[#1]{ \csname newdimen\expandafter\endcsname\csname #1\endcsname } \newdimens[colwidth]\newdimens[currdp]\newdimens[currht]\newdimens[filldepth]\newdimens[maxdepth] \def\newfonts[#1,#2]{\font#1=#2} \newfonts[\tinyfont,cmr5] \def\t{\par}%shortcut \def\colsep{\hskip20pt} \maxdepth=0.3\vsize %the maxsize of a tablerow \parindent=0pt \colwidth=50pt \raggedright \def\docol[#1]#2{% \setbox#1=\vtop{\vskip\baselineskip\hsize=\colwidth {\tinyfont (#1)}#2\vskip\baselineskip\hrule} \currdp=\dp#1\currht=\ht#1 \advance\currdp by \currht \filldepth=\maxdepth \advance\filldepth by -\currdp \setbox#1=\vtop{\vskip\baselineskip\hsize=\colwidth {\tinyfont (#1)}#2\vskip\filldepth \vskip2\baselineskip \hrule} }%enddoecol %filling boxes for testing \startA=10 \stopA=15 \loop \ifnum\startA<\stopA \docol[\the\startA]{Rund ein Drittel der Bundesrepublik ist bewaldet} %\maxdepth=\currdp%here is the question \advance\startA by 1 \repeat %filling boxes for testing %filling boxes for testing \startA=20 \stopA=25 \loop \ifnum\startA<\stopA %\maxdepth=\currdp%here is the question \docol[\the\startA]{Rund ein Drittel der Bundesrepublik ist bewaldet. Elf Millionen Hektar erstrecken sich von den Küsten im Norden bis zu den Alpen im Süden.} \advance\startA by 1 \repeat %filling boxes for testing %\docol[11]{fjt htjtf bgr bfdd}% this is how a column is built %\docol[12]{fjt htjtf bgr bfdd}% this is how a column is built \def\makerow[#1,#2]{ \hbox{%the maxsize of a tablerow \startA=#1 \stopA=#2 \loop \ifnum\startA<\stopA \colsep\copy\startA \ifvoid\startA[void cell] \startA=\stopA \fi %reporting void cell cancel the loop \advance \startA by 1 \repeat} } \makerow[10,20] \makerow[20,30] \makerow[30,40] \bye
- Setting a different font for theorems [duplicate]by why on February 11, 2026 at 9:26 pm
I would prefer for all of the theorems in a document of mine to be written in slanted style rather than italic. The math symbols themselves should still appear in italic, only the written text should be slanted. In my opinion this adds to readability. Consider the following example taken from Qing Liu's Algebraic Geometry and Arithmetic curves, p. 71: Is there any easy way to do this for the whole document instead of changing every single theorem?
- Crop certain percent from each side of the figureby monty01 on February 11, 2026 at 8:20 pm
I would like to crop x percent from each side from the img. \documentclass{article} \usepackage{graphicx} \begin{document} \begin{figure}[h] \centering \includegraphics[scale=0.3]{example-image-a} \caption{Caption} \label{fig:placeholder} \end{figure} \end{document} insted of using \includegraphics[scale=0.3]{example-image} I would like to call \cropimg{scale}{img}{crop percentage}
- Coloring listofs and refsby palloc on February 11, 2026 at 7:39 pm
I would like to color the listoffigures (name and entries), \cref{fig: ...} to blue color, and listotables (name and entries), \cref{tab: ...} to red color. \documentclass{article} \usepackage{graphicx} \usepackage{cleveref} \begin{document} \listoftables \listoffigures \begin{table}[!hbtp] \centering \begin{tabular}{cc} a & a \\ a & a \end{tabular} \caption{Caption} \label{tab:tabA} \end{table} \begin{figure}[!hbtp] \centering \includegraphics[width=0.3\linewidth]{example-image} \caption{Caption} \label{fig:figA} \end{figure} \cref{tab:tabA}, \cref{fig:figA} \end{document}
- Biblatex: First citation as full author + title; following citations ibid. or - when interrupted - short author-title citationby alcuinus on February 11, 2026 at 7:30 pm
The journal I am writing for requires: Whenever a bibliography entry is cited the first time: given name, family name, title, page -- no other data as publisher and so on When it is used again with other entries in between it will be shown as: familyname, title, page When it is used again without other entries in between it will be shown as"Ibid." With ext-verbose-trad1, citetracker=true I get "cit." which is not required. MWE: \documentclass[a4paper]{article} \usepackage[style=ext-verbose-trad1, citetracker=true,backend=biber]{biblatex} \begin{filecontents*}{\jobname.bib} @Book{A1, author = {Author, Anton}, title = {The First Very Long Title}, subtitle = {The Subtitle}, shorttitle = {The First}, year = {1900}, publisher = {The Printer}, address = {Printtown} } @Book{B2, Author = {Black, Berth}, Title = {The Second Title}, Year = {2000}, publisher = {The Typesetter}, address = {Typetown} } \end{filecontents*} \addbibresource{\jobname.bib} \begin{document} First title:\autocite[34]{A1}. Second citation (same title other page)\autocite[70]{A1}. Second title\autocite[12]{B2}. Back to first book (other page)\autocite[50]{A1}. Back to the first book (other page)\autocite[60]{A1}. Back to the first book (same page)\autocite[60]{A1}. Second title again\autocite[21]{B2}. \printbibliography \end{document} Question. How to substitute "cit." with shorttitle or title? See notes 4 and 7. The first and third note should print only given name + family name + title, but I will ask this in another post. Thanks for any help.
- How to tweak the edge's brace centering aligned with forest package?by Explorer on February 11, 2026 at 12:43 pm
Description and Code Here below is my first version code: \documentclass{standalone} \usepackage{forest} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{forest} for tree={ grow'=east, anchor=west, inner sep=0pt, outer sep=0pt, fit=band, align=left, if n=1{edge path'={(!ul.south west)-- (!u1.north west)}}{no edge}, edge={decorate, decoration={brace,amplitude=1.5mm,raise=2mm}}, draw,tikz={\fill[](.anchor)circle[radius=1pt];} } [1 First-level title [1.1 Second-level title [1.1.1 Third-level title [1.1.1.1 Fourth-level title] [1.1.1.2 Fourth-level title] ] [1.1.2 Third-level title [1.1.2.1 Fourth-level title] [1.1.2.2 Fourth-level title] ] ] [1.2 Second-level title [1.2.1 Third-level title [1.2.1.1 Fourth-level title] [1.2.1.2 Fourth-level title] ] [1.2.2 Third-level title [1.2.2.1 Fourth-level title] [\parbox{8em}{Text text text text text text text text text text text text}] ] ] ] \end{forest} \end{document} which gives: I manage to manually calculate the heights: \documentclass[border=5pt]{standalone} \usepackage{forest} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{forest} for tree={ grow'=east, anchor=west, inner sep=0pt, outer sep=0pt, fit=band, align=left, if n=1{edge path'={(!ul.south west)-- (!u1.north west)}}{no edge}, edge={decorate, decoration={brace,amplitude=1.5mm,raise=2mm}}, before drawing tree={ for tree={ if n children=0{}{ y/.pgfmath={(y("!1")+max_y("!1")+y("!l")+min_y("!l"))/2} } } } } [1 First-level title [1.1 Second-level title [1.1.1 Third-level title [1.1.1.1 Fourth-level title] [1.1.1.2 Fourth-level title] ] [1.1.2 Third-level title [1.1.2.1 Fourth-level title] [1.1.2.2 Fourth-level title] ] ] [1.2 Second-level title [1.2.1 Third-level title [1.2.1.1 Fourth-level title] [1.2.1.2 Fourth-level title] ] [1.2.2 Third-level title [1.2.2.1 Fourth-level title] [\parbox{8em}{Text text text text text text text text text text text text}] ] ] ] \end{forest} \end{document} It works with English-text: However, things changed with ctex bundle: \documentclass[border=5pt]{standalone} \usepackage[fontset=fandol]{ctex} % \usepackage[LoadFandol]{xeCJK} \usepackage{forest} \usetikzlibrary{decorations.pathreplacing} \begin{document} \begin{forest} for tree={ grow'=east, anchor=west, inner sep=0pt, outer sep=0pt, fit=band, align=left, if n=1{edge path'={(!ul.south west)-- (!u1.north west)}}{no edge}, edge={decorate, decoration={brace,amplitude=1.5mm,raise=2mm}}, }, before drawing tree={ for tree={ if n children=0{}{ y/.pgfmath={(y("!1")+max_y("!1")+y("!l")+min_y("!l"))/2} } } } [1 一级标题 [1.1 二级标题 [1.1.1 三级标题 [1.1.1.1 四级标题] [1.1.1.2 四级标题] ] [1.1.2 三级标题 [1.1.2.1 四级标题] [1.1.2.2 四级标题] ] ] [1.2 二级标题 [1.2.1 三级标题 [1.2.1.1 四级标题] [1.2.1.2 四级标题] ] [1.2.2 三级标题 [1.2.2.1 四级标题] [\parbox{8em}{文字文字文字文字文字文字文字文字文字文字文字文字}] ] ] ] \end{forest} \end{document} Question I was not sure what caused the difference here, is my y/.pgfmath={(y("!1")+max_y("!1")+y("!l")+min_y("!l"))/2} not so accurate? Or something baseline difference between English-text and CJK-text? Is there any suggestion on my code to work for both English-text and CJK-text together? Edited with schemata-version: \documentclass[border=5pt]{standalone} \usepackage[fontset=fandol]{ctex} \usepackage{schemata} \begin{document} \Schema{-2ex}{8ex} { \schemabox{1 一级标题} } { \Schema{0ex}{4.5ex} { \schemabox{1.1 二级标题} } { \schema { \schemabox{1.1.1 三级标题} } { \schemabox{1.1.1.1 四级标题} \schemabox{1.1.1.2 四级标题} } \schema { \schemabox{1.1.2 三级标题} } { \schemabox{1.1.2.1 四级标题} \schemabox{1.1.2.2 四级标题} } } \Schema{-1.5ex}{5.5ex} { \schemabox{1.2 二级标题} } { \schema { \schemabox{1.1.1 三级标题} } { \schemabox{1.1.1.1 四级标题} \schemabox{1.1.1.2 四级标题} } \schema { \schemabox{1.1.2 三级标题} } { \schemabox{1.1.2.1 四级标题}\smallskip \schemabox{\parbox{8em}{\linespread{1.1}\selectfont 文字文字文字文字文字文字文字文字文字文字文字文字}} } } } \end{document} I was not sure I get the correct way to nested \Schema, but just consider that if the tree is more complex, says 4 layers, the schema's syntax has less advantage, and need manually \Schema{-1.5ex}{5.5ex} adjustment, it's not a good practice, imho.
- Index in scrbook gets an (unwanted) index titleby Jack on February 11, 2026 at 11:12 am
The index, generated with scrbook, shows the index-title as page header. In scrartcl it does not. In a real world (complex) situation, the title appears only, if the index comprises exactly 2 pages. With an index of 3 or more pages, this text does nor appear. Is this a bug, or am I doing something stupid? My MWE: %\documentclass[paper=a5,fontsize=14pt]{scrartcl} \documentclass[paper=a5,fontsize=14pt]{scrbook} \usepackage[textheight=10cm]{geometry} \usepackage{imakeidx} \indexprologue{% \footnotesize \textbf{% Example index to show the problem when the index comprises 2 or more pages. This problem shows up with class scrbook, not with class scrartcl } } \makeindex[title=\large List of Words] \begin{document} Page 1 \index{Example-01!\textbf{Example} with some text to fill the line} \index{Example-02!\textbf{Example} with some text to fill the line} \index{Example-03!\textbf{Example} with some text to fill the line} \index{Example-04!\textbf{Example} with some text to fill the line} \index{Example-05!\textbf{Example} with some text to fill the line} \index{Example-06!\textbf{Example} with some text to fill the line} \index{Example-07!\textbf{Example} with some text to fill the line} \index{Example-08!\textbf{Example} with some text to fill the line} \index{Example-09!\textbf{Example} with some text to fill the line} \index{Example-10!\textbf{Example} with some text to fill the line} \index{Example-11!\textbf{Example} with some text to fill the line} \index{Example-12!\textbf{Example} with some text to fill the line} \index{Example-13!\textbf{Example} with some text to fill the line} \index{Example-14!\textbf{Example} with some text to fill the line} \index{Example-15!\textbf{Example} with some text to fill the line} \index{Example-16!\textbf{Example} with some text to fill the line} \index{Example-17!\textbf{Example} with some text to fill the line} \index{Example-18!\textbf{Example} with some text to fill the line} \index{Example-19!\textbf{Example} with some text to fill the line} \index{Example-20!\textbf{Example} with some text to fill the line} \printindex \end{document}
- Automatically resizing tcolorbox to even out text in 2 or more lines [duplicate]by aaragon on February 11, 2026 at 10:26 am
Here's a crazy proposition I am not sure is feasible: Create a tcolorbox (for instance in beamer) so that the box is automatically resized so that its content is balanced. Consider this code: \usepackage[skins]{tcolorbox} % for boxes \tcbset{ myblockbase/.style={ beamer, enhanced, no shadow, boxrule=1.2pt, arc=2.5mm, left=2mm,right=2mm,top=1.2mm,bottom=1.2mm, titlerule=2pt, coltitle=white, fonttitle=\bfseries\scshape, } } \newtcolorbox{myblock}[1]{% myblockbase, colframe=MidnightBlue, colback=MidnightBlue!10, colbacktitle=MidnightBlue, titlerule style={MidnightBlue!60}, title={#1}, } This creates a nice box I use for my slides. However, look at the attached image created as follows: \begin{myblock}{} \raggedright Notice the natural boundary conditions emerge naturally after integrating by parts! \end{myblock} Of course I could start playing with the width of the color box so as to get the right width in order to get both lines having more or less the same length. Would it be possible in any way to do this automatically? Is there a way to have some sort of iterative algorithm at the preamble that is computing the right width that the tcolorbox should take?
- pgfplots: Adjust groupplot to text widthby cis on February 11, 2026 at 9:28 am
I have a 2×2 groupplot (where the first plot should be replaced by a title "Supertitle") with titles in boxes. These "title boxes" should all have the same width, and boxes in the same row should have the same height. I achieved this using \vphantom{} because I didn't find a better method. How can I configure the settings such that the entire groupplot has a width of \textwidth? And a horizontal space between the columns like \tabcolsep (or something similar)? Is there a elegant way to do this by package keys? (resizebox etc. would certainly work, but that would be less elegant.) Ideally, it should stay a groupplot. PS: I'm using DIN A5 format here, but that shouldn't matter if the keys are set correctly. \documentclass[paper=a5]{scrartcl} \usepackage[margin=14mm, showframe]{geometry} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \pgfplotsset{compat=1.18} \begin{document} \section{Plots with Titles and Supertitle} \pgfmathsetlengthmacro\plotwidth{0.5*\textwidth-\the\arraycolsep} \begin{tikzpicture}[font=\footnotesize] \begin{groupplot}[ % Grouupplot settings ================== group style={ group size=2 by 2, % 2 columns, 2 rows vertical sep=25mm, horizontal sep=15mm, }, % Styles applied to all subplots ============== width=\plotwidth, height=30mm, % Title Styles ========================== title style={% at={(0,1)}, xshift=-3ex, align=left, anchor=south west, inner xsep=2pt, draw, fill=none, text width=0.925*\pgfkeysvalueof{/pgfplots/width}, },% ] % Title (Row 1, Col 1) \nextgroupplot[ % I don't know how to get this box to the same height without this trick: title={\vphantom{Plot 0} \\ \vphantom{000} \\ \vphantom{000}}, title style={name=super}, hide axis, ] \addplot[draw=none, samples={0}]{x}; % Plot 0 (Row 1, Col 2) \nextgroupplot[title={Title 0 \\ 000 \\ 000}] \addplot{x}; % Plot 1 (Row 2, Col 1) \nextgroupplot[title={Title 1 \\ 2-111 \\ 3-111 \\ 4-111}] \addplot{x^2}; % Plot 2 (Row 2, Col 2) \nextgroupplot[title={Title 2 \\ 2-222 \\ 3-222 \\ \vphantom{4-111}}] \addplot{x^3}; \end{groupplot} %% Supertitle \node[font=\bfseries\Large] at (super){Supertitle}; \node[anchor=north west, draw=none, align=left,] at (super.south west){ Some notes \\ below Supertitle}; \draw[cyan, very thick, |-|] (group c1r2.west) -- +(\plotwidth,0) node[midway, below, fill=yellow]{plotwidth =\plotwidth}; %% This gives a 'Overfull \hbox ' warning ================== \draw[red, thick, |-|, ] ([yshift=5mm]group c1r2.west) -- +(2*\plotwidth,0) node[midway, above, fill=yellow]{2*plotwidth =\plotwidth}; \end{tikzpicture} \end{document}
- Use the cld context.setuphead() to define a section with \startsection in the ConTeXt area when using a command option?by Gary on February 11, 2026 at 3:27 am
I'm probaby doing something stupid in this example and I don't know if anyone would ever do this; but should it be okay to set up the head in the lua code and still start the sections in ConTeXt code? If all of this brief example is coded in lua and run as a .cld file, it works. But if split it and run as .tex file, it errors concerning the command option line. If remove the command option line or remove the set up head from the lua code section and declare it in the ConTeXt section as \setuphead[section][command={\MySectionLua}] it works. Is there a way to write the command option line to permit the context.setuphead to remain in the lua code? Thank you. The error is: ! Control sequence expected instead of undefined tex error > tex error on line 16 in file ./junk.tex: { command = [[mber %s Title: %s",nbr,ttl) <argument> { command = [[\MySectionLua %s",nbr,ttl) ) ]] }, <macro> \luat_start_lua_code_indeed #1\stopluacode ->\directlua {#1 \beginlocalcontrol \endgroup \endlocalcontrol } <line 3.16> \stopluacode 6 protected = true, 7 actions = function(nbr, ttl) 8 context("Number %s Title: %s",nbr,ttl) 9 end, 10 } 11 12 context.setuphead( 13 { "section" }, 14 { command = [[\MySectionLua]] }, 15 ) 16 >> \stopluacode 17 18 \startTEXpage 19 \startsection[title={Title One}] 20 Paragraph 21 \stopsection 22 \stopTEXpage 23 You injected something that confused the parser, maybe by using some Lua call. mtx-context | fatal error: return code: 1 \startluacode interfaces.implement { name = "MySectionLua", public = true, arguments = "2 arguments", protected = true, actions = function(nbr, ttl) context("Number %s Title: %s",nbr,ttl) end, } context.setuphead( { "section" }, { command = [[\MySectionLua]] }, ) \stopluacode %\setuphead[section][command={\MySectionLua}] \startTEXpage \startsection[title={Title One}] Paragraph \stopsection \stopTEXpage
- Highlighting matrix multiplicationby Dimitrios ANAGNOSTOU on February 10, 2026 at 11:58 pm
I know there are several relevant questions on TeX Stack Exchange about nicely highlighting matrix multiplication, and some of them have excellent answers. I apologize if my question is a duplicate. I have managed to highlight the various entries manually, but it requires quite a bit of work. Is there a way to automate this procedure? \documentclass{article} \usepackage{amsmath, amssymb} \usepackage{xcolor} \usepackage[margin=1.5cm]{geometry} \begin{document} \section*{Matrix Multiplication} We want to compute the product \(AB\) for \[ A = \begin{bmatrix} 3 & 1 & -1 \\ -1 & 0 & 4 \end{bmatrix}, \quad B = \begin{bmatrix} 2 & 1 & 3 \\ -1 & 3 & 4 \\ 0 & 2 & 5 \end{bmatrix}. \] We can illustrate the multiplication as follows, highlighting each row of \(A\) and each column of \(B\): \[ \begin{array}{c@{\hspace{2em}}c@{\hspace{1em}}c} & \begin{bmatrix} \color{blue}{2} & \color{orange}{1} & \color{purple}{3} \\ \color{blue}{-1} & \color{orange}{3} & \color{purple}{4} \\ \color{blue}{0} & \color{orange}{2} & \color{purple}{5} \end{bmatrix} & \\[1em] % \begin{bmatrix} \color{red}{3} & \color{red}{1} & \color{red}{-1} \\ \color{green}{-1} & \color{green}{0} & \color{green}{4} \end{bmatrix} & = & \begin{bmatrix} \underbrace{\color{red}{3}\cdot \color{blue}{2} + \color{red}{1}\cdot \color{blue}{-1} + \color{red}{-1}\cdot \color{blue}{0}}_{\color{black}{5}} & \underbrace{\color{red}{3}\cdot \color{orange}{1} + \color{red}{1}\cdot \color{orange}{3} + \color{red}{-1}\cdot \color{orange}{2}}_{\color{black}{4}} & \underbrace{\color{red}{3}\cdot \color{purple}{3} + \color{red}{1}\cdot \color{purple}{4} + \color{red}{-1}\cdot \color{purple}{5}}_{\color{black}{8}} \\[0.5em] % \underbrace{\color{green}{-1}\cdot \color{blue}{2} + \color{green}{0}\cdot \color{blue}{-1} + \color{green}{4}\cdot \color{blue}{0}}_{\color{black}{-2}} & \underbrace{\color{green}{-1}\cdot \color{orange}{1} + \color{green}{0}\cdot \color{orange}{3} + \color{green}{4}\cdot \color{orange}{2}}_{\color{black}{7}} & \underbrace{\color{green}{-1}\cdot \color{purple}{3} + \color{green}{0}\cdot \color{purple}{4} + \color{green}{4}\cdot \color{purple}{5}}_{\color{black}{17}} \end{bmatrix} \end{array} \] Thus, the final product is \[ AB = \begin{bmatrix} 5 & 4 & 8 \\ -2 & 7 & 17 \end{bmatrix}. \] \bigskip \textit{Note:} \(BA\) is not defined because \(B\) is \(3\times 3\) and \(A\) is \(2\times 3\); the number of columns of \(B\) (3) does not match the number of rows of \(A\) (2). In general, \(AB \neq BA\). \end{document}
- Another way to write powers?by Lara de Assumpcao Maffei Piero on February 10, 2026 at 10:43 pm
My new keyboard writes ^ as ˆ, and overleaf doesn't recognize these the same way. Is there an alternative symbol in latex for writting powers and indexes or some way to make overleaf recognize ˆ as ^?
- Numbering equations in dcases without \usepackage{empheq}by Sebastiano on February 10, 2026 at 9:09 pm
At the moment, I don't remember how to number the equations inside dcases , with the amsart class, without empheq, in order to assign a label to each one. \documentclass{amsart} \usepackage{mathtools} \begin{document} \begin{subequations} \begin{equation} \begin{dcases} 0 \le \frac{u+v}{2} \le 1 \\ 0 \le \frac{v-u}{2} \le 1 - \frac{u+v}{2} \end{dcases} \iff \begin{dcases} 0 \le u+v \le 2 \\ \label{Psojjn} 0 \le v-u \le 2 - (u+v) \end{dcases} \end{equation} \end{subequations} \end{document} Addendum: My desidered output.
- Footnotes inside widetext in revtex4-2by E.P. on February 10, 2026 at 5:49 pm
I am writing a manuscript in revtex4-2, which is mostly in two-column format, but which has a (relatively meaty) section inside widetext. One quirk I've noticed, and which I would like to fix, is that one of the footnotes is inside that widetext, but it is being displayed in two-column mode, which looks rather ugly: How can this be fixed? I notice, in particular that the revtex4-1 guide says the following, \footnote in \widetext and table* environments improved. \footnotes in the \widetext or table* environments are now correctly placed and formatted. which would make one think that this was a problem in previous versions but should be fixed in RevTeX 4.1 and later. So what gives? Below is a minimal working example to produce the behaviour: \documentclass[% reprint, aps, pra, nofootinbib, ]{revtex4-2} \usepackage{lipsum} \begin{document} This is some two-column text. \lipsum[1-2] \begin{widetext} This is some one-column text, with a footnote.% \footnote{This is the footnote text, which is long enough to be just over one column wide.} \lipsum[1-8] \end{widetext} \end{document}
- Coloring equation and equation numberby palloc on February 10, 2026 at 4:17 pm
I would like to color equation and eqation number to different color. Every eqation should be blue, and every eqation number should be red. \documentclass{article} \usepackage{amsmath} \usepackage{lipsum} \usepackage{xcolor} \usepackage[colorlinks]{hyperref} \begin{document} \lipsum[1] \begin{equation} E = mc^2 \label{eq:emc} \end{equation} \begin{equation} F = ma \label{eq:fma} \end{equation} \eqref{eq:emc} \eqref{eq:fma} \lipsum[1] \end{document}
- Creating Circular Domains with TikZ [closed]by Assuério Cavalcante on February 10, 2026 at 3:45 pm
First, apologies if this question has been asked before. I'm trying to create an image of a particular circular domain, but my limited TikZ knowledge has made this quite challenging. I've searched for similar examples online without success. Any guidance would be greatly appreciated!
- How to calculate sums in a combination of datatool and expl3 by aggregating a list of available databases?by lukascbossert on February 10, 2026 at 11:51 am
I am using various datatool-databases with sums of funding for different projects and years. My aim is to have a macro with which I can get the sum of either a type or a year. The problem with my approach is that I need to create a list of available databases first, which I can feed to \DTLsumforkeys. Neither \datatool_db_state:nnnn {requestedFunding-\pNumber} {\clist_put_right:Nn \l__project_list_requested_funds_clist {requestedFunding-\pNumber}} {}{} nor its non-expl3-command \DTLifdbexists {requestedFunding-\pNumber} {\clist_put_right:Nn \l__project_list_requested_funds_clist {requestedFunding-\pNumber}} {} is creating the proper list for \l__project_list_requested_funds_clist, which should be requestedFunding-A01,requestedFunding-A02,requestedFunding-B01. The list \l__project_list_requested_funds_clist is then meant to be used in the actual macro calculating the sums. \documentclass{scrartcl} \usepackage{datatool} \usepackage[ mode = match, propagate-math-font = true, reset-math-version = false, reset-text-family = false, reset-text-series = false, reset-text-shape = false, text-family-to-math = true, text-series-to-math = true, tight-spacing = true, group-minimum-digits = 4, group-separator = {,}, %table-format = 6, table-alignment-mode = format, table-auto-round = true, locale =UK, input-decimal-markers = {.}, output-decimal-marker = {.}, input-ignore={,}, parse-numbers = true ]{siunitx} \DTLnewdb{project} \DTLnewrow{project} \DTLnewdbentry{project}{number}{A01} \DTLnewrow{project} \DTLnewdbentry{project}{number}{A02} \DTLnewrow{project} \DTLnewdbentry{project}{number}{B01} \DTLnewrow{project} \DTLnewdbentry{project}{number}{Q01} \DTLnewdb{requestedFunding-A01} \DTLnewrow{requestedFunding-A01} \DTLnewdbentry{requestedFunding-A01}{type}{costs} \DTLnewdbentry{requestedFunding-A01}{sum-year1}{1000} \DTLnewdbentry{requestedFunding-A01}{sum-year2}{2000} \DTLnewrow{requestedFunding-A01} \DTLnewdbentry{requestedFunding-A01}{type}{staff} \DTLnewdbentry{requestedFunding-A01}{sum-year1}{1001} \DTLnewdbentry{requestedFunding-A01}{sum-year2}{2001} \DTLnewdb{requestedFunding-A02} \DTLnewrow{requestedFunding-A02} \DTLnewdbentry{requestedFunding-A02}{type}{costs} \DTLnewdbentry{requestedFunding-A02}{sum-year1}{1000} \DTLnewdbentry{requestedFunding-A02}{sum-year2}{2000} \DTLnewrow{requestedFunding-A02} \DTLnewdbentry{requestedFunding-A02}{type}{staff} \DTLnewdbentry{requestedFunding-A02}{sum-year1}{1001} \DTLnewdbentry{requestedFunding-A02}{sum-year2}{2001} \DTLnewdb{requestedFunding-B01} \DTLnewrow{requestedFunding-B01} \DTLnewdbentry{requestedFunding-B01}{type}{staff} \DTLnewdbentry{requestedFunding-B01}{sum-year1}{1001} \DTLnewdbentry{requestedFunding-B01}{sum-year2}{2001} % intentionally there is no entry for Q01 \begin{document} \DTLdisplaydb{project}\\ \DTLdisplaydb{requestedFunding-A01}\\ \DTLdisplaydb{requestedFunding-A02}\\ \DTLdisplaydb{requestedFunding-B01}\\ \ExplSyntaxOn \clist_new:N \l__project_list_requested_funds_clist \DTLforeach{project}{ \pNumber=number }{ % \DTLifdbexists {requestedFunding-\pNumber} % {\clist_put_right:Nn \l__project_list_requested_funds_clist % {requestedFunding-\pNumber}} % {} \datatool_db_state:nnnn {requestedFunding-\pNumber} {\clist_put_right:Nn \l__project_list_requested_funds_clist {requestedFunding-\pNumber}} {}{} } % Doublecheck: \clist_use:N \l__project_list_requested_funds_clist \NewDocumentCommand{\getSumOverviewFundsCurrent}{smm} { % #2: year % #3: type (staff, costs...) \str_if_eq:nnTF {#2}{all} { \DTLsumforkeys{% \clist_use:N \l__project_list_requested_funds_clist } {sum-year#3}% {\SumOverviewRequestedFunds} } {\DTLsumforkeys[\DTLiseq{\pType}{#3}][ \pType=type %{staff,costs,instrumentation,fellowships,globalfunds} ]{ \clist_use:N \l__project_list_requested_funds_clist } {sum-year#2} {\SumOverviewRequestedFunds}} \IfBooleanTF{#1} {\SumOverviewRequestedFunds} {\tablenum{\SumOverviewRequestedFunds}} } \ExplSyntaxOff \getSumOverviewFundsCurrent*{1}{staff} % expecting here: 3,003 \getSumOverviewFundsCurrent*{2}{staff} % expecting here: 6,003 \getSumOverviewFundsCurrent*{1}{costs} % expecting here: 2,000 \getSumOverviewFundsCurrent*{2}{costs} % expecting here: 4,000 \getSumOverviewFundsCurrent*{all}{staff} % expecting here: 9,009 \getSumOverviewFundsCurrent*{all}{costs} % expecting here: 6,000 \end{document}
- Interesting dashed linesby Dhairya Kumar on February 10, 2026 at 10:50 am
While writing down the above expression on Overleaf, I encountered the problem of drawing the dashed line in between the Left Hand Side and the Right Hand Side expressions. Do help me in writing it exactly that way. (I had written it in my own unique way, but without the dashed line, and would be intrigued to know if such a function existed.) My code & Output: \documentclass{article} \usepackage{amsmath} \begin{document} ARCTAN TERMS: \[\boxed{\sqrt{2}\zeta_1+1 \to \infty \implies \tan^{-1}(\sqrt{2}\zeta_1+1)\rightarrow \dfrac{\pi}{2}}\text{ and } \boxed{\sqrt{2}\zeta_1+1 \rightarrow -\infty \implies \tan^{-1}(\sqrt{2}\zeta_1+1)\to \dfrac{-\pi}{2}}\] \[\boxed{\sqrt{2}\zeta_1-1 \to \infty \implies \tan^{-1}(\sqrt{2}\zeta_1-1)\rightarrow \dfrac{\pi}{2}}\text{ and } \boxed{\sqrt{2}\zeta_1-1 \rightarrow -\infty \implies \tan^{-1}(\sqrt{2}\zeta_1-1)\to \dfrac{-\pi}{2}}\] Hence, \[\text{ Arctan terms evaluates to } \frac{\sqrt{2}}{4}\left(\frac{\pi}{2}+\frac{\pi}{2}-\left(\frac{-\pi}{2}-\frac{\pi}{2}\right)\right)=\frac{\pi}{\sqrt2}\] \end{document} Output:
- Rows of 'cases' environment too close to each otherby Dhairya Kumar on February 10, 2026 at 6:10 am
I have an issue in typing the above equation in LaTeX, where the two rows of the cases environment are so close that they almost touch. Help me do it in a clean way. Code: \[ \boxed{ \displaystyle\int\limits_{0}^{\pi/2}\sin^{n}{x}dx= \displaystyle\int\limits_{0}^{\pi/2}\cos^{n}{x}dx= \begin{cases} \dfrac{n-1}{n}\cdot\dfrac{n-3}{n-2}\cdots \dfrac45 \cdot\dfrac23 \text{ if $n$ is odd}\\ \dfrac{n-1}{n}\cdot\dfrac{n-3}{n-2}\cdots \dfrac34 \cdot\dfrac12\cdot \dfrac{\pi}{2}\text{ if $n$ is even} } \]
- How can the roots of a quadratic equation be written in radical form?by Laurenso on February 10, 2026 at 3:52 am
I am trying to express the roots of a quadratic equation `t^2-3t-7=0' in radical form. I tried \documentclass[12pt]{article} \usepackage{polexpr} \usepackage{xint} \begin{document} \poldef f(t) = t^2-3t-7; \xintdefvar a = (f(2)-2*f(1)+f(0))/2; \xintdefvar c = f(0); \xintdefvar b = reduce(f(1)-a-c); \xintdefvar delta = b^2 - 4*a*c; \xintdefvar t1=reduce((-b+sqrt(delta))/2/a); \xintdefvar t2=reduce((-b-sqrt(delta))/2/a); \[\xinteval{t1}, \quad \xinteval{t2}\] \[t=\frac{1}{2} \left(3-\sqrt{37}\right)\lor t=\frac{1}{2} \left(3+\sqrt{37}\right).\] \end{document} I got How can I get?
- How to create a rectangle without tikzpicture [closed]by PureVessel on February 9, 2026 at 5:44 am
I'm translating Kazakh problems for the Art of Problem Solving forum, and I faced an obstacle with this problem: It translates like: Aigerim and Batyrkhan play the following game. There is a board of size $2\times2024$ (2 rows and 2024 columns). They take turns, with Aigerim moving first. On her move, Aigerim places a horizontal domino on the board $\boxed{\phantom{a}}\boxed{\phantom{a}}$, covering exactly two squares. On his move, Batyrkhan places a vertical domino on the board $\begin{aligned} \fbox{\rule{0pt}{1.2em}\hspace{1.2em}}[0em] \fbox{\rule{0pt}{1.2em}\hspace{1.2em}} \end{aligned}$, also covering exactly two squares. A player who cannot make a move loses. (Dominoes may be placed only on empty squares.) Who wins if both players play optimally? and I don't know how to do the vertical domino without separation between the squares. AoPS doesn't support features like tikzpicture, so I need to come up with a different method.
- Standard practices in label decluttering: overcoming overlapping label linesby Jasper on February 8, 2026 at 11:59 pm
I have a situation where I want to lable the sample points of a line segment, and also label the smaller line segments connecting those sample points. My labels are really cluttered right now. How can I make this more proper? \documentclass[tikz,border=1cm]{standalone} \begin{document} \begin{tikzpicture} \draw[thick,->] (-1,0) -- (5,0) node[below left] {\(x\)}; \fill (0.5,0) circle[radius = 3pt] node[above] {point}; \fill[gray] (0.5,0) circle[radius = 1.5pt]; \draw[] (0.5,0) -- (0.5,-2) -- (5,-2) node[right] {individual sample point}; \draw[line width = 6pt] (2,0) -- (3.5,0) node[above,pos=0.5]{line segment}; \foreach[count = \c from 1] \x in {2,2.5,...,3.5} { \fill[gray] (\x,0) circle[radius = 1.5pt]; \draw[] (\x,0) -- (4,-1); \ifnum\c=4\else\draw[thick,gray] (\x,0) -- ++(0.5,0);\fi } \draw[](4,-1) -- (5,-1) node[right] {multiple sample points}; \foreach[count = \c from 1] \x in {2.25,2.75,...,3.25} { \draw[] (\x,0) -- (4,-1.5); } \draw[](4,-1.5) -- (5,-1.5) node[right] {one or more line segments}; \end{tikzpicture} \end{document}