6
votes
1answer
187 views

evaluate a string like `sin(x)+3` with `x` given

I defined a macro that gets as input a string like sin(x)+3, a starting x and an ending x, which is plotted using \addplot from PGFplots. Now I want to evaluate this function for x equal to the ...
5
votes
1answer
234 views

How to preserve lenghts to use with \includegraphics scaling, when calculating them with pgf

This question is related to my earlier question here: How to define a macro that uses image width and height to define a variable for later use . There you can find a full MWE of the problematic code. ...
7
votes
3answers
177 views

Adjusting command behavior based on argument type

I have a following command in my latex document: \newcommand{\ApplyGradient}[1]{ \pgfmathsetmacro{\PercentColor}{100.0*(#1+0.2)/1.3} \textcolor{black!\PercentColor}{#1}} ...
3
votes
2answers
309 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 ...
9
votes
1answer
280 views

Macros and pgfmath within put in picture environment

I am trying to put some TikZ pictures into a Beamer slide to enhance readability. The position of the TikZ pictures on the slide will depend on how much text comes before. Since there will be many ...
4
votes
2answers
253 views

How to build macros for vector-matrix operators?

Can anybody build macros for doing the following vector operations? Or are there already such macros? For example, 1) Example data: \def\a{(5,3,0)} \def\b{(5,1,6)} ...
5
votes
2answers
286 views

Why does enumitem need the macro to exist already?

I'm using pgf and enumitem to define a hexadecimal enumeration scheme as follows: \documentclass{article} \usepackage{pgf,enumitem} \makeatletter \newcommand*{\Hex}[1]{% \expandafter\@Hex\csname ...