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`).
593
questions
4
votes
1
answer
80
views
LaTeX error during base conversion : Missing number, treated as zero
I found in this page in the first answer a way to write beautiful base conversions.
But, I had a compile error if Y try to use the last example, the ConverToBase command.
I searched, but I don't find ...
2
votes
1
answer
50
views
Function values in columns rather then rows with numerica-tables
Package numerica-tables helps create of multi-column tables of mathematical function values, the package arranges values on rows like in this simple example
\documentclass{article}
\usepackage{...
2
votes
2
answers
89
views
Misunderstanding yunit in pstricks, or a bug, or extreme imprecision?
Feeding latex with
\documentclass{article}
\pagestyle{empty}
\usepackage{pstricks}
\begin{document}
{1:
\begin{pspicture}(-.1,-1)(.1,5)
\psline(0,0)(0,5)
\end{pspicture}}
{$10^{-4}$: \psset{yunit=....
0
votes
2
answers
98
views
Inside German abbreviations, how to set the penalty and the width of the internal space including the stretch and shrink attributes?
Continuing How to letter space (German) abbreviations automatically and http://tex.stackexchange.com/a/134856 , some of us tend to typeset a usual or a thin space in abbreviations and write, e.g.,
d.\@...
0
votes
1
answer
121
views
How to compare aspect ratios?
I have a box whose side lengths are recorded as lengths as in
\newlength{\imageWidth} \setlength{\imageWidth}{300mm}
\newlength{\imageHeight} \setlength{\imageHeight}{200mm}
I am trying to create a ...
2
votes
3
answers
213
views
\def a variable for sqrt with parameters
I tried to define variables with the sqrt command but couldn't get the result printed .
\def \radius {sqrt(4^2+2^2)}
\draw (4,3) node [right] {$The radius is \radius for x=4, y=2$};
The \draw shows &...
0
votes
1
answer
113
views
Validity of \def in tikz
The following code does not resolve the defines inside tikzpicture and thus does not print the labels.
\documentclass[tikz]{article}
\usepackage{keycommand}
\usepackage{ifthen}
\usepackage{tikz}
\...
0
votes
1
answer
26
views
rounding error in simple assignment
I have a simple assignment in LuaTex:
\dimen1 = 210mm
Now I print the value
\the\dimen1
The result is:
597.50787pt
Calculating back with 1pt = 0.351mm is: 209.725...mm.
This is an error of more than a ...
4
votes
1
answer
270
views
Why is calculated value not recognized as a number?
In the code below I want to proceed with a calculated result (from Lualatex). But the calculated value (rounded) is not recognized as a number. Who knows a solution for this?
\documentclass{article}
\...
0
votes
0
answers
65
views
How to handle calculations in tabularx?
I try to create an invoice letter with automatic calculations of the invoice sum. Using tabular everything works.
With tabularx the counters do work correctly but the calculations do not. I understand ...
6
votes
2
answers
400
views
Finding syntax for performing calculations in latex [duplicate]
I'm wanting to perform some calculations in latex for the purpose of building a diagram that can be re-used for different inputs. Specifically its related to drawing lines connecting two points and ...
3
votes
2
answers
175
views
How to expand \fpeval{} results numerically?
I' m trying to use xfp to create some automated homework solutions. For short documents it works like a charm, but for longer one the compiling time grows exponentially. For example:
\def\GDUbeta{30} %...
0
votes
0
answers
95
views
FP calculation bug within tabularray
Strange results had been reported here when using the fp package inside a table using tabu package.
A solution had been proposed to manage the fact that computations are done twice by performing a ...
0
votes
1
answer
69
views
Simple calculations within tabularx-environment
I want to perform simple arithmetic operations for a document in a table in the tabularx environment. There is a column for the quantity, a column for the unit price and a column for the total price, ...
1
vote
0
answers
21
views
doing calculations with textfield inputs [duplicate]
I want to make a PDF form with various text fields.
I want to take the input from one textfield (where a number is typed in) and sustract it from another number. In the PDF, the substracted number ...