Questions tagged [pgfmathparse]
The pgfmathparse tag has no summary.
61 questions
3
votes
2
answers
39
views
How to use pfgmathparse within a margin note (using scrlayer-notecolumn)?
This MWE demonstrates the problem:
\documentclass{scrartcl}
\usepackage{scrlayer-notecolumn}
\usepackage{tikz}
\begin{document}
%Works fine: \pgfmathparse{hex(1020135)}0x\pgfmathresult
%...
2
votes
0
answers
116
views
What are "best practices" for PGF/TikZ use of pgfmathparse and friends?
I have encountered (sporadically) comments to the effect that \pgfmathparse, \pgfmathsetlength, and so forth should not be used unless absolutely necessary. For example, it is (I am told) preferable ...
2
votes
1
answer
488
views
pgfmathsetmacro, pgfmarthparse, pgfmathresult to define command with calculation
I am quite new to using tikz and the pgf package in general, and I'm having a hard time understanding how/when to use pgfmathsetmacro, pgfmathparse and pgfmathresult. I have the following problem: I ...
1
vote
1
answer
166
views
How to make a loop-generated table depending on the outcome of a calculation?
As a Dutch teacher my grading scale goes from 1,0 to 10,0. The calculation of the grade depends on three variables: the N-term; the score of the student; the total number of points for the exam.
I ...
0
votes
2
answers
144
views
Blank tikz figure in a pdf file
This could be a very problematic post so sorry in advance.
I am trying to draw a figure using tikz for a manuscript and when I used it, the first time it worked very well. But now I have added some ...
1
vote
1
answer
85
views
Incomplete \iffalse error with pgfmathparse in a caption
I am calculating a value with pgfmathparse, pgfmathroundto and pgfmathresult. It works all fine in normal text mode, but when I call the command in a caption, I get an "Incomplete \iffalse; all ...
2
votes
2
answers
150
views
Floating points calculation problem (with pgfmathparse via length)
The subtraction of the calculated height of an input via sbox (in this case = 116.43562 pt) and 17.68 pt gives an incorrect result at the 5th floating point.
Here is the full tex file
\usepackage[T1]{...
1
vote
1
answer
142
views
How to read values interms of milli(m), femto(f), micro(u) into float values
I have a .csv file, which contains values interms of milli(m), femto(f) and micro(u)etc. which I want to process it as float value inside pgfmathparse
\begin{filecontents*}{mycsv.csv}
Device, betaeff, ...
1
vote
3
answers
150
views
tikz - pgfmathresult prints nothing
I am trying to use a foreach statement to print the powers of 2. I start by defining n as 2 then I print n and multiply it by 2 10 times. The code does compile without errors but the only number I see ...
0
votes
1
answer
142
views
Plotting function with polygonal domain using pgfplots
I am trying to plot the product between a Heaviside function and a trigonometric function in the domain [-1,1]x[-1,1] using pgfplots. I can use Mathematica to obtain the required result (see image), ...
2
votes
1
answer
252
views
Function within a function in \pgfmathdeclarefunction
I'm trying to plot a complex function and to that end I'm using pgfmathdeclarefunction. Still, I'm unable to get it to work, I get the error:
! Illegal parameter number in definition of \pgfmathNi@.
...
1
vote
1
answer
239
views
Using addplot and pgfmathresult for color
I could use some help. I am trying to color a bar chart assigning different colors using a foreach loop and pgfmathresult to get a color gradient. Here is a minimal example:
\documentclass{minimal}
\...
4
votes
1
answer
279
views
problem when using radians with tikz
My initial problem occurred with this code:
\def\a{pi/2}
\pgfmathparse{\a r}\pgfmathresult
output : 89.99937
When I modified the macro \a thus \def\a{pi}
I get the error: Package PGF Math Error: ...
0
votes
1
answer
176
views
Summing up float values inside a tabularx
Note: this question is very similar to this one, but differs since I am using float values instead of int.
I am auto-generating a LaTeX table with a python script which contains times in decimal hour ...
4
votes
1
answer
342
views
Using pgfmath in draw options
I would like to set draw options in tikz depending on some pgfmath calculations. More specifically, I would like to draw or not draw an edge depending on some value in an array.
This works fine if ...