The fp tag has no wiki summary.
10
votes
5answers
345 views
How to create a “delay expansion” environment?
I don't want to use the following
\begingroup
\edef\next{\endgroup
\noexpand\const{Xp}{\X(tp)}
\noexpand\const{Yp}{\Y(tp)}
\noexpand\const{Xf}{\X(tf)}
\noexpand\const{Yf}{\Y(tf)}
...
8
votes
2answers
439 views
Format numbers as a fraction of pi with tikz \pgfmathprintnumber
I'd like to be able to output something like \frac{\pi}{2} for a input number like .5*pi automatically.
I've played a bit with some of the number printing macros available with tikz (closely linked ...
8
votes
1answer
194 views
What makes my line get shifted to the left when I invoke \LoadConstants?
In the beginning I use the following code. So far so good.
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{multido}
\usepackage[nomessages]{fp}
\def\LoadConstants{}
...
7
votes
2answers
112 views
How to parse optional arguments without keyval?
The current implementation only supports rounding with the specified digits in the optional arguments.
\documentclass{beamer}
\usepackage{multido}
\usepackage{pstricks}
\usepackage[nomessages]{fp}
% ...
6
votes
2answers
212 views
Name scoping issue (probably)
I'm trying to solve what is clearly a name scoping problem and don't know how to do it. (This discussion is extracted from a poorly-formed question about the same code that I posted yesterday; I've ...
4
votes
2answers
67 views
Is there a smart way to get a consistent accuracy with fp package?
Is there a smart way to get a consistent accuracy with fp package? I don't want to use round for sure!
\documentclass[preview,border=12pt]{standalone}
\usepackage[nomessages]{fp}
...
4
votes
2answers
327 views
Strange expansion of a macro inside an environment
I'm, I should confess, a total newbie. I'm trying to generate invoices with LaTeX, so I'm using the fp package.
But the strange thing is that calculations occur many times when they should only ...
4
votes
1answer
43 views
How to implement a constant declarating macro to behave differently in preamble and pspicture?
The example below is extremely trivial just to illustrate the problem in the simplest way.
\documentclass{beamer}
\usepackage[nomessages]{fp}
% constants declarator
\def\LoadConstants{}% to load ...
3
votes
1answer
107 views
convert outcome of reference to regular number
Is it possible to transform the outcome of a reference (e.g., a line number) to a regular number that I can use in a calculation?
I have this (and works fine):
\FPeval{\result}{clip(5+6)} $\result$
...
3
votes
1answer
101 views
passing random variable to fp function
I am trying to create a command that will display a "+" sign for positive numbers and no sign for numbers within the esami package. I believe that the issue is the format of the random variable that ...
3
votes
1answer
76 views
Odd results using FP package inside table environment
I'm trying to create a number of running totals using the FP package. I define a macro for adding numbers to a running total and then I define a macro to output the final value.
The problem I'm ...
3
votes
1answer
123 views
Issue with fp “missing number” macro
I write an fp macro that calculates the distance between frets on a guitar neck:
\def\ScaleLength{25.5}
\def\ScaleFactor{0.1}
\def\FretDist#1{\FPmul\resulta{-1}{#1}%
\FPdiv\resulta{\resulta}{12}%
...
2
votes
1answer
136 views
How to pass a macro output to \FPeval?
How to pass a macro output \X{Tpeak} to \FPeval\Ypeak as shown in the following code?
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add}
\usepackage[nomessages]{fp}
...
2
votes
1answer
123 views
Updating floating point number in animation
I'm trying to have an animated tikz graph with floating point values. While I can use floating point values as parameters for the graph, I can't seem to find a way to do so for displayed equations. ...
2
votes
3answers
374 views
macros that won't accept other macros as arguments
I'm trying to pass a counter to a macro that uses macros from the fp package.
I can pass hard coded values and \results from the fp package BUT if I pass the counter it complains that it is not a ...
2
votes
0answers
36 views
How to throw an error and abort the compilation for the following scenario? [duplicate]
Objectives:
I want to throw exceptions (or error messages) when the following illegal code is invoked.
\const[c,any]{temp}{\f[\i]}
\const[others]{temp}{\f[\i]}
Minimal Working Example:
I cannot ...
1
vote
1answer
70 views
What causes this error? [closed]
After seeing Herbert's answer, apparently this problem should not occur if I realized the first row of the following code should be \documentclass{beamer}. Problems often come from not knowing what I ...
-2
votes
1answer
180 views
Data conversion (datatool, fp) [closed]
Ich bin auf der Suche nach einer Möglichkeit aus einer Datei folgender Struktur
1,a
2,a
2,a
2,a
3,a
3,a
4,a
4,a
4,a
4,a
5,a
5,a
6,a
6,a
7,a
folgendes zu machen
1 1
2 3
3 2
4 4
5 2
6 2
7 1
(Das A ...
