Hot
- The table is not centering in the itemby M. Logic on December 31, 2025 at 12:18 pm
A MWS is as following. \documentclass{article} \renewcommand{\labelenumi}{(\theenumi)} \usepackage{enumitem} \setenumerate[1,2,3]{itemsep=0pt,partopsep=0.3\baselineskip plus 0.2ex minus 0.1ex,parsep=0pt,topsep=0pt} \setitemize[1,2,3]{itemsep=0pt,partopsep=0.3\baselineskip plus 0.2ex minus 0.1ex,parsep=0pt,topsep=0pt,align=left} \setdescription[1,2,3]{itemsep=0pt,partopsep=0.3\baselineskip plus 0.2ex minus 0.1ex,parsep=0pt,topsep=0pt,align=left} \setlist[enumerate]{leftmargin=2em,align=left,labelwidth=2em,labelsep=0em}%\parindent=2em \setlist[itemize]{leftmargin=1em,align=left,labelwidth=1em,labelsep=0em} \setlist[description]{leftmargin=2em,align=left,labelwidth=1em,labelsep=1em} \usepackage{amsthm} \theoremstyle{theorem} \newtheorem{theorem}{Theorem}[section] \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{remark}[theorem]{Remark} \usepackage{longtable, makecell, booktabs, multicol, multirow} \usepackage{lipsum} \begin{document} \section{Test} \begin{remark} \begin{enumerate} \item \lipsum[1] \begingroup %\setlength{\LTleft}{0pt}\setlength{\LTright}{0pt} \begin{longtable}{p{1cm}<{\centering}p{1cm}<{\centering}p{1.5cm}<{\centering}p{1.5cm}<{\centering}p{2.5cm}<{\centering}} \caption{On Implications} \\\toprule $\phi$&$\psi$&$\phi\to\psi$&$\phi\wedge\psi$&$\phi\wedge\psi\to\phi$\\ \midrule\endfirsthead% \midrule $\phi$&$\psi$&$\phi\to\psi$&$\phi\wedge\psi$&$\phi\wedge\psi\to\phi$\\ \midrule\endhead \midrule\endfoot \bottomrule\endlastfoot 1&1&1&1&1\\ 1&0&0&0&1\\ 0&1&$x$&0&1\\ 0&0&$y$&0&1\\ \end{longtable} \endgroup \lipsum[2] \item \lipsum[3] \end{enumerate} \end{remark} \end{document} As you see, the table is centering on the page in in horizontal direction but not centering in the item of the enumerate environment. Is there any way to make the table be centering in the item of the enumerate environment?
- How to properly generate nested pgfkeys procedurally?by dsacre on December 31, 2025 at 10:57 am
Task Consider the following: One needs to store a over time varying amount of pgfkeys entries with a nested data structure. All the entries have the same structure, but the content may vary. So one defines a macro to handle the pgfkeys structure initialization automatically when the user sets the data. Artificial Example: Inventory (MWE) \documentclass[parskip=full]{scrreprt} \usepackage{pgffor} \usepackage{pgfkeys} % DESCRIPTION: Set up inventory entries manually \pgfkeys{ /handlers/.is setter/.code=\pgfkeysedef{\pgfkeyscurrentpath}{% \noexpand\pgfqkeys{\pgfkeyscurrentpath}{##1}% },% /inventory/.cd, Manual 5 Speed/.is setter, Manual 5 Speed/inventory id/.initial = XXXXXXXXXX, Manual 5 Speed/product/.is setter,% Manual 5 Speed/product/manufacturer/.initial = EMPTY, Manual 5 Speed/product/product id/.initial = EMPTY, Manual 6 Speed/.is setter, Manual 6 Speed/inventory id/.initial = YYYYYYYYYY, Manual 6 Speed/product/.is setter,% Manual 6 Speed/product/manufacturer/.initial = EMPTY, Manual 6 Speed/product/product id/.initial = EMPTY } % DESCRIPTION: Logic for creating pgfkey "database" entry automatically and setting them to user specified data % ARGUMENTS: #1 = entry product, #2 = entry data \newcommand{\generateEntry}[2]{ % DESCRIPTION: Creating the pgfkeys "family" and intialize with default values \pgfkeys{ /handlers/.is setter/.code=\pgfkeysedef{\pgfkeyscurrentpath}{% \noexpand\pgfqkeys{\pgfkeyscurrentpath}{##1}% },% /inventory/#1/.cd, inventory id/.initial = ZZZZZZZZZZ, product/.is setter,% product/manufacturer/.initial = EMPTY, product/product id/.initial = EMPTY } % DESCRIPTION: Setting the data to the one specified by the user \pgfqkeys{/inventory/#1}{#2} } % DESCRIPTION: Macro for testing whether it is a problem with wrapping \pgfqkeys in an additional macro \newcommand{\setEntryData}[2]{ \pgfqkeys{/inventory/#1}{#2} } \begin{document} % DESCRIPTION: Setting the data of the manually added entry % with \pgfqkeys and "{}" notation % STATUS: WORKS AS EXPECTED \pgfqkeys{/inventory/Manual 5 Speed}{ inventory id = 6, product = { manufacturer = Herbert Motors, product id = 433M5 } } % DESCRIPTION: Setting the data of the manually added entry % with \pgfqkeys wrapped in macro and "{}" notation % STATUS: WORKS AS EXPECTED \setEntryData{Manual 6 Speed}{ inventory id = 11, product = { manufacturer = Herbert Motors, product id = 433M6 } } % DESCRIPTION: Generate and set data for automatic entry % with "/" notation % STATUS: WORKS AS EXPECTED \generateEntry{Automatic 4 Speed}{ inventory id = 21, product/manufacturer = Jane's Speedshop, product/product id = JS4A } % DESCRIPTION: Generate and set data for automatic entry % with "{}" notation % STATUS: FAILS FOR NESTED KEYS \generateEntry{Automatic 5 Speed}{ inventory id = 42, product = { manufacturer = Jane's Speedshop, product id = JS5A } } % DESCRIPTION: Visualize the data stored in the pgfkeys \section*{Inventory} \foreach \entry in {Manual 5 Speed, Manual 6 Speed, Automatic 4 Speed, Automatic 5 Speed}{ \textbf{\entry}:\\ inventory id: \pgfkeysvalueof{/inventory/\entry/inventory id}\\ manufacturer: \pgfkeysvalueof{/inventory/\entry/product/manufacturer}\\ product id: \pgfkeysvalueof{/inventory/\entry/product/product id} \\[0.25cm] } \end{document} This produces the following output: Issue When using the {...} notation to set the data of automatically generated entries, the data is not stored (see Automatic 5 Speed in MWE). The / notation seems to work. What was tried so far The problem seems to be related to the .is setter pgfkeys handler. It seems like the nested structure is not created, but a single key with e. g. product/manufacturer as id (with the / being interpreted as a letter, not a separator). So far, the following has been tried: Changing .code to .ecode Modifying the expansion from \noexpand to other possibilities Those experiments always resulted in errors and the compilation failing. Question Is there a simple way to achieve the desired behavior with pgfkeys (e.g. via .is family)? Suggestions of other methods are also welcome. However, solutions with pgfkeys would be preferred, since the rest of the data handling in the real project is already based upon pgfkeys.
- unicode-math: set up the math sans font and related familiesby Jinwen on December 31, 2025 at 9:56 am
Apart from the main math font, I would like to specifically set the math sans font and related families for various purposes. Here is an example (sorry for using a font not available in standard TeX distribution, I am just using a familiar font to demonstrate the issue, you may change it to your familiar font sets if needed): \documentclass{article} \usepackage{fontspec} \usepackage{unicode-math} \setmathfont{KpMath} % set a main math font, here I am just using a random font for demonstration \setmathsf{Palatino Sans LT Pro} \setmathfont{PalatinoSansLTPro-LightIta}[range=sfit] \setmathfont{PalatinoSansLTPro-Bold}[range=bfsfup] \begin{document} $\mathsf{H}$ % cohomology $\mathbfsfup{H}$ % supercohomology $\mathsfit{H}$ % a functor \end{document} The additional \setmathfont{...}[range=...] seems necessary, otherwise the result seems quite plain: However, my method of configuration is clumsy. The command \setmathsf comes from fontspec, and \setmathfont comes from unicode-math. Also, here I am just making a minimal example, but in reality there are more families than sfit and bfsfup, however, it would seem that one can only have no more than 9 instances of \setmathfont. May I thus ask what is the "correct" way to make this configuration, without having to use this mixture of commands and use up too many instances of \setmathfont? Thanks so much! This is related to my earlier question unicode-math: Trying to reduce the number of "\setmainfont" when configuring math font families, here I am trying to give a concrete example and hopefully would make the question more straightforward to answer.
- Cleveref and theorem-style environments in SIAM document classby Daniele Avitabile on December 31, 2025 at 7:50 am
This minimal example of SIAM document class shows that Cleveref has issues with theorem-style environments \documentclass{siamart251216} %% Used for creating new theorem and remark environments \newsiamremark{hypothesis}{Hypothesis} \crefname{hypothesis}{Hypothesis}{Hypotheses} \begin{document} \section{Test section}\label{sec:test} Here are one theorem and one hypothesis. \begin{theorem}\label{thm:test} Test theorem \end{theorem} \begin{hypothesis}\label{hyp:test} $x$ is a real number \end{hypothesis} And now we use cleveref to cite \cref{sec:test} \cref{thm:test} and \cref{hyp:test} \end{document} as it produces the following output: As you can see the Hypothesis is cited as a Theorem. Things to note: In the past, this used to be an issue, as seen in this post. The workaround(s) proposed there don't work for me The problem was not present with previous versions of the siamart document, and TeX distributions, in which the 2 commands in the preamble were working well. SIAM seems to be aware of the problem, because in their documentation states It is puzzling that the latex source of the documentation given at point 3 produces the correct reference. This document is far from being minimal, and I'm not including it here. However, I have tried to progressively comment out sections from the main body of the document (not the preamble), and I bump again into the Cleveref issue. Does anyone have an idea of how this can be fixed? It's way out of my LaTeX skills I must say.
- Can the section title be moved to the outer margin on all pages, or suppressed from the body but still linked to the headers?by Gary on December 31, 2025 at 5:36 am
I'm trying to re-typeset on 8.5 by 11 paper an old book that was printed on smaller paper, such that the author did not need to have section titles within the text body but used the right-hand header. An issue that arises is that, on the larger paper, instances occur in which more than one of these sections lands on facing pages, meaning only one can be in the right-hand header which would leave the other without any indication at all. In trying to stay as true to the original as possible without interrupting the body, I placed these section titles in the outer margin, added them also as sections in the right-hand header but suppressed them within the text body; such the last section on the page appeared in the right-hand header and all appeared in the outer margin. I'm struggling to achieve the same in ConTeXt. I can get the section-title text in the outer margin but can't add that also as a section that won't appear within the text body. Or I can get the sections added normally and set as margin text; however, I can't get them in the outer margin on right-hand pages. Thus, in the example below, I'd like to either: Get the "Section title" currently in the inner margin moved to the outer; or Leave the "A pseudo-margin title" as a margin item and add a section with the marking such that it will appear in the header but not in the body (or the TOC but that is likely a separate question). However setting title and list to {} doesn't appear to work. (In LaTeX the fancyhdr package permitted suppression of the section title in the body just by leaving the title blank.) It may be a bit odd; but is there a way to accomplish this? Thank you. \definepapersize[book][width=8.16in,height=10.66in][letter] \setuppapersize[book] \setuppagenumbering[alternative=doublesided,location=] \definelayout[main][ location=duplex, backspace=1.33in, topspace=0.33in, top=0.33in, topdistance=0in, width=5.0in, height=fit, headerdistance=0.125in, footerdistance=0in, header=\lineheight, footer=0in, bottom=0.83in, bottomdistance=0in, leftedge=1.33in, rightmargin=1.375in, rightmargindistance=0.125in] \setupbodyfont[libertinus,12pt] \definefontfeature [default] [default] [protrusion=quality,expansion=quality] \setupalign[justified,hyphenated,hanging,hz] \setupindenting[yes,medium,next] \setupwhitespace[quarterline] \setupinterlinespace[2.8ex] \definecolor[MargGray][r=0.425,g=0.535,b=.688] \definefont[MarginOuterFont][name:chorus*default at 12pt][line=2.8ex] \define[1]\MarginOuter { \margintext[ location=outer, margin=margin, color=MargGray, align=middle, line=1, style=\MarginOuterFont ]{#1} } \startbodymatter \settextcontent[header][text] [middletext][section] [chapter] \setuptexts [header][text] [][pagenumber] [pagenumber][] \setuphead[section][number=no,alternative=margintext] \startchapter [ title={Chapter Title}, ] \samplefile {ward} \startsection [ title={Section\\Title}, ] \samplefile {ward} \stopsection \MarginOuter{A pseudo-\\margin title} \samplefile {ward} \stopchapter \stopbodymatter EDIT: In attempt at employing the guidance of @Max Chernoff this appears to work. I don't understand the difference in alternative of text and margintext in \setuphead and \setupheadalternative; but if not text in \setuphead, cannot get the paragraph indentation. \definepapersize[book][width=8.16in,height=10.66in][letter] \setuppapersize[book] \setuppagenumbering[alternative=doublesided,location=] \definelayout[main][ location=duplex, backspace=1.33in, topspace=0.33in, top=0.33in, topdistance=0in, width=5.0in, height=fit, headerdistance=0.125in, footerdistance=0in, header=\lineheight, footer=0in, bottom=0.83in, bottomdistance=0in, leftedge=1.33in, rightmargin=1.375in, rightmargindistance=0.125in ] \setupbodyfont[libertinus,12pt] \definefontfeature [default] [default] [protrusion=quality,expansion=quality] \setupalign[justified,hyphenated,hanging,hz] \setupindenting[yes,medium,next] \setupwhitespace[quarterline] \setupinterlinespace[2.8ex] \definecolor[MargGray][r=0.425,g=0.535,b=.688] \definefont[MarginOuterFont][name:chorus*default at 12pt][line=2.8ex] \startbodymatter \definemargindata [inoutermargin] [outer][ margin=margin, width=\outermarginwidth, color=MargGray, line=1 ] \define[2]\MyHead{\inoutermargin{#1 #2}} \setuphead [section] [alternative=text, number=no, style=\MarginOuterFont, beforesection=\vskip -1.25\lineheight, indentnext=yes, command=\MyHead ] \setupheadalternative[margintext][ margintext=inoutermargin ] \settextcontent[header][text] [middletext][section] [chapter] \setuptexts [header][text] [][pagenumber] [pagenumber][] \startchapter [ title={Chapter Title}, ] \samplefile {ward} \startsection [ title={A real\\section\\title 1}, marking={A real section title 1}, list={} ] \samplefile {ward} \stopsection \startsection [ title={A real\\section\\title 2}, marking={A real section title 2}, list={} ] \samplefile {ward} \stopsection \samplefile {ward} \stopchapter \stopbodymatter
- unicode-math: Trying to reduce the number of "\setmainfont" when configuring math font familiesby Jinwen on December 31, 2025 at 4:36 am
In setting math font with unicode-math, since I have relied on the range feature too often (to slightly change a few symbols, etc.), there are already many \setmathfont in my settings, and in trying to write another \setmathfont, I am getting the errors: Too many symbol fonts declared. Symbol font `__um_fam9' not defined. Missing number, treated as zero. However, to my knowledge, in setting a math font for each style, like sfup, sfit, bfsfup, bfsfit... one seems to have to write a \setmathfont each time. For example, if I wish to set Palatino Sans as the math sans font, then the fontspec method \setmathsf{Palatino Sans LT Pro} would not seem to be able to set the families sfit, bfsfup... correctly (probably because the font has multiple weights, like for bold there are Medium and Bold etc., and automatic selection cannot seem to decide properly?), so I usually need to write some extra unicode-math style configuration like \setmathfont{PalatinoSansLTPro-LightIta}[range=sfit] \setmathfont{PalatinoSansLTPro-Bold}[range=bfsfup] ... But then it becomes very easy to have too many \setmathfont. Since I am not familiar with fontspec and unicode-math, perhaps I am setting in a very clumsy way. Is there any better way to set math fonts with all these families, so that it would not involve too many \setmathfont and lead to errors? Thanks so much! Sorry for not having a MWE since I am mostly asking a general method and not a particular issue, but the following code in my style file may give you some idea why I am using too many \setmathfont: \setmathfont [ RawFeature = mathkern ] { KpMath-Regular.otf } \setmathfont { KpMath-Regular.otf } [ range = \amalg , Scale = 0.84625 ] \setmathfont { KpMath-Sans.otf } [ range = { \sum } ] \setmathfont { latinmodern-math.otf } [ range = { frak, bffrak, \mitvarpi, \mupvarpi, \ast } , Scale = 1.10 ] \setmathfont { texgyrepagella-math.otf } [ range = { `(, `), `/, \setminus, `| } , Scale = 1.10 ] \setmathfont { texgyrepagella-math.otf } [ range = { \mathcomma, \mathsemicolon } , ] \setmathfont [ RawFeature = mathkern ] { Asana-Math.otf } [ range = { it / { Latin, latin }, bfit / { Latin, latin }, up / num, bfup / num } ] \setmathfont { KpMath-Regular.otf } [ range = { cal, bfcal }, RawFeature=+ss01 ] % \setmathfont { KpMath-Regular.otf } [ range = {} ] % reset the metric
- mpxtabular became wrong in texlive 2025-06-02by Arne Hallam on December 31, 2025 at 4:30 am
Similar to the question asked about supertabular on Sep 3 at 5:22 by Dmitry Sukhodoyev, I get a strange error when trying to compile tex files containing supertabular. It is hard to provide a MWE as I need multiple rows to cross multiple pages. Here are a couple of files I pared back. \documentclass[letterpaper,10pt]{article} \usepackage{enumitem} \usepackage{multicol} \usepackage{array,xtab} \usepackage[font=sl,labelfont=bf]{caption} \usepackage[T1]{fontenc} \usepackage{mathptmx} \usepackage[lmargin=1cm,rmargin=1cm,tmargin=2cm,bmargin=1cm,dvips,landscape]{geometry} \pagestyle{empty} \begin{document} \begin{center} \Large \bfseries Appendix Tables \end{center} \tablefirsthead {\hline \bfseries \bfseries Table Topic & \bfseries Content \tabularnewline \hline} \tablehead{\hline \bfseries \bfseries Table Topic & \bfseries Content \tabularnewline \hline} \tabletail{\hline \multicolumn{2}{|r|}{\emph{Continued on next page}}\tabularnewline \hline} \tablelasttail{\hline \hline} \begin{center} \begin{mpxtabular}{|>{\raggedright}p{6cm}|>{\raggedright}p{15cm}|} \hline Revenue and expenses for each of the ASCs and RRCs& \begin{enumerate}[nosep,leftmargin=*, label=\alph*.] \item Data for FY09 and FY12 \item To include: Admin. Overhead Charges, Allocated Costs, Directed Federal Appropriation, Directed State Appropriation, F\&A Cost Recovery, RMF, ISF, Other Revenue, Tuition, Total \item Direct expenses can be backed out (or do we include) in aggregate for each unit \item Include graphs \item Compute change for each \end{enumerate}\tabularnewline \hline Costs for each of the ASCs and RRCs &\begin{enumerate}[nosep,leftmargin=*, label=\alph*.] \item Data for FY09 and FY12 \item Include graphs \item Compute change for each \end{enumerate} \tabularnewline \hline Personnel for each of the ASCs and RRCs &\begin{enumerate}[nosep,leftmargin=*, label=\alph*.] \item Data for FY09 and FY12 \item FTEs for tenure-track faculty, non-tenure-track faculty, P\&S, merit, post-doc and graduate student \end{enumerate} \tabularnewline \hline Students enrolled & Headcount (and maybe FTEs) for undergraduate, graduate, and professional students for each college and total for FY09, FY10, FY11, FY12 \tabularnewline \hline Students graduated& Number of graduates (undergraduate, professional, M.S. and Ph.D) for each college and total for FY09, FY10, FY11, FY12 \tabularnewline \hline Graduate Student Support& \begin{enumerate}[nosep,leftmargin=*, label=\alph*.] \item For FY09, FY10, FY11, FY12 by college \item Headcount of graduate students on appointment \item Total paid in graduate student stipends by source of funds and total \item Sources of funds include the general funds, grants and contracts, ISU Foundation, other \item Total paid in graduate student tuition by source of funds and total \item Sources of funds include the general funds, grants and contracts, ISU Foundation, students, other \item May need to be two tables or only show FY09 and FY12 \end{enumerate} \tabularnewline \hline Undergraduate student credit hours& \begin{enumerate}[nosep,leftmargin=*, label=\alph*.] \item By college with two columns per college (across top of table) \item Undergraduate SCH by course level (100, 200, 300, 400) for each of FY09, FY10, FY11, FY12 \item First column will give total SCH, second will give as percent of total \end{enumerate} \tabularnewline \hline Undergraduate majors& \begin{enumerate}[nosep,leftmargin=*, label=\alph*.] \item By college for FY09, FY10, FY11, FY12 \item Resident and non-resident \end{enumerate} \tabularnewline \hline Graduate student credit hours& \begin{enumerate}[nosep,leftmargin=*, label=\alph*.] \item By college with two columns per college (across top of table) \item Undergraduate SCH by course level (500, 600) for each of FY09, FY10, FY11, FY12 \item First column will give total SCH, second will give as percent of total \end{enumerate} \tabularnewline \hline Graduate student net revenue& \begin{enumerate}[topsep=0pt, partopsep=0pt,itemsep=0pt,leftmargin=*, label=\alph*.] \item Landscape table \item By college with one row for each college \item Columns are gross, transfer and net for FY09, FY10, FY11, FY12 \end{enumerate} \tabularnewline \hline Net assignable square feet& For ASCs and RRCs \tabularnewline \hline Grants and contracts (single-count data)& \begin{enumerate}[nosep,leftmargin=*, label=\alph*.] \item Columns will include units which get IDC (aggregate as appropriate) \item Columns will include RRCs, ASCs, Centers (Aggregated), PIs, Other?? \item Maybe aggregate centers to those who report to VPRED and those who do not \item IDC collected (will only have for some of the years) \item Grant expenditures \end{enumerate} \tabularnewline \hline ``What if'' simulation& Perhaps some type of simulation of how base budgets would have looked without the RMM, but we may not be able to do in a meaningful way because of make whole calculations and movement of items from central to colleges with the adoption of RMM. \tabularnewline \hline \end{mpxtabular} \end{center} \end{document} \documentclass[letterpaper,12pt]{article} \usepackage[svgnames,dvipsnames,table]{xcolor} \usepackage[dvipsnames]{xcolor} \usepackage[inline,shortlabels]{enumitem} \usepackage{array,xtab} \usepackage[font=sl,labelfont=bf]{caption} \usepackage{lscape} \pagestyle{empty} \begin{document} \begin{landscape} \begin{center} \Large \textbf{TSC 220}\\ \emph{\large \bfseries Lectures by Week} \\ \end{center} \topcaption*{Materials for Each Week} \captionsetup{font=large,labelfont=bf, textfont=bf,skip=5pt} \tablefirsthead{ \rowcolor{LightBlue} \bfseries \textbf{Week} & \textbf{Lecture Material} &\textbf{Readings} \tabularnewline } \tablehead {\rowcolor{LightBlue} \bfseries \textbf{Week} & \textbf{Lecture Material} &\textbf{Readings} \tabularnewline } \tabletail{ \hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline} \tablelasttail{\hline } \begin{center} \small \begin{mpxtabular}{|>{\raggedright}p{1cm}|>{\raggedright}p{11cm}|>{\raggedright}p{9cm}|} \hline \shrinkheight{-1\baselineskip} 1 & \begin{itemize} \item CourseOutlinePresF2026.pdf \item HumanFlourishIntroF2026.pdf \item SustainabilityIntroF2026.pdf \item TechnologySystemsTheBoxF2026.pdf \item SustainabilitySummaryF2026.pdf \end{itemize} & \begin{itemize} \item EasterIslandDiamond.pdf \item Goodland1995ConceptEnvironmental.pdf \item Goodland2002Sustainability \dots .pdf \end{itemize} \tabularnewline \hline 2 & \begin{itemize} \item EconomicsOverviewF2026.pdf \item EconomicsGoodsBadsPublicGoodsF2026.pdf \item NaturalResourcesF2026.pdf \end{itemize} & \begin{itemize} \item AndersonGrewell.pdf \item GreenEconomyKrugmanHighlight.pdf \item CodQuotas.pdf \item HalfDome.pdf \item RainForestsCarbonTax.pdf \item CarbonTaxRainForest.pdf \end{itemize} \tabularnewline \hline 3 & \begin{itemize} \item CommonPropertyScenariosF2026.pdf \item TimeValueOverviewF2026.pdf \item TimeValuePresF2026I.pdf \item TimeValuePresF2026II.pdf \item AnnuityExcel.pdf \item TimeValueExamplesF2026.pdf \item TimeValue.xls \end{itemize} & \begin{itemize} \item SolowSustainability1992.pdf \item SternReviewExecutiveSummary.pdf \item NordhausSternJel.pdf \end{itemize} \tabularnewline \hline 4 & \begin{itemize} \item OverviewExternalitiesF2026.pdf \item OverViewJusticeF2026.pdf \item ExternalitiesMFPresentation2015.pdf \item TransformativeFS2015.pdf \item EngineerSolutions.pdf \item JusticeLecturesF2026.pdf \item FrameworkLecturesF2026.pdf \end{itemize} & \begin{itemize} \item Coase.pdf \item RawlsJustice.pdf \item WolfIntergenerationalJustice.pdf \item TransformativeMedicine.pdf \end{itemize} \tabularnewline \hline 5 & \begin{itemize} \item WaterSustainabilityOverviewF2026.pdf \item WaterLandCaseStudiesF2026.pdf \item WaterSustainabilityFS2015.pdf \item WaterValueF2026.pdf \end{itemize} & \begin{itemize} \item DessicationCalifornia.pdf \item LandsAridRegion.pdf \item MolleIrrigationJordan.pdf \item NazerPalestineLP.pdf \item NazerRetract.pdf \item NazerRetractedArticle.pdf \item OtherCalifornia.pdf \item PalestineRightToWaterFactSheet.pdf \item PalestineWaterIHighlighted.pdf \item PalestineWaterIIHighlighted.pdf \item plate-grants.pdf \item plate-rain.pdf \item plate-utah.pdf \item WellsDry.pdf \item WestDrought.pdf \end{itemize} \tabularnewline \hline 6 & \begin{itemize} \item EnergyOverviewIF2026 \item EnergyIntroF2026.pdf \item EnergyUnitsExamples.pdf \item EnergyHistory2015.pdf \item WorldEnergyF2026.pdf \end{itemize} & \begin{itemize} \item CO2Down.pdf \item EndCoal.pdf \item PeakCoal.pdf \item PeakOil.pdf \item ResourcesAreNotRunningOut.pdf \item SolowSustainability1993.pdf \end{itemize} \tabularnewline \hline 7 & \begin{itemize} \item EnergyOverviewIIF2026 \item EnergyResourcesF2026.pdf \item LevelizedCostF2026.pdf \item CapacityEfficiencyF2026.pdf \item EnergyPolicyF2026.pdf \end{itemize} & \begin{itemize} \item GuidingPrinciplesEnergy.pdf \item EnergyPrinciples.pdf \item EnergySubsidies.pdf \item EnergyPoverty.pdf \end{itemize} \tabularnewline \hline 8 & \begin{itemize} \item OverviewExternaliesEnergyOverviewTransF2026.pdf \item ExternalitiesEnergyMaterialsF2026.pdf \item TransportationOverviewIF2026.pdf \item ParadigmTransportationF2026.pdf \item TransportationBasicsF2026.pdf \end{itemize} & \begin{itemize} \item MarketBarriersOwen.pdf \item CarbonCredits.pdf \item BirdScorchingSolarProject.pdf \end{itemize} \tabularnewline \hline 9 & \begin{itemize} \item TransportationOverviewIIF2026.pdf \item NewParadigmsTransportationF2026.pdf \item TrendsSustainableTransportF2026.pdf \end{itemize} & \begin{itemize} \item 10TrendsTransport.pdf \item AutonomousVehiclesEthics.pdf \item GoogleCarSlate.pdf \item GoogleCarWSJ.pdf \item SaveTheEarthDriveYourCarMarketplace.pdf \end{itemize} \tabularnewline \hline 10 & \begin{itemize} \item ClimateChangeOverview2015.pdf \item ClimateChangePolicyOverview2015.pdf \item ClimateChange2015.pdf \item ClimateChangePolicy2015.pdf \end{itemize} & \begin{itemize} \item ClimateAndEarthsEnergyBudget.pdf \item ChinaUSClimate.pdf \item ClimateAgreementNYT.pdf \item ClimateAgreementWSJ.pdf \item ClimateChinaUSBrookings.pdf \item GlobalWarmingConcerned.pdf \item GlobalWarmingSkepticNot.pdf \item ClimateTalksFall2015.pdf \item ClimateHowToTalkAtlantic.pdf \item ExxonClimateChangeDenial.pdf \item TobControl2002Cummings.pdf \end{itemize} \tabularnewline \hline 11 & \begin{itemize} \item OverViewMaterialsF2026I.pdf \item OverViewMaterialsF2026II.pdf \item MaterialsTreasure2TrashF2026.pdf \item CriticalMaterialsF2026.pdf \item ConflictMaterialsF2026.pdf \item MaterialsTreasure2TreasureF2026.pdf \item AdditiveManufacturingF2026.pdf \end{itemize} & \begin{itemize} \item UpcycleToEliminateWaste.pdf \item EarthAudit.pdf \item ConflictMaterialsBBC2011.pdf \item ConflictMineralsDoddFrank.pdf \item ThirdindustrialRevolution2013.pdf \item AdditiveManufacturingDUP.pdf \end{itemize} \tabularnewline \hline 12 & \begin{itemize} \item EconomicDevelopment.pdf \item PolicyDevelopmentPresF2026.pdf \end{itemize} & \begin{itemize} \item SustainableDevelopmentGoalsGuardian.pdf \item UniversalHumanRights.pdf \item AgendaForSustainableDevelopment.pdf \item NotSoIncredible.pdf \item DoesItTakeAVillage.pdf \item PhelpsYunus.pdf \end{itemize} \tabularnewline \hline 13 & \begin{itemize} \item CommunitiesOverviewF2026.pdf \item CommunitiesF2026.pdf \item CommunityFailureF2026.pdf \item TheoryCitiesF2026.pdf \end{itemize} & \begin{itemize} \item Bettencourt2010NatureAUnifiedTheory.pdf \item BettencourtScience-2013-1438-41.pdf \item BettencourtUrbanScalingPlosOne0013541.pdf \item BiggerCitiesDoMoreWithLess.pdf \item CrisisOnThePlains.pdf \item GoodlandSustainabilityHSEE.pdf \item SocialMcKenzie.pdf \item SustainableCommunities.pdf \end{itemize} \tabularnewline \hline \end{mpxtabular} \end{center} \end{landscape} \end{document}
- Could you add "Happy New Year" in your language? Have a wonderful 2026!by Ñupi on December 31, 2025 at 3:11 am
\documentclass[aspectratio=169]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usetikzlibrary{shapes.geometric, shadings, shadows} \setbeamertemplate{navigation symbols}{} \begin{document} \begin{frame}[plain] \begin{tikzpicture}[remember picture, overlay] \fill[top color=blue!20!black, bottom color=black] (current page.south west) rectangle (current page.north east); \foreach \i in {1,...,60} { \fill[white, opacity=0.4] (current page.center) ++({rand*8}, {rand*4.5}) circle (0.03); } \node[white, opacity=0.75, font=\small\itshape] at (-5, 2.5) {Happy New Year}; % \node[white, opacity=0.75, font=\small\itshape] at (5, -2.5) {Bonne Année}; \node[align=center, text=white] at (current page.center) { {\fontsize{35}{40}\selectfont \textbf{\textcolor{yellow!70!white}{¡Happy New Year!}}} \\[0.3cm] {\fontsize{20}{24}\selectfont \textit{and prosperous}} \\[0.5cm] {\fontsize{75}{75}\selectfont \textbf{\textcolor{white}{2026}}} \\[0.8cm] {\fontsize{18}{22}\selectfont \textsf{\textbf{Friends of \LaTeX}}} }; \draw[very thick, orange!60!yellow, opacity=0.6] (-4,-1.8) -- (4,-1.8); \shade[ball color=yellow, opacity=0.3] (-7, 3) circle (0.5); \shade[ball color=orange, opacity=0.2] (7, -3) circle (0.8); \end{tikzpicture} \end{frame} \end{document}
- Bizarre interaction between `microtype` package and \eqref macroby John Pardon on December 30, 2025 at 11:14 pm
I would have thought that if I declare \let\stdeqref\eqref, then the \stdeqref macro and the \eqref macro would be interchangeable. But here is an example where it fails! Moreover, this failure is (somehow) caused by the microtype package?! What is going on, and how to fix it? \documentclass{article} \usepackage{microtype} \usepackage{amsmath} \let\stdeqref\eqref \begin{document} \begin{equation}\label{a} A \end{equation} This is good spacing: \eqref{a}\allowbreak\eqref{a} This is bad spacing: \stdeqref{a}\allowbreak\stdeqref{a} But the bad spacing becomes good if we remove microtype! \end{document} The reason I'm asking is that I would like to redefine the \eqref macro in a way which uses the usual \eqref macro as a subcomponent, via the usual strategy I've seen time and time again on this site: \let\stdeqref\eqref \renewcommand\eqref[1]{Something fancy containing \stdeqref{#1} etc.} but that doesn't work anymore if \let isn't behaving as expected . . .
- Drawing Only a Portion of an Oval Frameby DDS on December 30, 2025 at 10:39 pm
Consider the following code which I compile with xelatex: \documentclass{book} \usepackage{graphicx} \usepackage[abs]{overpic} \usepackage{tikz} \definecolor{cadmiumgreen}{rgb}{0.0, 0.42, 0.235} % 0, 107, 60 \definecolor{Gold}{RGB}{228,168,73} \begin{document} \thispagestyle{empty} \begin{center} \begin{tikzpicture} \clip (0,0) ellipse (4.25cm and 5.5cm); \draw[line width=5pt,Gold,fill=cadmiumgreen] ellipse (4.25cm and 5.5cm); \node at (0,0) {\includegraphics[scale=.37,clip, trim = 0 0 0 0]{example-image-a}}; \draw[line width=12pt,Gold!70!black] ellipse (4.25cm and 5.5cm); \end{tikzpicture} \end{center} \end{document} with the output: QUESTION: How may I draw only a part of the 12pt-thick oval frame; in particular, relative to the node (0,0), draw the frame from only -45 degrees to 225 degrees in a clockwise fashion (instead of from -90 degrees to 270 degrees which gives the entire oval)? Thank you.
- Increase vertical spacing for the boxed choice in enumextby Sebastiano on December 30, 2025 at 9:24 pm
I'm using the enumext package to create multiple-choice questions. In my case, the answer labels are boxed letters, produced using the wrap-label key. The issue is that the boxed letters appear too close to each other vertically. I would like to know the correct way to increase the vertical spacing between the boxed labels, without unnecessarily changing the text spacing or breaking the column alignment. Here a MWE: \documentclass[a4paper,12pt]{article} \usepackage{amsmath, amssymb} \usepackage{graphicx} \usepackage{enumext} \begin{document} \begin{enumext}[label=\textbf{Domanda} \arabic*.,wrap-label=\textbf{#1},list-indent=0pt, save-ans=test] \item Lion \setenumext[keyans]{label=\Alph*,font=\small,nosep,wrap-label={\fbox{\makebox[\height]{##1}}}} \begin{keyans}[columns=2,nosep,mini-env={0.4\linewidth}] \item \item \item \item \miniright \includegraphics[scale=.4]{example-image.png} \end{keyans} \end{enumext} \end{document}
- Ensure wrapfigure fits on page and appears immediately after text, otherwise break pageby taiwan12 on December 30, 2025 at 7:32 pm
I'm defining a custom command in LaTeX that shows a heading, a wrapped image, and some text. Currently, the image is displayed using wrapfigure inside a \des command: \documentclass{article} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{lipsum} \usepackage{parskip} \newsavebox{\imageHolder} \NewDocumentCommand{\wrapimage}{ O{0.5} m }{ \sbox{\imageHolder}{\includegraphics[scale=#1]{#2}} \begin{wrapfigure}{L}{\wd\imageHolder} \usebox{\imageHolder} \end{wrapfigure} } \NewDocumentCommand{\des}{m m m}{ \textbf{#1} \wrapimage{#2} #3 } \begin{document} \des{A}{example-image-a}{\lipsum[1]} \des{B}{example-image-b}{\lipsum[1]} \des{C}{example-image-c}{\lipsum[1]} \end{document} Problem: I want the wrapped image to always appear immediately after the heading ("A", "B"). However, if the image is too large to fit on the remaining space of the page, it should start on the next page instead of overlapping or leaving awkward whitespace. Currently, wrapfigure sometimes floats and breaks the layout in ways I don't want. Question: How can I modify my \des or \wrapimage command so that: The image is always placed right after the heading. If it doesn't fit on the current page, LaTeX automatically starts a page break before the heading + image. The image still wraps text if there is enough space. Any advice on how to achieve this behavior with wrapfigure (or an alternative) would be greatly appreciated.
- ignore part of formula in horizontal alignmentby Tamas Papp on December 30, 2025 at 4:56 pm
I would like to make LaTeX ignore part of a formula in horizontal alignment, ie center it as if that part did not exist. In some sense, the opposite of \phantom. MWE: \documentclass[12pt]{article} \begin{document} \begin{centering} $+$\\ % mark the center visually $3.0$\\ % reference, should align with this $-3.0$\\ % how to remove - from centering? $-3.0\phantom{-}$\\ % this works, but is inelegant \end{centering} \end{document} I could make this work by adding a \phantom of the part copied on the other side, but this feels like a kludge. Is there a way to make the - in the above example show up, but not participate in the horizontal size calculation?
- XeLaTeX - fontableby Rajesh TeXnicians on December 30, 2025 at 2:28 pm
How can we generate a font table for the XITSMath-Bold font using the XeLaTeX compiler? \documentclass{article} \usepackage{fontspec} \usepackage{fonttable} \begin{document} \fonttable{XITSMath-Bold} \end{document}
- Undesired bold text in Bibliography with BibLatexby DaVarPhi on December 30, 2025 at 1:44 pm
I'm using a template in Overleaf to make a mock article for practice, but it used natbib instead of biblatex so I attempted to replace the package and did all of the suitable replacements (like \citep to \parencite) But, it produced this "ugly" bibliography like below. Notice the bold texts Here is my bib file @book{sutton1998, title = {Reinforcement Learning: An Introduction}, author = {Sutton, Richard S. and Barto, Andrew G.}, year = {1998}, publisher = {MIT Press}, } @inproceedings{togelius2015, title = {AI Researchers, Video Games Are Your Friends!}, author = {Togelius, Julian}, booktitle = {Proceedings of the International Joint Conference on Computational Intelligence}, pages = {3--18}, year = {2015}, publisher = {Springer} } @incollection{johnson2016, author = {Johnson, Mark}, title = {Bullet Hell: The Globalized Growth of Danmaku Games and the Digital Culture of High Scores and World Records}, booktitle = {Transnational Contexts of Culture, Gender, Class, and Colonialism in Play: Video Games in East Asia}, pages = {17--42}, publisher = {Springer}, year = {2016} } @book{koziel2019, title = {Speedrun Science: A Long Guide to Short Playthroughs}, author = {Koziel, Eric}, year = {2019}, publisher = {Fangamer} } @inproceedings{li2019, author = {Li, Raymond C. and Ahn, Jun Min and Esteron, Zachary Tyler and Hong, Qiyin}, title = {Collision Avoidance with Deep Reinforcement Learning}, booktitle = {Proceedings of the 2019 Purdue Undergraduate Research Conference}, year = {2019} } @online{chen2025, author = {Chen, Jackson}, title = {Summer Games Done Quick 2025 Raises \$2.4 Million for Doctors Without Borders}, year = {2025}, organization = {Engadget}, url = {https://www.engadget.com/gaming/summer-games-done-quick-2025-raises-24-million-for-doctors-without-borders-182314037.html}, urldate = {2025-12-31} } And some MWE \input{preamble} \begin{document} LOREM IPSUM DOLOT SIT AMET \parencite{chen2025} LOREM IPSUM DOLOT SIT AMET \parencite{johnson2016} LOREM IPSUM DOLOT SIT AMET \parencite{koziel2019} LOREM IPSUM DOLOT SIT AMET \parencite{li2019} LOREM IPSUM DOLOT SIT AMET \parencite{sutton1998} LOREM IPSUM DOLOT SIT AMET \parencite{togelius2015} \newpage \input{bibliography} \end{document} that produces also an ugly citation Here are the content of preamble.tex that I think directly contributed to the bibliography and also the template for bibliography.tex %preamble.tex \documentclass[12pt,a4,american]{extreport} \usepackage[utf8]{inputenc} \usepackage[indonesian]{babel} \usepackage[T1]{fontenc} \usepackage{relsize} \usepackage{times} \usepackage{amsmath, amsthm, amssymb, amsfonts} \usepackage{actuarialsymbol} \usepackage{lipsum} \usepackage{geometry} \usepackage[onehalfspacing]{setspace} \usepackage{parskip} \usepackage{microtype} \usepackage{fancyhdr} \usepackage[ pdftex, bookmarks=true, unicode=true, pdfusetitle, bookmarksnumbered=true, bookmarksopen=true, breaklinks=true, pdfborder={0 0 1}, backref=page, colorlinks=false ]{hyperref} \usepackage[noabbrev, capitalise]{cleveref} \usepackage{xcolor} \usepackage[style=authoryear, backend=biber]{biblatex} \DeclareDelimFormat{nameyeardelim}{\addcomma\space} \addbibresource{citation.bib} \usepackage{xurl} \usepackage[nottoc,numbib]{tocbibind} % bibliography.tex \clearpage \phantomsection \addcontentsline{toc}{chapter}{BIBLIOGRAPHY} \nocite{*} \printbibliography[heading=bibintoc, title={BIBLIOGRAPHY}] I don't know what I did wrong here. I have checked the custom settings file of the template and there are no other command that modify the bibliography and I've done the suitable replacements. Any help? EDIT : Added MWE and all the relevant files content.
- Nested \foreach loop with changing start valueby Charlie on December 30, 2025 at 12:48 pm
Im trying to put a text inside a rectangle node in ~104 pages using tikz only if the text has a width less than 355pt. If this text is wider than that, another text will be found that fits this criteria. The text is provided by a python script run from \input command that sequentially obtains the text, out of a pool of 150 different texts. The approach I'm following consists in using a nested \foreach with a variable starting value, that calls this python script, as follows: \newcounter{testcount} \setcounter{testcount}{1} \foreach \i in {1,...,104}{ \foreach \j in {\value{testcount},...,150}{% \renewcommand{\lorem}{{\tiny \input{|python3 loremipsum/loremipsum.py --lorem Ipsum --dolor \j\space --sit 1}}} % \lorem command was defined as empty in preamble \setbox0=\hbox{\lorem} \loremwidth=\wd0 \ifdim\loremwidth > 355 pt \lorem \setcounter{testcount}{\j} \breakforeach \else {} \fi } } Placing the text into the rectangle is not a problem, that's why I ignored this part. However, when I try to compile this using xelatex, I get the following error: ! Missing number, treated as zero. <to be read again> : l.58 } ! Missing endcsname inserted. <to be read again> c@testcount l.58 } ! Use of ??? doesn't match its definition. <argument> ??? ! LaTeX Error: c@testcount invalid in file name. Lost: space... l.58 } ! Missing endcsname inserted. <to be read again> c@testcount l.58 } ! Use of ??? doesn't match its definition. <argument> ??? ! LaTeX Error: c@testcount invalid in file name. Lost: space... l.58 } ! Missing endcsname inserted. <to be read again> c@testcount l.58 } ! Use of ??? doesn't match its definition. <argument> ??? ! LaTeX Error: c@testcount invalid in file name. Lost: space... l.58 } Sometimes, the nested \foreach seem to work with no problems, but when its starting value changes the errors are thrown. The question is: How can I set the start value of the nested \foreach by the the value of counter testcount (which in turn is given by the value of \j)? What am I doing wrong here? Here is the whole code: \documentclass[a5paper,12pt, openany]{book} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{tikzpagenodes} \usepackage{array} \usepackage{etoolbox} \usepackage{pgffor} \usepackage{fontspec} \usepackage[right=1cm, left=1.5cm, top=1cm,bottom=2cm]{geometry} \usetikzlibrary{arrows, positioning, calc, shapes} \newcommand{\lorem}{% }% \begin{document} \newdimen\loremwidth \newcounter{testcount} \setcounter{testcount}{1} \foreach \i in {1,...,5}{ \foreach \j in {\value{testcount},...,15}{% % \renewcommand{\lorem}{{\tiny \input{|python3 loremipsum/loremipsum.py --lorem Ipsum --dolor \j\space --sit 1}}} \setbox0=\hbox{\lorem} \loremwidth=\wd0 \ifdim\loremwidth > 355 pt \lorem \setcounter{testcount}{\j} \breakforeach \else {} \fi } } \end{document} Merry Christmas and happy new year! Best regards, C.
- circuitikz: How to use circuitikz inside a TikZ-matrixby cis on December 30, 2025 at 11:27 am
Is it possible to use circuitikz-shapes as cells inside a TikZ-matrix? (I mean, as cells <*> & <*> & <*> ... \\, how to place nodes afterwards is already clear.) If I put in |[tgenericshape]|{} I get an error ! Package PGF Math Error: Unknown function base (in 'base'). \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \usetikzlibrary{matrix} \begin{document} \begin{circuitikz}[] \node[tgenericshape, label=center:GS0](G0){}; \matrix[matrix of nodes, nodes in empty cells, draw, column sep=11mm, ] at (0,-2) (m){ 1 & 2 & 3 \\ %|[tgenericshape, label=center:GS1]|{} & |[fill=pink]|{Test} & \\ does not work }; \end{circuitikz} \end{document}
- Font type differs PDFLaTeX and XELaTeXby GowriSaro on December 30, 2025 at 10:31 am
PDFLaTeX produced the output for the below code: \documentclass[10pt]{book} \RequirePackage[T1]{fontenc}% \RequirePackage[]{palatino}% \begin{document} This is for test $a+b=c$ \end{document} XELaTeX produced the output for the below code: \documentclass[10pt]{book} \RequirePackage[no-math]{fontspec}% \RequirePackage[]{unicode-math}% \setmainfont{EB Garamond} \setmathfont{XITS Math} \begin{document} This is for test $a+b=c$ \end{document} Font type differs for the both the PDFs, for PDFLaTeX it showed as Type: Type 1 but for XELaTeX it showed as Type 1 (CID), please advise that both are same or differs, as I'm not an expert in font handling. Also, is this possible to make as Type 1 for both LaTeX engines? All your suggestions are most welcome
- Multiple footnotes in a figure caption with hyperref in LaTeXby taiwan12 on December 30, 2025 at 8:57 am
I have a problem with hyperref and footnotes inside figure captions. I want to add footnotes to the caption text, so I’m using \footnotemark inside the caption and \footnotetext after the figure. However, when I click the hyperlinked footnote marks in the PDF, the links point to the wrong footnotes (the numbering and the anchors don’t match anymore). In the PDF, the footnote numbers are not correct, but the hyperref links jump to the wrong footnote text. How can I fix this so that the links point to the correct footnotes? \documentclass[12pt]{report} \usepackage{graphicx} \usepackage{float} \usepackage{hyperref} \hypersetup{colorlinks} \usepackage{lipsum} \begin{document} Some text \footnote{footnote I} Some text \footnote{footnote II} \lipsum[1] \begin{figure}[H] \centering \includegraphics[scale=0.3]{example-image} \caption[AAA, BBB, CCC]{AAA\protect\footnotemark, BBB\protect\footnotemark, CCC\protect\footnotemark} \label{fig:A} \end{figure} \footnotetext{figure caption footnote I} \footnotetext{figure caption footnote II} \footnotetext{figure caption footnote III} Some text \footnote{footnote III} Some text \footnote{footnote IV} \begin{figure}[H] \centering \includegraphics[scale=0.3]{example-image} \caption[DDD,EEE]{DDD\protect\footnotemark, EEE\protect\footnotemark} \label{fig:B} \end{figure} \footnotetext{figure caption footnote IV} \footnotetext{figure caption footnote V} \footnotetext{figure caption footnote VI} \lipsum[1] \end{document}
- circuitikz: How to read out the value of bipoles/lengthby cis on December 30, 2025 at 8:55 am
According to the manual, section 3.1.4.1 "Components size", bipoles/length (default 1.4cm) is the central parameter; "which can be interpreted as the length of a resistor (including reasonable connections): all other lengths are relative to this value." How can I read out bipoles/length? I tried \pgfmathsetlengthmacro\Rlength{ %\ctikzvalueof{bipoles/length}% does not work %\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}% does not work 5mm% works } without success. What do I have to do? \documentclass[margin=5pt, multi=circuitikz]{standalone} \usepackage{circuitikz} \begin{document} \pgfmathsetlengthmacro\Rlength{ %\ctikzvalueof{bipoles/length}% does not work %\pgfkeysvalueof{/tikz/circuitikz/bipoles/length}% does not work 5mm% works } \begin{circuitikz}[european resistors] \draw[] (0,0) to[R, name=R0] (2,0); \draw[red] (R0.west) -- +(\Rlength,0) node[below=3mm]{\Rlength}; \end{circuitikz} \ctikzset{bipoles/length=22.5mm,}% test for value change \begin{circuitikz}[european resistors] \draw[] (0,0) to[R, name=R0] (2,0); \draw[red] (R0.west) -- +(\Rlength,0) node[below=3mm]{\Rlength}; \end{circuitikz} \end{document}
- background color of 2 columnsby JamesDoe on December 30, 2025 at 6:42 am
How can I split my document in two (using paracol I think), such that the left part of the document occupies 30% of the page, and the right part occupies 70%, and set the background color of the left part to gray ? The whole left part needs to be gray, whether there is text or not, and with no margin. There is a header on top that is not part of this two column layout, which is set using tikz. My current text, for reference : \documentclass{article} \usepackage{expkv-cs} \usepackage{fontawesome} \usepackage[T1]{fontenc} % required ? \usepackage[margin=1cm, a4paper]{geometry} % required ? \usepackage[utf8]{inputenc} % required ? \usepackage{tikz} \usepackage{paracol} \usepackage{xcolor} \usepackage{lipsum} \setlength{\parindent}{0cm} % required ? \ekvcSplit\header { textColor={}, backgroundColor={}, firstName={}, lastName={}, occupation={}, leftContent={}, rightContent={} } { \tikz[remember picture, overlay, every node/.style={text=#1}] { \node[rectangle, fill=#2, anchor=north, minimum width=\paperwidth, minimum height=3cm](header) at (current page.north){}; \node[anchor=center](name) at (header.center) {\Huge #3 \bfseries\MakeUppercase{#4}}; \node[below](occupation) at (name.south) {#5}; \node[align=left, anchor=west](leftContent) at (header.west) [xshift=0.5cm] {#6}; \node[align=left, anchor=east](rightContent) at (header.east) [xshift=-0.5cm] {#7}; } } \begin{document} \header{ textColor={white}, backgroundColor={darkgray}, firstName={Jack}, lastName={Sparrow}, occupation={Pirate}, leftContent={ \faGlobe\; English\\ \faBirthdayCake\; 1690\\ \faCar\; Licence }, rightContent={ \faEnvelope\; jack@sparrow.com\\ \faPhone\; 333 5647380\\ \faMapMarker\; On a ship } } \vspace{5cm} % how to set to header size ? \begin{paracol}{2} \lipsum[1] \switchcolumn \lipsum[1] \end{paracol} \end{document}
- How to reproduce `listings` style features (right-side numbers, stepnumber) in `piton`?by d7ek on December 30, 2025 at 5:21 am
In the listings package, \lstset{numbers=right,stepnumber=3,numberfirstline} gives right-aligned line numbers and numbering every third line. I would like to achieve the same behavior using the piton package instead of listings, but I can’t find equivalent options in the documentation. \documentclass{article} \usepackage{piton,xcolor} \PitonOptions{line-numbers,} %\usepackage{listings} %\lstset{ % numbers=right, % stepnumber=3, % numberfirstline %} \begin{document} %\begin{lstlisting}%[firstnumber=2] \begin{Piton} print("Hello world") x = 1 + 1 print(x) x = 1 + 2 print(x) x = 2 + 2 print(x) \end{Piton} %\end{lstlisting} \end{document}
- Is it possible to create a circular document?by Brendan Langfield on December 30, 2025 at 3:11 am
I recently learned that it's possible to set fully custom page dimensions using geometry. However as far as I can tell, you can only do rectangular document shapes. Is it possible to use the geometry package or some other method to make the document itself circular?
- List with one item in an enviroment issueby murray on December 30, 2025 at 2:40 am
The following code produces the output shown. It uses an enviroment inside which there is a description list with just one item. Note the blank line before \item. With that, or with instead, {} or \mbox{}, the code compiles as expected. However, removing that blank line before \item causes error "Something's wrong--perhaps a missing \item when compilation reaches the line \end{oneproperty}. Why does this happen, and how can the definition of oneproplis or oneproperty be modfied so as to avoid the error? \documentclass{article} \usepackage{enumitem} \newlength{\oneproplabelwd} % NB: default is parentheized 2-char sf \settowidth{\oneproplabelwd}{\textsf{(SN)}} % NB: Enclose actual item name in parens, \label[...] in optional arg! \newlist{oneproplis}{description}{1} \newenvironment{oneproperty}[1]{% \setlist[oneproplis,1]{% font=\normalfont\textsf, wide, leftmargin=\dimexpr\parindent+\oneproplabelwd+\labelsep, itemsep=0pt, topsep=2pt, format={\normalfont\textsf}, }\begin{oneproplis}% \upshape} {\end{oneproplis}} \begin{document} \noindent A relation $\leq$ in a set $X$ is said to \emph{well-order} $X$ if it partially orders $X$ and: % \settowidth{\oneproplabelwd}{\textsf{(WO)}} \begin{oneproperty} \item[(WO)\label{property:wo}] Each nonempty subset of $X$ has a least element. \end{oneproperty} \end{document}
- True-false with `enumext` packageby Sebastiano on December 29, 2025 at 10:39 pm
I know very little about the enumext package. My intention is customize block true-false where I can choose the number of columns and create a structure similar to this one. I currently use two macros \newcommand{\truefalse}{\hfill\framebox[1.25em][c]{V}\quad\framebox[1.25em][c]{F}} \newcommand{\squarecap}[1]{\fbox{\makebox[\height]{#1}}} outside the enumext package with enumitem. Here a MWE: \documentclass[a4paper,12pt]{article} \usepackage{mathtools,amssymb} \usepackage{enumext} \usepackage{enumitem} \newcommand{\truefalse}{\hfill\framebox[1.25em][c]{V}\quad\framebox[1.25em][c]{F}} \newcommand{\squarecap}[1]{\fbox{\makebox[\height]{#1}}} \begin{document} \begin{enumext}[label=\textbf{Domanda} \arabic*.,wrap-label=\textbf{#1},list-indent=0pt, save-ans=test] \item My coat is \begin{keyans*}[columns=2,label=\Alph*,wrap-label=\squarecap{#1},labelwidth=1.5em] \item blue. \item green. \item lemon. \item magenta. \end{keyans*} \end{enumext} \textbf{Vero o falso?} \begin{enumerate} \item Se $f(x)=x^2-1$ allora $f(0)=0$\truefalse; \item La funzione $y=3x-2$ passa per l'origine degli assi cartesiani \truefalse; \item $|x+2|+|x-2|=0$ non ha soluzioni\truefalse; \item $2|x-1|<0$ per ogni $x\in\mathbb{R}$, $x\neq 1$\truefalse. \end{enumerate} \end{document}
- How can I place a mercator map on an overlay tikzpicture?by TobiBS on December 29, 2025 at 9:54 pm
I want to precisely place a mercatormap on my page and hence use the remember picture,overlay options. But I find no way to e.g. put the top left corner of my map to the center of the page. Here is my MWE: \def\mrcpkgprefix{} \documentclass{scrartcl} \usepackage{mercatormap} \begin{document} \begin{tikzpicture}[remember picture, overlay] \node at (current page.center) {E.g. left Corner of the map here?}; \mrcdefinemap{west=9.1,east=9.45,south=48.7,north=48.95,tile size=1cm,zoom=14} \path[draw,fill=green!10] (mrcmap.south west) rectangle (mrcmap.north east); \mrcdrawnetwork \coordinate (Stuttgart) at (mrcq cs:48.775556:9.182778); \node at (Stuttgart) {Stuttgart}; \end{tikzpicture} \end{document} Any idea which option or trick can help to do what I want to achieve?
- How to adjust spacing for flalign* environmentby Artic on December 29, 2025 at 6:00 pm
The code \begin{flalign*} x^2-3x+2&>0&&\\ (x-1)(x-2)&>0&& \end{flalign*} \begin{flalign*} &x-1=0 & x-2=0&&\\ &x_1=1 & x_2=2&& \end{flalign*} resulting as in the image. How can I adjust the spacing in areas 1 and 2 as in the image?
- testing a token's status, if active or notby Frigeri on December 29, 2025 at 4:10 pm
In expl one can test if a token is active or not (just using \token_if_active:) well, I wanted to test if a given token was already active before making it active with my own definition (to, perhaps, reduce the odds of a conflict with others packages). But I ran into the following problem: \documentclass{article} \ExplSyntaxOn \tl_const:Nn \c__pack_exc_tl {!} \cs_new:Npn \pack_test_activ: { \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} } \begin{document} as~expected: \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} \char_set_catcode_active:N ! still~ok: \cs_set:Npn ! {Hi,} \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} but: \pack_test_activ: \end{document} \ExplSyntaxOff I mean, there is a way to make the test in \pack_test_activ in which I can test the current status of the toke ! (better said, at execution time, and not with its value at definition time? EDIT Of course, rescan: \documentclass{article} \ExplSyntaxOn \tl_const:Nn \c__pack_exc_tl {!} \cs_new:Npn \pack_test_activ: { \tl_set_rescan:Nnn \l__pack_tmp_tl {} {!} \exp_args:NV \token_if_active:NTF \l__pack_tmp_tl {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} } \begin{document} as~expected: \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} \char_set_catcode_active:N ! still~ok: \cs_set:Npn ! {Hi,} \token_if_active:NTF ! {\par \c__pack_exc_tl{}~is~activ\par} {\par \c__pack_exc_tl{}~isn't~activ\par} (now ok:) \pack_test_activ: \end{document} \ExplSyntaxOff There is another way, or this is it?
- an error with using a variable defined by pgfmathsetmacro in "let...in..."by Khánh Bùi on December 29, 2025 at 10:30 am
An error occurs when I try to create the point C1. How can I fix this? \documentclass[12pt,a4paper]{book} \usepackage[left=1cm, right=1cm, top=2cm, bottom=2cm]{geometry} \usepackage{mathtools, amssymb, amsthm, amsmath} \usepackage{tikz} \usetikzlibrary{intersections,calc} \begin{document} \begin{tikzpicture} \path (2,5) coordinate (B) (4,0) coordinate (C) ($(B)!1/3!(C)$) coordinate (L) ; % CALCULATE BL and CL and assign them to \bl and \cl respectively \path let \p1 = (B), \p2 = (C), \p3 = (L), \n1 = {veclen(\x1-\x3,\y1-\y3)}, \n2 = {veclen(\x2-\x3,\y2-\y3)} in \pgfextra{ \pgfmathsetmacro{\bl}{\n1} \pgfmathsetmacro{\cl}{\n2} } ; \path ($(C) + (30:\cl)$) coordinate (C1) ; \draw[fill=red] (C1) circle (2pt); \end{tikzpicture} \end{document} after compiling, it said : test.tex: error: 32: Undefined control sequence. ($(C) + (30:\cl) test.tex: error: 32: Missing number, treated as zero. ($(C) + (30:\cl) test.tex: error: 32: Undefined control sequence. ($(C) + (30:\cl) test.tex: error: 32: Argument of \pgfmath@@onquick has an extra }. ($(C) + (30:\cl) test.tex: error: 32: Paragraph ended before \pgfmath@@onquick was complete. ($(C) + (30:\cl)
- Weird Overleaf errorby DavidIsDumb on December 28, 2025 at 2:31 am
I'm writing some math stuff using overleaf but it broke mysteriously. I wrote: \documentclass[11pt]{scrartcl} \usepackage[dvipsnames,svgnames]{xcolor} \usepackage[shortlabels]{enumitem} \usepackage[framemethod=TikZ]{mdframed} \usepackage{amsmath,amssymb,amsthm} \usepackage{epigraph} \usepackage[colorlinks]{hyperref} \usepackage{microtype} \usepackage{mathtools} \usepackage[headsepline]{scrlayer-scrpage} \usepackage{thmtools} \usepackage{listings} \usepackage{derivative} \renewcommand{\epigraphsize}{\scriptsize} \renewcommand{\epigraphwidth}{60ex} \ihead{\footnotesize\textbf{Some text here}} \ohead{\footnotesize Some text here} \providecommand{\re}{\text{Re}} \providecommand{\im}{\text{Im}} \providecommand{\ol}{\overline} \providecommand{\eps}{\varepsilon} \providecommand{\half}{\frac{1}{2}} \providecommand{\dang}{\measuredangle} \providecommand{\CC}{\mathbb C} \providecommand{\FF}{\mathbb F} \providecommand{\NN}{\mathbb N} \providecommand{\QQ}{\mathbb Q} \providecommand{\RR}{\mathbb R} \providecommand{\ZZ}{\mathbb Z} \providecommand{\dg}{^\circ} \providecommand{\ii}{\item} \providecommand{\alert}{\textbf} \providecommand{\opname}{\operatorname} \providecommand{\ts}{\textsuperscript} \DeclareMathOperator{\sign}{sign} \providecommand{\tarc}{\mbox{\large$\frown$}} \providecommand{\arc}[1]{\stackrel{\tarc}{#1}} \reversemarginpar \providecommand{\printpuid}[1]{\marginpar{\href{https://otis.evanchen.cc/arch/#1}{\ttfamily\footnotesize\color{green!40!black}#1}}} \mdfdefinestyle{mdgreenbox}{linecolor=ForestGreen,backgroundcolor=ForestGreen!5, linewidth=2pt,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[headfont=\bfseries\sffamily\color{ForestGreen!70!black}, mdframed={style=mdgreenbox},headpunct={.},]{thmgreenbox} \mdfdefinestyle{mdredbox}{frametitlefont=\bfseries,innerbottommargin=8pt, nobreak=true,backgroundcolor=Salmon!5,linecolor=RawSienna,} \declaretheoremstyle[headfont=\bfseries\color{RawSienna}, mdframed={style=mdredbox},headpunct={\\[3pt]},postheadspace=0pt,]{thmredbox} \mdfdefinestyle{mdblackbox}{linecolor=black,backgroundcolor=RedViolet!5!gray!5, linewidth=3pt,nobreak=true,rightline=false,leftline=true,topline=false,bottomline=false,} \declaretheoremstyle[mdframed={style=mdblackbox}]{thmblackbox} \declaretheorem[style=thmredbox,name=Problem]{problem} \declaretheorem[style=thmblackbox,name=Outline,numbered=no]{sol} \declaretheorem[style=thmgreenbox,name=Claim,numbered=no]{claim*} \usepackage{asymptote} \begin{asydef} size(8cm); // set a reasonable default usepackage("amsmath"); usepackage("amssymb"); settings.tex="pdflatex"; settings.outformat="pdf"; import geometry; void filldraw(picture pic = currentpicture, conic g, pen fillpen=defaultpen, pen drawpen=defaultpen) { filldraw(pic, (path) g, fillpen, drawpen); } void fill(picture pic = currentpicture, conic g, pen p=defaultpen) { filldraw(pic, (path) g, p); } pair foot(pair P, pair A, pair B) { return foot(triangle(A,B,P).VC); } pair centroid(pair A, pair B, pair C) { return (A+B+C)/3; } \end{asydef} \begin{document} \title{Some text here} \subtitle{Some text here} \author{Some text here} \date{\today} \maketitle \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} \end{document} When I compile there is no error message, but the last line has a red circle saying "unexpected \end{problem} after $" and the line before that says "unclosed $ found at \end{problem}". All the other probs with this format didn't break, so there's probably no problem with the \end. However, I found that if I type \begin{problem}[some text here] Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0$.) \end{problem} instead for the problem part nothing happens! No error if I delete like half a paragraph. Can somebody explain what is happening? Edit: Also in the first case autocompile doesn't work, saying that my code has errors that must be fixed first before that can run, but for the second case autocompile works. I also found out that autocompile works when I type: \begin{problem}[some text here] Fix an integer $n \ge 1$. Tom has a scientific calculator. Unfortunately, all keys are broken except for one row: \verb$1$, \verb$2$, \verb$3$, \verb$+$ and \verb$-$. Tom presses a sequence of $n$ random keystrokes; at each stroke, each key is equally likely to be pressed. The calculator then evaluates the entire expression, yielding a result of $E$. Find the expected value of $E$, in terms of $n$. (Negative numbers are permitted, so \verb$13-22$ gives $E = -9$. Any excess operators are parsed as signs, so \verb$-2-+3$ gives $E=-5$ and \verb$-+-31$ gives $E = 31$. Trailing operators are discarded, so \verb$2++-+$ gives $E=2$. A string consisting only of operators, such as \verb$-++-+$, gives $E=0.) \end{problem} for the problem, but the last line has the following error message: LaTeX Error: Command \end{mdframed} invalid in math mode. \ (button saying suggest fix using AI) \ Missing $ inserted. \ Missing } inserted. \ Extra }, or forgotten \endgroup.