Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
52 views

Calculations involving pgfkeys?

I've begun using pgfkeys to set a bunch of custom variables. I'm also using pgfmath to do some calculations. I understand how to set and call the variables, but the manual is mind boggling to me, ...
user182238's user avatar
3 votes
1 answer
69 views

Using pgfmath results in pgfkeys

I'm trying to create a simple variable system using pgfkeys, but I want to be able to create new "var" using other var, see this MWE where I have tried to use \pgfmathprintnumber. I thought ...
XGDragon's user avatar
6 votes
2 answers
215 views

TikZ: How to create a list with calculated entries for a style

I have a TikZ-matrix. And I want to highlight the rows 1, 3, 6, 10, 15, 21, 28,... =n*(n+1)/2 For small examples, I could do it this way: highlight/.style={ row #1/.style={....} }, highlight/.list=...
cis's user avatar
  • 9,923
2 votes
2 answers
108 views

pgfplotstable: Highlight rows of a numeric sequence

I would like to highlight the rows n*(n+3)/2 = 0, 2, 5, 9, 14, 20, 27, 35,... How could I automate that best way using the term n*(n+3)/2? \documentclass{standalone} \usepackage{pgfplotstable} \...
cis's user avatar
  • 9,923
0 votes
1 answer
190 views

Get value of global scale in in TikZ-picture [duplicate]

I calculate some lengths of a path (without the use of the let operator!). To achieve that I use the \pgfgetlastxy{}{}; command (which works fine so far) but if I scale the picture, the calculations ...
Wulle's user avatar
  • 1,234
2 votes
2 answers
355 views

How to print number with predefined exponent base (pgf)?

How can I print a number with some predefined base of power of 10 (exponent base) using \pgfmathprintnumber \documentclass[border=1cm]{standalone} \usepackage{pgf} \usepgflibrary{fpu} \begin{...
sergiokapone's user avatar
  • 5,640
1 vote
1 answer
71 views

How to get mantissa and exponent of a number from within pgf/fpu?

I need to get mantissa and exponent of a number from within pgf/fpu. I found @egreg's solution from here, but this solution does not work inside fpu. \documentclass[]{article} \usepackage{pgf, tikz} \...
sergiokapone's user avatar
  • 5,640
2 votes
2 answers
598 views

variant of scientific notation on pgf

I use scientific notation on pgf to display numbers. My present code as follows: \documentclass{article} \usepackage{pgf} \begin{document} \pgfkeys{ /pgf/number format/.cd, sci, sci generic={...
Takahiro Niwa's user avatar
2 votes
1 answer
293 views

change "output format" of pgfkeys sci or fixed

I have defined an environment that is used for calculation as shown below \newcounter{Precision} \newenvironment{calc}[1][1]{\setcounter{Precision}{#1} $\pgfkeys{/pgf/fpu,/pgf/fpu/output format=sci} }...
Raja's user avatar
  • 470
7 votes
4 answers
1k views

Is there a limit for the seed value in pgfmathsetseed

I am using pgf to create some random exams. To set the seed, I am using pgfmathsetseed. This system uses very different values for the seed, whose range could go to the thousands. The pgf manual says ...
iluvatar's user avatar
  • 315
0 votes
1 answer
158 views

How to use \pgfmathfloattomacro to store computation values in a variable and reuse the variable

I use \pgfmath for computation of floating point numbers a lot. But I want to store the result of each computation and store it in a variable and then use back to perform another floating point ...
Raja's user avatar
  • 470
10 votes
1 answer
636 views

How can the effects of \pgfkeys{/pgf/fpu=true} be reversed?

Consider the following MNWE: \documentclass[border=10pt,multi,tikz]{standalone} \usetikzlibrary{fpu} \pgfkeys{/pgf/fpu=true} \pgfkeys{/pgf/fpu=false} \begin{document} \pgfmathsetmacro\myresult{Mod(-...
cfr's user avatar
  • 219k
2 votes
1 answer
51 views

Computing minimum width based on style arg

I have successfully defined a "block" that I can instantiate in various sizes, with annotations at its sides. However, I would like to set the minimum width to sqrt(#2), while keeping the label as #2....
hans_meine's user avatar
5 votes
1 answer
840 views

rounding to one decimal woes...

I have a problem with rounding --- I have seen How do I get \pgfmathparse to create value rounded to one decimal place? but still I can't obtain the result I need. See this MWE: \usepackage[utf8]{...
Rmano's user avatar
  • 44.1k
3 votes
1 answer
691 views

pgfplots: math expressions of variables in axis style

I would like to use a calculated value of pgf variable exp(\pgfplots@data@xmin) This is a concrete example what I need \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \...
Manuel Schmidt's user avatar
6 votes
1 answer
867 views

Remove the first and last values of xtick and ytick

I use the following code to create a tufte-like range plot as suggested here: Tufte like axis with pgfplots \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} \makeatletter ...
Manuel Schmidt's user avatar
4 votes
1 answer
6k views

\pgfmathprintnumber and pre-defined styles

In text mode I would like to use \pgfmathprintnumber to print numbers in an uniform style. The style used shall be defined in the preamble of the document. See the following MWE: \documentclass{...
Sven Rüberg's user avatar
14 votes
1 answer
2k views

pgfmathprintnumber in bold and/or sans serif

I've set some pgfkeys such as precision=2 and use comma. Now I wonder how do I get the results of \pgfmathprintnumber{123.567} to be bold and/or sans serif? I thought this is easy, but everything ...
sauerburger's user avatar
3 votes
2 answers
2k views

Undefined control sequence \pgfmath@

Why does the following code give me this error message? Error ERROR: Undefined control sequence. --- TeX said --- \pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@ l.28 \draw (\...
John Wickerson's user avatar
11 votes
1 answer
477 views

Is it possible to store \pgfmathresult in a pgfkey?

I would like to perform a calculation using \pgfmathparse and then store \pgfmathresult as the value of a pgfkey. \documentclass{article} \usepackage{tikz} \begin{document} \...
Nicholas Hill's user avatar