Hot
- MikTex require Alegreya TTC?by nana on January 18, 2026 at 3:20 am
I used to have Alegreya font installed (presumably from google since it inception). As I migrated to a new system MikTeX said the Alegreya font I installed is not a TTC. Yes, it is indeed TTF from google package. But why I used to have no problem? What should I do now? Where to download a TTC Alegreya ?
- Set xmp description for other languages tooby HerpDerpington on January 18, 2026 at 1:50 am
The xmp description can be set for example using hyperref: \DocumentMetadata{ lang=en-US } \documentclass{article} \usepackage{hyperref} \hypersetup{ pdfsubject={This will end up as the english subject.} } \begin{document} test \end{document} exiftool then reveals: Description : This will end up as the english subject. Description (en-US) : This will end up as the english subject. Language : en-US coming from the XMP block [...] <dc:description> <rdf:Alt> <rdf:li xml:lang="x-default">This will end up as the english subject.</rdf:li> <rdf:li xml:lang="en-US">This will end up as the english subject.</rdf:li> </rdf:Alt> </dc:description> [...] which seems to suggest that the Description may also be set for other languages. How can I for example set the description for something like de-DE?
- How to add/calculate integers that are coming from a macro using LaTeX3?by lukascbossert on January 17, 2026 at 11:23 pm
In my example I want to calculate integers / getting the sum of entries based on various filtering options. Instead of using datatools macros, I’d like to get it done with LaTeX3/expl3-commands. The problem is the part: \int_set:Nn \l_tmpb_int { \dfgCountPosition[#1]{#2}{f} } which tells me in the log: ! Missing number, treated as zero. <to be read again> \xparse function is not expandable l.94 .../d): \dfgTotalPosition{PostDoc} but as far as I can see there is no \int_set:Nx for using an expansion therefor this is not the solution. So, how can I calculate the sum of entries based on the filter criteria? Here is my MWE \documentclass{article} \usepackage{expl3} % expl3 kernel \usepackage{datatool} % CSV handling \newcommand{\theFundingPeriodNumeral}{3} \ExplSyntaxOn %------------------------------------------------- % 1. Counting routine (optional DB argument) % \dfgCountPosition[<db>]{<position>}{<gender>} % → plain integer %------------------------------------------------- \NewDocumentCommand{\dfgCountPosition}{ O{mydb} m m } { % #1 = database name (default = mydb) % #2 = position (e.g. PostDoc) % #3 = gender (f / m / d) \group_begin: \def\dfgLocalDB{#1} \clist_clear:N \l_tmpa_clist \seq_clear:N \l_tmpb_seq \DTLforeach* [ \DTLiseq{#2}{\pPosition} \and \DTLiseq{#3}{\pGender} \and \DTLisinlist{PI}{\pRole} ] {\dfgLocalDB}{% \pID=id, \pPosition=position,% \pPeriod=period,% \pGender=gender,% \pRole=role }{ % using ID here because this is always one element \clist_put_right:NV \l_tmpa_clist {\pID} } \clist_count:N \l_tmpa_clist \group_end: } %------------------------------------------------- % 2. Total of the three genders for a given position % \dfgTotalPosition[<db>]{<position>} % → plain integer (f+m+d) %------------------------------------------------- \NewDocumentCommand{\dfgTotalPosition}{ O{mydb} m } { % start with the female count \int_set:Nn \l_tmpb_int { \dfgCountPosition[#1]{#2}{f} } % add the male count \int_add:Nn \l_tmpb_int { \dfgCountPosition[#1]{#2}{m} } % add the “diverse” count \int_add:Nn \l_tmpb_int { \dfgCountPosition[#1]{#2}{d} } % finally output the total \int_use:N \l_tmpb_int } \ExplSyntaxOff %------------------------------------------------- %------------------------------------------------- % Create a tiny CSV file that the example can read % ------------------------------------------------- \begin{filecontents*}{mydata.csv} id,position,period,gender,role 1,PostDoc,"2,3",f,PI 2,PostDoc,"1,2,3",m,PI 3,PostDoc,2,f,PI 4,PostDoc,3,d,PI 5,GroupLeader,3,m,PI 6,GroupLeader,2,f,PI 7,GroupLeader,3,m,PI 8,GroupLeader,2,d,PI 9,PhD,3,f,PI 10,PhD,2,m,PI \end{filecontents*} % Load the CSV into a datatool table called “mydb” \DTLloaddb{mydb}{mydata.csv} \begin{document} \section*{Demo of the two macros} \textbf{Counts for a single gender / position}\\[2mm] Females among PostDocs: \dfgCountPosition{PostDoc}{f}\\ Males among PostDocs: \dfgCountPosition{PostDoc}{m}\\ Diverse among PostDocs: \dfgCountPosition{PostDoc}{d}\\[2mm] \textbf{Total number of persons for a position}\\[2mm] All PostDocs (f/m/d): \dfgTotalPosition{PostDoc}\\ All GroupLeaders (f/m/d): \dfgTotalPosition{GroupLeader}\\ All PhDs (f/m/d): \dfgTotalPosition{PhD}\\[2mm] \textbf{Using a non‑default database (just to show the syntax)}\\[2mm] Females in the table “mydb” (same table here): \dfgCountPosition[mydb]{PhD}{f} \end{document}
- "[H]" command is not working even I used float package [duplicate]by Ege Tunç on January 17, 2026 at 8:19 pm
I used float package and here's an example of my graphs: \begin{figure}[H] \centering \subfloat[ObsID 4201960130]{\includegraphics[width=0.3\textwidth]{type2comptt/1.png}}\hfill \subfloat[ObsID 4201960131]{\includegraphics[width=0.3\textwidth]{type2comptt/2.png}}\hfill \subfloat[ObsID 4201960132]{\includegraphics[width=0.3\textwidth]{type2comptt/3.png}}\\[2mm] \subfloat[ObsID 4201960133]{\includegraphics[width=0.3\textwidth]{type2comptt/4.png}}\hfill \subfloat[ObsID 4201960134]{\includegraphics[width=0.3\textwidth]{type2comptt/5.png}}\hfill \subfloat[ObsID 4201960135]{\includegraphics[width=0.3\textwidth]{type2comptt/6.png}}\\[2mm] \subfloat[ObsID 4201960136]{\includegraphics[width=0.3\textwidth]{type2comptt/7.png}}\hfill \subfloat[ObsID 4201960137]{\includegraphics[width=0.3\textwidth]{type2comptt/8.png}}\hfill \subfloat[ObsID 4201960138]{\includegraphics[width=0.3\textwidth]{type2comptt/9.png}} \caption{Appendix figure: Type-II fits of \texttt{tbabs*(comptt + gauss)} model.} \label{fig:appendix1} \end{figure} whatever i do, i see "[H]" in text and cannot place the graph where i wanted Solved: "From the MNRAS LaTeX guide for authors: "The LATEX float placement commands [htbp] are intentionally disabled. Layout of figures and tables will be adjusted by the publisher during the production process, so authors should not concern themselves with placement to avoid disappointment and wasted effort. Simply place the LATEX code close to where the figure or table is first mentioned in the text and leave exact placement to the publishers.
- LaTeX macro to generate a centered grid of subfigures from a comma list (no gaps, equal widths, auto sublabels 1,2,3…)by taiwan12 on January 17, 2026 at 7:57 pm
I’m trying to define a LaTeX command that creates a figure containing multiple subfigures from a comma-separated list of image names. I’d like a macro with this interface: \multipleIMG{<images per row>}{<comma-separated list of image files>}{<main label>}{<main caption>} Requirements: Use the full available width (\linewidth). No horizontal and vertical gaps between images. Each row should be centered as a whole (even the last row if it’s not full). All images must have the same width (based on <images per row>). Create sublabels automatically as <main label>_1, <main label>_2, … (1, 2, 3, …). I’m using subcaption. I don’t want visible subcaptions, only labels for referencing (\phantomcaption is fine). Example input: \multipleIMG{3}{location-1,location-2,location-3,location-4,location-5}{fig:first}{Five Figure} This should produce 3 images in the first row, then 2 centered images in the second row, all with equal widths, and labels: fig:first_1, fig:first_2, fig:first_3, fig:first_4, fig:first_5 So that I can reference both the main figure and a subfigure like: \ref{fig:first}, \ref{fig:first_1} Here is an MWE showing the layout I want (hard-coded manually for 5 images). I want to replace this manual code with \multipleIMG. \documentclass{report} \usepackage[demo]{graphicx} \usepackage{subcaption} \usepackage[colorlinks=true]{hyperref} \begin{document} \begin{figure}[htbp] \centering \newlength{\imgw} \setlength{\imgw}{\dimexpr\linewidth/3\relax} \makebox[\linewidth][c]{% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_1} \end{subfigure}% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_2} \end{subfigure}% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_3} \end{subfigure}% } \vspace{-\baselineskip} \makebox[\linewidth][c]{% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_4} \end{subfigure}% \begin{subfigure}{\imgw} \includegraphics[width=\linewidth]{} \phantomcaption \label{fig:first_5} \end{subfigure}% } \caption{Five Figure} \label{fig:first} \end{figure} \ref{fig:first}, \ref{fig:first_1} \end{document}
- Technical question, Lua version built into luahbtex, vs lua in systemby rallg on January 17, 2026 at 7:51 pm
This question is a matter of curiosity, rather than a problem. Just yesterday, my texlive-bin was updated. Current version says that luatex (actually luahbtex is version 1.21.0. I do not get the binaries from TeXlive: Mya Android system, with Linux-like Termux app, gets a custom-build via Termux, because the file paths (and some other things) are different. Typically, I get the texlive-bin programs a few weeks later than they are released to others. Otherwise, the non-binaries come from TeXlive. As texlive-bin was being instllaed, the Terminal told me that it would be using Lua 5.2 for support; it was already in my system. But my own documents rely on Lua features that were unavailable until Lua 5.3. Nevertheless, all good. Behold: \documentclass{article} \directlua{ if (_VERSION >= 'Lua 5.3') then texio.write('LUA GOOD') else texio.write('LUA BAD') end } \begin{document} Hello, World. \end{document} It tells me LUA GOOD, even though Lua is version 5.2. I deduce that the Lua built into luahbtex is 5.3 or later. Others have asked whether the Lua is internal or external, and it has been answered: internal. But if I try to remove Lua (any version) from my system, it cannot be removed unless I also remove texlive-bin. Evidently, the installer believes that system Lua support is needed, even though the system version and built-in version do not match. Is there a reason for that? Or is it just how the installer script was written?
- Compilation problem with Symbolic Coordinatesby Fabrice on January 17, 2026 at 6:31 pm
This very simple code doesn't work, but I don't know what needs fixing. \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \begin{axis}[ [ xmin=0, xmax=100, y tick label style={/pgf/number format/1000 sep=}, symbolic y coords={Lecture, Jeux vidéo, Sport, Smartphone}, ytick=data ] \addplot[ xbar, fill=lightgray, ] coordinates { (10, Lecture) (50, Jeux vidéo) (30, Sport) (90, Smartphone) }; \end{axis} \end{tikzpicture} \end{document}
- Error while running Asymptote on Windows (file ended while scanning use of \next)by orion2112 on January 17, 2026 at 6:00 pm
Context All I want is to be able to plot nice 3D plots of functions of 2 variables. In another question of mine, it became clear to me that pgfplots is limiting my ability to do so. It was suggested to me to try out Asymptote. No problem, I am willing to learn... but I can't get it to compile on my setup. I've spent more time than I'm willing to admit on this and I need help. My Setup I am on Windows 11, I use TexStudio 4.9.1 and Tex Live (fresh install) and this is my Asymptote version and location C:\Users\USER>asy --version Asymptote version 3.04 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince] ENABLED OPTIONS: V3D 3D vector graphics output WebGL 3D HTML rendering OpenGL 3D OpenGL rendering SSBO GLSL shader storage buffer objects GSL GNU Scientific Library (special functions) FFTW3 Fast Fourier transforms Eigen Eigenvalue library XDR External Data Representation (portable binary file format for V3D) CURL URL support LSP Language Server Protocol Readline Interactive history and editing GC Boehm garbage collector threads Render OpenGL in separate thread DISABLED OPTIONS: Sigsegv Distinguish stack overflows from segmentation faults C:\Users\ORION>where asy C:\texlive\2025\bin\windows\asy.exe I use this line for compilation: pdflatex.exe --shell-escape -synctex=1 -interaction=nonstopmode %.tex I am aware that I should be compiling 3 times (the file is called test.tex): pdflatex test.tex asy test-1.asy pdflatex test However the first pdflatex compilation fails. The problem I am trying to run the simple code: \documentclass[12pt]{article} \usepackage{asymptote} \begin{document} This is a test \begin{asy} size(5cm); draw((0,0)--(1,1)); \end{asy} \end{document} and here is a snippet of the error log (at the end): (c:/texlive/2025/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live )) \openout3 = `test-1.asy'. ) Runaway argument? ! File ended while scanning use of \next. The file I am trying to compile is called test.tex and it produces a test-1.asy file which contains the following code: \end{asy} ^ C:\Users\***\test\test-1.asy: 13.2: invalid token '\' \end{document} ^ C:\Users\***\test\test-1.asy: 14.1: invalid token '\' \end{document} ^ C:\Users\***\test\test-1.asy: 14.2: syntax error: error: could not load module 'C:\Users\***\test\test-1.asy' I find it weird that it starts with \end{asy} and I suspect this is what causes the "runaway argument" error when compiling. What I have tried Deleting all but the .tex file in the working folder and recompile. I asked Crixet about this and it told me to play around the [inline] option with \usepackage{asymptote}. It changed nothing. It asked me to look into the test.pre file, which only contains: \InputIfFileExists {\jobname -1.pre}{}{} It says there should be no space between \jobname and -1.pre and that this causes asymptote not to find the test-1.asy file. I'm not 100% about this and even if it is true, why there is a space there is beyond me. I tried running the code using a command prompt with pdflatex test.tex within the folder but get the same error, so this does not seem to be caused by TexStudio. At first I was using MikTex. I had the same issue and heard that "MikTex had an outdated Asymptote package" and "I should switch to TexLive" which I did (after having uninstalled MikTex). So it seems like the issue isn't with MikTex or Tex Live either. I have the same setup (TexStudio + MikTex) on a laptop with Kubuntu and the same code works fine. I could use this but it is not optimal for my workflow. It seems to me like other people are able to run this fine on Windows, so I don't see why I couldn't. What I'm looking for I am at a loss as to what causes this issue. Also, I'm okay with understanding Latex "code" but anything outside like running command line, changing TexStudio configuration, etc. is not something I'm experienced with. So please, if you reply, explain like I'm five, because saying things that might seem obvious like "Make sure asymptote is on path" is really not clear to me. Thanks in advanced for all the help. Edit: adding the full log This is pdfTeX, Version 3.141592653-2.6-1.40.28 (TeX Live 2025) (preloaded format=pdflatex 2026.1.17) 17 JAN 2026 14:22 entering extended mode \write18 enabled. %&-line parsing enabled. **test.tex (./test.tex LaTeX2e <2025-11-01> L3 programming layer <2025-12-29> (c:/texlive/2025/texmf-dist/tex/latex/base/article.cls Document Class: article 2025/01/22 v1.4n Standard LaTeX document class (c:/texlive/2025/texmf-dist/tex/latex/base/size12.clo File: size12.clo 2025/01/22 v1.4n Standard LaTeX file (size option) ) \c@part=\count275 \c@section=\count276 \c@subsection=\count277 \c@subsubsection=\count278 \c@paragraph=\count279 \c@subparagraph=\count280 \c@figure=\count281 \c@table=\count282 \abovecaptionskip=\skip49 \belowcaptionskip=\skip50 \bibindent=\dimen148 ) (c:/texlive/2025/texmf-dist/tex/latex/asymptote/asymptote.sty Package: asymptote 2024/02/26 v1.38 Asymptote style file for LaTeX (./test.pre) \ASYbox=\box53 \ASYdimen=\dimen149 \c@asy=\count283 \AsyStream=\write3 \AsyPreStream=\write4 (c:/texlive/2025/texmf-dist/tex/latex/graphics/keyval.sty Package: keyval 2022/05/29 v1.15 key=value parser (DPC) \KV@toks@=\toks17 ) (c:/texlive/2025/texmf-dist/tex/latex/base/ifthen.sty Package: ifthen 2024/03/16 v1.1e Standard LaTeX ifthen package (DPC) ) (c:/texlive/2025/texmf-dist/tex/latex/graphics/graphicx.sty Package: graphicx 2024/12/31 v1.2e Enhanced LaTeX Graphics (DPC,SPQR) (c:/texlive/2025/texmf-dist/tex/latex/graphics/graphics.sty Package: graphics 2024/08/06 v1.4g Standard LaTeX Graphics (DPC,SPQR) (c:/texlive/2025/texmf-dist/tex/latex/graphics/trig.sty Package: trig 2023/12/02 v1.11 sin cos tan (DPC) ) (c:/texlive/2025/texmf-dist/tex/latex/graphics-cfg/graphics.cfg File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: pdftex.def on input line 106. (c:/texlive/2025/texmf-dist/tex/latex/graphics-def/pdftex.def File: pdftex.def 2025/09/29 v1.2d Graphics/color driver for pdftex )) \Gin@req@height=\dimen150 \Gin@req@width=\dimen151 ) (c:/texlive/2025/texmf-dist/tex/generic/iftex/ifpdf.sty Package: ifpdf 2019/10/25 v3.4 ifpdf legacy package. Use iftex instead. (c:/texlive/2025/texmf-dist/tex/generic/iftex/iftex.sty Package: iftex 2024/12/12 v1.0g TeX engine tests )) (c:/texlive/2025/texmf-dist/tex/generic/iftex/ifxetex.sty Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead. ) (c:/texlive/2025/texmf-dist/tex/generic/catchfile/catchfile.sty Package: catchfile 2019/12/09 v1.8 Catch the contents of a file (HO) (c:/texlive/2025/texmf-dist/tex/generic/infwarerr/infwarerr.sty Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) ) (c:/texlive/2025/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO) ) (c:/texlive/2025/texmf-dist/tex/generic/etexcmds/etexcmds.sty Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO) )) \openout4 = `test.pre'. ) (c:/texlive/2025/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def File: l3backend-pdftex.def 2025-10-09 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count284 ) (./test.aux) \openout1 = `test.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 3. LaTeX Font Info: ... okay on input line 3. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 3. LaTeX Font Info: ... okay on input line 3. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 3. LaTeX Font Info: ... okay on input line 3. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 3. LaTeX Font Info: ... okay on input line 3. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 3. LaTeX Font Info: ... okay on input line 3. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 3. LaTeX Font Info: ... okay on input line 3. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 3. LaTeX Font Info: ... okay on input line 3. (c:/texlive/2025/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] \scratchcounter=\count285 \scratchdimen=\dimen152 \scratchbox=\box54 \nofMPsegments=\count286 \nofMParguments=\count287 \everyMPshowfont=\toks18 \MPscratchCnt=\count288 \MPscratchDim=\dimen153 \MPnumerator=\count289 \makeMPintoPDFobject=\count290 \everyMPtoPDFconversion=\toks19 ) (c:/texlive/2025/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 85. (c:/texlive/2025/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv e )) \openout3 = `test-1.asy'. ) Runaway argument? ! File ended while scanning use of \next. <inserted text> \par <*> test.tex I suspect you have forgotten a `}', causing me to read past where you wanted me to stop. I'll try to recover; but if the error is serious, you'd better type `E' or `X' now and fix your file. ! Emergency stop. <*> test.tex *** (job aborted, no legal \end found) Here is how much of TeX's memory you used: 1792 strings out of 467538 29656 string characters out of 5423725 433733 words of memory out of 5000000 30710 multiletter control sequences out of 15000+600000 628019 words of font info for 41 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 72i,0n,79p,223b,66s stack positions out of 10000i,1000n,20000p,200000b,200000s ! ==> Fatal error occurred, no output PDF file produced!
- Insert in middle blank page with 2 columnsby miguel747 on January 17, 2026 at 5:26 pm
I'm having trouble inserting an image (Tikz) in the middle of a document that has two columns, and the second column is blank. Any tips? I replaced the \columnbreak (which only works with multicolumns and causes the error) with \newpage in \twocolumn mode, and added another \newpage after the block to start the next section on a new page. % ============================== % Codificação e fonte % ============================== \documentclass[a4paper,9pt]{article} \usepackage{lmodern} % Usa Latin Modern como base (compatível com fontes vetoriais) \usepackage{helvet} % Usa Helvetica \renewcommand{\familydefault}{\sfdefault} % Define sans-serif como padrão % ============================== % Formatação geral da página % ============================== \usepackage{geometry} % Define margens da página \geometry{top=2cm, bottom=2.7cm, left=1cm, right=1cm, headheight=62pt} \setlength{\footskip}{50pt} % Distância do rodapé até o fim da página \setlength{\parskip}{0pt} % Espaço entre parágrafos \setlength{\parindent}{1em} % Recuo no início dos parágrafos % ============================== % Cores (xcolor deve ser carregado antes do separador) % ============================== \usepackage[table]{xcolor} \definecolor{azulpetroleo}{HTML}{084D6E} \definecolor{verdeolivaclaro}{HTML}{E8F5E9} \definecolor{brancogelo}{HTML}{F8F9FA} \definecolor{BlueGreen}{HTML}{14BCBC} \definecolor{SkyBlue}{HTML}{4285F4} \definecolor{linhaFina}{HTML}{999999} % Cinza claro para linhas finas \definecolor{linhaGrossa}{HTML}{666666} % Cinza escuro para linha grossa % Layout de colunas com separador estilizado (três linhas em tons de cinza) \setlength{\columnsep}{28pt} % Espaçamento entre colunas % Customização do separador de colunas com três linhas verticais \makeatletter \renewcommand{\@outputdblcol}{% \if@firstcolumn \global\@firstcolumnfalse \global\setbox\@leftcolumn\copy\@outputbox \splitmaxdepth\maxdimen \vbadness\maxdimen \else \global\@firstcolumntrue \setbox\@outputbox\vbox{% \hb@xt@\textwidth{% \hb@xt@\columnwidth{\box\@leftcolumn\hss}% \hfil % Separador de colunas: linha fina | linha grossa | linha fina {\color{linhaFina}\vrule width 0.4pt}% \hspace{1.5pt}% {\color{linhaGrossa}\vrule width 1.2pt}% \hspace{1.5pt}% {\color{linhaFina}\vrule width 0.4pt}% \hfil \hb@xt@\columnwidth{\box\@outputbox\hss}% }% }% \@combinedblfloats \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn \@whilesw\if@fcolmade\fi{\@outputpage\@startdblcolumn}% \endgroup \fi } \makeatother % ============================== % Pacotes para matemática % ============================== \usepackage{amsmath} \usepackage{amssymb} % Fornece \checkmark e outros símbolos matemáticos \usepackage{mathtools} \everymath{\rm} % Força fonte reta em expressões matemáticas % ============================== % Tabelas % ============================== \usepackage{array} \usepackage{multirow} \usepackage{tabularx} % xcolor já foi carregado anteriormente com cores definidas % ============================== % Listas % ============================== \usepackage[inline]{enumitem} % Permite listas inline e personalização de listas % ============================== % Bibliografia % ============================== \usepackage[backend=biber, style=authoryear]{biblatex} % Geração da bibliografia \addbibresource{bibliografia.bib} % Caminho do arquivo .bib % ============================== % Cabeçalho e Rodapé % ============================== \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} % Limpa cabeçalho e rodapé % Cabeçalho com imagem %\fancyhead[c]{ % \hspace*{-1.7em}\raisebox{0pt}{\includegraphics[height=1.11cm]{Imagens/Cabeçalho.jpeg}} %} \renewcommand{\headrulewidth}{0pt} % Remove linha de separação do cabeçalho % Defines a robust length for the footer indent %\newlength{\footerindent} %\setlength{\footerindent}{0.7\oddsidemargin} % Rodapé personalizado %\fancyfoot[l]{% % \noindent % \hspace*{\footerindent}% <-- Corrige o início da caixa com comprimento pré-calculado % \colorbox{azulpetroleo}{ % fundo azul % \parbox{\paperwidth}{ % caixa que ocupa toda a largura do papel % \vspace{7pt} % \hspace{3em}\textcolor{white}{\textbf{\large SIMULADO 01 -- CAIXA}}\\[-3em] % % \hspace{3em}\textcolor{white}{Engenharia Elétrica} % \hfill % \includegraphics[height=1.4cm]{Imagens/Projeto_100_Aprovação.png} % \vspace{9pt} % } % } %} \fancyfoot[C]{% \raisebox{8pt}{ \tikz[baseline=(char.base), yshift=15pt]\node[ draw=white, fill=azulpetroleo, text=white, line width=1pt, inner sep=6pt, minimum width=1.5em, minimum height=1.5em ](char){\thepage}; } } % ============================== % Outros pacotes úteis % ============================== \usepackage{setspace} % Permite configurar espaçamento entre linhas \usepackage{tikz} % Criação de gráficos vetoriais \usepackage{circuitikz} % Diagramas eletricos/eletroeletronicos \usepackage[most]{tcolorbox} % Caixas coloridas avançadas \usepackage{eso-pic} % Adição de elementos na página (como molduras) \usepackage{lastpage} % Conta número total de páginas \usepackage[switch*]{lineno} % Numeração de linhas na margem externa (não reduz largura do texto) % ============================== % Configuração de numeração de linhas nos textos % ============================== \renewcommand\linenumberfont{\normalfont\fontsize{7}{9}\selectfont\itshape\bfseries} % Números em itálico e negrito, tamanho 7 \setlength\linenumbersep{-20pt} % Espaço entre número e margem do texto \setlength{\linenumberwidth}{2em} % Largura reservada para os números % Redefinição para alinhar números à esquerda e exibir apenas múltiplos de 5 (exceto 0) \makeatletter \renewcommand\makeLineNumber{% % Verifica se o número da linha é múltiplo de 5 e diferente de 0 \@tempcnta=\value{linenumber}% \divide\@tempcnta by 5\relax \multiply\@tempcnta by 5\relax \ifnum\@tempcnta=\value{linenumber}% \ifnum\value{linenumber}>0% \hss\makebox[\linenumberwidth][l]{\linenumberfont\thelinenumber}\hskip\linenumbersep \fi \fi } \makeatother % Ambiente para textos com numeração de linhas (reinicia contagem automaticamente) % Exibe apenas múltiplos de 5 (5, 10, 15, 20...), omitindo o número 0 \newenvironment{textonumerado}{% \par \setcounter{linenumber}{0}% \begin{linenumbers}% }{% \end{linenumbers}% \par } % Redefinição do flushright para desativar numeração de linhas (usado nas referências) \let\oldflushright\flushright \let\oldendflushright\endflushright \renewenvironment{flushright}{% \nolinenumbers \oldflushright }{% \oldendflushright } \usepackage{float} % mater a imagem onde foi colocada \usepackage{pdfpages} % Inserir PDFs externos \usepackage{pifont} % Símbolos especiais como \ding{} % ============================== % Comandos para questões % ============================== % Comando para inserir questão com alternativas maiusculas (A) \newcommand{\questaoV}[2]{ \item #1 \begin{enumerate}[label=(\Alph*),itemsep=0.3em] #2 \end{enumerate} } \newcommand{\questaoVtexto}[4]{ \item #1 \vspace{1em} #2 \vspace{1em} #3 \begin{enumerate}[label=(\Alph*),itemsep=0.3em] #4 \end{enumerate} } %Questoes com alternativas na Horizontal \newcommand{\questaoH}[2]{ \item #1 \begin{enumerate*}[label=(\Alph*),itemsep=0.3em] #2 \end{enumerate*} } %Novo comando para questões com afirmativas e alternativas \newcommand{\questaoComAfirmativas}[4]{ \item #1 \begin{enumerate}[label=\Roman*.,itemsep=0.3em] #2 \end{enumerate} #3 %comando to da questão \begin{enumerate}[label=(\Alph*),itemsep=0.3em] #4 \end{enumerate} } % ============================== % Ambiente Gabarito Box % ============================== \newtcolorbox{gabaritobox}{ enhanced, breakable, colback=brancogelo, colframe=brancogelo, arc=2mm, boxrule=0pt, left=6pt, right=6pt, top=6pt, bottom=6pt, fontupper=\itshape, colupper=SkyBlue, before upper={\noindent\raisebox{-0.3\height}{\includegraphics[width=16pt]{Imagens/gabarito.png}}\hspace{0.3em}\textbf{\normalfont COMENTÁRIOS:}\hspace{0.5em}}, overlay unbroken and first={} } % ============================== % Hyperref (deve ser carregado por último) % ============================== \usepackage[bookmarks=true,bookmarksopen=true,bookmarksopenlevel=1,colorlinks=true,linkcolor=black,urlcolor=blue,citecolor=black]{hyperref} % Necessário para \phantomsection e links \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%% NOÇÕES DE PROBABILIDADE E ESTATÍSTICA %%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newpage \begin{center} \subsection*{NOÇÕES DE PROBABILIDADE E ESTATÍSTICA} \end{center} \begin{enumerate}[leftmargin=*,label=\textbf{\arabic*.},itemsep=0.5em, resume=lista] % =============================================== % QUESTÃO 26 - Telemetria e Esperança Condicional % =============================================== \questaoV{Em um sistema de telemetria de uma subestação, dois sensores binários são monitorados a cada instante: \begin{itemize} \item $X$: indica se houve detecção de evento (0 = não, 1 = sim); \item $Y$: indica se um alarme foi acionado (0 = não, 1 = sim). \end{itemize} As probabilidades conjuntas observadas são: \begin{align*} P(X=0 \text{ e } Y=0) &= \frac{1}{4} \\ P(X=1 \text{ e } Y=0) &= \frac{1}{8} \\ P(X=0 \text{ e } Y=1) &= \frac{1}{2} \\ P(X=1 \text{ e } Y=1) &= \frac{1}{8} \end{align*} Com base nessas informações, dado que $X=1$, o valor esperado de $Y$ é:}{ \item $\dfrac{1}{4}$ \item $\dfrac{1}{2}$ \item $\dfrac{1}{8}$ \item $\dfrac{1}{3}$ \item $\dfrac{3}{4}$ } % =============================================== % QUEST�O 27 - Media Geometrica % =============================================== \questaoV{Quando tres numeros reais, positivos e nao nulos formam uma progressao geometrica, dizemos que o termo do meio corresponde a media geometrica dos outros dois. Desse modo, qual e a media geometrica entre 28 e 252?}{ \item 84 \item 168 \item 882 \item 1.764 \item 3.528 } % =============================================== % QUESTÃO 28 - Análise de Dados do ENADE % =============================================== \end{enumerate} % Temporariamente muda para uma coluna para acomodar a tabela larga da Q28 \onecolumn \begin{enumerate}[leftmargin=*,label=\textbf{\arabic*.},itemsep=0.5em, resume=lista] \questaoV{As questões do questionário socioeconômico foram tabuladas segundo as respostas dos ingressantes e dos concluintes e também segundo os dois grupos extremos (inferior e superior) de desempenho dos alunos da área no ENADE 2006. Esses grupos foram definidos pelos percentis de ordem 25 (P25) e 75 (P75). Os resultados relativos ao número de horas de estudo encontram-se na tabela a seguir. \textbf{Pergunta:} \textit{Quantas horas por semana, aproximadamente, você dedica/dedicou aos estudos, excetuando as horas de aula?} \begin{center} \begin{tabular}{|l|c|c|c|c|c|c|} \hline \textbf{Horas de estudo} & \multicolumn{3}{c|}{\textbf{Ingressantes}} & \multicolumn{3}{c|}{\textbf{Concluintes}} \\ \textbf{por semana} & P25 & P75 & Total & P25 & P75 & Total \\ \hline Nenhuma & 9,7\% & 4,6\% & 7,0\% & 12,7\% & 6,1\% & 9,3\% \\ \hline Uma a duas & 47,2\% & 29,7\% & 40,1\% & 46,8\% & 32,6\% & 40,4\% \\ \hline Três a cinco & 27,9\% & 35,1\% & 31,5\% & 25,7\% & 32,0\% & 29,8\% \\ \hline Seis a oito & 8,2\% & 15,6\% & 11,6\% & 7,9\% & 13,9\% & 10,7\% \\ \hline Mais de oito & 6,4\% & 14,7\% & 9,4\% & 6,3\% & 15,1\% & 9,5\% \\ \hline Sem informação & 0,6\% & 0,3\% & 0,4\% & 0,6\% & 0,3\% & 0,3\% \\ \hline \textbf{Amostra} & \multicolumn{3}{c|}{\textbf{38461}} & \multicolumn{3}{c|}{\textbf{27608}} \\ \hline \end{tabular} \end{center} Analisando-se as informações, conclui-se que: \textbf{I} -- a proporção de alunos que não estudam ou estudam no máximo duas horas por semana é maior no grupo de concluintes com desempenho inferior na prova; \textbf{II} -- pelo menos 12.000 alunos da área estudam mais de oito horas por semana; \textbf{III} -- a maioria dos alunos com desempenho superior, nos dois grupos, estuda de três a oito horas por semana; \textbf{IV} -- mais de 60,0\% dos alunos concluintes com desempenho superior na prova estudam, no mínimo, três horas por semana. Está(ão) correta(s) APENAS a(s) informação(ões):}{ \item I \item III \item I e IV \item I, II e IV \item II, III e IV } \end{enumerate} % Área de rascunho \vspace{0.5cm} \begin{center} \begin{tikzpicture} \node[opacity=0.3, rotate=45, scale=4, text=gray] {RASCUNHO}; \end{tikzpicture} \end{center} % Retorna ao layout de duas colunas \twocolumn \begin{enumerate}[leftmargin=*,label=\textbf{\arabic*.},itemsep=0.5em, resume=lista] % =============================================== % QUESTÃO 29 - Probabilidade sem Reposição % =============================================== \questaoV{Em um treinamento operacional de uma agência bancária, a coordenação prepara um conjunto com 52 cartões, todos bem embaralhados, cada um contendo o nome de uma operação. Dentre esses cartões, 12 são de operações consideradas ``prioritárias'', distribuídas igualmente entre: \begin{itemize} \item Transferência (TED) \item Pix \item Cartão de Crédito \end{itemize} (isto é, 4 cartões de cada uma dessas operações, totalizando 12 cartões prioritários). Retiram-se 4 cartões ao acaso, sem reposição. Qual é a probabilidade de que todos os 4 cartões retirados sejam cartões prioritários (TED, Pix ou Cartão de Crédito)?}{ \item $\dfrac{141}{54145}$ \item $\dfrac{325}{62522}$ \item $\dfrac{82}{43131}$ \item $\dfrac{99}{54145}$ \item $\dfrac{11}{54145}$ } % =============================================== % QUESTÃO 30 - Medidas Estatísticas % =============================================== \questaoV{A tabela a seguir apresenta a distribuição dos clientes de uma determinada agência bancária classificados segundo o perfil do investidor em: conservadores, moderados e arrojados. \begin{center} \begin{tabular}{|l|r|} \hline \textbf{Classificação dos clientes} & \textbf{Frequência absoluta} \\ \hline \textbf{Total} & \textbf{11.000} \\ \hline Conservadores & 3.300 \\ \hline Moderados & 5.400 \\ \hline Arrojados & 2.300 \\ \hline \end{tabular} \end{center} Considere as medidas estatísticas: média, moda, mediana, variância e desvio padrão. Para análise da classificação dos clientes, é possível determinar a:}{ \item moda, apenas. \item média e a mediana, apenas. \item média, a moda e a mediana, apenas. \item média, a variância e o desvio padrão, apenas. \item média, a moda, a mediana, a variância e o desvio padrão. } \end{enumerate} \newpage % Preenche o restante da segunda coluna com marca d'água \vfill \newpage \begin{center} \begin{tikzpicture} \node[opacity=0.3, rotate=45, scale=4, text=gray] {RASCUNHO}; \end{tikzpicture} \end{center} \vfill \end{document}
- Emulating the `\shortintertext` command in text modeby Wazabi on January 17, 2026 at 3:28 pm
I am trying to reduce the spacing between an align and gather environment using the \shortintextext command. I am aware of one solution that nests the align block inside the gather environment to achieve this. However, I am also interested in using \displaybreak (or allowdisplaybreaks) in the align environment, which becomes impossible if align is nested in gather, as it is then wrapped in an unbreakable box. I am therefore wondering how one could define a text mode version of \shortintertext? Below is an example that illustrates the issue by causing a large blank space to appear on the first page due to the unbreakable align: \documentclass{article} \usepackage[a6paper]{geometry} \usepackage{mathtools} \usepackage{blindtext} \allowdisplaybreaks \begin{document} \blindtext \begin{gather} \begin{align} a &= b, \\ a &= b, \\ a &= b, \\ a &= b, \\ a &= b, \\ a &= b, \\ a &= b, \\ a &= b, \end{align} \shortintertext{where} a = b. \end{gather} \end{document}
- Exam Class (Hirschhorn) has different Itemize Spacings for the solution and the solutionbox Environmentsby Simon on January 17, 2026 at 10:32 am
I am working with the "exam" class by Philip Hirschhorn (version 2.704) and I am experiencing some trouble with the spacing of lists, itemize in my case, in solution environments. I see strong differences between the spacing in the "solutionbox" and the other solution environment but I am not proficient enough in lower level Latex or Tex to figure out the reason and potential solutions myself. I could make the lists behave the same by using "enumitem" with \setlist[itemize, 1]{nosep}. As far as I understand, this means that the list settings are actually changing between the different environments. I am interested in an explanation of the underlying mechanisms. Here is a minimum working example for you \documentclass[11pt, answers]{exam} \renewcommand{\solutiontitle}{% \textbf{Solution:}% \par% \noindent% } \begin{document} \textbf{Start of Document} \begin{questions} \question This is a solutionbox environment \begin{solutionbox}{5cm} The solution is either \begin{itemize} \item A \textbf{or} \item B \end{itemize} But it could also be C in a new paragraph. Or D in another new paragraph. \end{solutionbox} \question This is a solution environment \begin{solution} The solution is either \begin{itemize} \item Z \textbf{or} \item Y \end{itemize} But it could also be X in a new paragraph. Or W in another new paragraph. \end{solution} \end{questions} \textbf{End of Document} \end{document} You can see the difference in this screenshot montage it looks like the line spacing is identical but some lengths in the list environment are modified, such as \itemsep or \parsep The behavior of the solution environment is identical with the other solution environments (solutionorbox, etc.) as far as I see. The documentation says that the solutionbox environment is implemented differently from the other environments. I guess that this is part of the reason. Thanks in advance, Simon
- Vertical space in titlesec wrap modeby Michael Rosales Vilca on January 17, 2026 at 10:32 am
I'm testing the modes or styles of the titlesec package. Specifically, I have a question about the wrap mode. I've noticed strange behavior with the before-code argument; when I try to apply color, the section title width changes, but that's a separate issue. I'm mentioning it now because I'm introducing a new command to retrieve it. My problem is the vertical space between the title section text and the text below it, as shown in the image. I wonder if there's a way to reduce that vertical space. If anyone has any ideas, I would greatly appreciate it. \documentclass{article} \usepackage{xcolor} \usepackage{titlesec} \usepackage{lipsum} \newcommand{\BlueTitle}[1]{% \textcolor{blue!70!black}{#1}% } \titleformat{\section}[wrap] {\normalfont\bfseries\filright} {\textcolor{blue!70!black}{\thesection.}} {0.5em} {\BlueTitle} \titlespacing{\section}{3cm}{1ex}{1em} \begin{document} \section{Long Title in wrap mode} \lipsum[1] \end{document}
- lyluatex: music system’s pdf is too big for inlineby Ngô Minh Hưng on January 17, 2026 at 9:52 am
I put the lyluatex package into my LaTeX code. I tried: \documentclass{article} \usepackage[program=C:/lilypond/lilypond-2.24.4/bin/lilypond.exe]{lyluatex} \begin{document} This is inline music. \lilypond[insert=systems]{ c’4 } After. \end{document} The code breaks the pdf file into 3 pages: This is the system’s pdf: How do I fix this? I just want to put the texts above into only a single page.
- Edas Abstract not recognizing + even in math mode [closed]by AishM on January 17, 2026 at 9:13 am
I am trying to write a symbol \(\gamma_{+limit}\) in Edas Abstract which I have inserted in the recommended math mode (). However it is not able to recognize it. It is able to recognize \(\gamma_{-limit}\) though. Seems like there is something to do with the + symbol. It is not throwing error when placed both inside or outside of math-mode. Only information I could find was that Edas uses MathJAX https://edas-conferences.blogspot.com/2018/06/equations-in-paper-titles-abstracts-and.html
- How can I define a custom listings language for MusicBrainz Picard scripts that matches the editor’s syntax highlightingby Marco Moldenhauer on January 17, 2026 at 6:57 am
I’m trying to define a custom language in LaTeX using \lstdefinelanguage so that keywords and variables in MusicBrainz Picard scripts are highlighted similarly to Picard’s built-in script editor (see MusicBrainz Picard Script Reference below). Here’s what I have so far: My Code \documentclass{article} \usepackage{listings} \usepackage{xcolor} \lstdefinelanguage{PicardScript}{ sensitive=true, morecomment=[l]{\#}, morestring=[b]", morekeywords=[1]{% $if,$if2,$left,$right,$num,$replace, $gt,$lt,$eq,$ne,$and,$or,$not,$len, $lower,$upper }, morekeywords=[2]{% \%artist\%,\%albumartist\%,\%album\%,\%title\%, \%date\%,\%originaldate\%,\%tracknumber\%, \%discnumber\%,\%totaldiscs\% }, keywordstyle=[1]\color{blue}\bfseries, keywordstyle=[2]\color{orange}, stringstyle=\color{red}, identifierstyle=\color{black}, commentstyle=\color{gray}\itshape } \lstset{ basicstyle=\ttfamily\tiny, numbers=left, numberstyle=\tiny\color{gray}, stepnumber=1, numbersep=5pt, showstringspaces=false, breaklines=true, tabsize=4, frame=single, commentstyle=\color{gray}\itshape } \begin{document} \begin{lstlisting}[language=PicardScript] $if2(%albumartist%,%artist%)/ ($left($if2(%originaldate%,%date%),4)) $replace(%album%,:,)/ $if($gt(%totaldiscs%,1),$num(%discnumber%,2)-)$num(%tracknumber%,2) - %artist% - %title% \end{lstlisting} \end{document} My Output: I would like the LaTeX output to match the coloring style of the Picard script editor. How can I modify my \lstdefinelanguage definition to better replicate the Picard script editor’s keyword coloring? MusicBrainz Picard Script Reference: Link: https://picard.musicbrainz.org/
- MTPro-II differences under lualatex vs pdflatex/xelatexby Knudsen on January 17, 2026 at 4:31 am
The following MWE produces a nice square root sign provided by MTPro-II \documentclass{report} \usepackage{amsmath} \usepackage{mtpro2} \input{mtpro2-patch}% https://github.com/RuixiZhang42/font-pairing-guide/blob/master/mtpro2-patch.tex \begin{document} \[ \SQRT{\begin{pmatrix} 1 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 9 \end{pmatrix}} \] \end{document} This works fine under pdflatex and xelatex producing the nice slanted surd portion of the square root sign But when processed with lualatex it goes back to the old CM square root sign Can anyone shed light on what is going on?
- \clearpage causes "not in outer par mode error" on second passby RLH on January 17, 2026 at 2:44 am
I have a long document (600+ pages) that uses \clearpage and \afterpage to force some page breaks and figure placement, and breakable tcolorboxes as example environments. I am encountering an intermittent bug in which my calls to \clearpage sometimes result in "not in outer par mode" errors on the second compilation pass, ! LaTeX Error: Not in outer par mode. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.128 \clearpage These errors do not appear to be due to incorrect placement of the command---the document builds correctly on the first, third, and subsequent calls to pdflatex. My best guess is that this is related to shifts in content between compilations (e.g., because a table of contents is inserted). -- The code structure around the error is: \afterpage{ \begin{figure}[p] % figure stuff \end{figure} \clearpage } \clearpage % <---- Error happens here \begin{example}{Example Name}{exampletag} % example stuff \end{example} This code pattern allows me to force the Example tcolorbox to start at the top of a page and have a full-page figure on the page immediately following it, even if the tcolorbox extends beyond a page break: [p] makes sure that no text is placed on the page with the figure \clearpage inside \afterpage{} makes sure that the figure is placed on the page immediately when \afterpage{} triggers, and doesn't get kicked further down the document \clearpage outside of \afterpage{} makes sure that the tcolorbox starts on a fresh page. (As was pointed out in comments, the outside \clearpage negates most of what \afterpage{} provides, and I can in this instance remove the \afterpage{}. I still think something odd is going on with the interaction between \clearpage and the Example tcbtheorem when the pages are moved by the insertion of a table of contents during the second pass compilation.) -- In some cases, I can comment out the \clearpage command, build the document so that the table of contents is created, and then uncomment the \clearpage command to get my desired document formatting. (This is however quite kludgy, and needs to be repeated if I compile from scratch.) It may be relevant that in the instance of this behavior that I'm running into right now, the \clearpage command comes directly before the \begin command for a breakable tcbtheorem environment from tcolorbox. It is quite possible that all such issues have a similar command placement. -- The specific construction of tcolorbox for the example environment is: \renewtcbtheorem[number within=section, number freestyle={\noexpand\thesection.\noexpand\arabic{\tcbcounter}}]{example}{Example}{ detach title, before upper={\tcbtitle.\quad \let\footnotetext=\footaux \let\footnote=\footnoteaux }, enhanced jigsaw, sharp corners, frame hidden, lines before break=4, borderline west={.5pt}{3pt}{black}, right=0pt, toprule=0pt, rightrule=0pt, bottomrule=0pt, leftrule=.5pt, colback=white, colframe=black, breakable=true, opacityback=0, colbacktitle=white, opacitybacktitle=0, coltitle=black, titlerule=0pt, fonttitle=\bfseries, parbox=false, label type=example }{exp} \zcRefTypeSetup{example}{ Name-sg=Example, name-sg=example, Name-pl=Examples, name-pl=examples } -- Any suggestions as to what I should be looking for / known issues? [I know it would be best to provide a minimal working example, but I believe this error is likely a corner case and its being triggered is related to the scale of the document.]
- Low accessibility score for my ltx-talk presentation because of itemizeby Elena on January 16, 2026 at 11:35 pm
I have customised my ltx-talk slides to have nice bullet and triangle symbols for my itemize items. \renewcommand{\labelitemi}{\textcolor{myblue}{$\bullet$}} \renewcommand{\labelitemii}{\textcolor{notecolor}{$\blacktriangleright$}} Now, the accessibility thingy in Moodle says that "This PDF contains images without description", and the offending images are the bullets and the triangles from the items. I checked, and I don't get that complaint if I comment the two commands above. Is there a way to have the bullets and triangles and not to get that error?
- Hungarian clickable references with manual suffixesby taiwan12 on January 16, 2026 at 9:03 pm
I’m typesetting a document in Hungarian. Hungarian uses case suffixes / postpositions attached to the noun (e.g. ábra, ábrán, ábrára, táblázat, táblázaton), so I need to manually provide the inflected noun in running text. Additionally, I use the chemstyle package and I want scheme environments to behave like figures: same counter as figures (one shared sequence) same caption name (schemes should say “Ábra” in the caption, not “Scheme”) schemes should appear in the List of Figures This scheme/figure integration is already working; I include that code only because it’s part of the real setup. What I’m stuck on is a small helper macro for clickable references that lets me manually supply the Hungarian noun/suffix without duplicating it. \newcommand*\myref[2][ábra]{\hyperref[#2]{\ref*{#2}.~#1}} Desired output (whole text clickable) ábra ábrán táblázat táblázaton Current output (wrong: noun duplicated) ábra 1. ábra ábra 1. ábrán táblázat 1. táblázat táblázat 1. táblázaton Important: If I remove chemstyle (and the scheme-related unification code), then my referencing setup behaves as expected. The duplication issue appears only when chemstyle is loaded / schemes are involved. MWE \documentclass{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage[demo]{graphicx} \usepackage{chemstyle} \usepackage[colorlinks]{hyperref} \usepackage[figurewithin=none, tablewithin=none]{caption} \newcommand*\myref[2][ábra]{\hyperref[#2]{\ref*{#2}.~#1}} \makeatletter % scheme and figure counter \let\c@scheme\c@figure \renewcommand{\thescheme}{\thefigure} % schemename caption figurename \renewcommand{\schemename}{\figurename} % scheme into lof \def\ext@scheme{lof} \let\l@scheme\l@figure \makeatother \begin{document} \tableofcontents \chapter{A} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{figA} \end{figure} \begin{scheme} \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{schA} \end{scheme} \begin{figure}[H] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{figB} \end{figure} \begin{table}[H] \centering \begin{tabular}{c|c} & \\ & \end{tabular} \caption{Caption} \label{tabA} \end{table} \myref[ábra]{figA}, \myref[ábra]{schA}, \myref[ábra]{figB}, \myref[táblázat]{tabA} \myref[ábrán]{figA}, \myref[táblázaton]{tabA} \clearpage \phantomsection \addcontentsline{toc}{chapter}{Ábrák jegyzéke} \listoffigures \clearpage \phantomsection \addcontentsline{toc}{chapter}{Táblázatok jegyzéke} \listoftables \end{document} MWE without chemstyle \documentclass{report} \usepackage[magyar]{babel} \usepackage{geometry} \usepackage[demo]{graphicx} \usepackage[colorlinks]{hyperref} \usepackage[figurewithin=none, tablewithin=none]{caption} \newcommand*\myref[2][ábra]{\hyperref[#2]{\ref*{#2}.~#1}} \begin{document} \tableofcontents \chapter{A} \begin{figure}[h] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{figA} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.5\linewidth]{...} \caption{Caption} \label{figB} \end{figure} \begin{table}[h] \centering \begin{tabular}{c|c} & \\ & \end{tabular} \caption{Caption} \label{tabA} \end{table} \myref[ábra]{figA}, \myref[ábra]{figB}, \myref[táblázat]{tabA} \myref[ábrán]{figA}, \myref[táblázaton]{tabA} \clearpage \phantomsection \addcontentsline{toc}{chapter}{Ábrák jegyzéke} \listoffigures \clearpage \phantomsection \addcontentsline{toc}{chapter}{Táblázatok jegyzéke} \listoftables \end{document}
- Exercise - answer - solutionby Andrius Berniukevičius on January 16, 2026 at 8:39 pm
I’m trying to set up a LaTeX workflow where, in the source code, each problem is written “locally” as a block: an exercise (the statement), immediately followed by a short answer, immediately followed by a full solution. So when I write the LaTeX file, the exercise, answer, and solution stay next to each other for easy editing. However, in the compiled PDF I want them separated into three different sections: Exercises — only the statements Answers — only the short final answers Solutions — only the full worked solutions Thanks for suggestions and help.
- Is that possible to just fill=white for text in only one node?by Explorer on January 16, 2026 at 8:07 pm
I have the following code: \documentclass[tikz,border=5pt]{standalone} \begin{document} \ExplSyntaxOn \keys_define:nn {mykey} { foo .tl_set:N = \l_tmpa_tl } \keys_set:nn {mykey} { foo = {O\quad K},%<- } \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[inner~sep=0pt] at (1,0) {\l_tmpa_tl}; \end{tikzpicture} \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[fill=white,inner~sep=0pt] at (1,0) {\l_tmpa_tl}; \end{tikzpicture} \ExplSyntaxOff \begin{tikzpicture} \draw[dotted] (0,0) -- (2,0); \node[fill=white,inner sep=0pt] at (.7,0) {O}; \node[fill=white,inner sep=0pt] at (1.3,0) {K}; \end{tikzpicture} \end{document} For the sake of the template settings, the text O\quad K should be put as a token list, as a whole, but I need the third picture's result. Is that possible to just fill=white to just shade the "text area"? Edited: Since cfr commented for the original template case, I would provide more information. Claims: The original package is exam-zh package It depends on xeCJK, so xelatex is must I was not sure that whether it's CJK fonts settings works on every OS. See here. What I want, is to achieve something sealline style as below: It appeared in the leftmargin of exam paper: Now I have the following code: \documentclass{exam-zh} \usepackage{zhlipsum} % \ExplSyntaxOn % % Line 1487 in exam-zh.cls % % https://github.com/xkwxdyy/exam-zh/blob/main/exam-zh.cls#L1487-L1496 % \cs_set:Npn \__examzh_sealline_odd_text_around_line: % { % \node [ anchor = east ] % at ([xshift = -\g__examzh_sealline_odd_text_xshift_dim, yshift = \g__examzh_sealline_odd_text_yshift_dim]current~page~text~area.west) % { % \g__examzh_sealline_odd_text_format_tl % \__examzh_sealline_odd_spread_box:nn { \g__examzh_sealline_odd_text_width_dim } % { \g__examzh_sealline_odd_text_tl } % }; % } % \ExplSyntaxOff \examsetup{ sealline={ show=true, circle-show=false, line-type={loosely-dotted}, text={密封线},%<- the text here is put as `\g__examzh_sealline_odd_text_tl' text-format={\huge\bfseries}, line-thickness={2.5pt}, text-xshift={.375cm} } } \begin{document} \zhlipsum[name=zhufu] \end{document} That is the original case. Noted that 密封线, the l3keys sealline/text is put into \g__examzh_sealline_odd_text_tl ands \g__examzh_sealline_even_text_tl here(why I say as a whole). Which need to be processed by \__examzh_sealline_odd_spread_box:nn here. I want to change the present settings of exam-zh's setting code to the minimal extent.(Of course, I can type text={}, leave it empty, and follow \__examzh_sealline_odd_circle: here to draw multiple \node[fill=white] {密}s) But that change too much the package's setting. So, I simplified it to my origianl post😊.
- The spacing between the title and the enumerate, and the spacing for each itemby Hana Seo on January 16, 2026 at 6:24 pm
I used setspace package here to space the items in enumerate, but this causes two problems for me. The spacing between the title and the enumerate also widens, The spacing for each item also widens. For example, consider the first item. What I want: The spacing doesn't affect the space between the title and the enumerate. The spacing doesn't affect each item in the enumerate. First time posting here so... let me know if I'm breaking any etiquette or if I'm unclear. Thank you. \documentclass{article} \usepackage{graphicx} % Required for inserting images \usepackage{geometry} % Changing margins \geometry{letterpaper, margin=1in} \usepackage{setspace} % Doublespace \usepackage{multicol} % Multicolumn \title{Quizzes} \begin{document} \maketitle \begin{spacing}{3} \begin{multicols}{2} \begin{enumerate} \item Define reciprocal of a number using words. This is a long sentence. \item The reciprocal of $\frac{10}{33}$ is: \item The reciprocal of $\frac{11}{30}$ is: \item The reciprocal of $\frac{1}{5}$ is: \item The reciprocal of $\frac{a}{b}$ is: \item $1\frac{8}{9} \div 1\frac{1}{2}$ \item $1\frac{5}{11} \div 6$ \item $\frac{3}{5} \div \frac{7}{9}$ \item $1\frac{1}{12} \div \frac{17}{18}$ \item $13 \div \frac{9}{16}$ \item $\frac{1}{16} \div \frac{1}{6}$ \item $1\frac{3}{5} \div 1\frac{1}{2}$ \item $\frac{1}{9} \div \frac{14}{19}$ \item $15 \div 2\frac{2}{3}$ \item $2\frac{3}{5} \div 1\frac{1}{3}$ \end{enumerate} \end{multicols} \end{spacing} \end{document}
- ConTeXt not handling per-page (i.e., bypage) footnotes properly even in very simple MWEby Jeff Dodson on January 16, 2026 at 3:08 pm
I've noticed something while experimenting with ConTeXt: I can make an incredibly simple MWE that demonstrates ConTeXt not handling per-page footnotes properly. Here's the MWE: \setupnote[footnote][way=bypage, paragraph=yes, location=page, distance=0.5em] \setupnotation[footnote][way=bypage, alternative=serried, inbetween={\hskip 1.5em plus 1em minus 0.5em}, width=broad, distance=.5em, indentation=no] \starttext \dorecurse{500}{This is some text with footnotes\footnote{This is a first footnote for verse \recurselevel.} that are fun to read.\footnote{This is a second footnote for verse \recurselevel{} that is longer.} } \stoptext And here's one of the pages from the PDF if I compile the MWE: Note that while the footnotes marked in the text body range from 1 to 48, the footnotes shown in the apparatus are 52, 53, then 1 to 48. You can see similar undesirable results here: On both of those pages, I'd expect to see "1" as the first footnote in both the body and apparatus. This MWE can be made to work properly simply by modifying the words in the test sentence slightly. It seems like it's just a matter of happenstance as to whether ConTeXt can actually resolve the footnotes and what pages they should be on. I did notice that when ConTeXt is unable to resolve the notes, the compilation takes a long time. So to be clear, you can run many compilation passes, and in the case of the above MWE, ConTeXt will never resolve the notes properly, as far as I can tell. I'm sure the most likely answer is that I'm doing something wrong in my MWE. However, I've tried a number of different sets of settings, and per-page footnotes never seem to work reliably for me if I'm showing them in run-on (i.e., "serried") paragraph form. Does anyone know why this is the case? UPDATE: Note that if you put a \par after the sentence inside the \dorecurse as shown below, so that each sentence is a separate paragraph (instead of having one huge paragraph), ConTeXt still doesn't typeset it properly. \setupnote[footnote][way=bypage, paragraph=yes, location=page, distance=0.5em] \setupnotation[footnote][way=bypage, alternative=serried, inbetween={\hskip 1.5em plus 1em minus 0.5em}, width=broad, distance=.5em, indentation=no] \starttext \dorecurse{500}{This is some text with footnotes\footnote{This is a first footnote for verse \recurselevel.} that are fun to read.\footnote{This is a second footnote for verse \recurselevel{} that is longer.}\par} \stoptext Here's an image if each sentence is a separate paragraph:
- `fontspec` conflict with `mlmodern` for sans serifby designer0588 on January 16, 2026 at 2:35 pm
I want to create a document using LuaTeX that displays some Chinese characters. For this purpose I use package fontspec: % !TEX program = lualatex \documentclass[12pt]{article} \usepackage[tbtags]{amsmath} \usepackage{bm} \usepackage{fontspec} \newfontfamily\CJKfont{SimSun} % Must contain U+266B0 \usepackage{mlmodern} \usepackage[T1]{fontenc} \def\T{{\mathsf{T}}} \begin{document} An equation with sans serif \[ \frac{\partial L}{\partial \bm{x}^\T}=\bm{y}^\T. \] Some Chinese characters: {\CJKfont 机器学习} (Machine Learning) \end{document} The compiler returns Font shape 'TU/mlmr/m/n' undefined and substitutes the standard latin modern roman font for capital t. Without fontspec this issue disappears. Replacing \mathsf{T} with \top does not remove the error messages. I can try to introduce the Chinese characters without fontspec but any ideas what causes this conflict?
- Best way to break up long equation to fit the IEEE format (double column)by TastyTurtle on January 16, 2026 at 12:41 pm
I have a very long equation where the fraction line spans the whole equation, which makes it fit poorly in the IEEEtran format! Below is an image of the equation(s) in question, along with the current code I am using. Feel free to think creatively for a solution, I am open to almost anything. \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath, amssymb, amsthm} \usepackage{geometry} \usepackage{empheq} \geometry{margin=1in} \begin{document} \begin{empheq}[left=\empheqlbrace]{alignat=2} \label{eq:EOM} &\ddot x_w &= \frac{ \dfrac{k_t}{R_m}V_m - \left(\dfrac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) - r_w m_b l_b\!\left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) }{ \dfrac{I_w}{r_w}+r_w m_w + r_w m_b }, \\ &\ddot\theta_b &= \frac{ - \dfrac{k_t}{R_m}V_m + \left(\dfrac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) + m_b l_b g \sin\theta_b - m_b l_b \ddot x_w \cos\theta_b }{ I_b + m_b l_b^{2} }. \end{empheq} \end{document} Any help would be awesome Edit: Its my first time working with the IEEEtran format but for this questions, it is just a double-column format. More information can be see here: https://www.overleaf.com/latex/templates/ieee-conference-template/grfzhhncsfqn Furthermore, I have updated the code above so that it's compilabl,e and below is a link to my set of equations in a IEEEtran document: https://www.overleaf.com/read/sqrtfcwfjygr#70ecc2 Edit 2: Three different "solutions" can be see in the image below, its probably best to drop the curly bracket and use ´\multline´: Here is the code to recreate the image above: \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts \usepackage{mathtools} \usepackage{empheq} \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \begin{document} \begin{verbatim} \splitfrac \end{verbatim} \begin{empheq}[left=\empheqlbrace]{align} \ddot{x}_w &= \frac{ \splitdfrac{ \frac{k_t}{R_m}V_m - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) }{ - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) } }{ \frac{I_w}{r_w} + r_w (m_w + m_b) } \label{eq:EOM_xw} \\[1em] \ddot\theta_b &= \frac{ \splitdfrac{ -\frac{k_t}{R_m}V_m + \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) }{ + m_b l_b g \sin\theta_b - m_b l_b \ddot{x}_w \cos\theta_b } }{ I_b + m_b l_b^{2} } \label{eq:EOM_thetab} \end{empheq} Fraction and multline\\ \begin{empheq}[left=\empheqlbrace]{align} \begin{split} \ddot x_w &= \frac{1}{\frac{I_w}{r_w} + r_w (m_w + m_b)} \Bigg[ \frac{k_t}{R_m}V_m \\ &\quad - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ &\quad - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) \Bigg] \end{split} \label{eq:EOM_xw} \\[15pt] \begin{split} \ddot\theta_b &= \frac{1}{I_b + m_b l_b^{2}} \Bigg[ -\frac{k_t}{R_m}V_m \\ &\quad + \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ &\quad + m_b l_b g \sin\theta_b - m_b l_b \ddot x_w \cos\theta_b \Bigg] \end{split} \label{eq:EOM_thetab} \end{empheq} Negative exponent and multline\\ \begin{multline}\label{eq:EOM_xw} \ddot x_w = \left( \frac{I_w}{r_w} + r_w (m_w + m_b) \right)^{-1} \\ \times \Bigg[ \frac{k_t}{R_m}V_m - \left(\frac{k_e k_t}{R_m}+b_f\right)\left( \frac{\dot{x}_w}{r_w} - \dot\theta_b \right) \\ - r_w m_b l_b \left(\ddot\theta_b\cos\theta_b-\dot\theta_b^{2}\sin\theta_b\right) \Bigg] \end{multline} \end{document}
- Italian format letterby RenatoP on January 16, 2026 at 12:13 pm
I need to develop an Italian simple letter. I need that sender and recipient stay on the left side one below the other. I use letteracdp class that is a good Italian style class but sender and receiver are like English letter. How can I obtain that? this is an example: \documentclass[boldsubject,italicsignature,smartindent]{letteracdp} \usepackage[italian]{babel} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{layaureo} \usepackage{lipsum} \address{Dott.~Lorenzo Pantieri \\Dipartimento di Matematica \\Università degli Studi di Bologna \\Via Zamboni, 5 \\40125 Bologna} \signature{Dott.~L.~Pantieri}%\date{} % al solito, la data è opzionale;% il valore predefinito è \today\place{Bologna}\ \begin{document} \begin{letter}{Prof.~Enrico Gregorio \\Dipartimento di Informatica \\Università di Verona \\Strada Le Grazie, 15 \\37134 Verona} [Questo è loggetto opzionale della lettera.] \opening{Egregio Prof.~Gregorio,} \lipsum[1] \closing{La saluto molto cordialmente,}5 \PS Qui ci va un eventuale post scriptum.\cc{Prof.~Claudio Beccari\\Dipartimento di Elettronica \\Università di Torino \\Corso Duca degli Abruzzi, 24 \\10129 Torino} \begin{enclosures} \item L' arte di scrivere lettere con \LaTeX \end{enclosures} \end{letter} \end{document} dott Lorenzo Pantieri address should stay on the right, just before prof Enrico Gregorio Thank you Renato
- Drawing a porous sandwich beamby Tldi You on January 16, 2026 at 9:03 am
Can we reproduce this image in LaTeX Tikz? I try this \documentclass[tikz,border=5pt]{standalone} \usepackage{tikz} \usetikzlibrary{patterns,arrows.meta,decorations.pathmorphing} \begin{document} \begin{tikzpicture}[scale=1] %------------------------------------------------- % Common styles %------------------------------------------------- \tikzset{ block/.style={draw, thick, fill=orange!20}, caps/.style={draw, thick, fill=blue!40}, axis/.style={->, thick}, profile/.style={thick}, } %================================================= % (b) SD %================================================= \begin{scope}[xshift=0cm] % Top and bottom caps \draw[caps] (0,4) rectangle (4,4.5); \draw[caps] (0,0) rectangle (4,0.5); % Main block with layered patterns \draw[block] (0,0.5) rectangle (4,4); % Internal layers \draw[pattern=checkerboard, pattern color=orange!70] (0,2.7) rectangle (4,4); \draw[pattern=crosshatch, pattern color=orange!70] (0,1.6) rectangle (4,2.7); \draw[pattern=grid, pattern color=orange!70] (0,0.5) rectangle (4,1.6); % Axes \draw[axis] (0,2.25) -- (5,2.25) node[above] {$x$}; \draw[axis] (0,2.25) -- (0,5) node[above] {$z$}; % Right profile \draw[domain=0.5:4,smooth,,red,variable=\z] plot ({6-cos(180*\z/((4-0.5)))},{\z}); % Labels \node[right] at (4.1,3.9) {$E_{\max},\,\rho_{\max}$}; \node[right] at (4.1,0.6) {$E_{\max},\,\rho_{\max}$}; \node at (2,-0.6) {(b) SD}; \end{scope} %================================================= % (c) ASD %================================================= \begin{scope}[xshift=8cm] % Top and bottom caps \draw[caps] (0,4) rectangle (4,4.5); \draw[caps] (0,0) rectangle (4,0.5); % Main block \draw[block] (0,0.5) rectangle (4,4); % Gradient-like pattern layers \draw[pattern=checkerboard, pattern color=orange!70] (0,2.5) rectangle (4,4); \draw[pattern=crosshatch dots, pattern color=orange!70] (0,0.5) rectangle (4,2.5); \draw[pattern=checkerboard, pattern color=orange!70] (0,0.5) rectangle (4,1.6); % Axes \draw[axis] (0,2.25) -- (5,2.25) node[above] {$x$}; \draw[axis] (0,0.5) -- (0,5) node[above] {$z$}; % Right profile (asymmetric) % \draw[profile] % (4,4) .. controls (4.8,3.5) and (4.8,1.5) .. (4,0.5); % Labels \node[right] at (4.1,3.9) {$E_{\max},\,\rho_{\max}$}; \node[right] at (4.1,0.6) {$E_{\min},\,\rho_{\min}$}; \node at (2,-0.6) {(c) ASD}; \draw[domain=0.5:4,smooth,,red,variable=\z] plot ({1*(5-cos(45+(180*\z)/(2*(4-0.5)))))},{\z}); \end{scope} \end{tikzpicture} \end{document} Current result:
- Primes in Latexby legogubben on January 15, 2026 at 10:18 am
I want to create a command \isthisprime{<number>} where it decides whether <number> is or is not prime, and if it is, it also returns the order of the prime (eg, 2 is the first, 3 is the second, and so on). Here is my attempt at a code (excuse my choice of naming the counters): \documentclass{article} \usepackage{amsmath} \usepackage{enumitem} \usepackage{lipsum,blindtext} \newcount\div \newcount\divs \newcount\somnum \newcount\yes \newcount\yess \newcount\numberofprimes \newcommand{\isthisprime}[1]{% %Decide if #1 is prime \div=2 \yes=0 \ifnum#1<2 \yes=1 \fi \loop \ifnum\div<#1 \ifnum#1=\numexpr(#1/\div)*\div\relax \yes=1 \fi \advance\div by 1 \repeat \numberofprimes=0 \somnum=2 \yess=0 \divs=2 %Checking every number less than or equal to #1 \ifnum\yes=0 \loop \ifnum\somnum<\numexpr#1+1\relax \loop%checking if somnum is prime \ifnum\divs<\somnum \ifnum\somnum=\numexpr(\somnum/\divs)*\divs\relax \yess=1 \fi \advance\divs by 1 \repeat \ifnum\yess=0 \advance\numberofprimes by 1 \fi \yess=0\divs=2\advance\somnum by 1 \repeat \fi \ifnum\yes=0 #1 is a prime with index~\the\numberofprimes. \else #1 is not a prime. \fi } \begin{document} \isthisprime{101}\newline \isthisprime{102} \end{document} The idea: the first part of the code decides whether or not <number> is a prime; if it is we set the counter \yes=1, otherwise it remains equal to 0. So if \yes=1 we check every number less than or equal to <number> to see if it is prime or not. At every occurrence of prime, we increase the counter \numberof primes. Hence \numberofprimes will determine the order of <number>, if it prime that is. The part where it decides whether or not the input is prime or not is fine. However, it cannot find its order. It just says that the order is 1 if the input is prime. It cannot see what is wrong with my code, so I would appreciate any advice! Thank you in advance.
- Is there a tool that translates LaTeX written with user-defined commands into standard LaTeX?by Steven Thomas Hatton on January 15, 2026 at 7:23 am
I have a (far from ideal) collection of macros that I \include in the preambles of my documents. It's very useful in giving my documents uniform semantic representation. For example, contravariant vector component functions all have a common appearance which I control globally. The down-side to this is that when I want to post an except to math.stackexchange.com, for example, I have to manually convert all of my LaTeX code into standard LaTeX which is independent of my preamble. Obviously the Tex-engine (e.g., lualatex) converts my macros into a form that TeX understands which is equivalent to standard LaTeX. Is there a tool that will take my customized LaTeX documents and convert them into standard LaTeX? Here's an example. (Please don't question the sanity of my notation. I have professionals for that.) \documentclass[a4paper,10pt]{article} \usepackage{amsmath} \newcommand{\CONST}[1]{\mathrm{#1}} \newcommand{\dd}{\CONST{d}} % differential d \newcommand{\DD}[2]{\frac{\dd#1}{\dd\CONST{#2}}} % derivative \newcommand{\PD}[2]{\frac{\partial #1}{\partial\CONST{#2}}} % partial derivative \begin{document} Written using my macros: \begin{align*} \dd f & = \PD{f}{x}\dd x + \PD{f}{y}\dd y.\\ \DD{f}{t} & = \PD{f}{x}\DD{x}{t}+\PD{f}{y}\DD{y}{t} \end{align*} What I want the tool to output: \begin{align*} \mathrm{d} f & = \frac{\partial f}{\partial \mathrm{x}} \mathrm{d} x + \frac{\partial f}{\partial \mathrm{y}} \mathrm{d} y.\\ \frac{\mathrm{d} f}{\mathrm{d}\mathrm{t}} & = \frac{\partial f}{\partial \mathrm{x}}\frac{\mathrm{d}x}{\mathrm{d}\mathrm{t}} +\frac{\partial f}{\partial \mathrm{y}}\frac{\mathrm{d}y}{\mathrm{d}\mathrm{t}} \end{align*} \end{document}
- Help me draw a labor supply diagramby henry on January 15, 2026 at 6:26 am
I'm trying to draw these two diagram in a slide but I cannot do it. Anyone can help me please. This is my previous code: \begin{frame}{Backward-bending Supply Curve} \vspace{0.1cm} \begin{columns}[T] \column{0.55\textwidth} \centering \resizebox{1\textwidth}{!}{% \begin{tikzpicture} \begin{axis}[ axis lines = left, xmin=0, xmax=125, ymin=0, ymax=3200, xtick={70, 80, 90, 110}, ytick=\empty, xlabel={leisure ($L$)}, ylabel={consumption(\textdollar)}, ylabel style={rotate=90, at={(axis description cs:0.03,1)}, anchor=south}, xlabel style={at={(axis description cs:1,0)}, anchor=north west}, clip=false] \coordinate (E) at (axis cs: 110, 0); \filldraw[black] (E) circle (2.5pt) node[right, font=\footnotesize] {$E$}; \node[below, font=\scriptsize] at (axis cs: 110, -50) {}; \coordinate (P1) at (axis cs: 90, 260); \coordinate (P2) at (axis cs: 70, 800); \coordinate (P3) at (axis cs: 80, 750); \draw[lineBlue, thick] (axis cs: 0, 1430) -- (E) node[pos=0.15, left, font=\tiny, black] {$w=13$}; \draw[lineBlue, thick] (axis cs: 0, 2200) -- (E) node[pos=0.15, left, font=\tiny, black] {$w=20$}; \draw[lineBlue, thick] (axis cs: 0, 2750) -- (E) node[pos=0.15, right, font=\tiny, black] {$w=25$}; \draw[curveBlack, thick] (axis cs: 60, 800) to[out=-75, in=160] (P1) to[out=-20, in=170] (axis cs: 115, 120) node[right, font=\tiny] {$U_1$}; \draw[curveBlack, thick] (axis cs: 45, 1600) to[out=-80, in=145] (P2) to[out=-35, in=165] (axis cs: 105, 300) node[right, font=\tiny] {$U_2$}; \draw[curveBlack, thick] (axis cs: 60, 1600) to[out=-85, in=135] (P3) to[out=-45, in=170] (axis cs: 105, 200) node[right, font=\tiny] {$U_3$}; \draw[dashed, thin, gray] (P1) -- (axis cs: 90, 0); \draw[dashed, thin, gray] (P2) -- (axis cs: 70, 0); \draw[dashed, thin, gray] (P3) -- (axis cs: 80, 0); \filldraw[dotRed] (P1) circle (2pt); \filldraw[dotRed] (P2) circle (2pt); \filldraw[dotRed] (P3) circle (2pt); \draw[dotted, thick, black] (E) .. controls (100,100) .. (P1) .. controls (80, 500) .. (P3) -- (P2) node[above left, font=\tiny] {Expansion Path}; \end{axis} \end{tikzpicture} } \vspace{0.1cm} \footnotesize \textbf{(a) Optimal bundles} \column{0.45\textwidth} \centering \resizebox{1\textwidth}{!}{% \begin{tikzpicture} \begin{axis}[ axis lines = left, xmin=0, xmax=55, ymin=0, ymax=32, xtick={0, 20, 30, 40}, ytick={10, 13, 20, 25}, xlabel={Giờ làm việc ($H$)}, ylabel={Mức lương ($w$)}, ylabel style={rotate=90, at={(axis description cs:0.05,1)}, anchor=south}, xlabel style={at={(axis description cs:1,0)}, anchor=north west}, grid=major, grid style={dotted, gray!50}, clip=false ] \coordinate (S1) at (axis cs: 20, 13); \coordinate (S2) at (axis cs: 40, 20); \coordinate (S3) at (axis cs: 30, 25); \coordinate (S0) at (axis cs: 0, 10); \draw[lineBlue, very thick] (S0) to[out=10, in=-120] (S1) to[out=60, in=-90] (S2) % Đoạn dốc lên to[out=90, in=-20] (S3) % Đoạn vòng ngược to[out=160, in=-60] (axis cs: 25, 30); \filldraw[dotRed] (S1) circle (2.5pt); \filldraw[dotRed] (S2) circle (2.5pt); \filldraw[dotRed] (S3) circle (2.5pt); \filldraw[black] (S0) circle (2pt); \node[right, font=\scriptsize, color=lineBlue] at (axis cs: 30, 28) {Labor Supply}; \end{axis} \end{tikzpicture} } \vspace{0.1cm} \footnotesize \textbf{(b) Labor supply} \end{columns} \end{frame}