# Tag Info

5

xint should have a binomial function but I forgot to include it in the last release. Here is one way in the meantime: The update has permuted the order of presentation, as testing proved that the simpler approach using the built-in factorial was significantly faster except for cases with a small #2. \documentclass{article} \usepackage{xintexpr}% at least ...

3

You can use the powerful apnum macros. \documentclass{article} \input apnum \def\binom#1#2{{\evaldef\n {#1} \evaldef\k {#2}% \evaldef\X {\FAC{\n}/(\FAC{\k}*\FAC{\n-\k})}\X}} \begin{document} \binom{2^4-3}{2^3} \end{document} Note that apnum can also be used in plain TeX, because it does use only TeX primitives. (And also note the joke message ...

3

The easiest way is using an expandable loop; longtable or tabular makes no difference, so in the example I use the latter. \documentclass{article} \usepackage[landscape]{geometry} \usepackage{xparse} \ExplSyntaxOn \DeclareExpandableDocumentCommand{\expfor}{mm} { \prg_replicate:nn { #1 } { #2 } } \ExplSyntaxOff \begin{document} \noindent ...

3

The problem is that \gla splits its input at spaces before doing expansions. However, no number of \expandafter's can solve the problem, because TeX can't know where \exnull will appear. You can fully expand the line before the scanning for spaces happens, but this can have adverse effects: beware and remember to add \protect when necessary. ...

1

You could use bigintcalc: \documentclass{article} \usepackage{bigintcalc} \newcommand{\bigintcalcBinomial}[2]{% \bigintcalcDiv {\bigintcalcFac{#1}} {% \bigintcalcMul {\bigintcalcFac{#2}} {\bigintcalcFac{\bigintcalcSub{#1}{#2}}}% }% } \begin{document} ...

1

Here is a possibility. A bit painful, but now done. Notice that the code assumes the Greek letters have been set-up to be italic, nothing breaks if not, but defined macros \alphait, \Gammait will then not do what their names indicate. \documentclass{article} \usepackage[utf8x]{luainputenc} \usepackage[T1]{fontenc} \usepackage{pxfonts} \usepackage{siunitx} ...

1

The simplest way is using expl3 (fill in the missing names): \documentclass{article} \usepackage{amsmath} \usepackage{pxfonts} \usepackage{siunitx} %\usepackage{isomath} %\usepackage{upgreek} \usepackage[ISO]{pxgreeks} \usepackage{expl3} \ExplSyntaxOn \cs_if_exist:NTF \alphaup { \cs_new:Nn \thewaywewalk_greek:n { \int_compare:nTF { \fam = 0 } { ...

1

If I understand what do you need, you want to spare macro space and type only: \setsmartgreek \alpha\beta\gamma\delta\epsilon \relax instead to re-defining \alpha, then \beta, then \gamma etc. You can try this: \def\setsmartgreek{% \expandafter\ifx\csname deltaup\endcsname\relax \else \def\stgreekC##1##2;{##2up}\fi \expandafter\ifx\csname ...

Only top voted, non community-wiki answers of a minimum length are eligible