# Tag Info

2

There are probably a whole hose of packages that could help here. However, the following is sufficient to evaluate the expression: \number\numexpr\t+1\relax Here's the "complete" context: \begin{tikzpicture} \foreach \t in {1,...,40} {% \only<\number\numexpr\t+1\relax>{\node [circle,draw] (a) at (22:11) {\t};}% }% \end{tikzpicture} Note ...

3

You could try a conditional: \ifnum\t = 1 \else \only<\t>...\fi \documentclass{beamer} \mode<presentation> { \usetheme{Warsaw} } \usepackage{tikz} \AtBeginSection[] { \begin{frame} \tableofcontents[currentsection] \end{frame} } \begin{document} \begin{frame} \frametitle{Hello} \begin{center} \begin{tikzpicture} \foreach \t in ...

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 ...

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 ...

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

With some conditionals on the current day-of-the-month, advdate can be used to retrieve the date you're looking for: \documentclass{article} \usepackage{advdate} \newcommand{\nextfifteenth}[1][\relax]{{% \ifx\relax#1\relax\else\SetDate[#1]\fi% If a date was specified \today---% \ifnum\day<15\else% \day >= 15 \AdvMonth{1}% Move to next ...

2

\documentclass{article} \def\zz#1{#1 --- \nextXV{#1}} \def\nextXV#1{\nextXVx#1\relax} \def\nextXVx#1 #2 #3\relax{% \ifnum#2<16 #1 15 #3% \else \csname nextXV#1\endcsname \space 15 \expandafter\ifx\csname nextXV#1\endcsname\nextXVDec \the\numexpr#3+1\relax \else #3% \fi \fi} \def\nextXVJan{Feb} ...

7

The issue is a bug in PGF (in the floating point unit). A workaround is to write use fpu=false in the axis options, i.e. \begin{axis}[use fpu=false]. This workaround is valid for relatively small number ranges, only -- such as in your MWE. I will take care of the bug.

1

Just another solution with PSTricks. \documentclass[pstricks,margin=5mm]{standalone} \usepackage{pstricks-add} \def\Diagram#1{% \begin{pspicture}[dimen=m,arrowscale=3](-6,-6)(6,6) \psframe*[linecolor=cyan!50](-6,0)(6,-6) \pscircle{5} \psline(-6,0)(6,0) \psline(0,-6)(0,6) \foreach \a in {0,10,...,350}{\psline(4.4;\a)(5;\a)} \foreach ...

3

The following is a slightly different approach to Christian's. It creates an automated \label for each \ref in order to ensure that the page numbering will be accurate. \documentclass{article} \usepackage{lipsum}% Just for this example \usepackage{refcount,hyperref,graphicx} \newcounter{refcnt} \AtBeginDocument{% \let\oldref\ref ...

3

Rather than redefine \ref, you may want to look into loading the varioref package and using that package's \vref and \fullref macros. They basically do what your modified \ref macro does. If the hyperref package is loaded as well, with \fullref the figure number (e.g., "n") and the page number (e.g, "m") are separate hypertargets. With \vref, the entire ...

4

hyperref overrules \ref, unless the new definition is in \AtBeginDocument egreg will strike me down for keeping xspace ;-) In addition: I doubt that \pageref{#1} will give a number at all, if it's inside the \ifthenelse expression. I used \getpagerefnumber from refcount which provides a number which can be used in calculations. Additionally, I shifted ...

8

You can use sin(x) to get the value and asin(x) to get arcsin value. The following works: \pgfmathsetmacro{\nindex}{1.3} %% n \pgfmathsetmacro{\incident}{30} %% angle of incidence \pgfmathsetmacro{\inci}{90+\incident} \pgfmathsetmacro{\refracted}{270+asin(sin(\incident)/\nindex)} so that you can use \inci and \refracted for the incident and ...

Top 50 recent answers are included