Hot
- How to put test code into a self-designed macro packageby lyl on August 28, 2026 at 2:21 am
I want to put some test code into a macro package like this: %mypkg.sty \newif\iftest\testfalse \RequirePackage{...} some macros designed by myself \iftest\documentclass{article} preamble \begin{document} some test codes \end{document}\else\fi When \testtrue, the file mypkg.sty wish to be compiled and run, to get an output to test if the macros designed in this file work all right. If \testfalse, all the test code would be ignored, and the package mypkg.sty can be introduced by other files. It seems that this dose not work as expected. What's wrong with this method, and if there are better ways to put macros and its test code together into a .sty file?
- `unicode-math`: prevent `\symbf` from switching font styles and just make things boldby moro11 on August 27, 2026 at 7:50 pm
Consider the MWE \documentclass[varwidth]{standalone} \usepackage{unicode-math} \begin{document} $aB\beta\Xi$\\$\symbf{aB\beta\Xi}$ \end{document} I don't like how \symbf switches Latin letters from italic to upright, while i only intend to make them bold, there are other commands to make a letter bold and switch font such as \symbfit and \symbfup. I would like \symbf to just make things bold. I know i can switch the font style (italic/upright) of lower/upper case Latin/Greek letters with the option math-style and the style of bold face letters by bold-style. Although, with the available options, i was only able to achieve the desired behavior with math-style=ISO,bold-style=ISO which results in everything being italic . From pre-unicode-math days, i am used to math-style=TeX and \usepackage{bm} which gives (everything italic except for upper case Greek letters, which are upright in normal and bold font). I guess the ISO/ISO configuration is fine, but i am still wondering if it is possible to reproduce this configuration in unicode-math? or even better, completely turn off the font switch of \symbf, i.e. always use the exact same italic/upright configuration for bold math as used in standard non-bold math, where "standard math" is defined by math-style)?
- Is there a tool that checks a manuscript against the Journal of Statistical Software (JSS) style guide?by kollerma on August 27, 2026 at 7:05 pm
The Journal of Statistical Software has an extensive style guide beyond generic LaTeX conventions: dedicated preamble macros (\Plainauthor, \Address), semantic markup (\proglang, \pkg, \code), natbib citation forms, different capitalization rules for titles vs. sections vs. captions, code-formatting conventions, and completeness requirements on the .bib (e.g. doi fields). General linters like chktex and lacheck check LaTeX hygiene but know nothing about a journal's requirements, so violations tend to be found by the editors, one revision round at a time. Is there a tool that checks a .tex (or Sweave .Rnw / R Markdown .Rmd) manuscript and its bibliography against the JSS style guide specifically?
- Full list by default available OpenType fonts in `fontspec` and `unicode-math`by moro11 on August 27, 2026 at 6:54 pm
Is there a (approximately) complete list of OpenType fonts available by default within fontspec and unicode-math? I was not able to find something similar. So maybe this post could also be used to collect some. Just to specify what i mean: it is clear that there can not be a complete list as any OpenType font file (.otf) is compatible, and what font files are available by default probably varies on your TeX installation and can be looked up in /texmf/fonts/opentype. But there are some preconfigured named fonts which are loaded by name instead of loading a specific font file. As a fontspec example, loading the named font STIX Two Text and the font file STIXTwoText-Regular.otf in the following MWE \documentclass{standalone} \usepackage{fontspec} \setmainfont{STIX Two Text} \begin{document} ABC \textbf{ABC} \end{document} \documentclass{standalone} \usepackage{fontspec} \setmainfont{STIXTwoText-Regular.otf} \begin{document} ABC \textbf{ABC} \end{document} lead to and , respectively. As a unicode-math example, loading the named font NewComputerModernMath and the font file NewCMMath-Regular.otf in the following MWE \documentclass{standalone} \usepackage{unicode-math} \setmathfont{NewComputerModernMath} \begin{document} $ABC$ $\symcal{ABC}$ \end{document} \documentclass{standalone} \usepackage{unicode-math} \setmathfont{NewCMMath-Regular.otf} \begin{document} $ABC$ $\symcal{ABC}$ \end{document} lead to and , respectively. It seems to me, that these named fonts are not just equivalent to loading a specific .otf file, but there is some configuration happening in the background. (I guess they combine several .otf files.) So my question: is there a (approximatly) complete list of preconfigured named fonts provided by fontspec and unicode-math, respectively? In case fontspec and unicode-math do not provide these named fonts themselves, such a list might not exist, nevertheless they have to look them up somewhere. So, in this case, is there a way to manually look up locally available named fonts instead of playing a guess-the-name game (just like i am able to look up available .otf files in /texmf/fonts/opentype)?
- Specify ``version=bold`` for specific font using ``unicode-math``by moro11 on August 27, 2026 at 5:38 pm
I am switching to unicode-math and have some trouble with the bold fonts. I know the intended way in unicode-math is to use \symbf, \symbfcal etc. which boldens characters, but no symbols like + or accents like \tilde. This is fine when boldface is used for schematics (e.g. to denote vectors). But sometimes, i want to use mathematics just in an all-bold environment (e.g. in section titles) where just everything should be bold. I know i could set a bold version of a math alphabet and switch to that using \boldmath or \boldsymbol instead of \symbfXY. (of course setting up these fonts has to be done carefully, as one might end up with two different bold fonts otherwise.) Now, i further want to have access to two calligraphic fonts \symcal and \symscr ideally with full support for both, but i can not get that to work. Consider the following MWE (the style files are available at CTAN): \documentclass[varwidth]{standalone} \usepackage{unicode-math} \setmathfont{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \begin{document} $\symcal{A}$ (symcal) $\symbfcal{A}$ (symbfcal) {\boldmath$\symcal{A}$} (boldmath + symcal)\\ $\symscr{A}$ (symscr) $\symbfscr{A}$ (symbfscr) {\boldmath$\symscr{A}$} (boldmath + symscr) \end{document} producing What i want to have is I tried other configurations as well, such as: \setmathfont{NewCMMath-Regular.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont{NewCMMath-Regular.otf} \setmathfont[version=bold]{NewCMMath-Bold.otf} \setmathfont[range={scr,bfscr}, StylisticSet=1]{NewCMMath-Regular.otf} \setmathfont[version=bold, range={scr,bfscr}, StylisticSet=1]{NewCMMath-Bold.otf} I have the bad feeling that i found some hard limits of the unicode-math package. Is there any way to achieve this? I would also be happy with some workarounds if this is not possible. Maybe some adjusted .otf files. Or redefining the mechanic behind \boldmath and \boldsymbol to additionally redefine \symscr and \mathscr with \symbfscr and \mathbfscr or something (i guess these are the only non-bold alphabets, so replacing them with bold version might not be ideal, but probably good enough?) I mean, we are talking about the second calligraphic font in combination with the lesser used bold mechanic, so the use-case is probably not the most relevant. Nevertheless it feels odd to not have support for that at all, especially, as this is no problem without unicode-math using the old 8-bit engine.
- Why do bib files generated by zbMATH and MathSciNet avoid the "address" key?by user134824 on August 27, 2026 at 5:32 pm
As a mathematician, I use zbMATH and MathSciNet to generate bibtex database files for sources that I reference in papers that I write. Generally these bib files are almost perfect and require little editing before use, and I trust that the database editors have put great care into the algorithm that generates these files. Nonetheless, these bib files sometimes require manual editing. By far the most common issue I find myself fixing is location information appearing in the publisher field rather than the address field, which is absent entirely. For example, here are excerpts from the bib files for Wilson's textbook on finite simple groups: zbMATH: PUBLISHER = {Springer-Verlag London, Ltd.} MathSciNet: publisher = {London: Springer} Question: Is there some subtlety in using the address field that explains its absence in .bib files from zbMATH and MathSciNet? More generally, what are best practices for using this field? (For example, according to the biblatex documentation one should really call this field location instead of address.)
- Determine if opt arg follows proper keyval syntaxby Ankaa on August 27, 2026 at 4:43 pm
I have a macro who's optional argument can either follow the classic key=value syntax or a special one that gets parsed differently. To detect which one is used, I currently extract the first key (assuming key=value syntax) and feed it into \keys_if_exist:nnTF, so that if the test is false, that means I did not extract a valid key. I am however changing the way this special syntax works and it requires me to change the above method: I would now need to test if every key of the optional argument is defined, and not just the first one. My first attempt at achieving this looks like this: \ExplSyntaxOn \bool_new:N \l__intexgral_special_syntax_bool \cs_new_protected:Npn \__intexgral_eval_opt_arg:n #1 { \bool_set:Nn \l__intexgral_special_syntax_bool { \exp_args:Ne \bool_lazy_all_p:n { \keyval_parse:nnn { \keys_if_exist_p:nn { integral } } { \exp_args:Nno \keys_if_exist_p:nn { integral } \use_i:nn } { #1 } } } } \__intexgral_eval_opt_arg:n { limits=ab, variables=cartesian, } % should yield TRUE \__intexgral_eval_opt_arg:n { double, variables={x,y} } % should yield TRUE \__intexgral_eval_opt_arg:n { double S:x,y } % should yield FALSE \bool_log:N \l__intexgral_special_syntax_bool \ExplSyntaxOff But I get the following error: ! Argument of \exp_args:Nno has an extra }. <inserted text> \par l.1191 ...rg:n { limits=ab, variables=cartesian, } From what I understand, the second argument of keyval_parse:nnn should receive code after which the key and value are placed into two braced groups, thus requiring a \use_i:nn to get rid of the value. Is there a better way of determining if the optional argument follows a suitable syntax for keys_set:nn? If my method seems correct, how can I get rid of this error?
- Using "University of Aberdeen" PhD template, how does one add the bibliography to the table of contents? [duplicate]by Shaun on August 27, 2026 at 4:05 pm
The Question: Using the University of Aberdeen PhD template, available on Overleaf, how does one add the bibliography to the table of contents? Context: Don't shoot! I'll be a bit naughty here and not go into details of what I tried. Why? Well, my dissertation deadline is on Monday, 31st August 2026. That's this coming Monday! I'm running out of time. I guess there will be a very quick fix, too \documentclass[phd]{abdnthesis} %% For citations, I would recommend natbib for its %% flexibility, particularly when named citation styles are used, but %% it also has useful features for plain and those of that ilk. %% The natbib package gives you the following definitons %% that extend the simple \cite: % \citet{key} ==>> Jones et al. (1990) % \citet*{key} ==>> Jones, Baker, and Smith (1990) % \citep{key} ==>> (Jones et al., 1990) % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., p. 32) % \citeauthor{key} ==>> Jones et al. % \citeauthor*{key} ==>> Jones, Baker, and Smith % \citeyear{key} ==>> 1990 \usepackage[round,colon,authoryear]{natbib} \setlength{\bibsep}{0pt} \bibliographystyle{apalike} \usepackage[T1]{fontenc} \title{How to use abdnthesis.cls} \author{Timothy J.\ Norman} % IMO this is a bit silly, but some like to include these. To remove, % delete this declaration and remove the option from the % \documentclass definition above. %\qualifications{PhD, Computer Science, University College London, 1997\\% %BEng (Hons.) Electrical and Electronic Engineering, The University of Wales, Swansea, 1992} \school{Department of Computing Science} %%%% In the final submission of a thesis, this should only be the year %%%% of submission. However, it is useful to use \date{\today} for drafts so that %%%% they don't get mixed up. \date{2010} %% It is useful to split the document up as chapters and include %% them. LaTeX will sort out all the numbering and cross-referencing %% for you --- if you run it enough times! %% If you want to include only a couple of chapters then use the %% \includeonly{} command with a list of the file/chapter names that %% you wish to include. NB, this must be in the preamble. \includeonly{introduction,faq} \def\sfthing#1#2{\def#1{\mbox{{\small\normalfont\sffamily #2}}}} \sfthing{\PP}{P} \sfthing{\FF}{F} %% This will make sure that all cross-references are correct (including %% references to those file not included) but will produce a dvi %% file with only those files/chapters you specify included. \begin{document} %%%% Create the title page and standard declaration. \maketitle \makedeclaration %%%% Then the abstract and acknowledgements \begin{abstract} An expansion of the title and contraction of the thesis. \end{abstract} \begin{acknowledgements} Much stuff borrowed from elsewhere \end{acknowledgements} %%%% It should have a table of contents, but delete the other two as %%%% necessary. \tableofcontents %\listoftables %\listoffigures \include{introduction} \include{faq} \include{literature-survey} \include{design} \include{implementation} \include{evaluation} \include{discussion} \include{conclusion} \appendix \include{proof} \bibliography{mybib} \end{document} Sorry!
- How can I make article titles upright and journal names italic in amsrefs?by licheng on August 27, 2026 at 2:49 pm
I am using amsrefs with bibliography entries written directly using biblist. For example: \documentclass{article} \usepackage[abbrev,nobysame]{amsrefs} \begin{document} See \cite{MR2365056}. \begin{bibdiv} \begin{biblist} \bib{MR2365056}{article}{ author={Balbuena, C.}, author={Cera, M.}, author={Di\'anez, A.}, author={Garc\'ia-V\'azquez, P.}, author={Marcote, X.}, title={On the edge-connectivity and restricted edge-connectivity of a product of graphs}, journal={Discrete Appl. Math.}, volume={155}, date={2007}, number={18}, pages={2444--2455}, doi={10.1016/j.dam.2007.06.014}, } \end{biblist} \end{bibdiv} \end{document} With the default amsrefs formatting, the article title is italic while the journal name is upright. I would like to reverse the default convention: the article title should be set in upright (roman) type, while the journal name should be italicized. I know that I could either write title={\textup{...} }, journal={\textit{...}}, in every bibliography entry. However, this would require modifying every bibliography entry individually, which is impractical since I have many references. All of my references are taken from MathSciNet.
- How to duplicate `\vert` and reduce its thickness at larger sizes?by Nyx on August 27, 2026 at 1:13 pm
I regularly use newpx for my LuaLaTeX documents with the font setup being similar to § 5, Example I of the documentation but using Asana Math as the OTF math font: \usepackage{newpxtext} \usepackage{unicode-math} \setmathfont{Asana Math} Unfortunately, I find that Asana Math's \vert is too thick at larger sizes for my taste. The following is version 1 of the MWE (with \otfmathtrue being uncommented) of my current problem: % !TEX program = lualatex \documentclass{article} \usepackage{mathtools} \usepackage{mleftright} % math fonts \newif\ifotfmath \otfmathtrue \ifotfmath \usepackage[ warnings-off={ mathtools-colon, mathtools-overbracket, }, ]{unicode-math} \setmathfont{Asana Math} \else \renewcommand*{\rmdefault}{minzpl} \usepackage[T1]{fontenc} \usepackage{newpxmath} \fi % \abs macro \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} % \set macro from https://tex.stackexchange.com/a/763668 \ExplSyntaxOn \newcommand*{\suchthatvert}{\vert} \NewDocumentCommand{\set}{sO{}m} { \group_begin: \seq_set_split:Nnn \l__egreg_set_input_seq {\suchthat} {#3} \int_case:nnF { \seq_count:N \l__egreg_set_input_seq } { {1} { \__egreg_set_bylist:nnn {#1} {#2} {#3} } {2} { \__egreg_set_byproperty:nnee {#1} {#2} { \seq_item:Nn \l__egreg_set_input_seq {1} } { \seq_item:Nn \l__egreg_set_input_seq {2} } } }{OOPS!} \group_end: } \seq_new:N \l__egreg_set_input_seq \tl_new:N \l__egreg_set_st_tl \cs_new_protected:Nn \__egreg_set_byproperty:nnnn { \bool_if:nTF {#1} {% auto sizing \left\lbrace #3 \nonscript\;\middle\suchthatvert\nonscript\; #4 \right\rbrace } { \mathopen{#2\lbrace} #3 \mathrel{#2|} #4 \mathclose{#2\rbrace} } } \cs_generate_variant:Nn \__egreg_set_byproperty:nnnn {nnee} \cs_new_protected:Nn \__egreg_set_bylist:nnn { \bool_if:nTF {#1} { \left\lbrace } { \mathopen{#2\lbrace} } \group_begin: \clist_use:nn {#3} {,\penalty0~\hspace{0pt plus 3pt}} \group_end: \bool_if:nTF {#1} { \right\rbrace } { \mathclose{#2\rbrace} } } \ExplSyntaxOff \begin{document} \(\abs{x}\) \(\abs{A}\) \(\abs{M}\) \(\abs{S}\) \(\set[\big]{x \suchthat \dfrac{1}{2} < x < 3}\) \(\set[\Big]{x \suchthat \dfrac{1}{2} < x <3}\) \(\set[\bigg]{x \suchthat \dfrac{1}{2} < x < 3}\) \(\set*{x \suchthat \dfrac{1}{2} < x <3}\) \(\set[\Bigg]{x \suchthat \dfrac{1}{2} < x <3}\) \end{document} The following is version 2 of the MWE (with \otfmathtrue being commented) of my current problem: % !TEX program = lualatex \documentclass{article} \usepackage{mathtools} \usepackage{mleftright} % math fonts \newif\ifotfmath % \otfmathtrue \ifotfmath \usepackage[ warnings-off={ mathtools-colon, mathtools-overbracket, }, ]{unicode-math} \setmathfont{Asana Math} \else \renewcommand*{\rmdefault}{minzpl} \usepackage[T1]{fontenc} \usepackage{newpxmath} \fi % \abs macro \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} % \set macro from https://tex.stackexchange.com/a/763668 \ExplSyntaxOn \newcommand*{\suchthatvert}{\vert} \NewDocumentCommand{\set}{sO{}m} { \group_begin: \seq_set_split:Nnn \l__egreg_set_input_seq {\suchthat} {#3} \int_case:nnF { \seq_count:N \l__egreg_set_input_seq } { {1} { \__egreg_set_bylist:nnn {#1} {#2} {#3} } {2} { \__egreg_set_byproperty:nnee {#1} {#2} { \seq_item:Nn \l__egreg_set_input_seq {1} } { \seq_item:Nn \l__egreg_set_input_seq {2} } } }{OOPS!} \group_end: } \seq_new:N \l__egreg_set_input_seq \tl_new:N \l__egreg_set_st_tl \cs_new_protected:Nn \__egreg_set_byproperty:nnnn { \bool_if:nTF {#1} {% auto sizing \left\lbrace #3 \nonscript\;\middle\suchthatvert\nonscript\; #4 \right\rbrace } { \mathopen{#2\lbrace} #3 \mathrel{#2|} #4 \mathclose{#2\rbrace} } } \cs_generate_variant:Nn \__egreg_set_byproperty:nnnn {nnee} \cs_new_protected:Nn \__egreg_set_bylist:nnn { \bool_if:nTF {#1} { \left\lbrace } { \mathopen{#2\lbrace} } \group_begin: \clist_use:nn {#3} {,\penalty0~\hspace{0pt plus 3pt}} \group_end: \bool_if:nTF {#1} { \right\rbrace } { \mathclose{#2\rbrace} } } \ExplSyntaxOff \begin{document} \(\abs{x}\) \(\abs{A}\) \(\abs{M}\) \(\abs{S}\) \(\set[\big]{x \suchthat \dfrac{1}{2} < x < 3}\) \(\set[\Big]{x \suchthat \dfrac{1}{2} < x <3}\) \(\set[\bigg]{x \suchthat \dfrac{1}{2} < x < 3}\) \(\set*{x \suchthat \dfrac{1}{2} < x <3}\) \(\set[\Bigg]{x \suchthat \dfrac{1}{2} < x <3}\) \end{document} I generally try to only use OpenType math fonts and use unicode-math's \setmathfont{...}[range={...}] or \setmathfont{...}[version=...] commands for additional glyphs or secondary fonts. In this particular case, I would like to duplicate the \vert macro into \suchthatvert and have the latter use the extensible delimiter from newpxmath (if that is possible) in order to have a \suchthatvert with reduced thickness at larger sizes without affecting other instances of \vert. Using \setmathfont{secondary-font.otf}[range={\vert}] with another OpenType math font would not work as it would affect \verts globally and using \setmathfont{secondary-font.otf}[version=secondary-font] would also not work as I believe it is not possible to do the following because of how \mathversion works: \newcommand*{\suchthatvert}{\mathversion{secondary-font}\vert\mathversion{default}}
- tikz pgfplot fill area between multiple graphs or pathsby paul_schaefer on August 27, 2026 at 12:22 pm
MWE: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[ngerman]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{datavisualization.formats.functions} \usepackage{pgfplots} \pgfplotsset{compat=1.18} \usepgfplotslibrary{fillbetween} \begin{document} \begin{tikzpicture}[scale=1] \begin{axis}[ axis equal, % axis line style=thick, axis x line=center, ylabel={$y$}, xlabel={$x$}, major tick style = {black}, axis y line=middle, every axis y label/.style={ at={(current axis.above origin)}, inner sep=3, anchor=north east, }, every axis x label/.style={ at={(current axis.right of origin)}, inner sep=3, anchor=north east, }, xtick={-1,1}, xticklabels={$-\frac{w}{2}$,$\frac{w}{2}$}, ytick={1}, yticklabels={$h$}, yticklabel style={anchor=south west}, xmin=-1.75, xmax=3.25, ymin=-0.1, ymax=1.5, height=4cm, samples=100] \addplot[domain=-1:1,thick, name path=A] {1 - x * x}; \addplot[domain=0.5:2.5,thick, name path=B] {1 - (x-1.5) * (x-1.5)}; \draw[name path=C, thin] (1/3,8/9) -- (1.5,1); \path [name path=D] (\pgfkeysvalueof{/pgfplots/xmin},0) -- (\pgfkeysvalueof{/pgfplots/xmax},0); \addplot[black!15] fill between[of=C and A, soft clip={domain=0:0.75}]; \addplot[black!15] fill between[of=C and B, soft clip={domain=0.75:1.5}]; \addplot[black!40] fill between[of=B and D, soft clip={domain=0.5:0.75}]; \addplot[black!40] fill between[of=A and D, soft clip={domain=0.75:1}]; \end{axis} \end{tikzpicture} \end{document} results in a graph, where the areas between the both graphs are filled in gray. In this example I splitted the areas into four sections and colored them. Is there a possibility to fill the areas without splitting them into sections? A second problem is, that the separation of each area into two parts will sometimes result in in slight white vertical line between the colored areas. In my case it depends on the scaling of the pdf viewer I use. If there area could be described without separation this should not happen.
- Unicode/Collate/Locale/zh_pin.pl can't be found after updating mactex [closed]by M. Logic on August 27, 2026 at 7:33 am
An error occurs after updating mactex recently when I compile biber 2.22: Unicode/Collate/Locale/zh_pin.pl can't be found at /var/folders/8y/zkd60m1s7jz_73wr7hjjnq5r0000gn/T/par-436f6e64656e/cache-364a02962a45a52cab8961a336f60ec963624107/inc/lib/Biber.pm line 4304.
- How do I create a combining character similar to \vec{} but with up and down arrows?by mathrm alpha on August 27, 2026 at 1:20 am
Although I can see the reverse \vec, unicode-math cannot directly produce the native unicode combining characters with the codes ‘COMBINING UP ARROW ABOVE’ and ‘COMBINING DOWN ARROW ABOVE’. How can I create these? https://tex.stackexchange.com/a/245346/286078
- How to draw 3D animation of reflection of a triangle about the bisector?by Learner on August 26, 2026 at 6:50 pm
I want to plot a 3D animation of an equilateral triangle about one bisector. I have plotted the steps by using tikz: \documentclass[a4paper,11pt]{article} \usepackage{tikz} \usepackage[margin=1.2cm]{geometry} \usepackage{amsmath} \begin{document} \begin{tikzpicture}[x=1cm,y=1cm] % First triangle: \begin{scope}[shift={(0,0)}] \coordinate (A) at (0,2); \coordinate (B) at (-1.732,0); \coordinate (C) at (1.732,0); % Median = axis of reflection \draw[dashed,very thick] (0,0) -- (0,2); % Triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Vertex labels \node[above] at (A) {$A$}; \node[below left] at (B) {$B$}; \node[below right] at (C) {$C$}; % Element \node at (0,-0.7) {I}; \end{scope} %Arrow from first triangle to second triangle \draw[->,thick] (2.2,1) -- (5.8,1); \node at (4,1.2) {s}; \node at (4,0.5) {$(\text{reflection})$}; %second triangle \begin{scope}[shift={(8,0)}] \coordinate (A) at (0,2); \coordinate (B) at (-1.732,0); \coordinate (C) at (1.732,0); % Reflect in the vertical median \begin{scope}[xscale=-1] % Triangle \draw[thick] (A) -- (B) -- (C) -- cycle; % Vertex labels \node[above left] at (A) {$A$}; \node[below left] at (B) {$B$}; \node[below] at (C) {$C$}; \end{scope} % Reflection axis \draw[dashed,very thick] (0,0) -- (0,2); \node at (0,-1) {II}; \end{scope} \end{tikzpicture} \end{document} which gives the following two triangles: I want to plot a 3D animation to display the reflection about the bisector.I would appreciate to do that. The vertices B and C will be changing every time but A will remain fixed. Note that the first triangle and the last triangle are same.
- PDFs not displayed in a document with background imageby Rodrigo Tavares on August 26, 2026 at 5:14 pm
I used a background image on the main part of the document, which is an RPG book, with the command \AddToHook, here my preamble: \documentclass[a5paper,oneside]{book} \usepackage[utf8]{inputenc} \usepackage[brazil]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,latexsym} \usepackage{graphicx} \usepackage{amsthm} \usepackage{marvosym} \usepackage{lipsum} \usepackage{wrapfig} \usepackage{makeidx} \usepackage{siunitx} \usepackage{caption} \usepackage{pdfpages} \usepackage{lipsum} \makeindex \AddToHook{shipout/background} { \put (0in,-\paperheight){\includegraphics[width=\paperwidth,height=\paperheight]{fundo.pdf}} } \usepackage{lipsum} \usepackage[Lenny]{fncychap} \begin{document} \chapter{one} \lipsum \chapter{Two] \lipsum \newpage \includepdf{ficha3dnd.pdf} \newpage \includepdf{fichastoryweller.pdf} \newpage \printindex \end{document} But in the end of the document I wanted to show the images of the character sheets. I used the package pdfpages and used the command \includepdf to display the two character sheets in a entire page each. But when I compile the images are not displayed, instead the background appear without any image in it. How can I solve it? There's a way to deactivate the background in these two pages?
- tikz datavisualization place axis labels next to axis tipsby paul_schaefer on August 26, 2026 at 12:44 pm
MWE: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{tikz} \usetikzlibrary{arrows.meta} \usetikzlibrary{datavisualization.formats.functions} \begin{document} \begin{tikzpicture}[baseline=(current bounding box.center), >=Stealth]% \datavisualization[% school book axes,% visualize as smooth line,% x axis={% label={$x$},% include value={-1.25, 1.25},% ticks={% major at={% -1 as $-\frac{w}{2}$,% 1 as $\frac{w}{2}$% },% },% },% y axis={% label={$y$},% include value=1.5,% ticks={% major at={% 1 as $h$% },% node style={anchor=south west},% },% },% ]% data [format=function] {% var x : interval [-1.0:1.0];% func y = 1 - (\value x * \value x);% };% \end{tikzpicture} \end{document} provides the following graph: What do I have to change to place the axis description next to the arrow tips (shown in red)? Adding visualize label={x axis={goto pos=.5}}, to the x axis definition leads to a second label. Trying to change the node style using visualize label={node style={anchor=north}}, doesn't has any effect. How can I change/access the label inside the axis definition?
- Why \pgfkeysifdefined gives a confused result when working with \pgfkeysby lyl on August 26, 2026 at 6:50 am
\documentclass{article} \usepackage{tikz} \begin{document} \pgfkeys{/vv/.initial} \pgfkeysifdefined{/vv}{yes}{no} \end{document} Since the key vv is not given any value, why is the output "yes", not "no"?
- Why does \pgfkeysvalueof give different results between nearly same codesby lyl on August 26, 2026 at 4:34 am
\documentclass{article} \usepackage{tikz} \begin{document} \pgfkeys{my family/my key/.initial=hello} \pgfkeysvalueof{my family/my key} % Running the above two lines of code gets nothing \pgfkeys{/my family/my key/.initial=hello} \pgfkeysvalueof{/my family/my key} % Running the above two lines of code gets right output as expected. % What causes such different results between the two block of codes? \end{document}
- How to draw chemistry flowcharts [closed]by Alcino Junior on August 26, 2026 at 2:06 am
I want to know if there are some package to draw flow charts for guiding chemistry lab experiments.
- Typeset a reference based on `zc@cntval`, not the \label / `\the` value?by Thibault de Villèle on August 25, 2026 at 8:35 pm
Note: this was posted into a Github issue on zref-clever's repository, but I figured it might also be a good idea to ask about it here. Note: all code blocks here, concatenated, form a MWE. This is only broken up to ease reading. I currently have a setup to make \labels to parts of a TikZ image using a custom counter named tikzcaption, relative to the figure counter (since none of those tikzpictures will be in a subfigure environment). I want a couple things to happen when I reference those labels: if I'm in the figure environment where this tikzpicture is shown, references should be typeset as figure ("tikzcaption" in \alph, typewriter text) ; if I'm not in that figure environment, references should be typeset as figure (regular figure numbering).("tikzcaption" in \alph, typewriter text). Here's the basic setup of the counter and the reference type: \documentclass{scrbook} \KOMAoption{parskip}{half-}% % Hyperref only included to get hyperlinks working. \usepackage{tikz, zref-clever, hyperref} \makeatletter% % Create the counter for parts of a TikZ image: \newcounter{tikzcaption} \counterwithin{tikzcaption}{figure} \renewcommand*{\thetikzcaption}{\thefigure.\texttt{\arabic{tikzcaption}}} % Typeset the parts of TikZ images as the figure ones for the main document: \zcRefTypeSetup{tikzcaption}{ name-sg = {figure}, name-pl = {figures}, Name-sg = {Figure}, Name-pl = {Figures}, } % Link tikzcaption <-> figure, as zref-clever doesn't seem to detect it: \zcsetup{counterresetby = { tikzcaption = figure }}% How I (think I should) achieve the behaviour I want is by having a custom figure-like environment where I can freely change commands. Here's a rough outline of how that works: \newif\ifinreftikzpicture% Used for a couple things relative to \caption... % #1: floating env parameters \NewDocumentEnvironment{reftikzpicture}{O{htp}} { \figure[#1]% Manually start the "figure" environment. \inreftikzpicturetrue% Signal we're in the reftikzpicture env. \setcounter{tikzcaption}{0}% % Override \thetikzcaption: \let\@outside@the@tikzcaption=\thetikzcaption% \renewcommand*{\thetikzcaption}{\texttt{\alph{tikzcaption}}}% % Make the reference "names" nil within the reftikzpicture env: \zcRefTypeSetup{tikzcaption}{% name-sg = {}, name-pl = {},% Name-sg = {}, Name-pl = {},% % Ideally, should not be needed since % \thetikzcaption switches to \ttfamily reffont={\ttfamily},% }% } { % Reset the original formatting of \thetikzcaption: \renewcommand*{\thetikzcaption}{\@outside@the@tikzcaption}% \inreftikzpicturefalse% \endfigure% End the figure environment manually. } % Create the \label inside a tikzpicture: % #1: Don't print the label on the tikzpicture. % #2: Node options for the label on that picture. % #3: What node is it a legend of? (can be a string) % #4: Position of the label inside the picture. % #5: The label name for \ref and friends. \NewDocumentCommand{\labeltikzat}{s O{} m m m}{ \refstepcounter{tikzcaption}% % Manually set the current counter value, and its name: \gdef\@currentcounter{tikzcaption}% \gdef\@currentlabel{\thetikzcaption}% \label{#5}% Label is #5 \IfBooleanF{#1}{% \begin{scope}[shift={#4}]% % Print the current label value in a node somewhere (#4) on the tikzpicture: \node[#2] (legend #3) at (0, 0) {\texttt{\alph{tikzcaption}}};% \end{scope}% }% } \makeatother% While this works (it sets a label and makes it referencable by zref-clever), it seems I cannot customize the typesetting of the label \zcref{} call beyond redefining the \the<counter> command. Furthermore, from the documentation it looks like the text to typeset is defined whenever the \label command is issued, and cannot be customized any further. See the document contents here: \begin{document} \begin{reftikzpicture}[ht] \centering% \begin{tikzpicture}[inner sep=0pt, outer sep=5pt]% \coordinate (circ) at (0,0);% \draw[thick, black] (circ) circle [radius=3cm];% \labeltikzat{circ}{(circ.center)}{fig/circ}% \end{tikzpicture} \caption{\zcref[S]{fig} is a \texttt{reftikzpicture}, with a single label named \zcref{fig/circ}.}% \label{fig} \end{reftikzpicture} Here are the expected and real values of the typeset references using \texttt{\string\zcref} for the different labels in the main document text: \begin{center} \begin{tabular}{p{4cm}|p{4cm}|p{4cm}} Label & Expected & Actual \\ \hline \hline \texttt{fig} & figure 1 & \zcref{fig} \\ \texttt{fig/circ} & figure 1.\texttt{a} & \zcref{fig/circ} \end{tabular} \end{center} \end{document} Gives the following document: However, I see the \zref@newlabel command records a \zc@cntval property which stores the current (local-only) value of the counter. Can I somehow use that value to print references (with hyperlinks and ranges+pairs formatting) within the reftikzpicture environment ? Using that counter to format the reference inside the reftikzpicture environment would allow for the references in the caption to be printed as they are now, but the references in the main document body would be printed as the expected values in the table. Full code: \documentclass{scrbook} \KOMAoption{parskip}{half-}% % Hyperref only included to get hyperlinks working. \usepackage{tikz, zref-clever, hyperref} \makeatletter% % Create the counter for parts of a TikZ image: \newcounter{tikzcaption} \counterwithin{tikzcaption}{figure} \renewcommand*{\thetikzcaption}{\thefigure.\texttt{\arabic{tikzcaption}}} % Typeset the parts of TikZ images as the figure ones for the main document: \zcRefTypeSetup{tikzcaption}{ name-sg = {figure}, name-pl = {figures}, Name-sg = {Figure}, Name-pl = {Figures}, } % Link tikzcaption <-> figure, as zref-clever doesn't seem to detect it: \zcsetup{counterresetby = { tikzcaption = figure }}% \newif\ifinreftikzpicture% Used for a couple things relative to \caption... % #1: floating env parameters \NewDocumentEnvironment{reftikzpicture}{O{htp}} { \figure[#1]% Manually start the "figure" environment. \inreftikzpicturetrue% Signal we're in the reftikzpicture env. \setcounter{tikzcaption}{0}% % Override \thetikzcaption: \let\@outside@the@tikzcaption=\thetikzcaption% \renewcommand*{\thetikzcaption}{\texttt{\alph{tikzcaption}}}% % Make the reference "names" nil within the reftikzpicture env: \zcRefTypeSetup{tikzcaption}{% name-sg = {}, name-pl = {},% Name-sg = {}, Name-pl = {},% % Ideally, should not be needed since % \thetikzcaption switches to \ttfamily reffont={\ttfamily},% }% } { % Reset the original formatting of \thetikzcaption: \renewcommand*{\thetikzcaption}{\@outside@the@tikzcaption}% \inreftikzpicturefalse% \endfigure% End the figure environment manually. } % Create the \label inside a tikzpicture: % #1: Don't print the label on the tikzpicture. % #2: Node options for the label on that picture. % #3: What node is it a legend of? (can be a string) % #4: Position of the label inside the picture. % #5: The label name for \ref and friends. \NewDocumentCommand{\labeltikzat}{s O{} m m m}{ \refstepcounter{tikzcaption}% % Manually set the current counter value, and its name: \gdef\@currentcounter{tikzcaption}% \gdef\@currentlabel{\thetikzcaption}% \label{#5}% Label is #5 \IfBooleanF{#1}{% \begin{scope}[shift={#4}]% % Print the current label value in a node somewhere (#4) on the tikzpicture: \node[#2] (legend #3) at (0, 0) {\texttt{\alph{tikzcaption}}};% \end{scope}% }% } \makeatother% \begin{document} \begin{reftikzpicture}[ht] \centering% \begin{tikzpicture}[inner sep=0pt, outer sep=5pt]% \coordinate (circ) at (0,0);% \draw[thick, black] (circ) circle [radius=3cm];% \labeltikzat{circ}{(circ.center)}{fig/circ}% \end{tikzpicture} \caption{\zcref[S]{fig} is a \texttt{reftikzpicture}, with a single label named \zcref{fig/circ}.}% \label{fig} \end{reftikzpicture} Here are the expected and real values of the typeset references using \texttt{\string\zcref} for the different labels in the main document text: \begin{center} \begin{tabular}{p{4cm}|p{4cm}|p{4cm}} Label & Expected & Actual \\ \hline \hline \texttt{fig} & figure 1 & \zcref{fig} \\ \texttt{fig/circ} & figure 1.\texttt{a} & \zcref{fig/circ} \end{tabular} \end{center} \end{document}
- Why is Adobe accessibility checker testing inside figures with PDF-based graphics?by Paul J Hurtado on August 25, 2026 at 5:13 pm
I've seen a few examples now of Adobe Acrobat's PDF checker flagging the contents of a figure graphic based on a PDF file, when the figure in the main document has alt text and should be passing. Is there a way to force it to not check those figure file contents? TO be clear: if the graphic were saved as, say, a PNG instead of a PDF, it wouldn't be flagging the issues. I don't want people to fix their accessibility report by converting those graphics to non-PDF formats. I'm not sure if this is related to this older issue and Form Xobjects: https://github.com/latex3/tagging-project/issues/945 Here is a MWE with two figures. The first gives Character encoding failures for the line segments used in the graph (but the beta on the vertical axis causes no failures), and the second figure gives Character encoding failures for the beta on the horizontal axis. FYI, I compiled the first figure PDF using lualatex (not pdflatex as mentioned in the file below) and it still gives Character encoding errors in the main document. The second figure needs to be created in R (using R Studio) by running the commands set.seed(1); hist(rnorm(1000),40,xlab=expression(beta),main="") then exporting and saving the figure as a PDF. You may need to compile the document below then compile xobject-figure.tex to generate that PDF. Alternatively, you can download the two figure PDFs, the document PDF, and LaTeX file below with this link: http://pauljhurtado.com/latex/tmp/MWE.zip. \begin{filecontents*}[overwrite]{xobject-figure.tex} \documentclass{standalone} % Deliberately use traditional TeX math fonts. \begin{document} \setlength{\unitlength}{1cm} \begin{picture}(5,4) % axes \put(0.5,0.5){\line(1,0){4}} \put(0.5,0.5){\line(0,1){3}} % deliberately problematic math character \put(0.05,2.0){$\beta$} % a little bit of graphical content \put(0.5,0.5){\line(1,1){3}} \end{picture} \end{document} \end{filecontents*} % Generate the external PDF with pdfLaTeX. \immediate\write18{pdflatex -interaction=batchmode xobject-figure.tex} % ------------------------------------------------------------ % Main accessible document % ------------------------------------------------------------ \DocumentMetadata{ lang=en-US, tagging=on, pdfstandard=ua-2 } \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage{graphicx} \title{Acrobat Form XObject Character-Encoding Test} \author{Test Author} \begin{document} \maketitle This document contains externally generated PDF figures, represented in the document structure by a Figure tag with alternative text. Both give ``Character encoding'' failures when parsed by the Adobe Acrobat Accessibility checker (the $\beta$ in the second figure no longer causes problems if you omit \texttt{math/setup=\{mathml-SE,mathml-AF\}} from DocumentMetadata.) \begin{figure}[ht] \centering \includegraphics[ width=.45\linewidth, alt={A simple graph showing a diagonal line on coordinate axes.} ]{xobject-figure.pdf} \caption{A simple example graph.} \end{figure} The figure above is generated by xobject-figure.tex which should be created when you compile this document (compile that file to generate the PDF). The figure below was created in R Studio, by running the commands \texttt{set.seed(1); hist(rnorm(1000),40,xlab=expression(beta),main="")} and exporting the file as PDF saved to the file \texttt{Rplot.pdf}. \begin{figure}[ht] \centering \includegraphics[ width=.65\linewidth, alt={A simple graph showing a histogram of a sample from a standard Normal distribution of size N=1000.} ]{Rplot.pdf} \caption{A simple example graph.} \end{figure} \end{document}
- exam.cls and \raggedright \oneparchoiceby Leeser on August 25, 2026 at 3:12 pm
When using \raggedright in exam.cls and the oneparchoices or oneparcheckboxes environment, the choices are listed vertically rather than on the one line. MWE attached. If I comment out \raggedright it works as intended, leaving in \raggedright puts them in a vertical list. I'd be grateful if anyone has a solution to this. I have tried {\justify ...} and {% \rightskip=0pt plus 1em \parfillskip=0pt plus 1em \begin{oneparcheckboxes}...} and a few other tweaks but nothing works. \documentclass{exam} \begin{document} \raggedright % comment in/out \begin{questions} \question What is the minimum number of personnel that should be present in the laboratory when experimental work is in progress? \begin{oneparcheckboxes} \choice 1 \CorrectChoice 2 \choice 3 \choice 4 \end{oneparcheckboxes} \question What is the minimum number of personnel that should be present in the laboratory when experimental work is in progress? \begin{oneparchoices} \choice 1 \CorrectChoice 2 \choice 3 \choice 4 \end{oneparchoices} \end{questions} \end{document} EDIT POST ANSWERS FROM kabenyuk and David Carlisle Following testing of both answers, both answers worked as I'm sure you tried yourselves before posting. I compiled the answers and both worked. I then compiled my original faulty behaviour MWE without making any changes and it worked fine. I deleted all .aux etc files and recompiled my original file and all fine. Headscratching. I have selected the first answer by kabenyuk to mark a solution but both work.
- Is it possible to have a different tocdepth in two table of contents?by KeithB on August 25, 2026 at 10:49 am
I've not been able to find a way to achieve this behaviour, in which the local toc has full depth, but the main toc suppresses sections for part 2 only. Any suggestions? Document structure: \documentclass{book} \usepackage{etoc} % or is there something better? \begin{document} \part{Part 1} \tableofcontents \chapter{Chapter 1} \section{Section 1.1} \section{Section 1.2} \chapter{Chapter 2} \section{Section 2.1} \section{Section 2.2} \part{Part 2} \localtableofcontents \chapter{Chapter 3} \section{Section 3.1} \section{Section 3.2} \chapter{Chapter 4} \section{Section 4.1} \section{Section 4.2} \chapter{Chapter 5} \section{Section 5.1} \section{Section 5.2} \end{document} Desired toc: Table of contents of both parts % NB: sections of part 2 suppressed (tocdepth changes for part 2) Chapter 1 ..................................................... Section 1.1 ................................................. Section 1.2 ................................................. Chapter 2 ..................................................... Section 2.1 ................................................. Section 2.2 ................................................. Chapter 3 ..................................................... Chapter 4 ..................................................... Chapter 5 ..................................................... Table of contents of part 2 % NB: sections of part 2 shown Chapter 3 ..................................................... Section 3.1 ................................................. Section 3.2 ................................................. Chapter 4 ..................................................... Section 4.1 ................................................. Section 4.2 ................................................. Chapter 5 ..................................................... Section 5.1 ................................................. Section 5.2 .................................................
- colorlet causes Undefined color error with slightly different pdflatex version [closed]by Namal on August 25, 2026 at 9:08 am
I use colorlet to define my own color at the beginning of the document. \usepackage[dvipsnames]{xcolor} \colorlet{row3_color}{red7} This works fine with the current Debian13 Texlive Version (texlive-full): pdfTeX 3.141592653-2.6-1.40.28 (TeX Live 2025) kpathsea version 6.4.1 Copyright 2025 Han The Thanh (pdfTeX) et al. There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source. Primary author of pdfTeX: Han The Thanh (pdfTeX) et al. Compiled with libpng 1.6.46; using libpng 1.6.46 Compiled with zlib 1.3.1; using zlib 1.3.1 Compiled with xpdf version 4.04 But causes an Error: ! Package xcolor Error: Undefined color `red7' with the Alpne Version (texlive-full) pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025/Alpine Linux) kpathsea version 6.4.1 Copyright 2025 Han The Thanh (pdfTeX) et al. There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source. Primary author of pdfTeX: Han The Thanh (pdfTeX) et al. Compiled with libpng 1.6.49; using libpng 1.6.58 Compiled with zlib 1.3.1; using zlib 1.3.2 Compiled with xpdf version 4.04 What do I do wrong here? Maybe I can define it differently if I really want to use red7? Otherwise if I use red7 directly in the document it works fine in both versions. Edit: Thanks to your answers I could figure it out. I was using the tabularry package with tblr-extras. Those extras were loading the color definition in the working case and weren't enough in the other case. Adding ninecolors fixes the problem. As requested, an example: \documentclass[ngerman]{article} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{babel} \usepackage[landscape, hmargin=0.5cm, vmargin=1.5cm ]{geometry} \usepackage[dvipsnames]{xcolor} \usepackage{hyperref} \usepackage{tabularray, tblr-extras} \usepackage{ninecolors} \UseTblrLibrary{babel,amsmath,varwidth} %\usepackage{showframe} \colorlet{row3_color}{red7} \begin{document} \centering \begin{longtblr}[ caption = {Mytable} ] { colspec={Q[l,m] Q[l,m] X[l,m] X[3,c] l l X[l,m]}, vlines, rowhead = 2, cell{1}{4}={r=3}{c}, cell{1}{1-Z}={row3_color}, measure=vbox, vspan=even } \hline 0B7 & {KBM-TelegrFehler \\ -Verdichtung} & Verdichtung Telegrammfehler von Anlage auf Linie & wird direkt übernommen & 0B7 & {KBM-TelegrFehler \\ -Verdichtung} & Verdichtung Telegrammfehler von Anlage auf Linie\\ \hline 2 & Empfangstimeout[sec] & Nach ablauf geht die Linie in Ausfall & & 2 & Empfangstimeout[sec] & Empfangs-Timeout\\ \hline 4 & Sendetimeout[sec] & Sende-Timeout& & 4 & Sendetimeout[sec] & Sende-Timeout\\ \hline \end{longtblr} \end{document} It seems that the texlive-full package in the alpine 3.23 Version is broken, at least for the tabularray. Switching to 3.24 solves the problem.
- How to make two TikZ nodes have exactly the same height?by Marco Moldenhauer on August 25, 2026 at 7:03 am
I am defining custom keyboard-key commands using TikZ and the menukeys package. I defined two types of keystroke commands: one containing a normal letter and another containing a symbol such as \shift. The problem is that the \keystrokeSymbol node does not have the same height as the \keystrokeLetter node. I would like the symbol key to have exactly the same height as the letter key, while still allowing the symbol to be vertically centered. What would be the most elegant TikZ/LaTeX approach to achieve this? Note: I would prefer a solution using TikZ itself, without introducing additional packages, if possible. Code \documentclass{article} \usepackage{tikz} \usepackage{menukeys} \tikzset{ keystroke/.style={ draw=black!50, fill=yellow, %drop shadow={shadow xshift=0.15ex,shadow yshift=-0.15ex,fill=black,opacity=0.7}, rectangle, %rounded corners=0.8pt, inner xsep=0.8pt, inner ysep=0.8pt, line width=0.3pt, %minimum width=0.21cm, %minimum height=0.21cm, font=\sffamily\small, text=blue!75!black, %anchor=south } } \newcommand*\keystrokeLetter[1]{% \tikz[baseline=(key.base)] % \node[keystroke,fill=green!10](key) {#1} ;% } \newcommand*\keystrokeSymbol[1]{% \tikz[baseline=(key.base)] % \node[keystroke](key) {#1} ;% } \newcommand*\menubutton[1]{% \tikz[baseline=(key.base)] % \node[% keystroke, %signal, fill=black!8 ](key) {#1} ;% } \begin{document} first press \keystrokeLetter{A} and \keystrokeSymbol{\shift}\keystrokeLetter{R}, then click on \menubutton{FILE} \menubutton{EDIT}. \end{document} Output Desired Output
- I cannot write any commands inside "\textArab{}"by الطريق طالب العلم on August 24, 2026 at 7:08 pm
I have a problem: After creating my custom character map "MyRules.lua", I can type the characters perfectly, but I cannot type any commands inside \textArab{}. This file 'MyRules.lua' local TransTable = { -- 1. معالجة الحروف المشددة أولاً (لأنها تتكون من رمز مكرر) {a = "%^t", b = "ث"}, {a = "%^H", b = "خ"}, {a = "%^d", b = "ذ"}, {a = "%^r", b = "ز"}, {a = "%^s", b = "ش"}, {a = "%^S", b = "ض"}, {a = "%^T", b = "ظ"}, {a = "%^A", b = "غ"}, {a = "%:y", b = "ي"}, } singlefv = { {a="e", b="ء"}, {a="a", b="ا"}, {a="b", b="ب"}, {a="t", b="ت"}, {a="j", b="ج"}, {a="H", b="ح"}, {a="d", b="د"}, {a="r", b="ر"}, {a="s", b="س"}, {a="S", b="ص"}, {a="T", b="ط"}, {a="f", b="ف"}, {a="A", b="ع"}, {a="f", b="ف"}, {a="q", b="ق"}, {a="k", b="ك"}, {a="l", b="ل"}, {a="m", b="م"}, {a="n", b="ن"}, {a="h", b="ه"}, {a="w", b="و"}, {a="y", b="ى"}, {a="c", b="c"}, } LuaAr = {} function LuaAr.process(text) local inside = text -- حلقة تكرارية تمر على الجدول من أول سطر إلى آخره for i = 1, #TransTable do inside = string.gsub(inside, TransTable[i].a, TransTable[i].b) end for i = 1,#singlefv do inside = string.gsub(inside, singlefv[i].a, singlefv[i].b) end -- إرجاع النص النهائي بعد تحويله بالكامل return inside end This is the code \documentclass{article} \usepackage{amsmath,amssymb,amsfonts} \usepackage{comment,luacode,xstring} \usepackage[no-math]{fontspec} \usepackage{polyglossia} \usepackage{xspace} \setdefaultlanguage[numerals=maghrib]{arabic} % from polyglossia \setotherlanguage{english} \newfontfamily\arabicfont[Script=Arabic, Mapping=maghrib]{Times New Roman}%Amiri \newfontfamily\englishfont[Script=Arabic,Mapping=maghrib]{Times New Roman} \newfontfamily\fontmath[Script=Arabic,AutoFakeBold=.7,%FakeSlant=-0.2 WordSpace =.8,PunctuationSpace=2, SizeFeatures={ {Size={-8},FakeStretch=1.1,FakeBold=1.5}, {Size={8-14}}, {Size={14-}}, }]{MyFonttwo002-VF.ttf} \directlua{dofile(kpse.find_file("MyRules.lua"))} \newcommand{\trans}[1]{% \bgroup \fontmath % \textdir TRT % جعل اتجاه الكتابة من اليمين إلى اليسار \directlua{tex.sprint(LuaAr.process(\luastringN{#1}))}\egroup% } \makeatletter \def\arabtexcodes{\catcode`^=11\relax\catcode`_=11\relax} %\let\arabtex@codes\arabtexcodes \makeatother \newcommand{\textArab}[1]{% \bgroup% \arabtexcodes \fontmath \ifvmode\leavevmode\fi% \directlua{tex.sprint(LuaAr.process(\luastring{#1}))}% \egroup% } \newcommand{\ar}[1]{%->arb-math inline {\ignorespaces\textArab{#1}} } \newcommand{\afrac}[2]{ {\bfseries\boldmath\fontspec{MyFonttwo002-VF.ttf}[FakeStretch=1.1,FakeBold=1.5]\ensuremath{\!\frac{\text{\textArab{#1}}}{\text{\textArab{#2}}}}} } \begin{document} \textArab{0123456789\\1.2\\ e a b t ^t j H^H d ^d r ^r s ^s S ^S T ^T A ^A f q k l m n h w y c }% $\frac{num}{den}$ \\ \ar{a + \afrac{num}{den}} \end{document} I have a problem. ! Incomplete \iffalse; all text was ignored after line 57. <inserted text> \fi <*> document.tex The file ended while I was skipping conditional text. This kind of error happens when you say `\if...' and forget the matching `\fi'. I've inserted a `\fi'; this might work. ! Emergency stop. <*> document.tex *** (job aborted, no legal \end found) Here is how much of LuaTeX's memory you used: 6259 strings out of 475695 100000,794899 words of node,token memory allocated 1050 words of node memory still in use: 6 hlist, 1 vlist, 2 rule, 1 local_par, 1 dir, 32 glue, 4 kern, 6 penalty, 44 glyph, 12 attribute, 52 glue_spec, 12 attribute_list, 1 temp, 3 if_stack, 2 writ e nodes avail lists: 2:1,4:1,5:6,7:1 29001 multiletter control sequences out of 65536+600000 31 fonts using 14732263 bytes 73i,1n,93p,291b,265s stack positions out of 10000i,1000n,20000p,200000b,200000s ! ==> Fatal error occurred, no output PDF file produced!
- how to put colored lines into a colored (colortbl) table?by Jürgen on August 24, 2026 at 1:39 pm
I would like to put vertical and horizontal lines in the innermost four cells. How to? \documentclass{scrartcl} \usepackage{colortbl} % \begin{document} \rowcolors{1}{green}{green} \color{blue}% \begin{tabular}{cccc} \rowcolor{blue} \textcolor{red}{$\Omega$} & \textcolor{red}{$T$} & \textcolor{red}{$\overline{T}$} & \textcolor{red}{$\Sigma$} \\ % \cellcolor{blue}\textcolor{red}{$K$} & 1960 & 40 & \cellcolor{blue}\textcolor{red}{2000} \\ % \cellcolor{blue}\textcolor{red}{$\overline{K}$} & 4900 & 93100 & \cellcolor{blue}\textcolor{red}{98000} \\ % \rowcolor{blue} \textcolor{red}{$\Sigma$} & \textcolor{red}{6860} & \textcolor{red}{93140} & \textcolor{red}{100000} \end{tabular} \end{document} Note: The result is definitely very ugly, pls don't comment on that. It is due to the reduction of a far more elaborated table to get a somehow minimal example. Thanks!
- Crowded piecewise model formula when using \displaystyle within casesby Marton Horvath on August 24, 2026 at 9:27 am
Considering the equation below, I found that when using \displaystyle, the space between the numerator in the second expression (i.e., t>t_{CP} case) and the fraction bar becomes disproportionate to the space between the numerator and the denominator in the first case. \begin{equation} P(t) = \begin{cases} \displaystyle \frac{W'}{t+\frac{W'}{P_{max}-CP}}+CP,&~~~~t\leq t_{CP}\\ \displaystyle \frac{W'}{t+\frac{W'}{P_{max}-CP}}+CP-A\cdot \ln\frac{t}{t_{CP}},&~~~~t>t_{CP} \end{cases} \end{equation} With \displaystyle: And without: A dummy fix to the version using \displaystyle is to introduce a new empty line between the two cases; nevertheless, it may not be too elegant besides making the equation take up significantly more space overall. I wonder what the best way is to avoid the expression getting crowded, and the explanation is behind this observation? I am using amsmath and amsfonts. Edit: Several nice solutions have been proposed. I would also be interested in why the spacing between the fraction bar and the symbol in the numerator changed seemingly when using \displaystyle?
- tikz how to stop lines at shape edge when using plotted coordinatesby JKomp on August 23, 2026 at 10:49 pm
I'm writing a translator from OmniGraffle (left diagram) to tikz and I've run into a bit of a problem for translating lines (right diagram). Lines in OmniGraffle are specified as a start point, middle vertices and an ending point. I can replicate the exact shape of the line from the OmniGraffle points by using tikz plot/coordinates in a draw but I'm unsure how to change the code to end at the shape boundary. Here's my MWE \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (36pt,-36pt) circle [radius=36pt ] node [] (S0) { S0}; \draw[red] plot [smooth, tension=1] coordinates { (S0) (-17.600000262260437pt, 3.89259546372341pt) (15.955999737740058pt, 28.233391483626292pt) (S0)}; \draw[red] plot [smooth, tension=1] coordinates { (36pt, -36pt) (87.40297565709261pt, 7.120001628994942pt) (57.999990582466125pt, 25.534386508502394pt) (36pt, -36pt)}; \draw[red] plot [smooth, tension=1] coordinates { (36pt, -36pt) (-15.128618137809553pt, -70.48571669739613pt) (10.699999623000622pt, -91.0802335745775pt) (36pt, -36pt)}; \end{tikzpicture} \end{document} Note, this is an early phase so things like line widths, arrowheads, text formatting, and converting out of pt coordinates are later tasks.
- How can I expand tables into column/text width using tabularrayby MadyYuvi on August 23, 2026 at 1:39 pm
My code are: \documentclass[twocolumn]{article} \usepackage{array} \usepackage{tabularray} \UseTblrLibrary{booktabs} \usepackage{lipsum} \SetTblrInner{ rowsep=0pt, row{1}={l,b}, hborder{1}={belowspace=6pt}, hborder{2}={abovespace=2pt,belowspace=6pt}, hborder{Z}={abovespace=6pt}, width=\textwidth} \begin{document} \lipsum[1] \begin{table} \caption{Value of Grid Convergence Index.\label{table1-09544062261479876}} \begin{tblr}{@{\extracolsep\fill}llll@{\extracolsep\fill}} \toprule {} & {\textit{Cpmin}} & {\textit{Cpmin}} & {\textit{Cpmin}}\\ \midrule {GCI N1-N2} & {0.95\%} & {0.46\%} & {0.86\%}\\ {GCI N2-N3} & {0.59\%} & {0.33\%} & {0.58\%}\\ \bottomrule \end{tblr} \end{table} \lipsum[2-3] \begin{table*} \caption{Value of Grid Convergence Index.\label{table1-09544062261479876}} \begin{tblr}{@{\extracolsep\fill}llll@{\extracolsep\fill}} \toprule {} & {\textit{Cpmin}} & {\textit{Cpmin}} & {\textit{Cpmin}}\\ \midrule {GCI N1-N2} & {0.95\%} & {0.46\%} & {0.86\%}\\ {GCI N2-N3} & {0.59\%} & {0.33\%} & {0.58\%}\\ \bottomrule \end{tblr} \end{table*} \lipsum[1-5] \end{document} This produced the output as: How can I expand table into column/full width (using table*) by auto?