Hot
- Why lipsum package use changes decimal separator in spanish?by Mika Ike on July 28, 2026 at 5:00 pm
Why lorem/lipsum use makes that spanish decimmal is not comma, as expected. \documentclass[12pt,a4paper]{article} \usepackage[spanish,es-notilde,]{babel} %\spanishdecimal{,} \usepackage{amsmath,mathtools} \usepackage{amssymb} \usepackage{siunitx} \sisetup{output-decimal-marker={,}} \usepackage{lipsum} \begin{document} \lipsum[1] \textbf{If you comment the previous \texttt{lipsum[1]} you obtain comma as decimal separator in the next 2 lines, as expected in spanish.} Decimal: $\dfrac{7}{4}\approx 1.75$ $\angle{3.4;2}$ No problem in the next lines: $\ang{3.4;2}$ $\num{5.5}$ \end{document}
- Prevent listings background from changing custom footnoterule backgroundby umarcor on July 28, 2026 at 2:14 pm
In the following Minimal Working Example (MWE), the length of the footnoterule is changed by renewing the command. When listings is used with a coloured background, and if a code block is cut at the end of a page, sometimes the footnoterule gets the background of the code. Note that changing the second lipsum to \lipsum[1][1-7] produces a correct result, while \lipsum[1][1-8] to \lipsum[1][1-11] all incorrectly colour the background of the footnoterule. \documentclass{report} \usepackage{lipsum} \usepackage{xcolor} \renewcommand*{\footnoterule}{ \noindent\rule{14mm}{0.4pt}\hfill\addvspace{.5\baselineskip} } \usepackage{listings} \lstset{ language=C, backgroundcolor=\color{gray!25}, } \begin{document} This is some regular text\footnote{With a footnote.}. \lipsum[1-4] \lipsum[1][1-8] \begin{lstlisting} #include <stdio.h> #include <stdlib.h> int main () { printf("Hello!\n"); return 0; } \end{lstlisting} \end{document}
- Spacing is too small when using TeX Gyre Termes Math fontby Muhannad Al Ayoubi on July 28, 2026 at 2:01 pm
I have noticed that when using the TeX Gyre Termes Math font, the spacing is too small. As you can see below, the letter j is practically jammed into the absolute value bars, as well as the ordinary square and round brackets. Is this the expected behavior of the font? If yes, is there a way to fix it? MWE: \documentclass{book} \usepackage{unicode-math} \setmainfont{TeX Gyre Termes}[Scale=1] \setmathfont{TeX Gyre Termes Math}[Scale=1] \begin{document} \[ \lvert j^2 - 1 \rvert \] \[ [j^2+1] \] \[ (j^2+1) \] \end{document}
- Need to print footnote after frontmatter using article class fileby GowriSaro on July 28, 2026 at 1:24 pm
This is related with my previous post: Footnote in "Abstract" - Article Class file and ftnright thanks to Ulrike The situation is not to change the existing tags and the footnote should be print with the body part with rightside algnment, for this, have tried with: \documentclass[twocolumn]{article} \usepackage{lipsum} \usepackage{ftnright} \usepackage{footnote} \begin{document} \twocolumn[ \begin{@twocolumnfalse} \title{Article Title} \author{Author Name} \maketitle \abstract{\savenotes Abstract text. This\protect\footnote{Footnote text} is for test text for abstract part. Abstract text. This is for test text for abstract part. Abstract text. This is for test text for abstract part. Abstract text. This is for test text for abstract part. Abstract text. This is for test text for abstract part. } \bigskip \end{@twocolumnfalse} ] \spewnotes \lipsum[1-2] \end{document} but received the error message as: ! Extra }, or forgotten \endgroup. <argument> ...s for test text for abstract part. } \par \bigskip \par \end {... l.26 ] How can I meet the requirement? please suggest
- columns longer than a pageby Sergi Espinosa Polo on July 28, 2026 at 12:12 pm
I have the following question. I have been looking in other places and I can't find anything similar (or I don't know how to look for it). I want to make a table with two columns and one row, so that I can buy a text in medieval Catalan and the Latin translation. I had thought about making a table, but I have a problem. The columns go beyond the page and, then, they appear cut off and do not continue on another page (as would happen with Word). Is there any way to make this document look like the one in Word that I am attaching? Thank you very much This is my code: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{longtable} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{longtable}{|p{0.47\textwidth}|p{0.47\textwidth}|} \hline \lipsum[1] \par \lipsum[1] \par \lipsum[1] \par \lipsum[1] & \lipsum[1] \par \lipsum[1] \par \lipsum[1] \par \lipsum[1] \par \end{longtable} \lipsum[1-2] \end{document}
- Footnote in "Abstract" - Article Class file and ftnrightby GowriSaro on July 28, 2026 at 9:43 am
I'm having several files which are in same format, in those, \footnote are tagged inside abstract, but I need to display those footnotes in the rightside of the page, I tried with: \documentclass[twocolumn]{article} \usepackage{lipsum} \usepackage{ftnright} \usepackage{footnote} \begin{document} \twocolumn[ \begin{@twocolumnfalse} \title{Article Title} \author{Author Name} \maketitle \begin{abstract}\savenotes Abstract text. This\protect\footnote{Footnote text} is for test text for abstract part. Abstract text. This is for test text for abstract part. Abstract text. This is for test text for abstract part. Abstract text. This is for test text for abstract part. Abstract text. This is for test text for abstract part. \end{abstract} \end{@twocolumnfalse} ] \spewnotes \lipsum[1-2] \end{document} This code produced the error as ! LaTeX Error: \begin{abstract} on input line 26 ended by \end{@twocolumnfalse} . See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. Please suggest how can I meet the requirement without changing the existing code.
- Necesessarily high-sampled curve in plain TikZby Jasper on July 28, 2026 at 6:34 am
I was making a rational double pendulum in Asymptote: // a rational double pendulum import graph; unitsize(3cm); pair truncated_pi(real t) { real t1 = 3.14 * t; return ( cos(t) + cos(t1), sin(t) + sin(t1) ); } path f = graph(truncated_pi, 0, 314, n=10000); draw(f); I wanted to make it in TikZ, but I am running into the issue of needing a number of samples which is beyond the limit imposed by pgfmath. As some of you may be familiar with, I am very fond of plain TikZ. I would like to see if there are ways to achieve this which are not overly ad hoc. For example, one strategy would be to break the domain into separate regions. How would one draw something like this in the spirit of plain TikZ? \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw[ domain=0:314, samples=10000, trig format=rad, declare function={ t1(\x) = 3.14 * \x; x(\x) = cos(\x) + cos(t1(\x)); y(\x) = sin(\x) + sin(t1(\x)); } ] plot ({x(\x)},{y(\x)}); \end{tikzpicture} \end{document}
- How to do single variable domain detection using the package luacas?by Jasper on July 28, 2026 at 1:59 am
How to do single variable domain detection using the package luacas? Expected result: (-infty,0)U(0,infty) \documentclass{article} \usepackage{luacas} \begin{document} \begin{CAS} vars('x') f = x*e^(1/x) \end{CAS} The domain of \(f\) is ... (I want to know). \end{document}
- How can I align the caption of a figure in a enumerateby Hailey Richardson on July 28, 2026 at 12:03 am
I'm learning LaTeX and am currently trying to format my document according to APA 7th-edition guidelines. I would like to know whether it is correct for a figure in an enumerate environment to appear as shonw below. I would like the caption to be aligned with the text of the enumerated item, but I don't know whether this is possible—or even correct—under APA 7 guidelines.
- Changing the words checked for word repetition in TexStudioby user445996 on July 28, 2026 at 12:01 am
Is there a way to change the kinds of words that the word repetition checker looks for? I like that it will help add variety (e.g. the overuse of very) and find any accidental duplicated words (e.g. "the the tree...") but function words like articles and prepositions can naturally occur frequently (e.g. "the first of the two options..." or "the crown of the king of England"). I dislike seeing the indication that I have a supposed error, and while some can be avoided, not all can be. Is there a way to fix this or is this just something I will have to learn to ignore? It makes me second guess myself unnecessarily.
- Multiple tables with same column widths [closed]by Tristan on July 27, 2026 at 10:50 pm
I am currently writing a linguistic document for which I will need to include multiple tables showing the inflection of various classes of word. I want to be able to have multiple noun declension tables, adjective declension tables, and verb inflection tables throughout the document, and for each table of a given type to have corresponding columns with the same widths (if I overlay one table of a given type over another, the column edges should line up). I.e. I have tables belonging to three types, A, B, & C. Each table of a given type has the same number of rows and columns. I want to ensure that each table of a given type is rendered with the same column widths (ideally this would not have to be set manually by me, but determined based on the widest text placed in a given column in a table of that type). The different types of tables may be interspersed with each other, and tables of a given type might occur in different chapters, so any solution would need to be able to handle that. A minimum example: \documentclass{article} \setlength\parindent{0pt} \begin{document} \begin{tabular}{ r l l} Case & Singular & Plural \\ \hline Nominative & -foo & -bar \\ Accusative & -foo & -bar \\ Genitive & -foo & -bar \\ \end{tabular}\\ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dictum, mauris id cursus interdum, ligula libero tristique nisi, eget accumsan risus diam et erat. Nulla dignissim neque a accumsan tincidunt. Integer eleifend vel ante porta fringilla. Praesent et venenatis enim, eget vehicula lorem. Curabitur cursus condimentum sagittis. Curabitur eget facilisis massa. Phasellus vitae scelerisque neque. Pellentesque quis magna sed neque mattis tincidunt.\\ \begin{tabular}{ r l l l l l l} Tense & 1sg & 2sg & 3sg & 1pl & 2pl & 3pl \\ \hline Present & -foo & -foo & -foo & -bar & -bar & -bar \\ Past & -foo & -foo & -foo & -bar & -bar & -bar \\ Future & -foo & -foo & -foo & -bar & -bar & -bar \\ \end{tabular}\\ Donec vitae risus id eros consectetur gravida eget nec erat. Fusce condimentum, sapien id vulputate ultricies, felis lacus sagittis elit, sit amet accumsan purus ante dapibus magna. Cras nec quam ac diam dapibus elementum sit amet vitae turpis. Praesent bibendum eleifend imperdiet. Etiam sit amet congue libero. Donec at mauris vitae mi tristique rhoncus sit amet sed turpis. Phasellus sed velit nec sem sodales molestie. Ut gravida, lorem at euismod elementum, lectus massa viverra dui, a ultrices arcu nulla nec arcu. \\ \begin{tabular}{ r l l} Case & Singular & Plural \\ \hline Nominative & -a-really-long-ending & -bar \\ Accusative & -foo & -bar \\ Genitive & -foo & -bar \\ \end{tabular}\\ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dictum, mauris id cursus interdum, ligula libero tristique nisi, eget accumsan risus diam et erat. Nulla dignissim neque a accumsan tincidunt. Integer eleifend vel ante porta fringilla. Praesent et venenatis enim, eget vehicula lorem. Curabitur cursus condimentum sagittis. Curabitur eget facilisis massa. Phasellus vitae scelerisque neque. Pellentesque quis magna sed neque mattis tincidunt.\\ \begin{tabular}{ r l l l l l l} Tense & 1sg & 2sg & 3sg & 1pl & 2pl & 3pl \\ \hline Present & -foo & -foo & -foo & -bar & -bar & -bar \\ Past & -foo & -foo & -something-that's long & -bar & -bar & -bar \\ Future & -foo & -foo & -foo & -bar & -bar & -bar \\ \end{tabular}\\ \end{document} The first and third table are of the same type, and the second & fourth table are of the same type. Because of this, the two Singular columns of the first and third tables should be of the same width, but because the third table has a longer ending in the table, its Singular column is much longer. Likewise, the 3sg columns of the second and third tables should have the same width, but in the fourth table it's much wider. As seen here, tables of a given type may be separated by other tables (including other tables of a repeating type). There might also be chapter/section/subsection boundaries between the tables of a given type.
- Why does helvratio not work when using newtx?by Muhannad Al Ayoubi on July 27, 2026 at 9:08 pm
It seems passing the option helvratio to \usepackage{newtxtext} does not really change anything. I am writing a textbook and have been experimenting with making the step-by-step explanations sans serif to add some contrast. However the sans serif font is too big, and no matter what I set helvratio to, nothing changes. I thought to try the sans serif font outside of the align environment, but after compiling and recompiling with different helvratios, again nothing changes. So I have resorted to using \scriptsize which I find very inappropriate because it also shrinks the mathematical text (the math included in the first explanation is nonsense, just for the MWE). I am compiling using LuaLaTeX as I believe that is relevant. Here is my MWE: \documentclass[10pt]{book} \usepackage{amsmath} \usepackage[scaled=0.9,helvratio=0.8]{newtxtext} % No matter how I change helvratio, nothing actually changed when I compile. \usepackage[scaled=0.9,vvarbb]{newtxmath} \begin{document} Begin by studying the expression $6x-2$ very well. Notice that it involves two operations: firstly, you multiply by 6, then you subtract by 2. By applying the same steps to the given inequality $x>1$, you can easily prove the statement. \begin{align*} x & > 1 && \text{\scriptsize\sffamily Original condition $x=6$ and $y-7<0$.} &&& \\ 6x & > 6 && \text{\scriptsize\sffamily Multiply each side by 6.} &&& \\ 6x-2 & > 4 && \text{\scriptsize\sffamily Subtract 2 from each side.} &&& \end{align*} $6x-2$ is greater than a positive number, so it must itself be positive. \end{document} (Side note: I am aware it is not good practice to mix sans serif text with serif math, but I could not change the math font only within sans serif environments.) Edit: It seems this problem is only affecting me, and I am not sure why. I have tried recompiling with helvratio=1.5 and helvratio=0.5, and that still results in, as you can see below, the same exact font size. Edit 2: My TeX version is MiKTeX-TeX 4.9 (MiKTeX 26.5). Here is my \listfiles: *File List* book.cls 2025/01/22 v1.4n Standard LaTeX document class bk10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) newtxtext.sty 2024/04/01 v1.744(Michael Sharpe) latex and unicode latex supp ort for TeXGyreTermesX xpatch.sty 2020/03/25 v0.3a Extending etoolbox patching commands expl3.sty 2026-04-28 L3 programming layer (loader) l3backend-luatex.def 2026-02-18 L3 backend support: PDF output (LuaTeX) xparse.sty 2025-10-09 L3 Experimental document command parser etoolbox.sty 2025/10/02 v2.5m e-TeX tools for LaTeX (JAW) xcolor.sty 2024/09/29 v3.02 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration luatex.def 2025/09/29 v1.2f Graphics/color driver for luatex mathcolor.ltx iftex.sty 2024/12/12 v1.0g TeX engine tests xkeyval.sty 2022/06/16 v2.9 package option processing (HA) xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) textcomp.sty 2024/04/24 v2.1b Standard LaTeX package xstring.sty 2023/08/22 v1.86 String manipulations (CT) ifthen.sty 2024/03/16 v1.1e Standard LaTeX ifthen package (DPC) scalefnt.sty binhex.tex fontspec.sty 2025/09/29 v2.9g Font selection for XeLaTeX and LuaLaTeX fontspec-luatex.sty 2025/09/29 v2.9g Font selection for XeLaTeX and LuaLaTeX fontenc.sty 2025/07/18 v2.1d Standard LaTeX package fontspec.cfg TeXGyreTermesX.fontspec supp-pdf.mkii ***********
- How can I filter a spline surface by a plane in Asymptote?by Jasper on July 27, 2026 at 5:50 pm
How can I filter a spline surface by a plane in Asymptote? import graph3; unitsize(1cm); currentprojection = orthographic(0,2,1); // Function to generate a point on the unit sphere triple sphere(real azimuth, real polar) { return ( cos(polar) * cos(azimuth), cos(polar) * sin(azimuth), sin(polar) ); } // Helix function triple helix(real t) { return ( 2 * cos(t), // x-coordinate 2 * sin(t), // y-coordinate t // z-coordinate ); } // Define the helix path path3 thehelix = graph(helix, 0, 4*pi); draw(thehelix); // Helicoid function triple helicoid(pair uv) { real t = uv.x; real theta = uv.y; return ( helix(t).x + sphere(t,theta).x, helix(t).y + sphere(t,theta).y, helix(t).z + sphere(t,theta).z ); } // Create the surface of the helicoid surface thehelicoid = surface(helicoid, (0, -3pi/2), (4*pi, 0pi), Spline); draw(thehelicoid, surfacepen=material(white, emissivepen=0.2 white)); triple myplane(pair uv) { return ( uv.x, uv.y, uv.x+2*uv.y+5 ); } surface themyplane = surface(myplane, (-5, -5), (5, 5), Spline); draw(themyplane, surfacepen=material(white, emissivepen=0.2 blue)); I want to remove the the portion of the helix which is beyond the boundary of the half-space on one side of the plane.
- Draw custom listings caption with tikz over the backgroundby umarcor on July 27, 2026 at 3:21 pm
I'm trying to customise listings captions using tikz, but the background of the code listing is drawn afterwards, covering the tikz caption. How can I ensure the caption to be drawn after/over the code? This is what I want to achieve: The Minimal Working Example (MWE) below shows where I got so far. In the orange examples (adding 4ex before and -5ex after) the tikz picture is properly aligned with the frame/background of the code; however, it's drawn below. Moreover, the vertical space between the previous text and the listing is the same in the cyan and red examples, but it's slightly increased in the orange examples, which I don't understand. On the other hand, the magenta examples use just -1ex before (no forced vertical spacing after) and are properly aligned with the frame/background of the code; but they require several \noparskip to avoid excessive vertical space from the previous text/title, which I neither understand. \documentclass[twoside,openright,11pt]{report} \usepackage[a4paper,margin=2cm]{geometry} \usepackage{filecontents} \edef\restoreparindent{\parindent=\the\parindent\relax} \RequirePackage{parskip} \restoreparindent \newcommand*{\noparskip}{\par\vspace{-\parskip}} \usepackage{fontawesome} \usepackage[dvipsnames,table]{xcolor} \usepackage{tikzpagenodes} % Loads tikz \usetikzlibrary{calc} \usepackage{caption} \usepackage{listings} \lstset{ language=C, basicstyle=\ttfamily, backgroundcolor=\color{gray!5}, frame=single, framerule=0pt, framesep=1ex, xleftmargin=1ex, xrightmargin=1ex, } \captionsetup[lstlisting]{ font={footnotesize,bf}, justification=raggedleft, singlelinecheck=false } \newcommand*\lstc[1]{\noparskip\lstinputlisting[firstline=5, caption = \faFileCodeO~\lstname]{#1}} \DeclareCaptionFormat{rulebox}{% \parbox{\linewidth}{% \makebox[\linewidth]{% \leaders\hrule height 0.5pt\hfill~#1#2#3% }% }% } \DeclareCaptionFormat{tikzrule}{% \begin{tikzpicture}[remember picture, overlay] \node[blue, anchor=east] (P) {#1#2#3}; \draw[blue] (current page text area.west|-0,0) -- (P); \end{tikzpicture} } \DeclareCaptionFormat{tikzrulebox}{% \begin{tikzpicture}[remember picture, overlay] \node[green, draw, anchor=north east] (P) {#1#2#3}; \draw[green] (current page text area.west|-0,0) -- (P.north west); \end{tikzpicture}% } \DeclareCaptionFormat{tikzruleboxpoff}{% \vspace*{4ex} \begin{tikzpicture}[remember picture, overlay] \node[cyan, draw, anchor=north east] (P) {#1#2#3}; \draw[cyan] (current page text area.west|-0,0) -- (P.north west); \end{tikzpicture}% } \DeclareCaptionFormat{tikzruleboxpoffn}{% \vspace*{4ex} \begin{tikzpicture}[remember picture, overlay] \node[red, draw, anchor=north east] (P) {#1#2#3}; \draw[red] (current page text area.west|-0,0) -- (P.north west); \end{tikzpicture}% \vspace*{-4ex} } \DeclareCaptionFormat{tikzruleboxpoffnd}{% \vspace*{4ex} \begin{tikzpicture}[remember picture, overlay] \node[orange, draw, anchor=north east] (P) {#1#2#3}; \draw[orange] (current page text area.west|-0,0) -- (P.north west); \end{tikzpicture}% \vspace*{-5ex} } \DeclareCaptionFormat{tikzruleboxnoff}{% \vspace{-1ex} \begin{tikzpicture}[remember picture, overlay] \node[magenta, draw, anchor=north east] (P) {#1#2#3}; \draw[magenta] (current page text area.west|-0,0) -- (P.north west); \end{tikzpicture}% } \begin{filecontents}{main.c} #include <stdio.h> #include <stdlib.h> int main () { printf("Hello!\n"); return 0; } \end{filecontents} \begin{document} \hrule \section*{Section title} \hrule \captionsetup[lstlisting]{format=rulebox} \lstc{main.c} \vspace*{5ex} \captionsetup[lstlisting]{format=tikzrule} \hrule TikZ Rule \hrule \lstc{main.c} \vspace*{5ex} \captionsetup[lstlisting]{format=tikzrulebox} \hrule TikZ Rule Box \hrule \lstc{main.c} \vspace*{5ex} \captionsetup[lstlisting]{format=tikzruleboxpoff} \hrule 4ex TikZ Rule Box \hrule \lstc{main.c} \vspace*{5ex} \captionsetup[lstlisting]{format=tikzruleboxpoffn} \hrule 4ex TikZ Rule Box -4ex (with rule) \hrule \lstc{main.c} \hrule 4ex TikZ Rule Box -4ex (no rule) \noparskip% \lstc{main.c} \newpage \captionsetup[lstlisting]{format=tikzruleboxpoffnd} \hrule 4ex TikZ Rule Box -5ex (with rule) \hrule \lstc{main.c} \hrule 4ex TikZ Rule Box -5ex (no rule) \noparskip% \lstc{main.c} \vspace*{5ex} \captionsetup[lstlisting]{format=tikzruleboxnoff} \hrule TikZ Rule Box N off (with hrule) \hrule \noparskip% \lstc{main.c} \hrule TikZ Rule Box N off (no hrule) \noparskip% \noparskip% \lstc{main.c} \end{document} EDIT Applying the solution proposed by @kabenyuk below, it works nicely except if the lstlisting needs to be located at the top of a page. In such case, the caption is put at the top of the current page and the code at the top of the next one. \documentclass{report} \usepackage{filecontents} \usepackage{lipsum} \usepackage{xcolor} \usepackage{tikzpagenodes} % Loads tikz \usetikzlibrary{calc} \usepackage{caption} \usepackage{listings} \lstset{ language=C, backgroundcolor=\color{gray!5}, } \newcommand*\lstc[1]{\lstinputlisting[caption = \lstname]{#1}} %% Deferred drawing of TikZ captions \makeatletter % A number unique to each TikZ caption. \newcount\lstcaption@id % Store the caption contents and mark its position. \newcommand*{\lstcaption@store}[1]{% \global\advance\lstcaption@id\@ne \edef\lstcaption@thisid{\the\lstcaption@id}% % Create a separate box for each caption, since one page may contain several listings. \expandafter\newsavebox \csname lstcaption@box@\lstcaption@thisid\endcsname \global\setbox \csname lstcaption@box@\lstcaption@thisid\endcsname = \hbox{#1}% % Only the coordinate is placed here. The actual drawing will be produced later. \begin{tikzpicture}[remember picture,overlay] \coordinate (lstcaption@pos@\lstcaption@thisid) at (0,0); \end{tikzpicture}% } \newcommand*{\lstcaption@draw}[1]{% \begin{tikzpicture}[remember picture,overlay] \node[draw, opacity=.75, anchor=north east] (P) at (lstcaption@pos@#1) {\copy\csname lstcaption@box@#1\endcsname}; \draw[opacity=.75] (current page text area.west|-P.north west) -- (P.north west); \end{tikzpicture}% } \DeclareCaptionFormat{tikzrulebox}{% % Store a caption and schedule it to be drawn in the foreground layer of the page. \lstcaption@store{#1#2#3}% \edef\lstcaption@tmp{% \noexpand\AddToHookNext{shipout/foreground}{% \noexpand\lstcaption@draw{\lstcaption@thisid}% }% }% \lstcaption@tmp } \makeatother \captionsetup[lstlisting]{ format=tikzrulebox, justification=raggedleft, singlelinecheck=false, aboveskip=-1ex, } \begin{filecontents}{main.c} #include <stdio.h> #include <stdlib.h> int main () { printf("Hello!\n"); return 0; } \end{filecontents} \begin{filecontents}{another.c} #include <stdio.h> int main () { printf("Bye!\n"); } \end{filecontents} \begin{document} \section*{Section title} \lstc{main.c} This is some regular text. \lstc{main.c} \lipsum[1-2] \lipsum[1][1-5] \lstc{another.c} \end{document}
- System upgrade introduced a new error: \scr@tso@lstlisting@linefill undefinedby Marijn on July 27, 2026 at 2:35 pm
I have a .tex file that used to compile (here is the full file), but since an upgrade of my Debian system, which I assume pulled in some new version of LaTeX packages, it fails to build with this error when I run xelatex on it: ! LaTeX Error: Command \scr@tso@lstlisting@linefill undefined. That looks like some internal issue in koma-script/tocbasic.sty, but my understanding of LaTeX isn't enough to know what to do about it. That sty file looks like it checks for this command being undefined and then defines it, yet here I am with the error. I'd be grateful for a proper solution, of course, but also satisfied with a crude hack to suppress this error so that my pdf file builds again. Edit: This is a minimal reproduction. Seems that both listings and arabxetex have to be present to trigger the error. \documentclass{scrbook} \usepackage{listings} \usepackage{arabxetex} \begin{document} \end{document} Further edit: The suggested fix of adding a line like this... \makeatletter \def\scr@tso@lstlisting@linefill{} \def\scr@tso@lstlisting@pagenumberformat#1{} \makeatother ... avoids this issue, but somehow affects pdfpages in a way that breaks \includepdf.
- Automatic Title Case [duplicate]by M0M0 on July 27, 2026 at 12:48 pm
I found this old question, which shows how to unconditionally capitalize words in section titles. However, title case normally does not capitalize every word, but, i.e., the Chicago Manual of Style recommends to not capitalize articles and conjunctions (among other exceptions). Is there maybe a package that achieves this? It's probably not to hard to code this with latex3, since in the end we have to capitalize every word which is not in some sort of ignore-list, but if someone has already done the work I would be happy to use it. Getting this to work well with toc entries and hyperref, might or might not be difficult.
- Some math symbols in Beamer using fibeamerby user445962 on July 27, 2026 at 12:48 pm
I'm using fibeamer and it seems that some symbols (like \leqslant for instance) that seem not changed according to the font, that is, by comparing the symbol "<" with fibeamer font and the same symbol with regular font (Computer Modern I presume), there are differences. However, the same does not occur with \leqslant. There is a way to overcome this?
- LaTeX package for following symbolsby mxguette on July 27, 2026 at 8:11 am
I was just wondering what LaTeX package (if it's LaTeX at all) the following large straight parentheses and vertical integral symbols are from. These are my (very many) current latex packages and commands and stuff: \usepackage{graphicx} \usepackage{pgfplots} \graphicspath{{images/}} \usepackage{pgfplots} \usepackage{pdfpages} \usepackage[margin=2.5cm]{geometry} \usepackage{microtype} \usepackage{array} \usepackage{newtxtext} \usepackage{amssymb} \usepackage{amsmath} \pdfmapfile{=mtpro2.map} \usepackage[lite,subscriptcorrection,looser]{mtpro2} \usepackage{placeins} \usepackage{enumitem} \usepackage{delarray} \setlength{\parindent}{0pt} \newcommand{\qmarks}[1]{\hfill\mbox{\textbf{#1}}} \renewcommand{\thepage}{--\,\arabic{page}\,--} \usepackage{accents} \DeclareFontFamily{OMX}{cmex}{} \DeclareFontShape{OMX}{cmex}{m}{n}{<-> cmex10}{} \DeclareSymbolFont{thindelims}{OMX}{cmex}{m}{n} \DeclareMathDelimiter{(}{\mathopen} {operators}{"28}{thindelims}{"00} \DeclareMathDelimiter{)}{\mathclose}{operators}{"29}{thindelims}{"01} \renewcommand{\arraystretch}{1.2} \delimiterfactor=1000 \delimitershortfall=0pt \DeclareFontFamily{OML}{ntxmi}{} \DeclareFontShape{OML}{ntxmi}{m}{it}{<-> ntxmi}{} \DeclareSymbolFont{newtxletters}{OML}{ntxmi}{m}{it} \DeclareMathSymbol{z}{\mathalpha}{newtxletters}{`z} \DeclareMathSymbol{u}{\mathalpha}{newtxletters}{`u} \DeclareMathSymbol{v}{\mathalpha}{newtxletters}{`v} \DeclareSymbolFont{thinsymbols}{OMS}{cmsy}{m}{n} \DeclareMathRadical{\ssqrt}{thinsymbols}{"70}{thindelims}{"70} \DeclareSymbolFont{newtxpi}{OML}{ntxmi}{m}{it} \let\oldpi\relax \DeclareMathSymbol{\oldpi}{\mathord}{newtxpi}{"19} \renewcommand{\pi}{\ensurepath{\oldpi}} \DeclareMathSizes{12}{12}{9}{7}
- I want to do a matrix multiplication (rotation, Rodriguez) on a sphere in Asymptoteby Jasper on July 27, 2026 at 3:03 am
I wrote my question in a comment within the following Asymptote code. My goal is to do a matrix multiplication (rotation, Rodriguez) on a sphere I made in Asymptote, without changing the camera. Rodriguez rotation is angle by axis, as opposed to Euler, which is by standard axes in a specific order. Also, any explanation as to why this is rather slow? I think it would be even clearer to pose this as a multiplication on an arbitrary triple. import three; unitsize(5cm); currentprojection=orthographic(1,2,3); /* draw((0,0) -- (1,1)); label("\(a\)", (0,1), (-1,-1)); draw((0,0)..controls (0,1) and (1,1)..(1,0)); */ triple SP(triple point){ return ( point.x / (1 - point.z), point.y / (1 - point.z), 0 ); } triple ISP(triple point){ real temp = point.x^2 + point.y^2; return ( 2 * point.x / (1 + temp), 2 * point.y / (1 + temp), (-1 + temp) / (1 + temp) ); } for(int i=-10; i<=10; ++i){ for(real j=-10; j<=10; j += 0.1){ if(j!=10){ draw(ISP((i,j,0)) -- ISP((i,j+1/10,0))); draw(ISP((j,i,0)) -- ISP((j+1/10,i,0))); /* My motivation in asking this question is to perform a general axis-angle (Rodriguez) transformation to this Riemann sphere, without changing the camera projection. I want to use a matrix multiplication, hopefully through a build in method with operator overloading and everything. */ } } }
- Followup Question to Placing an Inline Tcolorboxby DDS on July 26, 2026 at 7:45 pm
This is a follow-up to the question posed here: How to Place a Tcolorbox Inline Next to a Title? Consider the following code which incorporates the suggestion of Ulrike Fischer: \documentclass[12pt]{book} \usepackage{scalefnt,color} \usepackage[many]{tcolorbox} \begin{document} \thispagestyle{empty} {\color{red} \scalefont{2.00}{\textbf{\textsl{TITLE1}}}}\\[20pt] \scalebox{1.87}{\textbf{\Huge{Title2}}} \tcbox[nobeforeafter,colback=yellow,width=0.75in,height=0.75cm]{Inline tcolorbox} %\tcbox[nobeforeafter,colback=yellow,width=1.75in,height=0.75cm]{Inline tcolorbox} \end{document} Which seems to produce the desired output: However, when I try to adjust width=0.75in to, say, width=1.75in, there appears to be no change in the width of the tcolorbox. Moreover, if I delete width=0.75in and run the code, the output appears to be very much the same as that displayed. QUESTION: Am I doing something wrong? The log file indicates "Process exited normally". How should I encode a change of width in the inline tcolorbox? Thank you.
- Keep track of the number of chapters in each partby umarcor on July 26, 2026 at 2:48 pm
In the following Minimal Working Example (MWE), I'd like to keep track of the totvalue of chapcnt within each part (since chapcnt is set to 0 at the beginning of each part). Currently, \totvalue{chapcnt} returns the number of chapters in the last part (the maximum after it is last reset in the document). \documentclass[twoside]{report} \let\latexthesection\thesection \renewcommand*{\thesection}{\arabic{section}} \usepackage{titlesec} \titleclass{\part}{top} \titleformat{\part}{\Huge\bfseries\color{blue}}{\thepart}{10pt}{} \titleclass{\chapter}{top} \titleformat{\chapter}{\Huge\bfseries\color{green}}{\thechapter}{10pt}{} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{totcount, eso-pic, xifthen} \regtotcounter{partcnt} \newcounter{partcnt} \regtotcounter{chapcnt} \newcounter{chapcnt} \AddToShipoutPictureBG{% \begin{tikzpicture}[overlay] \ifthenelse{\isodd{\value{page}}}% {\def\corner{east}\def\sign{-}}% {\def\corner{west}\def\sign{+}} \pgfmathsetlengthmacro{\parttabheight}{\paperheight/\totvalue{partcnt}} \pgfmathsetlengthmacro{\parttaboffset}{(\thepartcnt-1)*\parttabheight} \fill[blue] ($(current page.north \corner)+(0,-\parttaboffset)$) rectangle ++(\sign.40,-\parttabheight); % FIXME Chapters should be counted within the part, thus keeping one chapter totvalue per part to adjust the chaptabheight in each part. \ifthenelse{\thechapcnt>0} { \pgfmathsetlengthmacro{\chaptabheight}{\parttabheight/\totvalue{chapcnt}} \pgfmathsetlengthmacro{\chaptaboffset}{(\thechapcnt-1)*\chaptabheight} \fill[green] ($(current page.north \corner)+(\sign.20,-\parttaboffset-\chaptaboffset)$)% rectangle ++(\sign.40,-\chaptabheight); }{} \end{tikzpicture} } \newcommand*{\unpart}[1]{ \part*{#1} \stepcounter{partcnt} \setcounter{chapter}{0} \setcounter{chapcnt}{0} \thepartcnt~\thechapcnt } \newcommand*{\unchapter}[1]{ \chapter*{#1} \stepcounter{chapcnt} \thepartcnt~\thechapcnt } \begin{document} \unpart{FirstPart} \unchapter{P1:FirstUNChapter} \section{A Numbered Section} \section{Another Numbered Section} \unchapter{P1:SecondUNChapter} \chapter{P1:ThirdNChapter} \stepcounter{chapcnt} \thepartcnt~\thechapcnt \unchapter{P1:LastUNChapter} \unpart{SecondPart} \unchapter{P2:FirstUNChapter} \unchapter{P2:SecondUNChapter} \unchapter{P2:ThirdUNChapter} \end{document} In the fourth page below the green rectangle is drawn outside of the blue rectangle because it's using 3 as the total number of chapters. The last part hast 3 chapters but the first one has 4. The chaptabheight of the chapters in the first part should be computed using 4, and the chaptabheight of the chapters in the second part should be computed using 3.
- Marginnote does not work [duplicate]by Rassine Orange on July 26, 2026 at 12:47 pm
When I try to put a tikzpicture inside a marginnote, I get this error: Equations.tex: error: 132: Argument of \pgfplots@addplotimpl@expression has an extra }. I guess there may be a conflict with another package/options as when I try a MWE with just the marginote, it works, see below. I cannot paste here my whole preambule as it would be too long. What could a possible source of this error? (For context I'm trying to get something similar as can be seen in this discussion. Sadly the code is nowhere to be found in the discussion...) \documentclass[a4paper,11pt]{article} \usepackage[top=2cm,bottom=2cm,right=4cm,left=2cm,marginparsep=0.5cm]{geometry} \usepackage{marginnote} %%%Tikz \usepackage{tikz} \usepackage{pgfplots} \begin{document} A marginote, all good \marginnote{ \begin{tikzpicture} %[x=1cm,y=1cm,auto,rotate=90,transform shape] \begin{axis}[ width=4.5cm, height=3cm, % hauteur xmin=-2, xmax=10, ymin=0, ymax=12, xtick= \empty, ytick= \empty, extra x ticks = {0,2}, extra x tick style={tick style={draw=none}}, extra y ticks = {2, 8,10}, extra tick style={tick style={draw=none}}, axis line style={thick, shorten >=-20pt, shorten <=0pt}, %extra x tick labels={0,0.5,...,10}, %grid style={very thin, dotted, color=gray}, grid=none, % grille verticale et horizontale axis x line=center, axis y line=center, ylabel=$x(t)$, ylabel style={anchor=south,yshift = 0.75cm}, xlabel=$t$, xlabel style={anchor=west,xshift = 0.75cm}, axis line style={>=stealth,->}, ] \addplot+[domain=0:10,color=cyan, thick, smooth,samples=400,mark=none] (\x,{4/(1+5^(-2*\x))}); \addplot+[only marks,mark = *, cyan, mark options={fill=white} ] coordinates { (2,5) (0,4)}; \draw [dashed, cyan] (axis cs:{2,0}) -- (axis cs:{2,5}) -- (axis cs:{0,5}); \draw [dashed, orange] (axis cs:{0,10}) -- (axis cs:{10,10}); \end{axis} \end{tikzpicture}} But does not work \end{document} Edit: The solution was here, the key was to use \shorthandoff. I'm not sure why and what this command does though, so the solution may not be robust.
- Use inner and outer margins implicitly in tikz when defining a custom section titleformat for a twoside reportby umarcor on July 26, 2026 at 12:29 pm
In the following Minimal Working Example (MWE), the section and subsection title formats are modified using titlesec's titleformat along with tikz. In order to handle odd and even pages, command sectitleformat receives arguments #6 and #7, which are {\innermargin}{\outermargin} for odd pages and {\outermargin}{\innermargin} for even pages. Is it possible to avoid defining and using \innermargin and \outermargin, and instead know/compute those margins using tikz's calc/positioning without explicitly passing those two arguments to sectitleformat? So, instead of using sectitleformat four times, I'd like to use it twice only (\sectitleformat[]... and \sectitleformat[numberless]...). \documentclass[twoside,openright,11pt]{report} \usepackage{geometry} \geometry{ showframe, a4paper, hmargin=18mm, bindingoffset=5mm, } \def\innermargin{\dimexpr\oddsidemargin+1in} \def\outermargin{\dimexpr\evensidemargin+1in\relax} \usepackage{MnSymbol} \usepackage{tikz} \usetikzlibrary{calc} \usepackage[explicit]{titlesec} \newcommand*\sectitleformat[7][]{ \titleformat{name=#2, page=#1}{\large\bfseries}{}{0pt}{ \begin{tikzpicture}[remember picture, overlay] \draw[draw=blue, thick] ($(current page.west|-0,0)+(#6,0)$) -- ++(#4,0) node [anchor=west] (S) {#3##1}; \draw[blue, thick] (S) -- ($(current page.east|-0,0)+(-#7,0)$); \end{tikzpicture} } } \newcommand*\sectitleformats[4]{ \sectitleformat[odd]{#1}{#2~$\filleddiamond$~}{#3}{#4}{\innermargin}{\outermargin} \sectitleformat[odd, numberless]{#1}{}{#3}{#4}{\innermargin}{\outermargin} \sectitleformat[even]{#1}{#2~$\filleddiamond$~}{#3}{#4}{\outermargin}{\innermargin} \sectitleformat[even, numberless]{#1}{}{#3}{#4}{\outermargin}{\innermargin} } \sectitleformats{\section}{\thesection}{.5cm}{fill} \sectitleformats{\subsection}{\thesubsection}{.75cm}{fill} \begin{document} \section{Numbered sec} \subsection{Numbered subsec} \section*{Numberless sec} \subsection*{Numberless subsec} \newpage \section{Another Numbered sec} \subsection{Another Numbered subsec} \section*{Another Numberless sec} \subsection*{Another Numberless subsec} \end{document}
- How do I consecutively number just regular paragraphs throughout a document?by Bruce Best on July 26, 2026 at 12:22 pm
I have searched this question, and have found so many, many different answers (a number of which I have tried unsuccessfully), that I feel as if it is the same as having no answer. What I am trying to do is fairly simple. I want every "normal" paragraph to be automatically and consecutively numbered through a document, eg, [1], [2]. By "normal" paragraph, what I mean is what would normally be a plain, unadorned paragraph from the body of a document that would be entered in most cases as plain text after a blank line. For example, my LaTeX source would look like this: \documentclass{article} \begin{document} \section{Section Heading} This is the first paragraph of my first section. It should have [1] at the beginning. This is the second paragraph of my first section. It should have [2] at the beginning. Following is a bullet list which should not be numbered: \begin{itemize} \item First list item \item Second list item \end{itemize} This is the third paragraph of my first section, should have [3] at the beginning. \subsection{Subsection Heading} This is the first paragraph of my first subsection. It should have [4] at the beginning. Here is a quote which should not be numbered: \begin{quote} This paragraph is a quotation from somewhere else. \end{quote} This is the next paragraph of my first subsection. It should have [5] at the beginning. \section{Another Section} This is the first paragraph of my second section. It should have [6] at the beginning. And so on. \end{document} Some of the code I've tried numbered EVERYTHING, including title pages, TOC, footnotes, captions etc. etc. However, I ONLY want the regular paragraphs numbered this way. What I want the output to look like is this: Section Heading [1] This is the first paragraph of my first section. It should have [1] at the beginning. [2] This is the second paragraph of my first section. It should have [2] at the beginning. Following is a bullet list which should not be numbered: First list item Second list item [3] This is the third paragraph of my first section. Subsection Heading [4] This is the first paragraph of my first subsection. It should have [4] at the beginning. Here is a quote which should not be numbered: This is the quotation. [5] This is the next paragraph of my first subsection. It should have [5] at the beginning. Another Section [6] This is the first paragraph of my second section. It should have [6] at the beginning. And so on. An example of what I want is Canadian court decisions, which usually look like this: https://www.canlii.org/en/on/onscdc/doc/2026/2026onsc3525/2026onsc3525.html If there is a simple answer to this that I have missed, would be much appreciated! Thanks
- Does `odt` creation with` tex4ht` resp. `make4ht` go with `lstinputlisting`?by user2609605 on July 26, 2026 at 10:44 am
The following is an MWE, or a MnWE test.tex: \documentclass{article} \usepackage{listings} \begin{document} This is \texttt{test.tex} \lstinputlisting{./test.tex} \end{document} Compiling this with make4ht -l -f xhtml test works without warning or error. In contrast, make4ht -l -f odt test yields $ make4ht -l -f odt test [STATUS] make4ht: Conversion started [STATUS] make4ht: Input file: test [ERROR] htlatex: Compilation errors in the htlatex run [ERROR] htlatex: Filename Line Message [ERROR] htlatex: ./test.tex ? Undefined control sequence. [STATUS] htlatex: <- [ERROR] htlatex: ? ? Undefined control sequence. [STATUS] htlatex: <- +1\relax }{}{\ifx \:temp \... l.41 \lstinputlisting{./test.tex} [WARNING] domfilter: XML DOM parsing of test.4oo failed: [WARNING] domfilter: ...ive/2025/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/text:p) [char=2732] [WARNING] domfilter: HTML DOM parsing OK, DOM filters will be executed --- xtpipes error 32 --- Missing 4xt script file name [WARNING] xtpipes: Xtpipes failed [WARNING] xtpipes: Trying HTML tidy [STATUS] make4ht: Conversion finished I tried a fix overwriting ooffice.4ht with the following patch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{listings} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \Configure{lstinline} {\HCode{<code class="lstinline">}\HtmlParOff\NoFonts} {\EndNoFonts\HtmlParOn\HCode{</code>}} \Css{code.lstinline{font-family:monospace,monospace;}} \Log:Note{to ensure proper alignments use fixed size fonts (see listings.dtx)} \HAssign\listingN=0%REIE \HAssign\listings:Depth = 0%REIE trying to define \listingN, but... I don't know whether this is the proper place or not. What I can tell is, that applying this patch, the result is [STATUS] make4ht: Conversion started [STATUS] make4ht: Input file: test [WARNING] domfilter: XML DOM parsing of test.4oo failed: [WARNING] domfilter: ...ive/2025/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/text:p) [char=2732] [WARNING] domfilter: HTML DOM parsing OK, DOM filters will be executed --- xtpipes error 32 --- Missing 4xt script file name [WARNING] xtpipes: Xtpipes failed [WARNING] xtpipes: Trying HTML tidy [STATUS] make4ht: Conversion finished which means that the error disappeared but the warning is still unresolved. My LibreOffice opens and shows a fairly good result. Nevertheless, if I unzip test.odt, and check xmllint settings.xml and accordingly with meta.xml, the xml tags are unbalanced. A last observation: If I use the according lstlisting environment instead of the \lstinputlisting macro as so: \documentclass{article} \usepackage{listings} \begin{document} test %\lstinputlisting{./test.tex} \begin{lstlisting} \documentclass{article} \usepackage{listings} \begin{document} test %\lstinputlisting{./test.tex} ... \end{document} \end{lstlisting} \end{document} all works fine, even without the patch.
- Fonts with good coverage of archaic Chinese charactersby richard on July 26, 2026 at 12:28 am
I'm trying to typeset an English document which contains the following text: The first of these Chinese characters is really problematic, and I've yet to identify a font which contains it. It is Unicode code point U+2B4DE (𫓞), which is an obscure, archaic character in the CJK Unified Ideographs Extension C block. It's normally replaced with 林 (U+6797) today, but I want to use the original character at least on the first use. Is anyone aware of a font that contains this sort of obscure characters? I typically use Noto Serif SC (or TC) when embedding fragments of Chinese in English text, and it's pretty good, but it doesn't seem to support this character. If not, is there any way of assembling the character manually from the 金 signific and 林 and 㐭 radicals which make it up, either in LaTeX or, possibly better, at a Unicode level using combining characters somehow? This question is not a duplicate of ‘Why doesn't my Chinese character display properly?’. I know why it doesn't display: my font doesn't support it. I'm also familiar with the solutions to that question: namely, to try a different font, in one of several different ways. What I'm looking for is either (a) a recommendation for a font that has sufficient coverage, or (b) a technique for composing the character manually from its individual radicals. Neither of those topics are addressed in that question.
- ConTeXt: is option `bodypartlabel` deprecated?by Akira on July 25, 2026 at 11:28 am
I am using ConTeXt ver: 2026.04.27 13:56 LMTX fmt: 2026.5.12 int: english/english on \setupinteraction[state=start,focus=standard] \definereferenceformat[zcref][label=reference:*] \setuplabeltext [en] [reference:section=Section~, reference:formula=Formula~] \setuphead [section] [textstyle=\bf, bodypartlabel=ABC, ] \starttext \startsection [title=Math, reference=sec:math] We want to refer to \zcref[sec:math]. \startformula 1 + 1 = 2 \numberhere[eq:one] \stopformula See \zcref[eq:one]. \stopsection \stoptext In particular, I use the option bodypartlabel=ABC to edit the label printed. However, there is no ABC on the PDF. Could you explain on this phenomenon? How can we check if the option bodypartlabel is deprecated?
- Is there a built-in mechanism in plain TikZ to cache intermediate calculations locally within a plot expression?by Jasper on July 25, 2026 at 5:35 am
Is there a built-in mechanism in plain TikZ to cache intermediate calculations locally within a plot expression? I mean I could just use a foreach loop and pgfmathsetmacro, but that's quite intensive. Is this built in to plot? If not, should/could it be? \documentclass{article} \usepackage{tikz} \begin{document} \tikz \draw[domain=0:1] plot ( \x, { (\x-2)^2 % there is an (\x-2) term here - (\x-2)^3 % and it is duplicated here } ) ; \end{document}
- tkz-euclide: Ignore undrawn points for bounding boxby Nick A. on July 24, 2026 at 1:34 pm
I'm using tkz-euclide to draw the following diagram, which is not properly centered: \documentclass{article} \usepackage{tikz} \usepackage{tkz-euclide} \begin{document} \begin{tikzpicture} \tkzDefPoints{0/0/A, 5/0/B} \tkzCalcLength(A,B) \tkzGetLength{dAB} \tkzDefCircle[R](A, 0.4*\dAB) \tkzGetPoint{P1} \tkzInterLC(A,B)(A,P1) \tkzGetPoints{}{C} \tkzDefCircle[R](B, 0.4*\dAB) \tkzGetPoint{P2} \tkzInterLC(A,B)(B,P2) \tkzGetPoints{D}{} \tkzInterCC(A,C)(C,A) \tkzGetPoints{E}{} \tkzInterCC(D,B)(B,D) \tkzGetPoints{F}{} \tkzInterLL(A,E)(B,F) \tkzGetPoint{G} \tkzDrawSegment[thick](A,B) \tkzDrawArc[gray, delta=10](A,C)(E) \tkzDrawArc[gray, delta=10](B,F)(D) \tkzDrawArc[gray, delta=10](C,E)(A) \tkzDrawArc[gray, delta=10](D,B)(F) \tkzDrawSegments[gray, add=0 and .1](A,G B,G) \tkzDrawSegments[thick, blue](A,G B,G) \tkzLabelPoint[below left](A){$A$} \tkzLabelPoint[below right](B){$B$} \tkzLabelPoint[below left](C){$C$} \tkzLabelPoint[below right](D){$D$} \tkzLabelPoint[above left](E){$E$} \tkzLabelPoint[above right](F){$F$} \tkzLabelPoint[above](G){$G$} % \tkzDrawPoints(P2) % \draw[red] (current bounding box.south west) rectangle (current bounding box.north east); \end{tikzpicture} \end{document} Uncommenting the code at the bottom shows the issue is with the point P2: It's only used for calculation and not drawn, but the bounding box is drawn to include it anyway, pushing the diagram left. Is there a way to instruct tikz to ignore this point so the diagram is centered appropriately? Is there a better way to use tkz-euclide to avoid this issue?
- Adjusting TikZ code example to create clock faces for modular arithmetic graphicsby Bryan-StackExchange on July 18, 2026 at 4:30 pm
The following Stack Exchange answers describe two sort of clock faces which are very close to what I need : Chords between nodes on a clock-like diagram using TikZ As seen in the two examples, I would like to : keep the digits on exterior of circle control whether to display the arrows or lines - or, especially, not display them. I have been able to adjust the code of the two answers (details below) in order to : increase the divisions e.g. from 12 to 98 (but see below) obtain any single face and print it using most of size 8.5 x 11 paper I still would like : display only certain values around perimeter - e.g. 12, 3, 6, 9 as might be seen on a normal clock increase the total to 98 but ideally any value. The purpose is generally for looking at symmetry in modular arithmetic. LaTeX seems ideally suited for this vs. e.g. Gnuplot. omit the lines between "nodes" (or markings) potentially create hash marks on the circle at any increment I do not understand many parts of the two code examples, and I believe this is necessary to adjust the examples to my requirements. e.g. the function of modtweleve and TikZMGClockMath. I am using https://tikz.dev/ as a reference - so I suspect I am overlooking a number of resources. The small adjustments to the two answers in the link are IMHO trivial, and I do not think they need to be reproduced here unless requested. some details : in the accepted answer by user Jake, in \newcommand replace 12 with e.g. 50. However, this approach runs into memory problems as the value increases. adjust stepsize in {1,...,12} to e.g. stepsize in {5} gives the fifth clock face only. This is good. in the answer by user percusse I adjusted 12 to 13 and used a single \begin{scope} to control how many pictures are displayed. The resultant image(s) are closest to what I need ; however, I do not understand how the macro is working - e.g. the \modtwelve part. However, the value can be increased to 98 without any memory problems, and create a nice image. In fact, my exact goal is met by adjusting \TikZMGClockMath{3}{28} - giving a 7-fold pattern. Specifically, the drawing would be perfect if the integers between e.g. 0 and 28 were omitted. in that answer, I commented out line 19-29 - from \draw and the first } that appears - to 'omit' the lines (vectors). This seems good. UPDATE: I added hashmarks with this code: \foreach \angle / \label in {90/0, 38.6/14, -12.8/28, -64.2/42, -115.6/56, -167/70, -218.4/84} ... which is good to show 7-fold symmetry, but they are not on the perimeter. The \draw commands adjust the position of a node or line width by the \angle. This is easy to adjust. See https://tikz.dev/pgffor UPDATE I found an inelegant way to add hashmarks - right after the above code, put this in: \draw[line width=0.5pt] (\angle:8.0cm) -- (\angle:8.5cm); } \foreach \angle in {86.3265, 86.3265, 82.6531, [.. skipping...] -258.98, -262.653, -266.327} the values are pre-calculated using awk. It would be nice to reduce that into a \foreach, multiplying the value of the example (360/98). Then, (360/98) could be any division of the circle. I tried asking on the original post, but I do not have the requisite reputation. If there is a better approach, I'd be glad to change this question.