# Tag Info

2

I’m not quite sure what you’re looking for, but here’s something I was using today for a problem sheet that I might use again. I use the \tag* command (like \tag in an equation environment, but the argument isn’t automatically wrapped in parentheses) to put an annotation at the side of equation. I then make the text smaller and dim the colour slightly, so ...

0

I decided that the best way for me to solve this problem would be to use footnotes at the equality signs to indicate what is being used. Ordinarily, the footnote mark might be confused with an exponent, but for this purpose, the footnote will be on an equality sign (or something similar), and so there will be no confusion. It turns out though, that doing ...

0

Would something like that be convenient? I use flalign* to have an equations alignment in the center of the line and comments on the right side, ragged left thanks to the \llap command. If the equation on a line would overlap with the comment/justification, it is enough to write the comment on a supplementary line: \documentclass[11pt]{article} ...

7

My package 'calculus' (installed together with 'calculator') defines some commands to declare mathematical functions. Unfortunately these functions can not be drawn using PSTricks, but you can draw it using my package 'xpicture". Your example can be defined typing \newqpoly{\myMathFunction}{0}{5}{-1} (this declare the quadratic polynomial p(x)=0+5x-x^2). ...

3

Is this what you are aiming at? \documentclass[12pt]{article} \usepackage{xintfrac} \usepackage{xintexpr} \begin{document}\thispagestyle{empty} % dice = floor(expected / 3.5) % mod = floor(expected - dice * 3.5) \def\rows {12} \begin{tabular}{ccc} \hline expected & dice & mod \\ \hline \xintFor* #1 in {\xintSeq {1}{\rows}} ...

12

Here's a solution that uses the math capabilities of Lua(La)TeX. A TeX-side macro called \mchoose{n}{k} and a Lua-side function named mchoose(n,k) do most of the work. An auxiliary Lua function called fwrite allows the printing of arbritrary-length integers; no provision, though, is made in this example to introduce line breaks when printing overly long ...

12

Answer re-organized, code snippets gathered (and a bit modified). First, an implementation of binomial(n,k) = n choose k which uses only \numexpr. Will fail if the actual value is at least 2^31 (the first too big ones are 2203961430 = binomial(34,16) and 2333606220 = binomial(34,17)). The 2-arguments macro \binomialb is expandable, hence it can be used ...

5

For an expression with the basic operations and the square root extraction [and also logic operators and conditional evaluation] you can use \xintNewExpr or \xintNewFloatExpr from the xintexpr package to create a (completely expandable) mathematical function. The package core routines compute exactly, with an arbitrary number of digits, and natively with ...

1

It's possible to avoid the matrix \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node (n1) {1}; \foreach \x in {2,...,4} {% \node (n\x) at (\x-1,0) {\x}; \draw[red, -latex] (n\the\numexpr\x-1) -- (n\x); } \end{tikzpicture} \end{document}

3

I think you just need expandable computations. Many things can be done with \numexpr. \documentclass{article} \usepackage{tikz} \begin{document}\thispagestyle{empty} \begin{tikzpicture} \matrix[column sep=1cm]{% \node (n11) {1}; & \node (n12) {2}; & \node (n13) {3}; & \node (n14) {4};\\ \node (n21) {1}; & \node (n22) {2}; & ...

2

Another version of evaluate: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \matrix[column sep=1cm]{ \node (n1) {1}; & \node (n2) {2}; & \node (n3) {3}; & \node (n4) {4};\\ }; \foreach \x [remember=\x as \lastx (initially 1)] in {2,...,4}{ \draw [red, -latex] (n\lastx)--(n\x); }% \end{tikzpicture} ...

10

Yes it is possible, you just need to compute \x+1 first. One way to do that is to use \pgfmathtruncatemacro: Notes: I added arrows to make it clear that there were three iterations. Using \pgfmathsetmacro instead of \pgfmathtruncatemacro produces a real number and hence the calculations are a bit off and the result is slightly different: You can ...

Top 50 recent answers are included