Questions tagged [calculations]
{calculations} is about calculations in (La)TeX documents. A popular package is calc, although others also exist (fp, pgf, and LaTeX3 packages, e.g `xfp`).
609 questions
9
votes
3
answers
131
views
Calculate values of standard normal distribution table as macro
I calc values of the Standard normal table (with 5-digit accuracy).
So I wrote a calculation with numerica.sty (using approximate values of the error function).
This works so far;
if I put in a ...
9
votes
5
answers
599
views
Best ways to calculate sums in LaTeX
In many computer algebra systems, one can sum a sequence of numbers using the syntax
sum(a(k), k, kStart, kEnd) for a sequence a(k) (of real and integer values) with the variable k.
What's the best ...
4
votes
1
answer
94
views
Calculation error when setting up a thumb index with LaTeX3
I am currently trying to rewrite the code of @Tobi (https://tex.stackexchange.com/a/57317/98739) for a thumb index using LaTeX3-syntax.
So far so good, my code works for the position of the first ...
0
votes
1
answer
49
views
Incrementing a variable in tikzmath [duplicate]
The following code works perfectly, I don't want to change it this structure, please.
However, I cannot increment the variable \m when \s < \u (I need to count the number os times to calculate the ...
2
votes
3
answers
471
views
How can I write the equation of the plane that passes through three points given in a list of three points?
I have a list of three points (code in Mathematica)
{{{-12, 2, -1}, {-11, 1, -5}, {-10, -2, 3}}, {{-12, 2, -1}, {-11,
1, -5}, {-10, 6, 3}}, {{-12, 2, -1}, {-11, 1, -5}, {-9,
5, -7}}, {{-12, 2, ...
7
votes
1
answer
639
views
How can I accurately compute the cross product of two vectors whose coordinates are rational numbers?
I use this code to calculate the cross product of two vectors whose coordinates are integers.
\documentclass{article}
\usepackage{pgf}
\usepackage{amsmath, nicematrix}
\usepackage{esvect}
\...
5
votes
1
answer
171
views
Implement unsupported built-in fp operators with `\fp_set_function:nnn`
Update
As @egreg pointed out in the comment, several built-in fp operators, like sign, >, <, a:b?c, atan, round are not allowed to be used in \fp_set_function:nnn.
https://github.com/latex3/...
7
votes
2
answers
281
views
Precision problem of pgfmath and xfp
The MWE is quite self-explaining:
\documentclass{article}
\usepackage{pgfplots}
\usepackage{pgfmath-xfp}
\usetikzlibrary{math}
\pgfmxfpdeclarefunction{test}{4}{
#1 * #3 - #2 * #4
}
\begin{...
4
votes
1
answer
138
views
Calculated coordinates in TikZ-Paths
I require coordinates in a TikZ-path, which are calculated from values in a table or in a csv-file. Therefore I cannot create the coordinates using the calc-library but have to incorporate additional ...
1
vote
0
answers
136
views
Procedural rendering methods in TeX and easier ways to draw classic ("Roger Penrose") "hand-drawn" style pointillist filled illustrations in TikZ? [closed]
Is there an easier way to do in TIKZ some of the things hand-drawn illustrations do? (Think those by Roger Penrose or anything that was common in 1950's to 1970's McGraw-Hill, Prentice-Hall, and the ...
5
votes
3
answers
463
views
Help with generating invoices from JSON data using LaTeX
I'm looking for help with creating a LaTeX template that can generate invoices from a JSON file. The JSON file contains customer-specific data, such as payee information, items sold, and general ...
1
vote
1
answer
108
views
How may I calculate columns in TeX?
In this example I can define tables with various column widths, from 1 col up to 20 cols. The calculation of the column width is done by \ifnum\columns=1 \csize=0.91\hsize\fi The value "0.91"...
4
votes
1
answer
127
views
Caculating Prices of Goods
I have looked on the forum and I am wondering if there is a better way to go this. I would like to set a value for the total cost of something and then calculate the price and output it into my ...
0
votes
0
answers
94
views
Automatically summing up of points in a protocol
I'm working on a LaTeX document where I keep a detailed protocol of various meditation sessions, including the points I earn for each session. The document is organized by different hierarchical ...
1
vote
2
answers
110
views
Calculate dimension of minipage from argument with `\dimexpr`
I want to create a new environment that scales the content of a frame in beamer. To this purpose, I define a new enviroment resize which takes an argument, used as scaling factor. I use the same ...