Hot
- Cleveref reference is typeset as "definition" when it should typeset as "theorem" [duplicate]by Evan Aad on December 26, 2025 at 3:06 pm
I would like all definitions and theorems to be numbered consecutively as though they were the same element, so that, for instance, if the document contains a definition and later a theorem, the definition will be numbered 1, and the theorem will be numbered 2. I would also like to use the cleveref package in order to reference previous definitions and theorems. Whenever I reference in this manner, the output should say "definition n" if the reference is to a definition, and "theorem n" if the reference is to a theorem. I tried to do this in the following document. \documentclass{article} \usepackage{amsthm} \usepackage{cleveref} \theoremstyle{definition} \newtheorem{definition}{Definition} \newtheorem{theorem}[definition]{Theorem} \crefname{theorem}{Theorem}{Theorems} \begin{document} \begin{claim}\label{myLabel} hello world \end{claim} \cref{myLabel} \end{document} Unfortunately, as can be seen in the screenshot below, the reference is typeset as "definition 1", when it should be typeset as "theorem 1". Why does the reference typeset as "definition 1"? What do I need to change so that it typesets as "theorem 1"? PS I use MikTeX on Windows 11 Pro.
- Interleave blank pages at specific locationsby MysteryGuy on December 26, 2025 at 2:55 pm
All is in the title: I have a current document with (plain) numbered pages and I would like to interleave blank pages but only after current page 3, that is, put one blank page between every plain page, starting from page 3 (so keep my current pages 1, 2, 3 unchanged, then start interleaving blank pages). These blank pages should be either numbered or not numbered but keeping the numbering of the plain pages coherent (i.e., I don't want to go from plain page 4 to 6). I can not use newpage since of course, I don't exactly know where the page breaks might occur regarding the content. Thanks in advance for help !
- Epicycle and deferent of the Ptolemaic modelby Sebastiano on December 26, 2025 at 2:22 pm
About 15 years ago, I had created a drawing using GeoGebra that looks similar to the attached image. The source .ggb file from GeoGebra is available here, and I'm happy to share it with anyone interested (The file will expire after a maximum of 30 days). I was wondering if it's possible to replicate this drawing exactly using TikZ-PGF. I have the .ggb file and I'm wondering if there's a way to convert it or if TikZ can reproduce the same graphic. Additionally, I found a more recent package, pst-sphericaltrochoid, which might be useful for generating spherical trochoid curves, and the package is documented in the PDF manual from December 25, 2025. Moreover, I would like to have this drawing animated in LaTeX. When export in tikz-pgf using Geogebra the output is not the expected result like the image (with animations). I never done a drawing with animate package or similar. \documentclass[10pt]{article} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{mathrsfs} \usetikzlibrary{arrows} \pagestyle{empty} \begin{document} \definecolor{ffwwqq}{rgb}{1,0.4,0} \definecolor{zzttqq}{rgb}{0.6,0.2,0} \definecolor{xdxdff}{rgb}{0.49019607843137253,0.49019607843137253,1} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm] \begin{axis}[ x=1cm,y=1cm, axis lines=middle, grid style=dashed, xmin=-24.649425971185988, xmax=51.05123247996474, ymin=-17.77843276444837, ymax=20.90166759086156, xtick={-20,-15,...,50}, ytick={-15,-10,...,20},] \clip(-24.649425971185988,-17.77843276444837) rectangle (51.05123247996474,20.90166759086156); \draw [line width=0.8pt] (0,0) circle (8cm); \draw [line width=0.8pt] (4.690951292494638,6.480353074597315) circle (2cm); \draw[line width=4pt] (-22.73456951795283,17.710240168806287) -- (-9.968859829731798,17.710240168806287); \draw[line width=4pt] (-22.73456951795283,15.157098231162069) -- (-9.968859829731798,15.157098231162069); \begin{scriptsize} \draw [fill=xdxdff] (4.690951292494638,6.480353074597315) circle (0.5pt); \draw[color=xdxdff] (4.137249375752443,7.338101047126645) node {$A$}; \draw [fill=black] (-17.202761986390385,17.710240168806287) circle (2.5pt); \draw[color=black] (-16.096400480077897,19.40169670249558) node {$k = 1.3$}; \draw [fill=zzttqq] (2.345168103332513,5.359058630909856) circle (1pt); \draw[color=zzttqq] (4.392563569516864,6.316844272068956) node {$Pianeta$}; \draw [fill=black] (-17.06092076763237,15.157098231162069) circle (2.5pt); \draw[color=black] (-16.479371770724526,16.848554764851364) node {$v = 5$}; \draw [color=ffwwqq] (0,0) circle (4.5pt); \draw[color=ffwwqq] (1.264964695902711,1.4658745905449386) node {$Sole$}; \end{scriptsize} \end{axis} \end{tikzpicture} \end{document} My idea is to animate the drawing using the animate package for my students of an high school, with the ability to modify parameters and see how the drawing changes in real time. Could I add interactive buttons to allow users to modify the parameters of the animation? If anyone has experience animating drawings in LaTeX, I'd be happy to receive suggestions on how to implement it. Also, how can I animate package this drawing and add interactive buttons to control the parameters?
- tex4ebook: How to correctly define Metadataby Jack on December 26, 2025 at 12:45 pm
I am trying to set the metadata in my ebook via the following cfg file, but it only works partially: \Preamble{xhtml} \Configure{OpfMetadata}{% \HCode{<dc:title xml:lang="de">My ebook</dc:title>} \HCode{<dc:creator>My name</dc:creator>} \HCode{<dc:language>en</dc:language>} \HCode{<dc:date>2025-25-12</dc:date>} \HCode{<dc:subject>Ebook</dc:subject>} \HCode{<dc:description>This is an ebook</dc:description>} \HCode{<dc:keywords>My keywords</dc:keywords>} \HCode{<dc:publisher>My publisher</dc:publisher>} \HCode{<dc:identifier>My identifier</dc:identifier>} } \begin{document} \EndPreamble The meta data looks fine for subject, description, keywords and publisher. However, for the title, Calibri only shows "Unnamed". For the author, it shows "Anonymous & My name" instead of only "My name", the date shows today's date and not the one I had selected, and it doesn't show an identifier. How can I ensure that all meta data is correctly displayed? Here is an MWE which I ran with the above cfg file. \documentclass{book} \usepackage{tex4ebook} \begin{document} \tableofcontents \part{Headline} This is an ebook. \end{document}
- natbib option "super" not working properly with make4htby MadyYuvi on December 26, 2025 at 11:13 am
I'm trying with: \documentclass[]{article} \usepackage[numbers,super,sort&compress,comma]{natbib} \begin{document} Test\cite{ref1,ref2,ref3,ref4,ref5,ref6,ref7,ref8,ref9,ref10} \begin{thebibliography}{99} \bibitem{ref1} Entry 1 \bibitem{ref2} Entry 2 \bibitem{ref3} Entry 3 \bibitem{ref4} Entry 4 \bibitem{ref5} Entry 5 \bibitem{ref6} Entry 6 \bibitem{ref7} Entry 7 \bibitem{ref8} Entry 8 \bibitem{ref9} Entry 9 \bibitem{ref10} Entry 10 \end{thebibliography} \end{document} For HTML conversion, I'm trying with make4ht filename and the output was: If I remove the option super, then it works correctly: But I'm in need to use options numbers,super,sort&compress,comma, how can I meet this? Please advise.
- zref-clever: Use noname by default for equations?by user1362373 on December 26, 2025 at 10:44 am
I'm thinking about migrating several large documents from cleveref to zref-clever. I have read Migration from cleveref to zref-clever as well as the manual, but several questions remain. One of them is: How I can control whether references to equations include "equation" or "equations" before the label(s), independently of whether references to figures and tables include "figure" and "table"? (The reasoning is that equations are numbered with parentheses whereas figures and tables are numbered without parentheses. Thus, it is clear that "see (1)" means equation (1) whereas "see 1" would be ambiguous because it could mean either Figure 1 or Table 1.) My understanding is that I need to use the option noname when referring to each equation. To avoid having to type the option in each reference, I could define a new command: \documentclass{article} \usepackage{zref-clever} \newcommand{\zcrefeq}[1]{\zcref[noname]{#1}} \begin{document} \begin{equation}\label{eq:1} a = b \end{equation} \begin{figure}[h] \caption{Some figure.} \label{fig:1} \end{figure} We have \zcrefeq{eq:1} and \zcref{fig:1}. \zcref[S]{eq:1} is the first equation. \end{document} Is there a more elegant way of doing this by setting an overall option or a reference format option?
- Don't get decimal output with luacasby Fa-Mat on December 26, 2025 at 10:38 am
First of all "Merry Christmas" to everyone. I'm trying to get decimal output with luacas and don't get it. \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \directlua{ a=3 b=8 c=a/b tex.print('$',c,'$') } \end{document} The code above gives the expectet 0.375. Changing to \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \begin{CAS} a=3 b=8 c=Rational(a,b) \end{CAS} $\print{a}$ $\print{b}$ $\print{c}$ $\print{c.numerator}$ $\print{c.denominator}$ \end{document} gives 3, 8, the fraction 3 over 8, 3 and 8. In the manual there is the funtion :asnumber() given but \documentclass[paper=a4,fontsize=12pt]{scrartcl} \usepackage{luacas} \begin{document} \begin{CAS} a=3 b=8 c=Rational(a,b) d=c:asnumber() \end{CAS} $\print{a}$ $\print{b}$ $\print{c}$ $\print{c.numerator}$ $\print{c.denominator}$ $\print{d}$ \end{document} gives Lua-Error and the $\print{d}$ is ignored. I also tried something like d=Rational:asnumber(c) or used the funktions ZZ(), QQ() and RR() but without any success. Also $\print{c:asnumber()}$ fails. Trying to print the decimal with $\directlua{tex.print(string.format("\csstring\%.3f",c))}$ gives also a Lua error ('c' is a table but a number is expected by 'string.format()'). I'm not having any ideas how to solve it any more. Thank you for your help.
- Paragraphs beside wrapstuff environments have larger indentsby youthdoo on December 26, 2025 at 10:31 am
I noticed that paragraphs within the scope of a wrapstuff environment have larger horizontal distances between the title and the content. See for example \documentclass[b5paper]{article} \usepackage{graphicx} \usepackage[margin=2cm]{geometry} \usepackage{lipsum} \usepackage{wrapstuff} \begin{document} \begin{wrapstuff}[l,width=16em] \includegraphics[width=16em]{example-image} \end{wrapstuff} \paragraph{paragraph name}\lipsum[4] \paragraph{paragraph name}\lipsum[4] \end{document} The difference is very obvious and ugly in certain cases. What is the cause for this and how to solve the problem?
- How to disable clickable and breakable url hyperlink only in `minted` environment?by Explorer on December 26, 2025 at 6:45 am
I was afraid that this question is duplicated, but I can't find it since 5-minutes' search. I have the following code with minted-v3 on TL2025: \documentclass{article} \usepackage{showframe} \usepackage{minted} \usepackage{xurl} \usepackage{hyperref} \begin{document} \section{aaa}\label{sec:aaa} abcde \begin{minted}[breakanywhere]{toml} directory = fmt-10.2.1 source_url = https://github.com/abcedfg/abc/abcdefgh/download/100.2.1/abc-10.2.1.zip source_hash = ec44298fc55f4c8b934ca495991b789961c149afb493b052b8fb92427ae41e46 \end{minted} \begin{minted}[breaklines]{toml} directory = fmt-10.2.1 source_url = https://github.com/abcedfg/abc/abcdefgh/download/100.2.1/abc-10.2.1.zip source_hash = ec44298fc55f4c8b934ca495991b789961c149afb493b052b8fb92427ae41e46 \end{minted} \begin{minted}[breakanywhere,breaklines]{toml} directory = fmt-10.2.1 source_url = https://github.com/abcedfg/abc/abcdefgh/download/100.2.1/abc-10.2.1.zip source_hash = ec44298fc55f4c8b934ca495991b789961c149afb493b052b8fb92427ae41e46 \end{minted} \noindent I want the ref: \ref{sec:aaa} but I don't want the hyperlink in \texttt{minted}. \url{https://github.com/abcedfg/abc/abcdefgh/download/100.2.1/abc-10.2.1.zip} \end{document} Here below is the version information: *File List* article.cls 2025/01/22 v1.4n Standard LaTeX document class size10.clo 2025/01/22 v1.4n Standard LaTeX file (size option) showframe.sty 2020/10/14 v0.1j showframe (new impl., RN) eso-pic.sty 2025/12/10 v3.0d eso-pic (RN) keyval.sty 2022/05/29 v1.15 key=value parser (DPC) xcolor.sty 2024/09/29 v3.02 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration pdftex.def 2025/09/29 v1.2d Graphics/color driver for pdftex mathcolor.ltx minted.sty 2025/05/14 v3.7.0 Yet another Pygments shim for LaTeX catchfile.sty 2019/12/09 v1.8 Catch the contents of a file (HO) infwarerr.sty 2019/12/03 v1.5 Providing info/warning/error messages (HO) ltxcmds.sty 2023-12-04 v1.26 LaTeX kernel commands for general use (HO) etexcmds.sty 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO) iftex.sty 2024/12/12 v1.0g TeX engine tests etoolbox.sty 2025/10/02 v2.5m e-TeX tools for LaTeX (JAW) fvextra.sty 2025/05/29 v1.13.2 fvextra - extensions and patches for fancyvr b fancyvrb.sty 2025/07/28 4.6 verbatim text (tvz,hv) pdftexcmds.sty 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO) upquote.sty 2012/04/19 v1.3 upright-quote and grave-accent glyphs in verbat im lineno.sty 2025/05/13 line numbers on paragraphs v5.5 kvoptions.sty 2022-06-15 v3.15 Key value format for package options (HO) kvsetkeys.sty 2022-10-05 v1.19 Key value parser (HO) latex2pydata.sty 2025/03/26 v0.6.0 latex2pydata - write data to file in Pyth on literal format pgfkeys.sty pgfkeys.code.tex pgfopts.sty 2014/07/10 v2.1a LaTeX package options with pgfkeys shellesc.sty 2023/07/08 v1.0d unified shell escape interface for LaTeX float.sty 2001/11/08 v1.3d Float enhancements (AL) xurl.sty 2022/01/09 v 0.10 modify URL breaks url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc. hyperref.sty 2025-07-12 v7.01o Hypertext links for LaTeX kvdefinekeys.sty 2019-12-19 v1.6 Define keys (HO) pdfescape.sty 2019/12/09 v1.15 Implements pdfTeX's escape features (HO) hycolor.sty 2020-01-27 v1.10 Color options for hyperref/bookmark (HO) nameref.sty 2025-06-21 v2.57 Cross-referencing by name of section refcount.sty 2019/12/15 v3.6 Data extraction from label references (HO) gettitlestring.sty 2019/12/15 v1.6 Cleanup title references (HO) stringenc.sty 2019/11/29 v1.12 Convert strings between diff. encodings (HO) pd1enc.def 2025-07-12 v7.01o Hyperref: PDFDocEncoding definition (HO) intcalc.sty 2019/12/15 v1.3 Expandable calculations with integers (HO) puenc.def 2025-07-12 v7.01o Hyperref: PDF Unicode definition (HO) bitset.sty 2019/12/09 v1.3 Handle bit-vector datatype (HO) bigintcalc.sty 2019/12/15 v1.5 Expandable calculations on big integers (HO) hpdftex.def 2025-07-12 v7.01o Hyperref driver for pdfTeX rerunfilecheck.sty 2025-06-21 v1.11 Rerun checks for auxiliary files (HO) uniquecounter.sty 2019/12/15 v1.4 Provide unlimited unique counter (HO) l3backend-pdftex.def 2025-10-09 L3 backend support: PDF output (pdfTeX) Which gives: Notices that: There is strange 」-like symbol at linebreak The url is imcomplete, just https://github.com/abcedfg/abc/abcdefgh/download/10 but not https://github.com/abcedfg/abc/abcdefgh/download/100.2.1/abc-10.2.1.zip What I want to achieve, is that: Cancel the hyperlink and the colorlink frame inside minted Keep the hyperlink outside the minted the same, clickable with colorframe The line breakable the same as breakanywhere,breaklines case In a word, how can I disable the hyperlink of url in minted with proper linebreak? Edit Thanks to cfr's comment, the link's behavior is differed across different PDF-viewers: case1: the same as the image I shown: Adobe Acrobat Reader Foxit PDF Editor PDF-Xchange Editor case2: the colorlink-frame is not a clickable link: Microsoft Edge Firefox Okular Edited Again: Turn of the button of "Create links from urls", would make the urls inside minted unclickable, but the annoying red colorlink is still here, is that possible to turn them off only inside minted? Because I don't think urls in minted is meanful to be click, it's only need to be copied.
- In \setuplayout why aren't the width pieces totalling as simple arithmetic?by Gary on December 26, 2025 at 4:48 am
I suspect I'm overlooking the obvious, but would you please explain why the width pieces do not add in this simple example? That is, in the A not so short introduction to ConTeXt text, it states that \backspace is the sum of leftedge + leftedgedistance + leftmargin + leftmargindistance, which, here, should be 1.5in + 0.125in + 0 + 0 = 1.625 but it is 1.0119in; and the text width is 4.9881in which appears to be the pagewidth (8.5in) less all the right side values which total 2.5in = 1.5in + 0.125in + 0.125in + 0.75in less the \backspace rather than 1.625. Thank you. [Added: Perhaps, I'm being stupid; I mean that the backspace can be defined also. I just didn't expect that it had to be defined in addition to its components. If I set backspace to the total of its components, then the text width is the page width less all the other width pieces.] \mainlanguage[en] \definepapersize[book][letter][letter] \setuppapersize[book] \setuppagenumbering[alternative=doublesided] \definelayout[main][ headerdistance = 0.125in, width=fit, height=fit, footerdistance=0.125in, leftmargin=0, leftmargindistance=0, leftedge=1.5in, leftedgedistance=0.125in, rightmargin=1.5in, rightmargindistance=0.125in, rightedge=0.75in, rightedgedistance=0.125in] \setupbodyfont[libertinus,12pt] \setupindenting[yes,medium,next] \setupwhitespace[quarterline] \setupinterlinespace[2.8ex] \starttext \setuplayout[main] \showlayout[pt,in] \showframe Testing text \stoptext \paperheight 794.9700pt 11.0000in \paperwidth 614.2950pt 8.5000in \printpaperheight 794.9700pt 11.0000in \printpaperwidth 614.2950pt 8.5000in \topspace 66.9106pt 0.9258in \backspace 73.1312pt 1.0119in \makeupheight 661.1488pt 9.1483in \makeupwidth 360.4888pt 4.9881in \topheight 0.0000pt 0.0000in \topdistance 0.0000pt 0.0000in \headerheight 53.5309pt 0.7407in \headerdistance 0.0000pt 0.0000in \textheight 545.0532pt 7.5419in \footerdistance 9.0337pt 0.1250in \footerheight 53.5309pt 0.7407in \bottomdistance 0.0000pt 0.0000in \bottomheight 0.0000pt 0.0000in \leftedgewidth 108.4050pt 1.5000in \leftedgedistance 9.0337pt 0.1250in \leftmarginwidth 0.0000pt 0.0000in \leftmargindistance 0.0000pt 0.0000in \textwidth 360.4888pt 4.9881in \rightmargindistance 9.0337pt 0.1250in \rightmarginwidth 108.4050pt 1.5000in \rightedgedistance 9.0337pt 0.1250in \rightedgewidth 54.2025pt 0.7500in \bodyfontsize 12.0000pt 0.1660in \lineheight 14.4065pt 0.1993in \strutheightfactor .72 \strutdepthfactor .28 \topskipfactor 1.0 \maxdepthfactor 0.4
- photobook pagesby Elza on December 26, 2025 at 3:47 am
I am trying to produce a photobook using LaTeX. I understand that there is a package called photobook but I am not sure how to use it. I have three types of pages looking like the images below (dimensions in millimeters). But I am not able to achieve what I want. I know that minipagecell is experimental in the package and I haven't try it. Is there any way to do the task without it? Or should I use a different package than photobook? Or maybe even a different tool than LaTeX? im2 means image 2; block2 means the corresponding block of text
- Can cleveref and varioref together change the varioref format, but only for certain reference types?by Draconis on December 26, 2025 at 1:31 am
I'm currently using cleveref, varioref, and hyperref together, and the result is very nice! I love the way it looks for figures and tables, which are described as "figure X on page Y" when appropriate. However, "section X.Y on page Z" flows less well. I would like to be able to change this to "section X.Y (page Z)", only for chapters, sections, and subsections (i.e. for document headings but not for floats). This seems like something cleveref should be able to do. But it seems to delegate the page-number handling to varioref in such a way that I can't change the varioref options based on the cleveref reference type. Is there a straightforward way to do this? The alternative is defining my own \sref command to use for headings, and using \vref only for floats, but this feels like the sort of manual tracking that cleveref was meant to avoid. P.S. In the PDF this isn't really a concern, because hyperref automatically provides a link to the appropriate page. But this document is also going to be printed, and sections and subsections are not listed in the table of contents, so finding where exactly "section X.Y" is located can be quite annoying. That's why I'd like to find an unobtrusive way to list it.
- Replacing all characters I in a documentby innocuous-squid on December 26, 2025 at 1:25 am
I'm writing a document with XeTeX that uses Calibri as its main font (this is non-negotiable). An issue with Calibri is that capital I and lowercase l look nearly identical. Is it possible to add a serifed I to the font somehow, so that they are clearly distinguished throughout the document? I know that this might not be an entirely LaTeX question and I might need to look into the TTF files I'm using, but I'm unsure how I would even set something up for this.
- AGUTeX changes angle brackets in DOIsby Tor on December 25, 2025 at 6:28 pm
I'm writing a paper for an AGU journal, using the AGUTeX templates. I have a reference with a DOI that contains angle brackets (I'm using the term "angle brackets" loosely here). The correct DOI is 10.1175/1520-0493(1997)125<2293:ROTBSC>2.0.CO;2 This DOI is listed in the doi field in the reference in the .bib file. After typesetting, the DOI listed in the compiled pdf has different angle brackets: 10.1175/1520-0493(1997)125⟨2293: ROTBSC⟩2.0.CO;2 In the pdf I build with the AGUTeX class myself, the DOI is just listed as text, but in the version the journal builds the DOIs are given as clickable URLs, and this link then naturally leads to a page that says DOI NOT FOUND for this reference, as well as other references with angle brackets. Has anyone else come across this issue? And is it possible to find out which lines of code in the AGUTeX class is responsible for the switch? For completeness, here is a minimal example tex-file and bib-file to reproduce this, using the class agujournal2019 available on overleaf (and as mentioned, the error also exists in the pdf with the page proofs I received from the journal, so this or something similar is presumably also what they use in-house). tex-file: \documentclass[draft]{agujournal2019} \draftfalse \journalname{Journal name} \begin{document} \title{Title} \cite{adcroft1997} \bibliography{agusample} \end{document} bib-file: @article{adcroft1997, title = {Representation of {{Topography}} by {{Shaved Cells}} in a {{Height Coordinate Ocean Model}}}, author = {Adcroft, Alistair and Hill, Chris and Marshall, John}, year = {1997}, journal = {Monthly Weather Review}, volume = {125}, number = {9}, pages = {2293--2315}, doi = {10.1175/1520-0493(1997)125<2293:ROTBSC>2.0.CO;2}, }
- tex4ebook: How to customize section names and include them in the ToCby Jack on December 25, 2025 at 3:43 pm
I am trying to customize section names add them correctly to the ToC While I found a working solution for a standard tex document using the \titleformat from the titlesec package, I have to issues with when doing the same for an ebook: The customized title is not used in the headline of the relevant sections While I can manually add a new line to the ToC even with my customized title, the \protect\setcounter{tocdepth}{0} command does not surpress the standard section line to appear in the ToC, i.e. I now have the sections twice in the ToC Is there a way to solve this so that it looks similar to what is shown when compiling a pdf instead of an ebook? Here is an MWE that works for pdf but has the above issues for an ebook: \documentclass{book} \usepackage{tex4ebook} \usepackage{cleveref} \usepackage{titlesec} \titleformat{\section}{\normalfont\Large\bfseries}{My Section~\thesection}{1em}{} \renewcommand{\thesection}{\arabic{section}} \begin{document} \tableofcontents \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} \section{Headline} \label{sec:Headline} \addtocontents{toc}{\protect\setcounter{tocdepth}{2}} \addcontentsline{toc}{section}{My Section \thesection \hspace{1em} Headline} Some text. \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} \section{Another headline} \addtocontents{toc}{\protect\setcounter{tocdepth}{2}} \addcontentsline{toc}{section}{My Section \thesection \hspace{1em} Another headline} Some text. \end{document} and the relevant cfg file \Preamble{xhtml} \Css{nav ol li{ list-style-type: none; }} \begin{document} \EndPreamble
- How to make a straight-line stroke that transitions from thick to thin in METAFONT?by Grzegorz Brzczyszczykiewicz on December 25, 2025 at 1:32 pm
is it possible to make a stroke that transitions from thick to thin, like a Chinese brush or a calligraphy pen? Not like a bent hook that fakes the transition using elliptical pens, that one is cheating. I want a perfectly straight line, that starts out thick and transitions to thin. Is it possible to do such a "dynamic brush" effect"?
- Precision issue with Tikz tangent coordinate systemby I. Cho on December 25, 2025 at 12:21 pm
The TikZ tangent coordinate system appears to be inaccurate. The blue and red lines are expected to overlap, but they fail to do so. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \draw [help lines,dotted,thick] (0,0) grid (10,10); \def\rA{.5} \def\rB{4} \coordinate (OA) at (1,1); \coordinate (OB) at (5,5); \path (OA) node (A) [draw,circle,minimum size=2*\rA cm] {A}; \path (OB) node (B) [draw,circle,minimum size=2*\rB cm] {B}; \path ($(A.center)!{\rA/(\rA - \rB)}!(B.center)$) coordinate (X) node [below left] {X}; \path (tangent cs:node=A,point={(X)},solution=1) coordinate (A1); \path (tangent cs:node=A,point={(X)},solution=2) coordinate (A2); \path (tangent cs:node=B,point={(X)},solution=1) coordinate (B1); \path (tangent cs:node=B,point={(X)},solution=2) coordinate (B2); \draw [blue] (X) -- (A1) -- ([turn]0:9cm); \draw [red] (X) -- (B1) -- ([turn]0:5cm); \draw [blue] (X) -- (A2) -- ([turn]0:9cm); \draw [red] (X) -- (B2) -- ([turn]0:5cm); \end{tikzpicture} \end{document} Corrected by adding outer sep=0pt: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \draw [help lines,dotted,thick] (0,0) grid (10,10); \def\rA{.5} \def\rB{4} \coordinate (OA) at (1,1); \coordinate (OB) at (5,5); \path (OA) node (A) [draw,circle,minimum size=2*\rA cm,outer sep=0pt] {A}; %% \path (OB) node (B) [draw,circle,minimum size=2*\rB cm,outer sep=0pt] {B}; %% \path ($(A.center)!{\rA/(\rA - \rB)}!(B.center)$) coordinate (X) node [below left] {X}; \path (tangent cs:node=A,point={(X)},solution=1) coordinate (A1); \path (tangent cs:node=A,point={(X)},solution=2) coordinate (A2); \path (tangent cs:node=B,point={(X)},solution=1) coordinate (B1); \path (tangent cs:node=B,point={(X)},solution=2) coordinate (B2); \draw [blue] (X) -- (A1) -- ([turn]0:9cm); \draw [red] (X) -- (B1) -- ([turn]0:5cm); \draw [blue] (X) -- (A2) -- ([turn]0:9cm); \draw [red] (X) -- (B2) -- ([turn]0:5cm); \end{tikzpicture} \end{document}
- text4ebook: How to include graphics in nested enumerate environments to correctly fit ebook page size?by Jack on December 25, 2025 at 12:05 pm
I am trying to include pictures in a nested enumerate environment and want to make sure they fit the screen size correctly. After playing around a while, I am now using the \adjustbox{\linewidth} command, which works well outside of the environment as well as on the first level of an enumerate environment. However, if I have nested environments, the picture runs out of the screen on the second level (at least with Kindle reader and Google Play Books reader - with Calibri it seems to work still on the second level). Is there a way to correctly fit the size on the second level also for readers like Kindle or Google Play Books? Here is an MWE: \documentclass{book} \usepackage{tex4ebook} \begin{document} First enumerate level: \begin{enumerate} \item On this level, pictures work well \adjustbox{\linewidth}{\includegraphics{Picture.png}} Second enumerate level: \begin{enumerate} \item On this level, pictures run over the screen even with linewidth setting: \adjustbox{\linewidth}{\includegraphics{Picture.png}} \end{enumerate} \end{enumerate} \end{document}
- nicematrix, \CodeAfter and overlappingby projetmbc on December 25, 2025 at 11:11 am
Is there an automatic way to avoid "TikZ code after" overlap the text? I give a real use case, and not a MWE. \documentclass[12pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[top=1cm, bottom=1.95cm, left=.9cm, right=.9cm]{geometry} \usepackage{nicematrix} \usepackage[svgnames]{xcolor} \usepackage{tikz] \tikzset{ product/.style = { shorten > = 3.75mm, thick }, product-times/.style = { pos=0.5, circle, fill=white, inner sep=2pt }, arrow/.style = { ->, thick }, rounded-frame/.style = { draw, rounded corners, thick, inner sep = 5pt, anchor = west } } \begin{document} XXX $\begin{NiceArray}{*{9}{c}}[cell-space-limits=3pt] & & & & & & & & C_j^{\,\prime} \\ & & & & & & & & \phantom{X} \\ & & & & & & & & \Vdots[shorten-start=11pt] \\ & & & & & & & & \color{IndianRed}a[k]_{qj} \\ & & & & & & & & \Vdots \\ & & & & & & & & \color{ForestGreen} a[k]_{rj} \\ & & & & & & & & \Vdots[shorten-end=21pt] \\ & & \NotEmpty & & & & \NotEmpty & & \\ L_i & \hspace{3pt} & \Cdots[shorten-start=18pt] & \color{IndianRed} 1 & \Cdots & \color{ForestGreen} 0 & \Cdots[shorten-end=18pt] & \hspace{12.5pt} & a[k{+}1]_{ij} % \CodeAfter % Sous-matrices. \SubMatrix({3-9}{7-9})[slim] \SubMatrix({9-3}{9-7}) \SubMatrix({9-9}{9-9}) % Décorons... \begin{tikzpicture} % Indication pour la ligne et la colonne. \draw[ arrow, shorten > = 8mm, ] (1-9.south) to (4-9.north); \draw[ arrow, shorten < = 1mm, shorten > = 9.5mm, ] (9-1.east) to (9-4.west); % Flèches des produits. \draw[ product, IndianRed, ] (9-4.north) to [bend left] node[ product-times, draw = IndianRed, ] {$\times$} (4-9.west); \draw[ product, ForestGreen, ] (9-6.north) to [bend left] node[ product-times, draw = ForestGreen ] {$\times$} (6-9.west) ; % Signification des entrées. \draw[ arrow, ForestGreen, ] ([yshift=-5mm]9-6.south) to (9-6.south); \node[ rounded-frame, ForestGreen ] at ([yshift=-8.1mm, xshift=-2mm]9-6.south) {Pas de lien direct de $i$ à $r$.}; % \draw[ arrow, IndianRed, ] ([yshift=-13.5mm]9-4.south) to (9-4.south); \node[ rounded-frame, IndianRed ] at ([yshift=-17mm, xshift=-2mm]9-4.south) {Un lien direct de $i$ à $q$.}; % \draw[ arrow, IndianRed ] ([xshift=8.5mm] 4-9.east) to ([xshift=3.5mm] 4-9.east); \node[ rounded-frame, IndianRed, ] at ([xshift=8.5mm] 4-9.east) {Nombre de parcours de longueur $k$ de $q$ à $j$.}; % \draw[ arrow, ForestGreen, ] ([xshift=8.5mm] 6-9.east) to ([xshift=3.5mm] 6-9.east); \node[ rounded-frame, ForestGreen, ] at ([xshift=8.5mm] 6-9.east) {Nombre de parcours de longueur $k$ de $r$ à $j$.}; \end{tikzpicture} \end{NiceArray}$ XXX \end{document}
- tex4ebook: How to make a table run over more than one page being shown correctly in Google Play Booksby Jack on December 25, 2025 at 10:27 am
I am trying to make a long table that may run over more than one page in an ebook using the tabularx package. While the table on the first page is shown correctly in Google Play Books and while it indeed runs over more than one page, the vertical lines of the table suddenly disappear on the second page, i.e. only the horizontal lines are shown on the second page. The text is shown correctly, so it's really only the vertical lines that disappear. Is there a way how to make such a table being displayed correctly? Here is an MWE: \documentclass{book} \usepackage{tabularx} \usepackage{tex4ebook} \begin{document} \begin{tabularx}{\linewidth}{| X | c | X |} \hline \textbf{\textit{Column 1}} & \textbf{\textit{Column 2}} & \textbf{\textit{Column 3}} \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline Some Text & More text & Even more text \\ \hline \end{tabularx} \end{document}
- Problems using latexdiff with mintedby Andymang on December 25, 2025 at 1:27 am
I am trying to get a diff between two versions of my thesis. The first command I tried using is: git latexdiff -v --main thesis.tex -o diff.pdf --flatten --latexmk --latexopt -shell-escape defended HEAD This failed. When I inspected the log, I discovered one of the errors to be: ! Missing $ inserted. <inserted text> $ l.1172 } %DIFDELCMD < }%%% I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. Here is an excerpt of the diff.tex where that's from: %DIFDELCMD < \begin{minted}[breaklines]{json} %DIFDELCMD < { %DIFDELCMD < %%% \DIFdel{"interval": }%DIFDELCMD < { %DIFDELCMD < %%% \DIFdel{"start_millis": 0, "end_millis": 13 }%DIFDELCMD < }%%% \DIFdel{, "all": }%DIFDELCMD < { %DIFDELCMD < %%% And here is an excerpt form the old file thesis.tex: \begin{minted}[breaklines]{json} { "interval": { "start_millis": 0, "end_millis": 13 }, "all": { The problem appears to be that underscores were counting as a math symbol once they were taken out of the minted environment and put in a \DIFdel command. I can't just escape the underscores like \_ in the original input, because then the backslashes show up in the PDF. So I asked ChatGPT, which led me to try setting the VERBATIMLINEENV and --append-safecmd options: git latexdiff -v --main thesis.tex -o diff.pdf --flatten --latexmk --config "VERBATIMLINEENV=minted" --append-safecmd=mintinline --append-safecmd=inputminted --latexopt -shell-escape defended-fixed HEAD But that doesn't work, either. Here is one of the error messages that produces: ! Package pgfkeys Error: I do not know the key '/minted/cmd/alsolanguage', to w hich you passed 'DIFcode', and I am going to ignore it. Perhaps you misspelled it. And the diff.tex: %DIFDELCMD < \begin{minted}[breaklines]%%% %DIFAUXCMD NEXT \DIFmodbegin \begin{minted}[breaklines,alsolanguage=DIFcode] %DIF < { %DIF < "interval": { %DIF < "start_millis": 0, %DIF < "end_millis": 13 %DIF < }, %DIF < "all": { It looks like it is trying to pass the alsolanguage option to minted, which doesn't support it. I don't know if this is the fatal error that is causing the pdf not to compile. Here is the next error: ! Argument of \end has an extra }. <inserted text> \par l.1244 \end {minted} I've run across a `}' that doesn't seem to match anything. For example, `\def\a#1{...}' and `\a}' would produce this error. If you simply proceed now, the `\par' that I've just inserted will cause me to report a runaway argument that might be the root of the problem. But if your `}' was spurious, just type `2' and it will go away. I don't know if this next error is caused by the first one or not. What are my options here? I want the differences in the minted block to show up. Minimal Reproducible Example a.tex: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}{text} something_here \end{minted} \end{document} b.tex: \documentclass{article} \usepackage{minted} \begin{document} \end{document} Commands: latexdiff a.tex b.tex > diff.tex pdflatex -shell-escape diff.tex Output: ! Missing $ inserted. <inserted text> $ l.50 } %DIFDELCMD < \end{minted} ?
- What are the advantages of environments over macros (and of \NewDocumentEnvironment over \NewDocumentCommand)?by Alexey on December 24, 2025 at 9:24 pm
I noticed that when I start from a custom environment, and then decide to do something slightly non-trivial with its content (like hide it, or typeset in a different color), I end up switching to a custom macro with an argument. Consider, for example, these questions: Hide custom environment content based on boolean Environment hiding its content I have no idea how to make the content of an environment disappear without using packages like comment or version or scontents. On the other hand, this is trivial to do with a custom macro: just (re)define the macro as a no-op: \newcommand\comment[1]{}. It looks to me that any environment could be replaced with a macro, to have \theorem{...} instead of \begin{theorem}...\end{theorem}, etc. On the other hand, I do not know how to make an environment that, for example, duplicates or discards its content, or puts it in a box. What are the advantages of environments over macros that offset the inconveniences? P.S. IMO the environ package takes the correct approach.
- How can I make an image extend into the line spacing?by Draconis on December 24, 2025 at 9:02 pm
I'm working on a document about an obscure writing system, which means I often need to insert images of the glyphs I'm talking about. So far I've been putting them inline, using the following code: \usepackage{calc} % Calculate the proper height for inline signs \usepackage{graphicx} \graphicspath{{./images/}} \newlength{\normaldepth} \makeatletter \DeclareRobustCommand{\inlinesign}[1]{% \setlength{\normaldepth}{\depthof{p}}% \raisebox{-\normaldepth}{% \includegraphics[height={\f@size pt}]{#1}% }% } \makeatother This makes them extend downward as far as a p and upward as far as a b, which is generally a good size for inline characters. However, some of these glyphs are much more elaborate than English letters, so this is sometimes difficult to see: I would like to make them extend into the inter-line spacing both above and below, to give them just a little bit more space to breathe. Since I seldom have more than three inline signs per paragraph, the odds of one being directly above another are small; I'm willing to live with the risk of that happening. How can I adjust my code to extend into the line spacing: adding twice the line spacing to the \includegraphics height, and subtracting it from the \raisebox depth? MWE: \documentclass[12pt]{article} \usepackage{calc} % Calculate the proper height for inline signs \usepackage{graphicx} \graphicspath{{./images/}} \newlength{\normaldepth} \makeatletter \DeclareRobustCommand{\inlinesign}[1]{% \setlength{\normaldepth}{\depthof{p}}% \raisebox{-\normaldepth}{% \includegraphics[height={\f@size pt}]{#1}% }% } \makeatother \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nec tortor aliquam, scelerisque diam ac, pharetra risus. Etiam est lacus, maximus ut ipsum pulvinar, consectetur tincidunt velit. Proin enim mauris, ullamcorper eu dolor sit amet, rutrum convallis mauris. Vestibulum quis ante nec ex venenatis imperdiet nec vitae erat. Nulla tempus mattis arcu, sit amet euismod metus commodo eu. Morbi blandit odio felis, vitae sodales urna elementum non. Phasellus dolor nibh, volutpat vel justo eu, commodo posuere orci. \inlinesign{umbin_new} Cras sit amet molestie tortor, eget imperdiet dolor. Proin ac ex non justo congue iaculis eget non urna. Integer pretium placerat consectetur. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In eu libero elit. Fusce eget lacus eu leo pulvinar imperdiet. Praesent dui neque, efficitur sit amet scelerisque vitae, blandit sit amet eros. Donec elit lorem, porta vitae ipsum quis, scelerisque elementum quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vitae urna a lacus sollicitudin vulputate. Nulla at ipsum sed turpis sollicitudin ultrices. \end{document}
- Unexpected (to me!) behaviour when trying to resume enum item numbers in subsequent enumerate environmentsby dmorg on December 24, 2025 at 8:09 pm
I have defined a counter (firstcounter) and, in the first column, item numbers display as I'd expect. However, in the middle column with the same code (but a secondcounter to avoid interaction with the first list), I have changed \only<1-> to \only<1-4> and it breaks the numbering. The right hand column (with two separate counters, thirdcounter and fourthcounter), 'works' but unsatisfactorily; I feel I should not need an extra counter for each resumption of enumeration. Can someone explain to me what I'm doing wrong? \documentclass{beamer} \newcounter{firstcounter} \newcommand{\setfirst}{\setcounter{firstcounter}{\value{enumi}}} \newcommand{\contfirst}{\setcounter{enumi}{\value{firstcounter}}} \newcounter{secondcounter} \newcommand{\setsecond}{\setcounter{secondcounter}{\value{enumi}}} \newcommand{\contsecond}{\setcounter{enumi}{\value{secondcounter}}} \newcounter{thirdcounter} \newcommand{\setthird}{\setcounter{thirdcounter}{\value{enumi}}} \newcommand{\contthird}{\setcounter{enumi}{\value{thirdcounter}}} \newcounter{fourthcounter} \newcommand{\setfourth}{\setcounter{fourthcounter}{\value{enumi}}} \newcommand{\contfourth}{\setcounter{enumi}{\value{fourthcounter}}} \begin{document} \begin{frame} %left column \begin{minipage}{0.3\textwidth} \only<1->{ \begin{enumerate} \item 1st \item <2-> 2nd \item <3-> 3rd. \item <4-> 4th \setfirst \end{enumerate} } \only<5->{ \begin{enumerate} \contfirst \item 5th. \item <6-> 6th. \item <7-> 7th. \setfirst \end{enumerate} } \only<8->{ \begin{enumerate} \contfirst \item 8th. \item <9-> 9th. \item <10-> 10th. \end{enumerate} } \end{minipage} % middle column \begin{minipage}{0.3\textwidth} \only<1-4>{ \begin{enumerate} \item 1st \item <2-> 2nd \item <3-> 3rd. \item <4-> 4th \setsecond \end{enumerate} } \only<5->{ \begin{enumerate} \contsecond \item 5th. \item <6-> 6th. \item <7-> 7th. \setsecond \end{enumerate} } \only<8->{ \begin{enumerate} \contsecond \item 8th. \item <9-> 9th. \item <10-> 10th. \end{enumerate} } \end{minipage} % right column \begin{minipage}{0.3\textwidth} \only<1-4>{ \begin{enumerate} \item 1st \item <2-> 2nd \item <3-> 3rd. \item <4-> 4th \setthird \end{enumerate} } \only<5->{ \begin{enumerate} \contthird \item 5th. \item <6-> 6th. \item <7-> 7th. \setfourth \end{enumerate} } \only<8->{ \begin{enumerate} \contfourth \item 8th. \item <9-> 9th. \item <10-> 10th. \end{enumerate} } \end{minipage} \end{frame} \end{document} These are all the same lists and should have the same numbering.
- nicematrix submatrix fails when \Cdots is usedby projetmbc on December 24, 2025 at 2:52 pm
The following M(not)WE fails because of the \Cdots used. Is there a quick fix of this bug? The log file indicates the error below if I uncomment the failing sub matrix command. Package nicematrix Error: Impossible delimiter. (nicematrix) It's impossible to draw the right delimiter of (nicematrix) your \SubMatrix because all the cells are empty (nicematrix) in that column. (nicematrix) This \SubMatrix will be ignored. Here is the LaTeX code. \documentclass[border=5pt, varwidth]{standalone} \usepackage{nicematrix} \begin{document} $\begin{NiceArray}{*{7}{c}}[cell-space-limits=3pt] & & & & & & \Vdots \\ & & & & & & a[k]_{mj} \\ & & & & & & \Vdots \\ & & & & & & a[k]_{m'j} \\ & & & & & & \Vdots \\ & & & & & & \phantom{X} \\ \Cdots & 1 & \Cdots & 0 & \Cdots & \hspace{12.5pt} & a[k+1]_{ij} % \CodeAfter \SubMatrix({1-7}{5-7})[slim] % \SubMatrix({7-1}{7-5}) % <-- This fails! \SubMatrix({7-7}{7-7})%[slim] \end{NiceArray}$ $\begin{NiceArray}{*{7}{c}}[cell-space-limits=3pt] & & & & & & \Vdots \\ & & & & & & a[k]_{mj} \\ & & & & & & \Vdots \\ & & & & & & a[k]_{m'j} \\ & & & & & & \Vdots \\ & & & & & & \phantom{X} \\ Cdots & 1 & Cdots & 0 & Cdots & \hspace{12.5pt} & a[k+1]_{ij} % \CodeAfter \SubMatrix({1-7}{5-7})[slim] \SubMatrix({7-1}{7-5}) \SubMatrix({7-7}{7-7})%[slim] \end{NiceArray}$ \end{document} PS: for those who are curious, this is just to demonstrate how to calculate the number of paths of known length using an adjacency matrix.
- Incompatibility between KOMA-script classes and babel Spanishby mlg on December 24, 2025 at 10:57 am
While using [spanish]babel with a KOMA-script class (I've tried with scrartcl and scrbook) I get the following error: LaTeX hooks: Generic hooks cannot be added to '\@startsection'. How can I fix this? Here is my MWE. \documentclass{scrartcl} \usepackage[spanish]{babel} \begin{document} Buenos días. \end{document}
- Is there a reference on how to make tables better, or a more standard way of pre-contemplating them?by Jasper on December 23, 2025 at 6:39 pm
Is there a reference on how to make tables better, or a more standard way of pre-contemplating them? I was trying to tabulate the elementary linear transformations, and noticed that my table was rather unaesthetic. My hope is that someone could guide me on how I could better pre-contemplate these tables, so that they don't come out looking like this: \documentclass[letterpaper]{book} \usepackage{nicematrix} \usepackage{booktabs} \usepackage{tikz} \usepackage{microtype} \usepackage{mathtools} \usepackage{unicode-math} \newcommand{\temp}{% \begin{tikzpicture} \draw (-1,-1) rectangle (1,1); \node at (0,0) {Blah.}; \end{tikzpicture}% } \begin{document} \begin{table} \centering \begin{tabular}{lll} \toprule Linear transformation & Example Matrix & Geometric effect \\ \midrule Scale & \({\begin{bNiceArray}{cc} t & 0 \\ 0 & 1 \end{bNiceArray}}\) & \temp \\ \midrule Shear & \({\begin{bNiceArray}{cc} 1 & t \\ 0 & 1 \end{bNiceArray}}\) & \temp \\ \midrule Swap & \({\begin{bNiceArray}{cc} 0 & 1 \\ 1 & 0 \end{bNiceArray}}\) & \temp \\ \bottomrule \end{tabular} \caption{The elementary matrices are blah blah blah.} \label{table:chap-elem-mat} \end{table} \end{document}
- Tikz to plot a part of a coneby Latexfan on December 23, 2025 at 10:30 am
I try to use tikz to plot the following image ... \documentclass[border=0.2cm]{standalone} \usepackage{pgfplots} \usepgfplotslibrary{colormaps} \pgfplotsset{compat = newest} \begin{document} \begin{tikzpicture} \begin{axis}[ axis equal image, grid = both, minor tick num = 2, xlabel = {$x$}, ylabel = {$y$}, zlabel = {$z$}, major grid style = {draw = lightgray}, minor grid style = {draw = lightgray!25}, xmin = 0, xmax = 1, ymin = 0, ymax = 1, zmin = 0, zmax = 2, scale = 3, view = {60}{30}, samples = 30, samples y = 30, z buffer = sort, ] % Kjeglesektor \addplot3[ surf, shader = interp, opacity = 0.75, colormap/viridis, ] ({x},{y},{sqrt(3)*sqrt(x^2+y^2)}); \end{axis} \end{tikzpicture} \end{document} But I do not get similar image ... can you please help me?
- Booktabs cmidrule creates unwanted vertical spaceby profj on December 22, 2025 at 7:30 pm
I am making the following table using LaTeX. One way to do it is to make a separate row for the "Top Header" header. However, this results in space below that header and the "sub headers": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule & & \multicolumn{2}{c}{Top Header} \\ \cmidrule(lr){3-4} Main & Main & \\ Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} An alternative way is to include "Top Header" on the same line as the top line of the "Main Headers", but the use of \cmidrule creates awkward space for the two "Main Headers": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule Main & Main & \multicolumn{2}{c}{Top Header} \\ \cmidrule(lr){3-4} Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} A third way, with no \cmidrule gets the vertical spacing right, but I do want a to use \cmidrule to get a line under "Top Header": \documentclass{article} \usepackage{booktabs} \begin{document} \begin{table} \centering \begin{tabular}{ll rr} \toprule (1) & (2) & (3) & (4) \\ \midrule Main & Main & \multicolumn{2}{c}{Top Header} \\ Header 1 & Header 2 & Sub 1 & Sub 2 \\ \midrule 0.01 & 0.25 & 0.05 & 0.00 \\ 0.02 & 0.25 & 0.11 & 0.03 \\ 0.05 & 0.25 & 0.16 & 0.09 \\ \bottomrule \end{tabular} \end{table} \end{document} How can I get columns 1 and 2 to behave as in the first table, but columns 3 and 4 to behave as in the second table? In other words, I'd like the headers to take up two lines, as in the second table, and I'd like to use the \cmidrule command for columns 3 and 4, but I don't want the the extra space in between "Main" and "Header 1" and "Main" and "Header 2" that we see in the second table.
- Custom 3D line plot in plain tikz and/or luadrawby Dr. Manuel Kuehner on December 19, 2025 at 12:30 pm
Disclaimer This question is a bit of "do it for me" but there is a histrory behind it, see this question. User Jasper offered me a solution without using pgfplots. I plan to add a bounty as soon as it is possible. Question I want to create diagram with a 3D line plots. The main feature is to have several x axes that share the same y axis. Each x axis has its own F (or z) axis. There are only data points on specific y values (in the example below at +30, +15, 0, -15). In addition, the y axis is reversed (+ and - direction reversed). I need a grid in each F-x plane. Important ist also, that all F axes share the same min and max. Each axis should have a label and the diagram should have a title. The data is given in separate csv files, see example below. The MWE contains the data and plots the data (for testing) using pgfplots. Goal: The goal is to have a plain tikz solution and maybe in addition, a solution based on luadraw or lua-tikz3dtools respectively. I am looking for a easy-to-use custom interface for my plot task. If the result looks as it is created with pgfplots, then I am happy. S!#i, I forgot a key feature (not shown in the hand drawing) In addition to the x-F plots described above, there is ONE plot in the y-F plane (= from left to right). This works, because all F axes share the same min and max. \begin{filecontents*}{y_F_data.csv} y,F -15,20 -14,8 30,-4 \end{filecontents*} \documentclass{article} \usepackage{pgfplots} % ------------------------------- \begin{filecontents*}{x_zero.csv} x,F -30,12 -29,8 30,-4 \end{filecontents*} \begin{filecontents*}{x_neg_one.csv} x,F -30,12 -29,8 30,-4 \end{filecontents*} \begin{filecontents*}{x_pos_one.csv} x,F -30,12 -29,8 30,-4 \end{filecontents*} \begin{filecontents*}{x_pos_two.csv} x,F -30,12 -29,8 30,-4 \end{filecontents*} % ------------------------------- \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = center, title = {$x_0$}, xlabel = {$x_0$}, ylabel = {$F_0$}, xmin = -30, xmax = 30, ymin = -100, ymax = 100, ] \addplot table [x=x, y=F, col sep = comma] {x_zero.csv}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines = center, title = {$x_{-1}$}, xlabel = {$x_{-1}$}, ylabel = {$F_{-1}$}, xmin = -30, xmax = 30, ymin = -100, ymax = 100, ] \addplot table [x=x, y=F, col sep = comma] {x_neg_one.csv}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines = center, title = {$x_{1}$}, xlabel = {$x_{1}$}, ylabel = {$F_{1}$}, xmin = -30, xmax = 30, ymin = -100, ymax = 100, ] \addplot table [x=x, y=F, col sep = comma] {x_pos_one.csv}; \end{axis} \end{tikzpicture} \begin{tikzpicture} \begin{axis}[ axis lines = center, title = {$x_{2}$}, xlabel = {$x_{2}$}, ylabel = {$F_{2}$}, xmin = -30, xmax = 30, ymin = -100, ymax = 100, ] \addplot table [x=x, y=F, col sep = comma] {x_pos_two.csv}; \end{axis} \end{tikzpicture} \end{document}