Week
- Why should I continue learning LaTeX?by Sourav on October 13, 2026 at 6:11 pm
I started learning (and using) LaTeX almost two years ago. But I see now that AI can produce the code for whatever I may want in a few seconds. This has demotivated me to continue learning more about LaTeX. Should I continue learning it ? If yes, why ? Just for the sake of enjoyment ? Or, are there more practical reasons ?
- Two Greek alphabetical sets: Key 'fontspec-opentype/Language' accepts only a fixed set of choicesby user41063 on October 13, 2026 at 2:57 pm
I am working on a font that includes two sets of the Greek alphabet, allowing for the choice between them. The code is as follows: \documentclass{article} \usepackage{fontspec} \usepackage[ancientgreek,italian,provide*=*]{babel} \babelfont[ancientgreek,italian]{rm}[Ligatures=TeX,Numbers={Lining, Proportional},RawFeature=+calt]{ContemporaryGaramond} \usepackage{etoolbox} \newrobustcmd\greekalt[1]{{\addfontfeature{StylisticSet=2}#1}} \begin{document} \begin{otherlanguage}{ancientgreek} Θουκυδίδης Ἀθηναῖος ξυνέγραψε τὸν πόλεμον τῶν Πελοποννησίων καὶ Ἀθηναίων, ὡς ἐπολέμησαν πρὸς ἀλλήλους, ἀρξάμενος εὐθὺς καθισταμένου καὶ ἐλπίσας μέγαν τε ἔσεσθαι καὶ ἀξιολογώτατον τῶν προγεγενημένων, τεκμαιρόμενος ὅτι ἀκμάζοντές τε ᾖσαν ἐς αὐτὸν ἀμφότεροι παρασκευῇ τῇ πάσῃ καὶ τὸ ἄλλο Ἑλληνικὸν ὁρῶν ξυνιστάμενον πρὸς ἑκατέρους, \end{otherlanguage} \bigskip \begin{otherlanguage}{ancientgreek} \greekalt{Θουκυδίδης Ἀθηναῖος ξυνέγραψε τὸν πόλεμον τῶν Πελοποννησίων καὶ Ἀθηναίων, ὡς ἐπολέμησαν πρὸς ἀλλήλους, ἀρξάμενος εὐθὺς καθισταμένου καὶ ἐλπίσας μέγαν τε ἔσεσθαι καὶ ἀξιολογώτατον τῶν προγεγενημένων, τεκμαιρόμενος ὅτι ἀκμάζοντές τε ᾖσαν ἐς αὐτὸν ἀμφότεροι παρασκευῇ τῇ πάσῃ καὶ τὸ ἄλλο Ἑλληνικὸν ὁρῶν ξυνιστάμενον πρὸς ἑκατέρους,} \end{otherlanguage} \end{document} Compilation halts, and I receive this error: ! LaTeX Error: Key 'fontspec-opentype/Language' accepts only a fixed set of (LaTeX) choices. For immediate help type H <return>. ... l.15 ...ενον πρὸς ἑκατέρους,} ? and: The key 'fontspec-opentype/Language' only accepts predefined values, and 'Ancient Greek' is not one of these. However, if I press "Enter," the file compiles correctly: Is there a way to avoid this error (and the potential consequences it might entail)? Thanks. PS I'm probably mistakenly mixing "classical mode" (which supports ancientgreek) and "modernmode" (which doesn't). But if I modify the code with: \documentclass{article} \usepackage{fontspec} \usepackage[ancientgreek,italian]{babel} \babelfont[ancientgreek,italian]{rm}[Ligatures=TeX,Numbers={Lining, Proportional},RawFeature=+calt]{ContemporaryGaramond} \usepackage{etoolbox} \newrobustcmd\greekalt[1]{{\addfontfeature{StylisticSet=2}#1}} disaster strikes because the LRoman font is searched for: /usr/local/texlive/2026/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyph-grc .tex UTF-8 Hyphenation patterns for Ancient Greek (/usr/local/texlive/2026/texmf-dist/tex/generic/hyph-utf8/patterns/tex/hyph-grc .tex))) Missing character: There is no ο (U+03BF) in font [lmroman10-regular]:+tlig;! Missing character: There is no υ (U+03C5) in font [lmroman10-regular]:+tlig;! Missing character: There is no κ (U+03BA) in font [lmroman10-regular]:+tlig;! Missing character: There is no υ (U+03C5) in font [lmroman10-regular]:+tlig;!
- Choose closed theta shape in fontsetup with lxby Ethan Duckworth on October 13, 2026 at 11:56 am
I would like to use the fontsetup package, with lx option, and get the closed theta shape 𝜃 but it gives ϑ instead. Here's my minimal file \input{iftex.sty} \RequireLuaTeX \documentclass{article} \usepackage[lx]{fontsetup} \begin{document} test $\theta$ \end{document} I tried adding the hooks from the newcomputermodern documentation \AddToHook{begindocument/end}{% \addfontfeature{RawFeature={-ss06}}} but it didn't help. Any suggestions?
- How to tell svg package that inkscape is enabled in shell_escape_commands?by Victor on October 13, 2026 at 8:24 am
I want to compile a file with svg graphics using the svg package. The documentation says Both packages svg and svg-extract rely heavily upon executing commands on shell using the \ShellEscape command—or respectively the old known \write18—for executing the CLIs of the applications mentioned above. So passing flag --shell-escape to the LATEX engine is utterly essential when using package svg and/or svg-extract. However, enabling --shell-escape globally is unsecure. As I understand it, it enables any Latex package to invoke any command. Latex provides a more fine-grained setting through the shell_escape_commands directive in texmf.cnf. It's a whitelist which is enabled by default. I added inkscape to the list. ~ : kpsewhich -var-value=shell_escape p ~ : kpsewhich -var-value=shell_escape_commands bibtex,bibtex8,extractbb,gregorio,kpsewhich,l3sys-query,latexminted,makeindex,memoize-extract.pl,memoize-extract.py,repstopdf,r-mpost,texosquery-jre8,inkscape, But svg package still complains: Package svg Warning: You didn't enable `shell escape' (or `write18') (svg) so it wasn't possible to launch the Inkscape export (svg) for `../../media/lysnip/murDeSaba/Huseyni-Makam.svg' on in put line 184. I added \svgsetup{inkscapeexe=inkscape} the document header, to try to convince the package to bypass the check, but that has no effect. Is there another way to make it understand that inkscape is enabled in shell_escape_commands, although --shell-escape is not given on the commandline?
- Adjusting vertical spacing AND indentation for list items in Beamerby Mandar Mitra on October 12, 2026 at 7:44 pm
I want to change both vertical spacing (topsep and itemsep) and indentation (\leftmargini etc.) in Beamer. Question 87249 addresses vertical spacing, while Question 5941 solves the indentation / margin issue. My problem is that while the two solutions work in isolation, I can't get them to work together. I've provided an MWE below. I suspect the problem is with the \setlistspacing macro, which is copied from the accepted answer, but don't know enough TeX to identify the problem. \documentclass{beamer} \makeatletter \newcommand{\setlistspacing}[2]{\def\@ld{#1}\expandafter\def\csname @list\romannumeral\@ld \endcsname{\leftmargin\csname leftmargin\romannumeral\@ld \endcsname \topsep #2 \parsep 0\p@ \@plus\p@ \itemsep #2}} \makeatother \begin{document} % \setlistspacing{1}{23pt} % \setlistspacing{2}{8pt} \setlistspacing{3}{10pt} \begin{frame}[t] \setlength{\leftmargini}{2mm} \setlength{\leftmarginii}{3mm} \setlength{\leftmarginiii}{4mm} \begin{itemize} \item Point A1: \begin{itemize} \item Point B is so long that it needs two lines longer longer longer longer longer \item Point C is so long that it needs two lines longer longer longer longer longer \begin{itemize} \item deeply nested deeply nested deeply nested deeply nested deeply nested deeply nested deeply nested \item deeply nested deeply nested deeply nested deeply nested deeply nested deeply nested deeply nested \end{itemize} \item Point D is so long that it needs two lines longer longer longer longer longer \end{itemize} \item Point A2: \item Point A3: \end{itemize} \end{frame} \end{document} In the above, adjusting the 3 \leftmargin lengths for the 3 levels works as expected. If I uncomment \setlistspacing{2}{8pt}, changing leftmarginii stops having any effect, but changing leftmarginiii affects the margins for levels 2 and 3 identically. Likewise, if I uncomment the line for level 1 as well, changing either leftmargini or leftmarginii stops having any effect, but changing leftmarginiii affects the margins for all 3 levels identically. I expect the long form solution (redefining \@listi and family) will work, but a corrected version of \setlistspacing would be a more compact way to achieve my objective.
- When to create a new command vs. a code snippetby wjmccann on October 12, 2026 at 7:31 pm
I have been using VS Code in order to type up my documents in Latex, and the terminal to compile/render them. In VS Code, I have various code snippets, such as "Real Numbers": { "prefix": "RR", "body": "\\mathbb{R}", "description": "Real numbers" }, that populate \mathbb{R} whenever I type RR. However, I could have also created a new command \RR in my tex file via \newcommand that does the same thing. I was wondering if y'all had any insight into when it would be better to use one over another. Question: Are there practical reasons to prefer using \newcommand over code fill snippets, or vice versa for certain applications?
- What's wrong with these margins, using the geometry package?by Cham on October 12, 2026 at 2:38 pm
I'm writing a large novel (no maths), and need to change the main font size and the page margins for a special page at the end of the novel. Using the commands \newgeometry and \restoregeometry works only if I use 1 inch for the left and right margins, and 0.5 inch for the top and bottom margins. Using 0.75in (for left and right) and 0.25in (for top and bottom) give a wrong asymmetrical composition, as shown with the following MWE. Take note that the main document is using 11pt font size, while I need to change it to 12pt for the special page at the end, as shown here: \RequirePackage[l2tabu,orthodox]{nag} \documentclass[11pt,twoside]{book} \usepackage[T1]{fontenc} \usepackage[tt=false]{libertinus} \usepackage[french]{babel} \usepackage[stretch=50]{microtype} % \usepackage[letterpaper,left=1.25in,right=1in,top=0.5in,bottom=0.5in,includeheadfoot,headheight=15pt,showframe]{geometry} % \raggedbottom \setlength{\parindent}{1.5em} % \linespread{1.1} \usepackage{fancyhdr} \begin{document} \mainmatter % \chapter*{Chapter title} Blabla bla bla blabla bla bla blablabla bla, blabla bla bla blabla bla bla blablabla bla. Blabla bla bla blabla bla bla blablabla bla blabla bla bla blabla bla bla blablabla bla. Blabla bla bla blabla bla bla blablabla bla. Blabla bla bla blabla bla bla blablabla bla. Blabla bla bla blabla bla bla blablabla bla, blabla bla bla blabla bla bla blablabla bla. \cleardoublepage \backmatter { \newgeometry{left=0.75in,right=0.75in,top=0.25in,bottom=0.25in,includeheadfoot} % New margins \fontsize{12}{14}\selectfont \noindent Blabla bla bla blabla bla bla blablabla bla, blabla bla bla blabla bla bla blablabla bla. Blabla bla bla blabla bla bla blablabla bla blabla bla bla blabla bla bla blablabla bla. Blabla bla bla blabla bla bla blablabla bla. Blabla bla bla blabla bla bla blablabla bla. Blabla bla bla blabla bla bla blablabla bla, blabla bla bla blabla bla bla blablabla bla. } \restoregeometry % \end{document} So what is wrong here? What mistake am I doing with this setup? Is there a better way to change the margins and font size just for a single special page? Would it be better for me to make that page with a separate code, and use the command \includepdf{page_name.pdf} instead? Take note that I'm using the standard TeXLive distribution of pdflatex.
- default key values and ltx-talk framesby David Purton on October 12, 2026 at 1:25 pm
I want to add some extra keys to the ltx-talk frame environment. In the following MWE, \test does not return true with \begin{frame}[test]. I can get \test to return true if: I use \begin{frame}[test=true] I use \begin{frame}[name=foo, test] I call \keys_set:nn { talk / frame } { test } in the preamble What's going on? \DocumentMetadata{} \documentclass{ltx-talk} \ExplSyntaxOn \keys_define:nn { talk / frame } { test .bool_set:N = \l_dcp_test_bool, test .default:n = true } \cs_new:Npn \test { \bool_if:NTF \l_dcp_test_bool { true } { false } } \ExplSyntaxOff \begin{document} \begin{frame}[test]% works with [test=true] or [name=foo, test] test: \test \end{frame} \end{document}
- Excluding specific `\subsubsubsection` and `\subsubsubsubsection` titles from the ToC in amsart?by Arbuja on October 11, 2026 at 10:29 pm
Background: I am using Latex Overleaf. I used a previous question to include \subsubsubsection and \subsubsubsubsection titles with the code. Edit: In my original paper, the ToC is three pages long and reading through it is tiring. If I can shorten the table of contents it will be easier for the viewers to read. Question: How do we exclude specific \subsubsubsection and \subsubsubsubsection titles from the ToC in amsart while allowing their section numbers, when they have no * marker. The Section numbers with an x (specifically Amet I and Elit II) should be excluded from the ToC. \documentclass[11pt]{amsart} \usepackage{xpatch} \NewCommandCopy\subsubsubsection\paragraph \NewCommandCopy\subsubsubsubsection\subparagraph \makeatletter % fix for further levels in the toc \xpatchcmd{\@writetocindents}{2,3}{2,3,4,5}{}{} % fix for unnumbered section titles not in the toc \xpatchcmd{\@startsection}{\@m}{\@M}{}{} \makeatother \setcounter{secnumdepth}{5} \setcounter{tocdepth}{5} \title[Title]{Title} \author[Arbuja]{Arbuja Krishnan} \address{None, Unaffiliated, United States} \begin{document} \maketitle \tableofcontents \section{Lorem} \subsection{Ipsum} \subsubsection{Dolor} \subsubsubsection{Sit} \subsubsubsection{Amet I} x \subsubsubsubsection{Amet II} \subsubsection{Consectetur} \subsubsubsubsection*{Adipiscing} x \subsubsubsubsection*{Elit} x \subsubsubsubsection{Elit II} x \end{document}
- TikZ: good method to add dimension arrowsby cis on October 11, 2026 at 6:03 pm
I would like to add dimension arrows like the ones shown here. What is the most elegant way to do this in common? (Note that I am showing an example here; however, a good general method would be interesting.) So, for instance, the dimension arrows and labels should be placed evenly and systematically. Here is my own rather clumsy attempt: \documentclass[margin=5pt, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} %% Values \pgfmathsetmacro{\R}{2.0} \pgfmathsetmacro{\a}{1.9} \pgfmathsetmacro{\b}{sqrt(\R^2 - \a^2) + \R} \pgfmathsetmacro{\x}{\R+(sqrt(2)*sqrt(\R*(2*\R-\b)) +\b -2*\R)-\b} \begin{tikzpicture}[scale=1.5, font=\footnotesize, >={Triangle[length=0pt 2*4,width=0pt 4]}, ] %% Coordinates on the main segment \coordinate[label=below:$M$] (M) at (0,0); \coordinate[label=below:$O$] (O) at (-\R,0); \coordinate[label=below:$A$] (A) at (\R,0); \coordinate[label=below:$C$] (C) at (\R-\b,0); %% Draw main segment OA \draw[] (O) -- (A); %% Solution elements on the main segment \coordinate[label=below:$X$] (X) at (\x,0); % Dimension arrows \foreach \P in {C,M,X,A}{%% \path[draw=none, shorten <=1em] (\P) -- +(0,-1.125) coordinate[pos=0.3] (\P-1) coordinate[pos=0.6] (\P-2) coordinate[pos=0.8] (\P-3) coordinate[pos=1.0] (\P-4); }%% \draw[shorten <=1em] (X) -- (X-2); \draw[<->] (C-1) -- (X-1) node[midway, fill=black!1]{$r$}; \draw[shorten <=0.25em] (M-1) -- (M-2); \draw[<->] ([yshift=0.5em]M-2) -- ([yshift=0.5em]X-2) node[midway, below]{$x$}; \draw[shorten <=1em] (C) -- (C-4); \draw[shorten <=1em] (A) -- (A-4); \draw[<->] (C-3) -- (A-3) node[midway, fill=black!1]{$b$}; %% Draw points on the axis (solution) \foreach \P in {A, X} \draw[fill=black!1] (\P) circle (1.5pt); %% Draw points on the axis (task) \foreach \P in {C, M} \draw[fill=black!1] (\P) circle (1.5pt); \draw[fill=black!1] (O) circle (1.5pt); \end{tikzpicture} \end{document}
- How to remove the page number from a single figure page? [duplicate]by carl on October 11, 2026 at 10:04 am
My document contains a relatively large figure with an extensive figure note. Because I am required to use relatively large vertical margins, the page number overlaps with the figure note (see below). Since this issue occurs on only one page in my document, I would like to suppress the page number on that specific page only, while keeping the figure, its note, and the formatting of all other pages unchanged. I have tried using \thispagestyle{empty}, but this removes the page number from the preceding page rather than the page containing the figure. I have also experimented with the float and floatpag packages, but these introduce unwanted changes to the formatting or page-number placement elsewhere in the document. My question is therefore whether there is a simple and reliable way to suppress the page number only on the page containing this particular figure, without affecting other pages or having to modify the generated PDF manually? Example: \documentclass[a4paper,12pt]{article} \usepackage[hmargin=1in,vmargin=1.5in,footskip=0.5in]{geometry} \usepackage[onehalfspacing]{setspace} \usepackage{graphicx} \usepackage{afterpage} \usepackage{subcaption} \usepackage{lipsum} \begin{document} \lipsum[1-4] {\afterpage \clearpage \begin{figure}[!ht] \subcaptionbox*{}{\includegraphics[width=.45\textwidth]{example-image-a}}\hfill \subcaptionbox*{}{\includegraphics[width=.45\textwidth]{example-image-b}}\\ \subcaptionbox*{}{\includegraphics[width=.45\textwidth]{example-image-a}}\hfill \subcaptionbox*{}{\includegraphics[width=.45\textwidth]{example-image-b}}\\ \subcaptionbox*{}{\includegraphics[width=.45\textwidth]{example-image-a}}\hfill \subcaptionbox*{}{\includegraphics[width=.45\textwidth]{example-image-b}}\\ \caption{Placeholder Figure} {\footnotesize Notes to figure: \lipsum[1-2][1-21]} \end{figure} } \lipsum[1-4] \end{document}
- constructing relative joined plot's and --'s with --cycle in tikzby Jasper on October 11, 2026 at 6:48 am
I was looking at Use "plot" inside a \draw path in tikz. I want to fill such a region, and improve my (very inconvenient currently) syntax. Is it possible to do cycle in a way like this too? \documentclass[border=1cm]{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[trig format=rad] \draw (0,1) coordinate (T0) -- (1,1) coordinate (T1) [shift={(T1)}] plot[domain=0:2*pi] (\x,{sin(\x)}) coordinate (T2) [shift={($(T1) + (T2)$)}] (0,0) -- (1,0) coordinate (T3) [shift={(T3)}] (0,0) -- (1,3) coordinate (T4) [shift={(T4)}] plot[domain=0:pi] (-2*\x,{sin(\x)}) coordinate (T5) [shift={($(T4) + (T5)$)}] plot[domain=0:1] (-\x,\x) [shift= {(T0)}] -- (0,0) ; \end{tikzpicture} \end{document}
- Using PetiteCaps: a special caseby user41063 on October 11, 2026 at 1:07 am
Some fonts include Petite Caps in addition to Small Caps. They are actually useful because roughly two-thirds of the Cyrillic alphabet is identical; once created, they serve a dual purpose (though Petite Caps are rarely used in print). Where they use the standard .pc extension, simply add the following to the preamble: \newrobustcmd\textpc[1]{{\addfontfeature{Letters=PetiteCaps}#1}} However, in some fonts (such as Garamond Premiere Pro), they are designated by the .a extension (lookup c2sc, but it adopts .pc and not .sc, that is right), and in that case, they are not utilized. I also tried: \newfontfamily{\textpc}[Letters=PetiteCaps]{Garamond Premr Pro} but the result is the same: \documentclass{article} \usepackage{fontspec} \usepackage[italian]{babel} \babelfont[italian]{rm}[RawFeature=+pcap]{Garamond Premr Pro} \usepackage{etoolbox} \newrobustcmd\pcap[1]{{\addfontfeature{Letters=PetiteCaps}#1}} %\newfontfamily{\pcap}[Letters=PetiteCaps]{Garamond Premr Pro} \begin{document} This is \textsc{small caps} and this is {\pcap petite caps lowercase} or {\pcap PETITE CAPS UPPERCASE} \end{document} I provide an MWE, but the downside is that the font needs to be installed. In general terms, do you have any suggestions, or is more information needed? For it isn't easy to find a font that (1) includes petite caps - most fonts don't - and (2) is available for free download. I'll try searching online... UPDATE The same with Brill, which use another not canonical extension for petiteCaps, id est .c2sc: \documentclass{article} \usepackage{fontspec} \usepackage[italian]{babel} \babelfont[italian]{rm}[RawFeature=+pcap]{Brill} \usepackage{etoolbox} \newrobustcmd\pcap[1]{{\addfontfeature{Letters=PetiteCaps}#1}} %\newfontfamily{\pcap}[Letters=PetiteCaps]{Garamond Premr Pro} \begin{document} This is \textsc{small caps} and this is \pcap{petite caps lowercase} or \pcap{PETITE CAPS UPPERCASE} \end{document} It's possible to download Brill free from: Brill font
- Eliminating user-defined beamer notes in ltx-talkby EconGuy on October 9, 2026 at 12:29 pm
I use beamer for my slides and have added notes to them, using the \note command, plus I have defined my custom \mynote to change the appearance as needed. As I have to provide accessible slides, I intend to switch to ltx-talk and as it doe snot support notes want to 'silence' the \note and \mynote command. While this easily works with \note, with \mynotes the problem is that once the overlay specification <10-11> becomes too big, it prints the notes. How can I silence my own command so that the note does not show? MWE (for texlive2026 and Lualatex) \DocumentMetadata{tagging=on, tagging-setup={math/setup=mathml-SE}, pdfstandard=ua-2, lang=en-GB} \documentclass[mode = handout]{ltx-talk} %%%Definition of mynote in beamer %\newcommand<>{\mynote}[1]{\alt#2{\note[item]{[$\rightarrow$]\textcolor{red}{#1}\par}} % {\note[item]{[$\rightarrow$] #1\par}}} \newcommand{\note}[2][]{} %%%This 'empty' command does not work \long\def\mynote#1#2#3#4{}% \begin{document} \begin{frame} \begin{itemize}[<+->] \item Point 1 \item Point 2 \item Point 3 \item Point 4 \item Point 5 \item Point 6 \item Point 7 \item Point 8 \item Point 9 \item Point 10 \item Point 11 \end{itemize} \note[itemize]{\item Initial note 1 \item Initial note 2} \mynote<1>{Note 1} \mynote<2>{Note 2} \mynote<3>{Note 3} \mynote<4>{Note 4} \mynote<5>{Note 5} \mynote<6>{Note 6} \mynote<7>{Note 7} \mynote<8>{Note 8} \mynote<9>{Note 9} \mynote<10>{Note 10} \mynote<10-11>{Note 11} \end{frame} \end{document}
- How could I make a template from this bit of code?by Jolia on October 9, 2026 at 8:32 am
I'm a teacher and for my tests, I have a template like that : \documentclass[11.5pt, oneside]{report} \usepackage{tikz} \RequirePackage{geometry} \geometry{a4paper,left=1.5cm,top=2.5cm,right=1.5cm,bottom=1cm} \begin{document} \begin{minipage}{0.60\linewidth} \begin{flushleft} \large NAME : {\dotfill} \\ \vspace{0.3cm} Forname : {\dotfill} \end{flushleft} \end{minipage} \hfill \begin{minipage}{0.15\linewidth} \begin{flushright} \large class \\ \vspace{0.3cm} date \end{flushright} \end{minipage} \vspace{0.5cm} \begin{center} {\Large \textbf{Contrôle number : test name}} \medbreak {\Large Sujet A} \medbreak {\Large Durée : duration.} \end{center} \vspace{0.5cm} \begin{tikzpicture} \draw[thick] (0,0)--(18,0)--(18,2.5)--(0,2.5)--cycle; \draw[thick] (0,0)--(2.5,2.5)--(2.5,0); \draw (1.8,0.7) node{\Huge maxgrade}; \end{tikzpicture} \end{document} I created a documentclass for my tests but I would like to find a way to define the date, the class, the number and name of the test, the duration of the test and the maximum grade and have them automatically be implemented in that way without having all those lines that make it hard to see and to modify. Does anyone have any idea of how I could do that?
- How to create an otf math font?by wipet on October 9, 2026 at 6:39 am
We have a font with almost all math characters and all sizes of braces, fences etc. Ten years ago we worked with pfb format of this font and we divided it to many subfonts and we created TeX metrics for them manually. The project was not completed and stopped. Now, the project is opened again. We decide that the old method (with many fonts and TeX metric) is obsolete and we want to create an OTF math font. Does anyone have any experience with this? What needs to be done? Yes, math font needs to have math tables inside, but how the tables can be created, what tools should be used and where is a specification of this format and good examples?
- Is it possible to combine T1 and OTF/TTF fonts nicely?by Roel on October 8, 2026 at 11:03 pm
I am trying to combine these two packages in LuaLaTeX, but cannot work out how to get both font encodings to work together nicely. Currently, to my surprise, only the bold bits are shown using the font txtt: \documentclass{article} \usepackage{fourier-otf} \usepackage{newtxtt} \usepackage[T1,TU]{fontenc} \begin{document} This is the main body text in \textbf{Erewhon Roman}. {\ttfamily\fontencoding{T1}This is typewriter text in \textbf{texttt}} \texttt{\fontencoding{T1}This is typewriter text in \textbf{texttt}} \verb|This is typewriter text in texttt| \end{document} Is there a way to make this work, ideally defining in the preamble that Erewhon is TU-encoded and txtt is T1-encoded and not switching encodings manually inside the document?
- Trying to find a specific math font or packageby iZiqx on October 8, 2026 at 10:07 pm
I'm trying to recreate the style of a pdf document i really like but i just can't get the font / package right , i tried fourier and a lot of others but nothing matches.
- How to show that a sinusoidal function continues indefinitely to the left?by Marco Moldenhauer on October 8, 2026 at 4:18 pm
I plotted a sinusoidal function using the axis environment from the pgfplots package. My code \documentclass[margin=3mm]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \begin{document} \begin{tikzpicture} \begin{axis}[ width=50cm, height=0.80\textwidth, axis y line=middle, axis x line=middle, axis on top, % <-- Correct pgfplots key to draw ticks, grid, and lines over plots xmin=-15, xmax=5.8, ymin=-125, ymax=125, xtick={-14,-3*pi,-5*pi/2,-2*pi,-3*pi/2,-pi,-pi/2,0,1,pi/2,pi,3*pi/2,2*pi}, xticklabels={$-\inf$,$-3\cdot\pi$,$-\frac{5}{2}\cdot\pi$,$-2\cdot\pi$,$-\frac{3}{2}\cdot\pi$,$-\pi$,$-\frac{1}{2}\cdot\pi$,$0$,1,$\frac{1}{2}\cdot\pi$,$\pi$,$\frac{3}{2}\cdot\pi$,$2\cdot\pi$}, ytick={-112.5,-112.5/sqrt(2),0,112.5/sqrt(2),112.5}, yticklabels={-112.5,,0,,112.5}, legend cell align={left}, grid=both, grid style={line width=.1pt, draw=gray!10}, major grid style={line width=.2pt, draw=gray!20}, xlabel={$\alpha=\omega\cdot t$ in rad}, ylabel={$p(t)$ in Watt}, xlabel style={at={(ticklabel* cs:1)}, anchor=north west}, ylabel style={at={(ticklabel* cs:1)}, anchor=south west} ] % 1. Colored area between x = 0 and x = 1 \addplot[ domain=0:1, samples=100, fill=green!30, draw=none ] {-112.5*sin(deg(x))} \closedcycle; % 2. Colored area between x = -4*pi and x = 0 \addplot[ domain=-4*pi:0, samples=100, fill=red!30, draw=none ] {-112.5*sin(deg(x))} \closedcycle; % Main curve \addplot[ domain=-4*pi:2*pi, samples=200, smooth, blue, thick ] {-112.5*sin(deg(x))}; \end{axis} \end{tikzpicture} \end{document} My output What I would like to achieve I would like to visually indicate that the sinusoidal function continues to oscillate periodically indefinitely in the negative "x"-direction. I'm totally open to creative ideas or completely different approaches. Any suggestions are very welcome! 🙂
- chemfig cram bond not drawn nicelyby nepomuk99 on October 8, 2026 at 4:15 pm
After some research (amongst others in this tex stackexchange question or this question), I could not resolve my issue in any straightforward way: It appears as though bond join is not working properly, since the following MWE % !TeX Program = lualatex \documentclass[tikz]{standalone} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \usepackage{chemfig} \setchemfig{ atom sep=0.5cm, cram width=2.0pt,, cram dash sep=0.5pt, cram dash width=0.5pt, bond join=true, bond style={line width=0.75pt, cap=round}} \begin{document} \chemfig{*6(--(<[::120]>[::60])-=--)} \end{document} produces this where I would expect it to produce this (pdf edited using inkscape): How can I get chemfig to draw the joined cram bonds properly? Of course I could edit all my figures in inkscape after producing them, but that seems not very efficient and somewhat defeating the purpose of a chemistry package... EDIT: I am sure that compilation uses bond join=true, although the difference is only nicely visible if cap=butt is set, as in \setchemfig{ atom sep=0.5cm, cram width=2.0pt,, cram dash sep=0.5pt, cram dash width=0.5pt, bond join=false, bond style={line width=0.75pt, cap=butt}} which then produces this output:
- Split an ecvitemize of europasscv list across pagesby Sebastiano on October 8, 2026 at 3:53 pm
I have a curriculum vitae and I would like to handle the page breaks in an ecvitemize list properly. \begin{ecvitemize} \item \lipsum[2][3-5] \item \lipsum[2][3-5] \item \lipsum[3][3-5] \item \lipsum[4][3-5] \item \lipsum[5][3-5] \item (2015) \lipsum[6][3-5] \item (2020) \lipsum[7][3-5] \end{ecvitemize} I would like the list to use the available space at the bottom of the page as efficiently as possible, with some \item filling the remaining space and the rest continuing normally at the top of the next page. At the moment, I would simply like to avoid having empty lines or large unused spaces at the bottom of the page. I have tried a few packages and different solutions, but eventually gave up on my attempts yesterday evening. I was thinking of something simple, such as a command like \breakpage, breakable of tcolorbox, \newpage, but I cannot figure out the best way to achieve this. What is the simplest way to do this? Simple solutions are preferred. Here my MWE: \documentclass[italian,a4paper]{europasscv} \usepackage[italian]{babel} \usepackage{graphicx} \usepackage{tikz} \usetikzlibrary{decorations.markings} \usepackage[pdftex,outline]{contour} \contourlength{0.011em} \usepackage[most]{tcolorbox} \newtcolorbox{mybox}{ blankest, borderline west={1pt}{-10pt}{% postaction=decorate, decoration={% markings, mark=at position 0.5 with {\filldraw circle[radius=3pt];} }, } } \usepackage{lipsum} \begin{document} \begin{europasscv} \lipsum[1] \lipsum[2] \lipsum[3] \lipsum[4] \lipsum[5] \lipsum[6] \lipsum[7] \lipsum[8] \lipsum[9] \lipsum[10] \ecvsection{Istruzione e formazione} \ecvtitlelevel{2012 – 2026/2027}{Corsi di perfezionamento \emph{post–lauream}}{ISCED~7} \ecvitem{}{ \begin{mybox} \begin{ecvitemize} \item \lipsum[2][3-5] \item \lipsum[2][3-5] \item \lipsum[3][3-5] \item \lipsum[4][3-5] \item \lipsum[5][3-5] \item (2015) \lipsum[6][3-5] \item (2020) \lipsum[7][3-5] \end{ecvitemize} \end{mybox} } \end{europasscv} \end{document}
- tikzpicture placing is different as specified [duplicate]by Rup_LA on October 8, 2026 at 1:48 pm
I am writing a document and used tikzpicture in an example. After the example, a section begins. But after compiling, I am getting the next section before the tikzpicture diagram, while my code says it to do otherwise. Why is it happening? I am sharing a fragment of the code here as the code for the whole document is too long: \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amssymb,graphicx,tikz,amsthm} \usetikzlibrary{positioning} \setlength{\topmargin}{-0.5in} \setlength{\topskip}{0.275in} % between header and text \setlength{\textheight}{9.5in} % height of main text \setlength{\textwidth}{6.25in} % width of text \setlength{\oddsidemargin}{0.1in} % odd page left margin \setlength{\evensidemargin}{0.1in} \newtheorem{theorem}{Theorem}[section] \theoremstyle{definition} \newtheorem{definition}{Definition}[section] \newtheorem{example}{Example} \begin{document} \begin{example} Here we give examples of two simple graphs where adding an edge results in spectral integral variation in one and two places. We also give one example where adding an edge does not result in spectral integral variation. The spectrum of each graph are written below that graph. \begin{figure}[htbp] \centering \tikzset{ vertex/.style={circle, draw=black, fill=white, inner sep=0pt, minimum size=4pt, thick} } % Left Graph \begin{tikzpicture}[baseline=(c.base), thick] % Coordinates: center and 4 cardinal directions \node[vertex] (c) at (0, 0) {}; \node[vertex] (n) at (0, 1.2) {}; \node[vertex](s) at (0, -1.2) {}; \node[vertex] (w) at (-1.2, 0) {}; \node[vertex] (e) at (1.2, 0) {}; % Edges forming the cross \draw (n) -- (c) -- (s); \draw (w) -- (c) -- (e); \node[below=1em of s] {$\{0, 1, 1, 1, 5\}$}; \end{tikzpicture} \hspace{2.5cm} % Right Graph \begin{tikzpicture}[baseline=(c.base), thick] % Coordinates \node[vertex] (c) at (0, 0) {}; \node[vertex] (n) at (0, 1.2) {}; \node[vertex] (s) at (0, -1.2) {}; \node[vertex] (w) at (-1.2, 0) {}; \node[vertex] (e) at (1.2, 0) {}; % Edges forming the cross plus the diagonal \draw (n) -- (c) -- (s); \draw (w) -- (c) -- (e); \draw[red] (s) -- (e); % Label underneath \node[below=1em of s] {$\{0, 1, 1, 3, 5\}$}; \end{tikzpicture} \\ \vspace{3em} \begin{tikzpicture}[baseline=(c.base), thick] \node[vertex] (u) at (0,0) {}; \node[vertex] (v) at (1.2,0) {}; \node[vertex] (w) at (2.4,0) {}; \draw (u) -- (v); \node[below=1em of v] {$\{ 0,0,2\}$}; \node[vertex] (p) at (5,0) {}; \node[vertex] (q) at (6.2,0) {}; \node[vertex] (r) at (7.4,0) {}; \draw (p) -- (q); \draw[red] (q) --(r); \node[below=1em of q] {$\{ 0,1,3 \}$}; \end{tikzpicture} \\ \vspace{3em} \begin{tikzpicture}[baseline=(c.base), thick] \node[vertex] (a) at (0,0) {}; \node[vertex] (b) at (1.2,0) {}; \node[vertex] (c) at (0,1.2) {}; \node[vertex] (d) at (1.2,1.2) {}; \draw (a)--(b); \draw (c)--(d); \node[draw=none] at (0.6,-1) {$\{ 0,0,2,2\}$}; \node[vertex] (p) at (4.5,0.5) {}; \node[vertex] (q) at (5.7,0.5) {}; \node[vertex] (r) at (6.9,0.5) {}; \node[vertex] (m) at (8.1,0.5) {}; \draw (p)--(q); \draw (m)--(r); \draw[red] (q)--(r); \node[draw=none] at (6.3,-1) {$\{ 0,2-\sqrt{2},2,2+\sqrt{2}\}$}; \end{tikzpicture} \end{figure} \end{example} \section{Work done} In this paper, we discuss the characterizations of simple graphs in which spectral integral variation occurs by adding an edge. We also investigate the case where (one of) the changed eigenvalue(s) is the algebraic connectivity. \end{document} which gives the result as shown below: Note that I've written the section after completing the example but it is coming before the pictures and then after the pictures again continued where it left.
- How to change width of precis text in newly defined part title page?by Chris Walton on October 8, 2026 at 1:41 pm
I have modified the part title page in memoir to: Add a part precis using chapterprecishere Add a part toc using \startcontents[parts] and \printcontents[parts]{}{0}{} Added a fake title to the part toc using \addtocontents Given this new part title page: how do I change the width of the precis text? How do I link the width of the precis text to the width of the toc? Example text width = 0.5 * toc width; or text width = toc width - number space - page number space (pseudo code). Any solution to this part has to be simple enough for me to understand as I will need to be able to maintain it in the future. My minex and image of my results so far are: \documentclass[a4paper,11pt,twoside,openright]{memoir} \usepackage{titletoc} \usepackage{lipsum} \makeatletter \def\ece#1#2{\expandafter#1\csname#2\endcsname} \def\setproperty#1#2#3{\ece\protected@edef{#1@p#2}{#3}} \def\setpropertyglobal#1#2#3{\ece\protected@xdef{#1@p#2}{#3}} \def\getproperty#1#2{ \expandafter \ifx\csname#1@p#2\endcsname\relax \else \csname#1@p#2\endcsname \fi} \makeatother \makeatletter \def\@endpart{ \vfil \chapterprecishere{\getproperty{partlayout}{text}} \setcounter{tocdepth}{0} \startcontents[parts] \printcontents[parts]{}{0}{} \par\bigskip \vfil\newpage \if@twoside \if@openright \null \thispagestyle{empty}% \newpage \fi \fi \if@tempswa \twocolumn \fi} \makeatother \setsecnumdepth{part} \begin{document} \setproperty{partlayout}{text}{\lipsum[1]} \setproperty{partlayout}{toctitle}{\cftpartfont{This is the Real (tm) ToC title}} \addtocontents{toc}{\getproperty{partlayout}{toctitle}} \part{First Part} \chapter{First Chapter} Obsufcate Pontificate Procrastinate Many times \end{document}
- want citations appear differently depending on my textby Rup_LA on October 8, 2026 at 10:42 am
I want to cite some papers as well as their authors in the document in different places. We use \cite{label} to cite a paper which appears as [#] in the document depending on the number given to it in the bibliography. Here is a sample of my Tex document code: \documentclass[a4paper,12pt]{article} \usepackage[ colorlinks=true, linkcolor=blue, citecolor=blue, urlcolor=blue ]{hyperref} \begin{document} \section*{Introduction} General Theory of Relativity \cite{ein} tells that ...\\ This theory is developed by Physicist \cite{ein} \begin{thebibliography}{33} \bibitem{ein} Einstein A., General Theory of Relativity, 2000. \end{thebibliography} \end{document} This gives the following output: I want the second [1] to be appeared as Einstein A. while the first one remains the same. Is there any way to do this?
- How to make \autoref shows "Example" for new theorem "example"? [duplicate]by Rup_LA on October 8, 2026 at 9:43 am
I want to link my example in text. For linking a lemma/theorem, I use \autoref which shows Theorem # in the document. But for the example environment, it is not working. What should I do? \documentclass{article} \usepackage{amsmath,amssymb,amsthm} \usepackage{hyperref} \hypersetup{ colorlinks=true, filecolor=blue, urlcolor=blue, linkcolor=blue } \newtheorem{theorem}{Theorem} \theoremstyle{definition} \newtheorem{example}{Example} \begin{document} \begin{theorem} \label{thm} Theorem. \end{theorem} \begin{example} \label{eg} Some examples. \end{example} See \autoref{thm} and \autoref{eg} \end{document} The above code gives the following output: Basically I want Example 1, not just 1. Any suggestion?
- Avoid double spaces around macro with no output [duplicate]by Wrzlprmft on October 8, 2026 at 7:02 am
I want to define a macro that – depending on its argument and external parameters – sometimes produces an output and sometimes nothing. When it produces nothing and is surrounded by spaces, it shall not yield a double space. Ideally, it applies the same behaviour to everything treated like a space such as newlines. How can I achieve this? The macro is exclusively used in regular text. Here is a minimal example: \documentclass[margin=5pt]{standalone} \usepackage{etoolbox} \newcommand{\mymacro}[1]{\ifstrempty{#1}{}{a #1 space}} \begin{document} Here \mymacro{} is \mymacro{double}. \end{document} This produces: I want to get rid of the double space without touching the document, only the macro definition. I considered the package trimspaces, but that can at best trim spaces created within the macro. xspace only adds spaces; so it’s also not what I am looking for.
- Small gap between the overlapped Wick contract lines on the same variableby myhsia on October 8, 2026 at 2:41 am
As shown in the attached picture, there are gaps in the same variable with double Wick contracted lines: especially the $\hat A$: the gap is wider. I guess it's similar to something like "letters' baseline"... but quite different. MWE: \documentclass{article} \usepackage{simplewick} \begin{document} \[ \contraction [1.6ex]{}{\hat q_j}{\,\hat q_j\,} {\hat q_j} \contraction [2.4ex]{\hat q_j\,}{\hat q_j}{\,\hat q_j\,}{\hat A} \bcontraction[.8ex] {\hat q_j\,}{\hat q_j}{\,} {\hat q_j} \bcontraction[1.6ex]{}{\hat q_j}{\,\hat q_j\,\hat q_j\,}{\hat A} \contraction [.8ex] {}{\hat q_j}{\,} {\hat q_j} \contraction [.8ex] {\hat q_j\,\hat q_j\,}{\hat q_j}{\,}{\hat q_j} \hat q_j\, \hat q_j\, \hat q_j\, \hat A \] \end{document}
- Dictate the first page break of an environmentby lobchi on October 7, 2026 at 11:26 pm
Doing math homeworks, I quite like each problem on a new page \newenvironment{problem}{\newpage}{} but sometimes the problem and solution are only about a third of the page leaving a lot of white space at the end. I would like to move the next problem up (i.e. do not \newpage) if and only if I can fit the entire problem-environment on that page. But, if forgoing the \newpage would mean having to break anywhere in the environment I would like it to first break at the top (and then if it's really long, we might go on to a second or third page). I know I can use \pagebreak[3] to strongly encourage a pagebreak at the top of the environment, and this works well when the first problem was already mostly filling the page: But if the first problem is far from the page break, a break later in the problem is taken before breaking at the top, which I take to be maximally bad. Below, Problem 2 spans the first and second pages when it should get a page break at the beginning
- scrletter: How to position enclosure next to closing?by lAtExFaN on October 7, 2026 at 9:57 pm
The German standard specification for business letters (specified in DIN5008) also allows to place the enclosures' hint next to the closing, see this demo screenshot: How can this change be implemented? This is the code (MWE) I used to produce the above shown default output: \documentclass{scrartcl} \usepackage{scrletter} \usepackage[ngerman]{babel} \setkomavar{fromname}{Peter Mustermann} \setkomavar{signature}{Peter} \renewcaptionname{ngerman}{\enclname}{Anlage} \setkomavar{enclseparator}[\sffamily{\bfseries\enclname}]{} \makeatletter %DIN5008 conforming enclosure option 1 (when enough vertical space left): \renewcommand*{\encl}[1]{% \par% \ifdim\parskip=\z@% \vskip\baselineskip% \fi% \noindent% \begingroup \parbox[t]{\textwidth}{% \Ifkomavarempty*{enclseparator}% {}% {% \strut\usekomavar*{enclseparator}\usekomavar{enclseparator}\\% }% \ignorespaces #1\strut}% \parfillskip\fill\par \endgroup } \makeatother \begin{document} \begin{letter}{% Petra Ochs\\ Vor dem Berg 1\\ 12345 Musterhausen% } \opening{Liebste Petra,} bla bla \ldots{} \closing{In Liebe} \encl{2 Poster\\5 Autogrammkarten} \end{letter} \end{document}
- How can I depict X-ray beams as wavefronts that interfere above the sample to form a standing wave?by user449589 on October 7, 2026 at 7:24 am
I'm not very skilled using TikZ but I wanted to use it for all the figures in my bachelors thesis. So far I created this TikZ-picture: \documentclass{article} \usepackage{tikz} \usetikzlibrary{patterns} \usetikzlibrary{patterns.meta} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{decorations.markings} \usetikzlibrary{snakes} \usetikzlibrary{arrows.meta} \usetikzlibrary{calc,patterns,angles,quotes} \usepackage[table]{xcolor} \definecolor{Minzgrün}{RGB}{0,140,79} \definecolor{Fenstergrau}{RGB}{128,128,128} \definecolor{Telegrau 4}{RGB}{230,230,230} \definecolor{Tomatenrot}{RGB}{140,28,0} \begin{document} \begin{tikzpicture} [x=0.35cm,y=0.2cm,line cap=round,line join=round] \draw[line width=1.5pt] (17.5,12.5) arc [start angle=0, end angle=180, x radius=2.5, y radius=1]; \draw [black, line width=1pt] (16,13) -- (21,14) node [align=center,right]{Detector\\window}; \draw[line width=1.5pt] (19,2) arc [start angle=0, end angle=180, x radius=4, y radius=1.5]; \draw[black,line width=1.5pt] (5,0.5) -- (25,0.5) -- (25,2) -- (5,2) -- cycle; \draw[black,line width=1.5pt] (10,25) -- (10,12.5) -- (20,12.5) -- (20,25); \draw[black,line width=1.5pt] (12.5,17.5) -- (17.5,17.5) -- (17.5,20) -- (12.5,20) -- cycle; \fill[black,pattern=crosshatch dots] (12.5,17.5) -- (17.5,17.5) -- (17.5,20) -- (12.5,20) -- cycle; \draw [black,line width=1pt] (12,20) -- (8.5,21) node[align=center,left] {Energy-dispersive\\detector}; \draw[Fenstergrau,line width=1pt,postaction={decorate,decoration={markings,mark=at position 0.15 with{\arrow{>}},mark=at position 1 with {\arrow{>}}}}] (-5,4) -- (10,2) -- (25,4); \draw[Fenstergrau,line width=1pt,postaction={decorate,decoration={markings,mark=at position 0.15 with{\arrow{>}},mark=at position 1 with {\arrow{>}}}}] (5,4) -- (20,2) -- (35,4); \node[align=center] at (0,6.5){Incident beam}; \node[align=center] at (30,6.5){Reflected beam}; \draw[black,line width=1pt] (12.5,1.25) -- (10,-2.5) node [below, align=center] {Sample carrier\\(\textit{reflector})}; \draw[black,line width=1pt] (16,2.5) -- (21,-2.5) node [below, align=center] {Sample}; \draw[Minzgrün,line width=1.25pt,->,decorate,decoration={snake,amplitude=0.1cm,segment length=0.4cm, post length=0.2cm}](15,2.5) -- (15,17); \draw [black, line width=1pt] (14,8) -- (9,12) node [align=center, left] {Fluorescence\\radiation}; \end{tikzpicture} \end{document} But I would like to include the X-ray beams as wave fronts which interfere above the sample to form a standing wave like in this image: Sadly this is beyond my TikZ-skills. Maybe somebody can help me or tell me where to look for answers. Thanks a lot!