Hot
- Switching between fourier and helveticaby Amir on September 25, 2026 at 8:10 am
In a manuscript there are two sections, the main part and the application part. For the main we use fourier package and for the application we use phv font with helvetica. The codes interfere with each other then. For example \Biggl(, \Biggr), \begin{cases} ... \end{cases} , \Biggl|, \Biggr| are not working for the fourier case. Also, \hbar is wrongly typed in the application part. Here is the code (given by AI) I am using % Configuration of \mathversion{application} (Helvetica / CM Math) \DeclareMathVersion{application} \SetSymbolFont{operators}{application}{T1}{phv}{m}{n} \SetSymbolFont{letters}{application}{OML}{cmm}{m}{it} \SetSymbolFont{symbols}{application}{OMS}{cmsy}{m}{n} \SetSymbolFont{largesymbols}{application}{OMX}{cmex}{m}{n} \SetMathAlphabet{\mathrm}{application}{T1}{phv}{m}{n} \SetMathAlphabet{\mathbf}{application}{T1}{phv}{b}{n} \SetMathAlphabet{\mathit}{application}{T1}{phv}{m}{it} % Dynamic Math Slot Switcher for Fourier <-> Application (Helvetica/CM) \makeatletter \let\fourier@orig@hbar\hbar % Fourier (normal) specific slots & delimiters \newcommand{\fourier@mathslots}{% \let\hbar\fourier@orig@hbar \global\mathcode`+ = "2280 \global\mathcode`- = "2200 \global\mathcode`= = "3281 \global\mathcode`< = "3282 \global\mathcode`> = "3283 % Delcodes for (, ), [, ], {, } \global\delcode`( = "0283A1 \global\delcode`) = "0293A2 \global\delcode`[ = "05B3A3 \global\delcode`] = "05D3A4 \global\delcode`\{ = "266328 \global\delcode`\} = "267329 % Macros for \lbrace, \rbrace, | \gdef\lbrace{\delimiter"4266328 }% \gdef\rbrace{\delimiter"5267329 }% \gdef\vert{\delimiter"026A30C }% \gdef\vertbar{\delimiter"026A30C }% } % Standard / Helvetica (application) slots & delimiters (CMEX/OMS) \newcommand{\standard@mathslots}{% \gdef\hbar{{\mathchar'26\mkern-9mu h}}% \global\mathcode`+ = "202B \global\mathcode`- = "2200 \global\mathcode`= = "303D \global\mathcode`< = "313C \global\mathcode`> = "313E % Delcodes for (, ), [, ], {, } \global\delcode`( = "028300 \global\delcode`) = "029301 \global\delcode`[ = "05B302 \global\delcode`] = "05D303 \global\delcode`\{ = "266308 \global\delcode`\} = "267309 % Macros for \lbrace, \rbrace, | \gdef\lbrace{\delimiter"4266308 }% \gdef\rbrace{\delimiter"5267309 }% \gdef\vert{\delimiter"026A30C }% \gdef\vertbar{\delimiter"026A30C }% } % Switch math slots when the math version changes \let\orig@mathversion\mathversion \renewcommand{\mathversion}[1]{% \orig@mathversion{#1}% \def\@tempa{#1}% \def\@tempb{normal}% \ifx\@tempa\@tempb \fourier@mathslots \else \standard@mathslots \fi } % Initialize in Fourier / normal mode \fourier@mathslots \makeatother Can you fix it so that two sections are working properly without interefering with each other? thanks.
- How to adjust the opacity of the solution enviroment background in exam class?by Mika Ike on September 25, 2026 at 6:06 am
How to adjust the opacity of the solution background in exam class? \documentclass[12pt]{exam} \usepackage[dvipsnames,x11names,svgnames]{xcolor} \shadedsolutions \colorlet{SolutionColor}{cyan!33} \usepackage{tikz} \usepackage{watermark} %-------------------------------- \watermark{ \begin{tikzpicture}[remember picture,overlay] \node [scale=1.1824,rotate=45,anchor=base,shift={(0em,6em)}] at (current page.center) [text width=1.64\linewidth,rounded corners,align=center] {{\color{pink} \parbox[][][m]{32cm}{ \LARGE{ {\center \hspace{6em}XXXXXXXXXXXXXX YYYYYYYYYYYYYYYY ZZZZZZZZZZZZZZZZ .......}}} }}; \end{tikzpicture} } \printanswers \begin{document} \begin{questions} \question $2+4=$ \begin{solution} $2+4=6$ \end{solution} \question $5+6$ \end{questions} \end{document}
- Why TeX does not print error for hyphenchar when \language is changed?by Igor Liferenko on September 25, 2026 at 6:01 am
If we run TeX on this example1.tex \hfuzz=\maxdimen \hsize=0pt \hyphenchar\font=`^^ff \hskip0pt error \bye in log file we get Missing character: There is no ^^ff in font cmr10! But if we change \language in example2.tex, this error message is not produced. Why? \language 1 \hfuzz=\maxdimen \hsize=0pt \hyphenchar\font=`^^ff \hskip0pt error \bye EDIT Let us load patterns. Create this my.tex: \input plain \language 1 \patterns {z4zy} \dump Then run tex -ini my to create my.fmt. Then run the example with new format: tex -fmt my example2 The warning in log file still does not appear. Why?
- zleftrepeat not working with noindent in Musixtexby ABV on September 25, 2026 at 3:55 am
It is needed to implement \zleftrepeat command with \noindent\kern-1.6cm to avoid the offset, but it is not working. The basic code is as follow: \documentclass[12pt]{article} % ========== FORMATO DE PÁGINA: A4 VERTICAL ========== \usepackage[a4paper,portrait,left=0.4cm,right=0.2cm,top=0.2cm,bottom=0.2cm]{geometry} \pagestyle{empty} % ========== PAQUETES ========== \usepackage{tikz} \usetikzlibrary{quotes} \usetikzlibrary{shapes} \usetikzlibrary{fit,positioning} \usetikzlibrary{arrows.meta} \usetikzlibrary{decorations} \usepackage{amsmath} \usepackage{xcolor} \usetikzlibrary{calc} \usepackage{musicography} \usepackage{musixtex} \input musixlyr \input musixjt \xdefinecolor{red-undar}{RGB}{179,35,79} \begin{document} \begin{music} % ========== CONFIGURACIÓN GLOBAL ========== \parindent0mm% \staffbotmarg8\Interligne \font\B=phvb8t at 12pt \font\A=phvb8t at 10pt \A% \setsongraise1{6mm} \setstaffs1{1} \setlines{1}{5} \setclef{1}{\treble} \setclefsymbol{1}{\empty}% \generalmeter{\meterfrac34}% %\nobarnumbers% \systemnumbers% \def\raisebarno{5\internote}% % acerca el número al pentagrama \def\shiftbarno{-5pt}% % posición horizontal \def\writebarno{\eightrm\the\barno\barnoadd}% quita el recuadro, usa texto simple \nostartrule % ancho de sistema = ancho del texto de la página A4 (sin sobreancho) % ========== SISTEMA 1 (6 compases) ========== \startpiece \Notes\usf m\ibl1i0\qb1j\nbbl1\qb1j\tbl1\qb1j\usf m\ibl2i0\qb2{j}\tbl2\qb2{j}\Qqbbl jjjj\en\bar% \Notes\usf m\ibl1i0\qb1j\nbbl1\qb1j\tbl1\qb1j\usf m\ibl2i0\qb2{j}\tbl2\qb2{j}\Qqbbl jjjj\en\bar% \Notes\usf m\ibl1i0\qb1j\nbbl1\qb1j\tbl1\qb1j\usf m\ibl2i0\qb2{j}\tbl2\qb2{j}\Qqbbl jjjj\en\bar% \Notes\usf m\ibl1i0\qb1j\nbbl1\qb1j\tbl1\qb1j\usf m\ibl2i0\qb2{j}\tbl2\qb2{j}\Qqbbl jjjj\en\bar% \noindent\kern-1.6cm\zleftrepeat% \Notes\ccharnote{-5}{\hspace{-0.7cm}\p}\usf p\ql j\Dqbu fj\qu f\en\bar% \Notes\usf p\ql j\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\ql j\Dqbu fj\qu f\en\bar% \Notes\usf p\ql j\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\ql j\Dqbu fj\qu f\en\bar% \Notes\usf p\ql j\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\ql j\Dqbu fj\qu f\en\bar% \Notes\usf p\ql j\Dqbu fj\Dqbu ff\en\bar% \Notes\usf p\ql j\Dqbu fj\qu f\en\bar% \NOtes\stdstemfalse\smallnotesize\islurd{1}{j}\grcu j\en% \Notes\tslur{1}{j}\ql j\qp\qp\en\rightrepeat% \Notes\ccharnote{-19}{\hspace{0.3cm}\mf}\usf m\ibl0i0\qb0j\triolet l\nbbl0\qb0{jj}\tql0j\usf m\ibl1i0\qb1{j}\tbl1\qb1{j}\Qqbbl jjjj\en\bar% \NOtes\stdstemfalse\smallnotesize\islurd{1}{j}\grcu j\en% \Notes\tslur{1}{j}\ql j\qp\qp\en\bar% \NOtes\stdstemfalse\smallnotesize\islurd{1}{j}\grcu j\en% \Notes\tslur{1}{j}\fermataup{k}\ql j\qp\qp\en\setdoubleBAR% \nolyr% \lyricsoff% \endpiece% \end{music} \end{document} The current output is as follow: The desired output is as follow:
- Why TeX does not print error message about \hyphenchar for some fonts?by Igor Liferenko on September 25, 2026 at 3:44 am
If we run TeX on this file \hfuzz=\maxdimen \hsize=0pt \hyphenchar\font=`^^ff \hskip0pt error \bye in log file we get Missing character: There is no ^^ff in font cmr10! But if we load rm-lmr10 font, this error message is not produced. Why? \font\F=rm-lmr10 \F \hfuzz=\maxdimen \hsize=0pt \hyphenchar\font=`^^ff \hskip0pt error \bye Which part of rm-lmr10 makes TeX not to print this message? Is this proper behavior?
- Override a PGF key .initial value for a new shapeby karlh on September 25, 2026 at 12:00 am
Is it possible to set shape border rotate to a new default for a particular shape? For example, say I want to define a shape (which I'll call trapezoid in the MWE) that is essentially a trapezium but it is rotated by 180° by default. For example, \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \pgfdeclareshape{trapezoid}{% \nodeparts{text}% \inheritsavedanchors[from=trapezium]% \inheritbackgroundpath[from=trapezium]% \inheritanchorborder[from=trapezium]% \inheritanchor[from=trapezium]{text}% \inheritanchor[from=trapezium]{center}% \inheritanchor[from=trapezium]{north}% \inheritanchor[from=trapezium]{south}% \inheritanchor[from=trapezium]{east}% \inheritanchor[from=trapezium]{west}% \inheritanchor[from=trapezium]{north west}% \inheritanchor[from=trapezium]{north east}% \inheritanchor[from=trapezium]{south west}% \inheritanchor[from=trapezium]{south east}% \behindbackgroundpath{% \pgfpathmoveto{\lowerleftpoint}% \pgfpathlineto{\upperrightpoint}% }% }% \begin{document} \begin{tikzpicture} \node [draw,trapezium,minimum size=1cm] {}; \node [draw=blue,trapezoid,minimum size=1cm,name=s] at (0,-1.25) {}; \node [draw=orange,trapezoid,minimum size=1cm,shape border rotate=180] at (0,-2.5) {}; % \foreach \anchor/\placement/\color in {north/above/orange,south/below/teal, % east/right/red,west/left/green,50/above/violet} % \draw [color=\color,shift=(s.\anchor)] plot [mark=x] coordinates {(0,0)}; \end{tikzpicture} but both the blue and the orange shapes should be the same. Alternatively, the blue one could be narrow-end-on-top, and the orange one rotates 180° more and looks like the black one. Options I have considered: Define a new shape and a new set of keys to go with it that are very similar to trapezium except upside-down (this is the worst option) Define trapezoid as a style that calls another shape (say, decorated trapezium or some such) whose only real purpose is to set another default value of shape border rotate Create an anchor that reads another key (say, trapezoid rotate) that determines what the user wants the new angle to be, then sets shape border rotate to something based on that. I am hoping there is another way, something like issuing \changepgfinitialvalue inside the shape definition so that the initial value changes for that shape (and only that shape). Is there?
- Rotate some table header's textby Natan Camargos on September 24, 2026 at 7:36 pm
My goal is to achieve this: Best that a can do now is: \begin{tabular}{c c c c c} &\Text{Calça Azul} & \text{Calça Preta} & \text{Sapato Azul} & \text{Sapato Preto} \\ \text{Camisa branca} & & & & \\ \text{Camisa vermelha} & & & & \end{tabular} How to get something more close to the goal?
- Drawing a rectangular box in three different orientations with TikZby Sebastiano on September 24, 2026 at 7:26 pm
I am preparing some physics exercises about pressure, and I would like to illustrate a rectangular box that can be placed on each of its three different faces. In this way, the same box would have three different base areas, while its dimensions remain unchanged. For example, my box has dimensions: 23 cm, 24 cm, 46 cm I would like to create the three possible orientations of the box with TikZ, so that in each drawing a different face is touching the ground. At the moment, I have this code for one orientation: \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{tikz} \begin{document} \begin{center} \begin{tikzpicture}[x=0.027cm,y=-0.027cm,line width=0.35pt,draw=black!75] \draw (77,123)--(77,199)--(146,231)--(281,163)--(281,110); \draw (146,156)--(146,231); \draw (212,55)--(212,122); \draw (77,123)--(60,84)--(126,117)--(146,156)--cycle; \draw (77,123)--(51,96)--(186,27)--(212,55)--(109,109); \draw (212,55)--(232,16)--(301,48)--(281,87)--cycle; \draw (146,156)--(281,87)--(319,91)--(184,160)--cycle; \draw[<->] (66,126)--(66,198); \draw[<->] (72,210)--(141,242); \draw[<->] (151,242)--(286,173); \node[rotate=-90,inner sep=0pt,font=\small] at (57,160) {23 cm}; \node[rotate=-25,inner sep=0pt,font=\small] at (101,233) {24 cm}; \node[rotate=27,inner sep=0pt,font=\small] at (227,213) {46 cm}; \end{tikzpicture} \end{center} \end{document} Is there a relatively simple way to modify this code (or to define a reusable TikZ command) so that I can obtain the other two orientations of the same box, with the 23 cm, 24 cm, and 46 cm dimensions exchanged accordingly? Ideally, I would like to be able to write something like \boxorientation{23}{24}{46} and obtain the corresponding drawing, or otherwise have a convenient way to generate the three possible orientations. The purpose is to use the drawings in physics exercises about pressure, where the students have to calculate the pressure exerted by the box when it rests on each of its three possible bases.
- How can I make a vee with two bars underneath it?by Akiva Weinberger on September 24, 2026 at 6:10 pm
In their 1962 paper "The Braid Groups," Fox and Neuwirth use a notation similar to \veebar to describe one point being directly on top of another in the plane, as shown below. I was wondering what the best way to reproduce this in LaTeX would be. One option would be \stackrel\vee=, but it doesn't have quite the right spacing. (I wonder how they did it. Obviously this predates LaTeX, but I don't know enough about the way mathematics papers were typeset in the 60s. By the way, the terms "abscissa and ordinate" refer to the x- and y-coordinate respectively.)
- Easys methods for reording elements visibility and layers [closed]by vanila bean on September 24, 2026 at 3:38 pm
Beginner Ipe user here! Every time I accidentally draw things in the wrong order my only method has been to redraw everything (eg. writing labels first and then drawing the filled nodes ultimately hiding the text labels as seen in the attached image). I was wondering if there was a way to make use of layers somehow to make this process simpler. I can see that you can toggle visibility but I could not see a way to change the pre-existing elements' stacking order. Are layers the way to go about it or is there some other tool I should be using for this? Thanks in advance & happy to add more clarification if necessary!
- Replacing a Circle of Asterisks with Tikz Colored Starsby DDS on September 24, 2026 at 2:52 pm
First, consider the code which produces the colored star: \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.geometric} \begin{document} \begin{center} \begin{tikzpicture} \node[ shape=star, star points=5, star point ratio=2.5, minimum size=0.8cm, fill=red, draw=red ] {}; \end{tikzpicture} \end{center} \end{document} which produces: Now, consider the code which produces the tikz circle of asterisks: \documentclass{book} \usepackage{tikz} \usetikzlibrary{shapes.geometric} % Required for the star shape \usetikzlibrary{calc} \definecolor{oldgloryblue}{RGB}{10,49,97} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \foreach \k in {0,30,...,360} \node at ($(0,0)+(\k:2)$){*}; \end{tikzpicture} \end{center} \end{document} and which produces However, when I replace the asterisk by `shape=star, star points=5, star point ratio=2.5, minimum size=0.8cm, fill=red, draw=red` I encounter many problems. QUESTION: How may I produce the circular image of `red stars' instead of the circular images of asterisks? Thank you.
- Manipulating the numbering of tcolorboxes created by newtcbtheoremby Littlejacob2603 on September 24, 2026 at 1:42 pm
I have the following set up for my different elements \documentclass{report} \usepackage[theorems]{tcolorbox} % for producing coloured boxes \tcbuselibrary{theorems} % theorems with tcolorbox \tcbuselibrary{breakable} \tcbuselibrary{skins} \definecolor{myblack}{RGB}{0, 0, 0} \definecolor{mywhite}{RGB}{255, 255, 255} \definecolor{mylightblue}{RGB}{102, 178, 255} \definecolor{mymidblue}{RGB}{0, 128, 255} \definecolor{mydarkblue}{RGB}{0, 0, 204} \definecolor{mylightgreen}{RGB}{128, 255, 0} \definecolor{mymidgreen}{RGB}{102, 204, 0} \definecolor{mydarkgreen}{RGB}{76, 153, 0} \definecolor{mylightred}{RGB}{255, 153, 153} \definecolor{mymidred}{RGB}{255, 102, 102} \definecolor{mydarkred}{RGB}{255, 51, 51} \definecolor{myyellow}{RGB}{255, 255, 0} \definecolor{myorange}{RGB}{255, 204, 153} \definecolor{mydarkpink}{RGB}{255, 102, 178} \definecolor{mymidpink}{RGB}{255, 153, 204} \definecolor{mylightpink}{RGB}{255, 204, 229} \tcbset{commonstyle/.style={ breakable, enhanced, coltitle=myblack, colupper=myblack, toprule=1mm, bottomrule=1mm, leftrule=1mm, rightrule=1mm }, defstyle/.style={ commonstyle, colframe=mydarkblue, colback=mylightblue, colbacktitle=mymidblue}, theostyle/.style={ commonstyle, colframe=mydarkred, colback=mylightred, colbacktitle=mymidred}, exastyle/.style={ commonstyle, colframe=mydarkgreen, colback=mylightgreen, colbacktitle=mymidgreen}, remstyle/.style={ commonstyle, colframe=mydarkpink, colback=mylightpink, colbacktitle=mymidpink} } \newtcbtheorem[number within=section, Crefname={theorem}{theorems}]{theorem}{Theorem}{theostyle}{theo} \newtcbtheorem[use counter from=theorem, Crefname={definition}{definitions}]{definition}{Definition}{defstyle}{def} \newtcbtheorem[use counter from=theorem, Crefname={example}{examples}]{example}{Example}{exastyle}{exa} \newtcbtheorem[use counter from=theorem, Crefname={remark}{remarks}]{remark}{Remark}{remstyle}{rem} \newtcbtheorem[use counter from=theorem, Crefname={corollary}{corollaries}]{corollary}{Corollary}{theostyle}{cor} \newtcbtheorem[use counter from=theorem, Crefname={lemma}{lemmas}]{lemma}{Lemma}{theostyle}{lem} \newtcbtheorem[use counter from=theorem, Crefname={proposition}{propositions}]{proposition}{Proposition}{theostyle}{prop} \newtcbtheorem[use counter from=theorem, Crefname={algorithm}{algorithms}]{algorithm}{Algorithm}{theostyle}{alg} \tcolorboxenvironment{proof}{commonstyle,colframe=mydarkred, colback=myorange, colbacktitle=mymidred} \begin{document} \chapter{Chapter 1} \section{Section 1.1} \begin{theorem}{Title}{1.1.1} ... \end{theorem} \begin{lemma}{Title}{1.1.2} ... \end{lemma} \begin{sublemma}{Title}{1.1.2a} ... \end{sublemma} \begin{corollary}{Title}{1.1.3} ... \end{corollary} \end{document} I want to understand how to define the sublemma tcbtheorem with an \alph counter so that the numbering reads Lemma 1.1.1a, Lemma 1.1.1b, ... Following Theorem/Lemma/... 1.1.1 and so on, resetting every time the original theorem counter increases. I've tried everything under the sun, but I couldn't make it work. I tried setting up a global counter for the theorems, but this kept on breaking with how tcolorbox overwrites the counter definition, etc. Does anyone know how to do it?
- Tasks environment: Page break in tasksby Martin on September 24, 2026 at 10:22 am
I use the tasks environment from the tasks package to make exercises and solutions. If the solutions are long, there is a lot of free space since it seems that individual \tasks do not allow page breaks inside of them. Instead. the \task will start on the next page. I could just use the enumerate environment for these solutions, but some solutions are rather short, so I use the task envornment for these, to have multiple tasks side by side, going from left to right and not from top to bottom first. To have my code consistent, I would like to have the longer solutions in the task environment also. Can \tasks somehow be set up such that they can span over multiple pages? MWE: \documentclass{scrartcl} \usepackage{tasks} \usepackage{lipsum} \begin{document} \begin{tasks} \task \lipsum[1-2] \task \lipsum[1-3] \end{tasks} \end{document}
- semi-space problem in Persian keyboard [closed]by Faroogh on September 24, 2026 at 7:56 am
I am a new Linux Ubuntu user that trying to learn that for my major but I do not know when I add Persian keyboard, It worked fine but when I try to write semi-space (usually write with ctrl + shift + 2 or shift + space) doesn't work at all like it does not know it at all. please If you know this problems solution leave an answer blow tnx
- TeXworks compiles without errors but will not output PDFby br4m on September 23, 2026 at 9:47 pm
I've been working on a fairly long document which uses quite a few subfiles. It had been compiling fine, but today I added some figures into one of the subfiles. Since then, when I try to compile the document it is like TeXworks gets stuck. The console output shows chapter headings and page numbers as I would expect, and seems to get to the end of the document. Then it says "*", and nothing else happens. It doesn't show any errors. I have also realised that it does create a PDF file in the right folder, but when I try to open that it seems to get stuck on loading (there's a grey background and a full loading bar, but no pages). I'm using MikTeX and TeXworks, set to compile using pdfLaTeX. Since there's no error message it's hard to know what's causing this. Does anyone know what's happening?
- Custom `\crefname`s do not work [closed]by Subhajit Paul on September 23, 2026 at 7:48 pm
\documentclass[a5paper]{article} \usepackage{amsthm} \usepackage[nospace]{varioref} \usepackage[colorlinks=true]{hyperref} \usepackage[english]{babel} \usepackage{cleveref} \newtheorem{defn}{Definition} \newtheorem{thm}[defn]{Theorem} \newtheorem{lem}[defn]{Lemma} \newtheorem{prop}[defn]{Proposition} \newtheorem{cor}{Corollary}[defn] \crefname{defn}{definition}{definitions} \crefname{thm}{theorem}{theorems} \crefname{lem}{lemma}{lemmas} \crefname{prop}{proposition}{propositions} \begin{document} \begin{defn}\label{D1} content \end{defn} \begin{thm}\label{T2} content \end{thm} \begin{lem}\label{L3} content \end{lem} \begin{prop}\label{P4} content \end{prop} \vref{D1} \vref{T2} \vref{L3} \vref{P4} \end{document} The custom \crefnames are not working as intended. Any help is appreciated.
- How to control backgrounds for named pages and ODD and EVEN un-named pages in book classby keith77777 on September 23, 2026 at 3:56 pm
There must be something wrong with the following code as it gives no errors but the wrong results. Changing the \getpagerefnumber to \getabspagerefnumber causes a huge number of errors. Please can you correct the syntax. I have deliberately included quite a few named pages in an attempt to trace what is going on. \documentclass{book} \usepackage[a6paper]{geometry} % to get smaller pictures \usepackage{graphicx} \usepackage{xparse} \usepackage{zref-abspage} % Required for \getabspagerefnumber \usepackage{lastpage} \usepackage{refcount} \usepackage{parskip} \ExplSyntaxOn \NewDocumentCommand{\choosebackgrounds}{mmmmmmmmm}% 9 [m]s { \bool_case:n {% {\int_compare_p:n {\value{page}=\getpagerefnumber{named_page_one}}} {\putbackground{#1} 111}% named {\int_compare_p:n {\value{page}=\getpagerefnumber{named_page_two}}} {\putbackground{#2} 222}% named {\int_compare_p:n {\value{page}=\getpagerefnumber{named_page_three}}} {\putbackground{#3}}% named % {\int_compare_p:n {\value{page}=\getpagerefnumber{title_page_one}}} {\putbackground{#5}}% title {\int_compare_p:n {\value{page}=\getpagerefnumber{title_page_two}}} {\putbackground{#6}}% title % {\int_compare_p:n {\value{page}=\getpagerefnumber{named_page_four}}} {\putbackground{#4}}% named % {\int_compare_p:n {\value{page}=\getpagerefnumber{LastPage}}} {\putbackground{#7}}% named % {\int_if_odd_p:n {\value{page}}} {\putbackground{#8}}% others {\int_if_even_p:n {\value{page}}} {\putbackground{#9}}% others } } \ExplSyntaxOff \NewDocumentCommand{\putbackground}{m}{\put(30mm,-90mm){#1}} \AddToHook{shipout/background}{% % \choosebackgrounds% on basis that first condition that is satisfied wins {\Huge named page one}% 1 {\Huge named page two}% 2 {\Huge named page three}% 3 {\Huge named page four}% 4 {\Huge title page one}% 5 {\Huge title page two}% 6 {\Huge LAST PAGE}% 7 {\Huge un-named ODD}% 8 {\Huge un-named EVEN}% 9 } \begin{document} \pagenumbering{arabic}% 1, 2, ... \setcounter{page}{1} \label{page:named_page_one}% Front cover: named page one Generated page No. \thepage % % --------------------------------------------------------------------- % \clearpage \label{page:named_page_two}% Inside front cover: named page two Generated page No. \thepage % ------------------------- Facing inside front cover ------------------ % \clearpage \label{page:named_page_three}% Facing inside front cover: named page three Generated page No. \thepage % ------------------------- Facing inside front cover ------------------ % \clearpage No label reference Just before title - a LEFT-HAND or EVEN page Generated page No. \thepage % ------------------------------ First title page --------------------------------- % {\centering \begin{titlepage}% first page of title- becomes revised page No 1 \begin{center} \label{page:title_page_one}% Title page: ONE Generated page No. \thepage Absolute page No: 4 % ------------------------------------ Second title page --------------------------- % \clearpage \label{page:title_page_two} Title page: TWO Generated page No. \thepage Absolute page No: 5 \end{center} \end{titlepage} } % --------------------------------------- Contents ---------------------------------- % \clearpage \label{page:named_page_four} The start of contents Generated page No. \thepage Absolute page No: 6 % ------------------------------------------------------------------------------------- % \clearpage Preface to this volume Generated page No. \thepage Absolute page No: 7 % ------------------------------------------------------------------------------------- % \mainmatter Some introductory content after mainmatter Generated page No. \thepage Absolute page No: 8 \vspace{6pt} First page of book proper. % -------------------------------------------------------------------------------------- % \clearpage% Another page of the book. Generated page No. \thepage % -------------------------------------------------------------------------------------- % \clearpage% Another page of the book. Generated page No. \thepage % -------------------------------------------------------------------------------------- % \clearpage% Another page of the book. Generated page No. \thepage % -------------------------------------------------------------------------------------- % \clearpage% Penultimate page Generated page No. \thepage % --------------------------------------------------------------------------------------- % \clearpage This is the rear cover% no background required but made visible here \label{page:LastPage} Generated page No. \thepage Absolute page No: 13 ? \end{document}
- Looking for a specific LaTex font [duplicate]by Rup_LA on September 23, 2026 at 3:40 pm
I am looking for a specific LaTex font which I loved very much (especially for the lambda it produces) I have already asked a question for the lambda but my preamble was restricted by my institution. But now I just want to use that lambda for my own documents. I'm attaching my previous questions and efforts here: Using lambda in different font than that of the document I want this document to recreate specifically. If anyone knows the font then please do let me know.
- latex2sympy2 parses correctly all variables except d and Eby program programson on September 23, 2026 at 2:42 pm
So I was playing around with latex2sympy2 - a Python library to convert LaTeX to SymPy objects. I tried to run this code: from latex2sympy2 import latex2sympy latex_code = r"\begin{bmatrix} a & b \\ c & d \end{bmatrix}" print(latex2sympy(latex_code)) and ran into this: Exception: I expected something else here \begin{bmatrix} a & b \\ c & d \end{bmatrix} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ It took me a while to figure out that the problem was d. I checked every letter instead of d and it worked correctly, run this so that you can see that yourself: from latex2sympy2 import latex2sympy for i in range(65, 91): if i == 69: continue # every letter except E print(chr(i), latex2sympy(r"\begin{bmatrix} 1 & 2 \\ 3 & %s \end{bmatrix}" % chr(i))) for i in range(97, 123): if i == 100: continue # every letter except d print(chr(i), latex2sympy(r"\begin{bmatrix} 1 & 2 \\ 3 & %s \end{bmatrix}" % chr(i))) # d try: print(latex2sympy(r"\begin{bmatrix} 1 & 2 \\ 3 & d \end{bmatrix}")) except Exception as e: print(f"{type(e).__name__}: {str(e)}") # E try: print(latex2sympy(r"\begin{bmatrix} 1 & 2 \\ 3 & E \end{bmatrix}")) except Exception as e: print(f"{type(e).__name__}: {str(e)}") I'm not good at LaTeX, though, please don't blame me. How do I fix that? I have no clues.
- How can I position one node chain relative to another?by EnronEvolved on September 23, 2026 at 12:17 pm
I'm trying to arrange a collection of nodes using \graph, which will be used to define a series of spath3 knot strands. However, the default cartesian placement strategy doesn't work very well for my purposes, as node chains that I intend to "tee off" from other nodes are placed at a constant width. It's possible to get what I want with the following code, but it's obviously rather fragile: \documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs} \begin{document} \begin{tikzpicture} \graph[nodes={draw, as={}}]{ a -> b -> c, {[placement/width=1, placement/depth=1, grow down] b -> d -> f -> g}, {[placement/width=2, placement/depth=2, grow right] f -> p}, }; \end{tikzpicture} \end{document} How can I achieve the same effect by specifying the node rather than the width and depth?
- Modern Scientific illustrations: what can we "show off" now that wasn't possible 12 years ago?by DJP on September 23, 2026 at 1:05 am
There is a highly popular post from 2014 showcasing Nice scientific pictures show off but a lot has changed with LaTeX over the last 12 years. What is your best science picture to show off now that wasn't possible 12 years ago? Constraints for each answer: The Picture & Code: Show off a beautiful scientific illustration that utilizes features, packages, or engine capabilities (e.g., LuaLaTeX memory handling, modern pgfplots limits, Luametafun) that remove barriers which routinely stopped typical users from doing this 12 years ago (such as hard memory crashes, lack of default ecosystem support, or prohibitive manual workarounds). The Evolution: You must explicitly explain what technological progress or package developmentover the last decade made this picture possible today. AI usage is allowed, but must be acknowledged per community guidelines.
- In bidi text using babel with LuaLaTeX, how do I control punctuation placement?by David Graff on September 22, 2026 at 10:39 pm
In the following minimal example, I placed each Arabic word on a separate line to make it clear that first the exclamation mark follows the fifth (final) Arabic word. Using "bidi=basic", the 5 Arabic words appear in the desired order (RTL), but that 1st excl.mark appears between the first Arabic word and the English word "There's", whereas it ought to appear between the word "Example:" and the fifth Arabic word (i.e. the excl.mark should be included within the RTL context of the Arabic phrase). \documentclass{article} \usepackage[english,bidi=basic]{babel} \babelprovide[onchar=ids fonts]{arabic} \babelfont{rm}{FreeSerif} \begin{document} \pagestyle{empty} \paragraph{Example:} يا ناس ما كان باس ! There's nothing wrong! \end{document} The placement is the same when I put the entire Arabic phrase on one line, with the excl.mark immediately after the last Arabic letter. I understand why this is happening. Is there a way to force that excl.mark to be included within the RTL scope of the Arabic phrase? (Edited to add: With all the Arabic on one line, most (all?) bidi-capable displays make the same mistake: the "default" LTR context causes the excl.mark to appear to the right of the Arabic phrase; usually this can be fixed by putting the Unicode RLE character U+202b in front of the first Arabic letter, and "Pop Directional Formatting" U+202c after the excl. mark. Doing that in the .tex file has no effect.)
- Is there any way to add a little space after a diacritic symbol used for IPA transliteration?by Cedric on September 22, 2026 at 3:53 pm
Using LuaLaTeX for a text in English that includes Cantonese characters and their IPA transliteration, all works fine, except that one diacritic symbol used for some final consonants (P, T, K) merge with the following tone symbol. The result is unreadable. Here is the MWE: \usepackage[english]{babel} \usepackage{fontspec} \babelfont{rm}{TeX Gyre Pagella} \babelprovide[import=yue]{cantonese} \babelfont[cantonese]{rm}[Renderer=Harfbuzz]{Noto Sans HK} \babelfont[tipa]{rm}[Renderer=Harfbuzz]{FreeSans} \usepackage[dvipsnames]{xcolor} \DeclareRobustCommand\gdg[1]{\textcolor{CadetBlue}{\foreignlanguage{cantonese}{#1}}} \DeclareRobustCommand\gdgp[1]{\textcolor{MidnightBlue}{\foreignlanguage{tipa}{[\,{\footnotesize #1}\,]}}} \begin{document} This transliteration without the issue: \gdg{廣州} \gdgp{kʷɔːŋ² tsɐu¹} Here is one example of the problematic case: \gdg{百越} \gdgp{paːk̚³ jyːt̚⁶} \end{document} After compilation, the unreleased stop diacritic, also known as "combining left angle above", UNICODE U+031A, directly merges into the following tone number in superscript. Hence my question: is there a possibility to include a space that would apply only after this diacritic stop symbol and not before any tone number? Thank you in advance for any help or suggestion
- Correctly closing tagging structure for custom sections in ltx-talkby David Purton on September 22, 2026 at 2:01 pm
I want to add some tagged section headings within frames with ltx-talk. It seems like using the exisiting section templates would be a neat way of doing this. But I am having trouble getting the section tagging structure to close correctly at the end of the frame. I can't find a way to inject sockets to close things without redefining internal ltx-talk macros. And so far, I haven't closed things correctly in all situations even if I do redefine. This seems to work in most cases I try, but seems risky: \cs_set_protected:Npn \__talk_frame_process:nn #1#2 { \__talk_decode_parse:n {#1} \bool_if:NT \l__talk_decode_mode_bool { \__talk_frame_process_aux:nn {#1} { #2 \par \UseTaggingSocket{sec/end}{6} \UseTaggingSocket{sec/end}{5} } } } What is a good way of doing this? MWE %! TeX Program = lualatex \DocumentMetadata{ , lang = en , pdfstandard = ua-2 , tagging = on } \documentclass{ltx-talk} \tagpdfsetup { , role/new-tag = frame-heading/H5 , role/new-tag = frame-subheading/H6 } \AssignStructureRole{sec/5/title}{frame-heading} \NewStructureName{sec/6} \AssignStructureRole{sec/6}{Sect} \NewStructureName{sec/6/title} \AssignStructureRole{sec/6/title}{frame-subheading} \NewStructureName{sec/6/number} \AssignStructureRole{sec/6/number}{section-number} \DeclareInstance{heading}{frame-heading}{display} { , name = frame-heading , level = 5 , before-vspace = \medskipamount , after-vspace = \smallskipamount , heading-decls = \Large\bfseries , headformat-instance = frame-heading } \DeclareInstance{heading}{frame-subheading}{display} { , name = frame-subheading , level = 6 , before-vspace = \medskipamount , after-vspace = \smallskipamount , heading-decls = \large\bfseries , headformat-instance = frame-subheading } \DeclareInstanceCopy{headformat}{frame-heading}{std} \DeclareInstanceCopy{headformat}{frame-subheading}{std} \ExplSyntaxOn \NewDocumentCommand \frameheading { D <> { all } m } { \__talk_if_overlay:nT {#1} { \ParseLaTeXeHeading{frame-heading}{\BooleanTrue}{}{#2} } } \NewDocumentCommand \framesubheading { D <> { all } m } { \__talk_if_overlay:nT {#1} { \ParseLaTeXeHeading{frame-subheading}{\BooleanTrue}{}{#2} } } \ExplSyntaxOff \begin{document} \begin{frame} Filler text. \frameheading{A Heading} Filler text. \framesubheading{A Subheading} Filler text. \end{frame} \begin{frame} \frametitle{A Frame Title} Filler text. \frameheading{A Frame Heading} Filler text. \framesubheading{A Frame Subheading} Filler text. \end{frame} \section{A Section Heading} \begin{frame} \frametitle{A Frame Title} Filler text. \frameheading{A Frame Heading} Filler text. \framesubheading{A Frame Subheading} Filler text. \end{frame} \end{document}
- Using lambda in different font than that of the documentby Rup_LA on September 22, 2026 at 6:36 am
I am writing my Mid-Sem Report to be submitted to my University and they have fixed a particular style of document to be used. I am attaching my code which I am writing. \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amssymb,graphicx,tikz,amsthm} \usetikzlibrary{arrows,matrix} \usepackage[utf8]{inputenc} \usepackage{titlesec} \titlelabel{\thetitle.\quad} \usepackage{setspace} \usepackage{indentfirst} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{Proposition}[theorem]{Proposition} \newtheorem{definition}{Definition}[section] \newtheorem{corollary}[theorem]{Corollary} \newtheorem{Con}[theorem]{Conjecture} \newtheorem{Prob}[theorem]{Problem} \newtheorem{Fact}[theorem]{Fact} \newtheorem{Remark}[theorem]{Remark} \newtheorem{Def}[theorem]{Definition} \newtheorem{Example}[theorem]{Example} \newtheorem{Question}[theorem]{Question} \newtheorem{Problem}[theorem]{Problem} %\newtheorem{proof}[theorem]{Proof} \renewcommand{\baselinestretch}{1.1} \usepackage{pifont,txfonts,geometry,hyperref} \newcommand{\bcomma}{,\allowbreak} \newcommand{\R}{\mathbb{R}} \newcommand{\ds}{\displaystyle} %%%%%%%%% Set page size and margins here %%%%%%%%%%%%%%% \setlength{\topmargin}{-0.5in} \setlength{\topskip}{0.275in} % between header and text \setlength{\textheight}{9in} % height of main text \setlength{\textwidth}{6.25in} % width of text \setlength{\oddsidemargin}{0.1in} % odd page left margin \setlength{\evensidemargin}{0.1in} % even page left margin %\theoremstyle{definition} %\newtheorem{definition}{Definition} \renewcommand{\theenumi}{\rm(\alph{enumi})} \renewcommand{\labelenumi}{\theenumi} %CAN REFER ITEMS WITH THE ABOVE TWO LINES \renewcommand{\theenumii}{\rm(\roman{enumii})} \renewcommand{\labelenumii}{\theenumii} \begin{document} %%%%%%%%%%%%%%%%%%%%%% Title page %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \thispagestyle{empty} \begin{center} \LARGE\textbf{Midterm Report} \end{center} \vspace{1cm} \noindent \textbf{Name: Arghya Das} \vspace{3mm}\\ \noindent \textbf{Roll No: MSI22022} \vspace{3mm}\\ \noindent \textbf{Name of the Supervisor: Prof. Milan Nath} \vspace{2em} \hrule \vspace{1em} \section*{Title: A study on algebraic connectivity and spectral integral variations of graphs.} \section*{Abstract:} Write your abstract within 200 words. \section{Introduction} Throughout this document, all graphs are assumed to be finite and simple, unless otherwise mentioned. Let $G$ be a graph with vertex set $V(G)=\{1,2,\dots,n\}$ and edge set $E(G)=\{e_1, e_2,\dots,e_m\}$. We use the notation $i\sim j$ to mean that the vertices $i$ and $j$ are adjacent. The\textbf{\textit{ adjacency matrix}} of $G$, denoted by $A(G)$, is defined as $A(G)=[a_{ij}]_{n\times n}$, where \\ \\ \indent \indent \indent \indent \indent \indent \indent \indent \indent \indent $a_{ij}=\begin{cases} 1, & \text{if } i \sim j\\ 0, & \text{otherwise.} \end{cases}$ \\ \\ The \textit{\textbf{Laplacian matrix}} of $G$, denoted by $L(G)$, is defined as $L(G) := D(G)-A(G)$, where $D(G)$ is the diagonal matrix with degrees of the vertices of $G$ as diagonal entries. It is well-known that $L(G)$ is symmetric and positive semidefiniite and rank of $L(G)$ is $n-k$ where $k=k(G)$ is the number of connected components in $G$. Since $L(G)$ is symmetric and positive semidefinite so all the eigenvalues of $L(G)$ are real and non-negative. Moreover, $0$ is the smallest eigenvalue of $L(G)$ as for $v=(1 \ \ 1\ \dots \ 1)^T \in \R^n$, \ \ $L(G)v=0v$. \par Suppose that $0=\lambda_1\leq \lambda_2 \leq \cdots$ \section{Preliminaries} \section{Work done} Maximum 03 pages \section{Further study} Maximum 01 page \begin{thebibliography}{33} \bibitem{F1} Castelaz, A.~Commutivity degree of finite groups.~Thesis,~Department of Mathematics,~ Wake Forest University,~North Carolina,~5-8, 2010. \bibitem{C1} Cerf, V.,~Fernandez, E.,~Gostelow, K.,~and~Volausky, S.~ Formal control and low properties of a model of computation. Report ENG 7178, Computer Science Department, University of California, Los Angles, CA,~pp. 81, 1997. \bibitem{E2} Dutta, P.~and~Nath, R.K.~Autocommuting probability of a finite group.~{\em Communications in Algebra},~46(3):961-969, 2018. \end{thebibliography} \end{document} However I didn't like the lambda produced here and I want it changed while rest of the fonts and symbols of the document remain untouched (as I can't change the fonts and symbols very much). I want this lambda to use specifically: I have gone through many Tex exchange answers and AI answers but none of them work. Some of these are: How to make italic greek letter \lambda \usepackage{amsmath,amssymb} \usepackage{unicode-math} \setmathfont{Latin Modern Math} \setmathfont[range=\lambda]{TeX Gyre Termes Math} \DeclareSymbolFont{newtxletters}{OML}{ntxmi}{m}{it} \DeclareMathSymbol{\newtxlambda}{\mathord}{newtxletters}{"15} But either they throw an error or produces the same lambda as in produced before. So any help would be appreciated.
- repeating verbatim text within forloop or equivalentby blandish on September 21, 2026 at 6:57 pm
I would like to use forloop (or multido or another alternative if suggested) so that I can generate a series of short coding quizzes where each quiz uses verbatim (or fancyvrb or listings or another alternative). But when I try to do this: \documentclass{article} \usepackage{forloop} \newcounter{x} \begin{document} \forloop{x}{1}{\value{x} < 7}{% \begin{verbatim} def f(x): return x + 1 \end{verbatim} } \end{document} I get an error: File ended while scanning use of \@xverbatim The same basic problem has occurred when I have tried using multido rather than forloop; likewise fancyvrb or listings instead of verbatim. Is there anyway around this limitation?
- Displaying a Tabularx Entry on Two Linesby DDS on September 21, 2026 at 3:34 pm
Consider the code: \documentclass[12pt]{book} \usepackage{tabularx,lipsum} \begin{document} \thispagestyle{empty} \begin{tabularx}{\linewidth}{c>{\arraybackslash}X} \emph{Heading:} \emph{(to go on second line)} \hskip 15pt & \lipsum[13] \end{tabularx} \end{document} which produces QUESTION: How may I place Heading: (on the second line) over two lines: Heading and (on the second line)? (\vspace{5pt} or \vspace*{5pt} neither seem to work; and, \\[5pt] gives me an overflow message.) Thank you.
- How to make this matrix fit inside the width of a column, in a document with a two-column page layoutby Ricky W. on September 20, 2026 at 7:02 pm
I am trying to put a 12 times 12 matrix into one column of the IEEE conference format. But it turns out like this. How do I make this looks better and fit the 12*12 matrix into the left column? Here is the package I am using \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts % The preceding line is only needed to identify funding in the first footnote. If that is unneeded, please comment it out. \usepackage{cite} \usepackage{amsmath,amssymb,amsfonts} \usepackage{algorithmic} \usepackage{graphicx} \usepackage{textcomp} \usepackage{xcolor} \usepackage{algorithm} \usepackage{mathtools} \usepackage{matlab-prettifier} \usepackage{diagbox} \usepackage{amsmath} \usepackage{booktabs} \usepackage{amsthm} \setcounter{MaxMatrixCols}{12} \newcommand{\INPUT}{\item[\algorithmicinput]} \newcommand{\algorithmicinput}{\textbf{Input:}} \newcommand{\OUTPUT}{\item[\algorithmicoutput]} \newcommand{\algorithmicoutput}{\textbf{Output:}} \newcommand{\INITIALIZE}{\item[\algorithmicinitialize]} \newcommand{\algorithmicinitialize}{\textbf{Initialize:}} \newcommand{\wvar}[1]{\mathit{#1}} Here is my code: \begin{equation} A = \begin{bmatrix} 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & g\sin{\psi} & g\cos{\psi} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & -g\cos{\psi} & g\sin{\psi} & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & r & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & -r & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & q & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_y-Jz}{J_x}r & \frac{J_y-J_z}{J_x}q \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_z-J_x}{J_y}r & 0 & \frac{J_z-J_x}{J_y}p \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{J_x-J_y}{J_z}q & \frac{J_x-J_y}{J_z}p & 0 \\ \end{bmatrix}\label{eq.3} \end{equation}
- roman numerals as enumeration in italics font styleby Rup_LA on September 20, 2026 at 2:59 pm
I'm writing a lemma with italics font style where I need enumeration in lowercase Roman numerals. I tried different ways and the best I could do is to use the package enumerate like this: \usepackage{enumerate} \begin{document} \begin{lemma} For any graph G, \begin{enumerate}[(i)] \item L(G) is symmetric. \item L(G) is positive semidefinite. \item etc. \end{enumerate} \end{lemma} \end{document} But the problem I'm facing is the tilts of parentheses are more than that I like. Actually I want like this: Any help would be appreciated.
- Macro for drawing intervalsby Fabrice on September 19, 2026 at 6:04 pm
How to modify this macro to ensure the same spacing between the first mark and the opening delimiter, and between the last mark and the closing delimiter ? \documentclass[border=5mm]{standalone} \usepackage{luatex85} \usepackage{luamplib} \begin{document} \mplibtextextlabel{enable} \begin{mplibcode} beginfig(1); vardef interval(expr a, b, c, d) = interim ahangle := 30; numeric u; u = 0.5cm; path l; l = (0,0) -- (8*u,0); drawarrow l; for x = (a + 0.2) step 0.2 until (b - 0.2): draw (3 down -- 3 up rotated -45) shifted (x * u, 0); endfor label(c, (2*u,0)); label(d, (6*u,0)); label.bot("$a$", (a*u,-5)); label.bot("$b$", (b*u,-5)); label.bot("$-\infty$", (0,-5)); label.bot("$+\infty$", (8*u,-5)); enddef; interval(2, 6, "[", "]"); endfig; \end{mplibcode} \end{document}