Fail to invoke g(f(x))
up vote
7
down vote
favorite
I want to invoke g(f(x))
which is equal to x
actually. However the following does not compile in PostScript stage (I think). Could you fix it? I am not asking how to plot y=x
but how to invoke the composition function g(f(x))
.
MWE
documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g(f(x))}
end{pspicture}
end{document}
pstricks
add a comment |
up vote
7
down vote
favorite
I want to invoke g(f(x))
which is equal to x
actually. However the following does not compile in PostScript stage (I think). Could you fix it? I am not asking how to plot y=x
but how to invoke the composition function g(f(x))
.
MWE
documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g(f(x))}
end{pspicture}
end{document}
pstricks
2
Usedeff#1{((#1-2)/(2*(#1)+1))} defg#1{((2+#1)/(1-2*(#1)))}
andpsplot{-4}{5}{g{f{x}}}
, i.e. the usual curly braces instead of round ones. When you usedeff(#1)
you are using delimited arguments which have problems when you nest calls (like the[
and]
of optional arguments)
– moewe
Nov 18 at 5:53
1
It is the same situation as forbegin{lstlisting}[language={[LaTeX]TeX}]
. The inner[...]
have to be braced.
– Herbert
Nov 18 at 8:47
@Herbert: I found a bug inpstTriangle
. It cannot acceptRand
. For example:pstTriangle(0,0){A}(3,4){B}(!.5 Rand sub 10 mul 3){C}
does not compile.
– Artificial Stupidity
Nov 21 at 19:20
1
tx@Dict begin Rand end
– Herbert
Nov 21 at 21:07
@Herbert: Th anks.
– Artificial Stupidity
Nov 22 at 6:17
add a comment |
up vote
7
down vote
favorite
up vote
7
down vote
favorite
I want to invoke g(f(x))
which is equal to x
actually. However the following does not compile in PostScript stage (I think). Could you fix it? I am not asking how to plot y=x
but how to invoke the composition function g(f(x))
.
MWE
documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g(f(x))}
end{pspicture}
end{document}
pstricks
I want to invoke g(f(x))
which is equal to x
actually. However the following does not compile in PostScript stage (I think). Could you fix it? I am not asking how to plot y=x
but how to invoke the composition function g(f(x))
.
MWE
documentclass[pstricks,border=12pt]{standalone}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g(f(x))}
end{pspicture}
end{document}
pstricks
pstricks
asked Nov 18 at 5:39
Artificial Stupidity
4,46611038
4,46611038
2
Usedeff#1{((#1-2)/(2*(#1)+1))} defg#1{((2+#1)/(1-2*(#1)))}
andpsplot{-4}{5}{g{f{x}}}
, i.e. the usual curly braces instead of round ones. When you usedeff(#1)
you are using delimited arguments which have problems when you nest calls (like the[
and]
of optional arguments)
– moewe
Nov 18 at 5:53
1
It is the same situation as forbegin{lstlisting}[language={[LaTeX]TeX}]
. The inner[...]
have to be braced.
– Herbert
Nov 18 at 8:47
@Herbert: I found a bug inpstTriangle
. It cannot acceptRand
. For example:pstTriangle(0,0){A}(3,4){B}(!.5 Rand sub 10 mul 3){C}
does not compile.
– Artificial Stupidity
Nov 21 at 19:20
1
tx@Dict begin Rand end
– Herbert
Nov 21 at 21:07
@Herbert: Th anks.
– Artificial Stupidity
Nov 22 at 6:17
add a comment |
2
Usedeff#1{((#1-2)/(2*(#1)+1))} defg#1{((2+#1)/(1-2*(#1)))}
andpsplot{-4}{5}{g{f{x}}}
, i.e. the usual curly braces instead of round ones. When you usedeff(#1)
you are using delimited arguments which have problems when you nest calls (like the[
and]
of optional arguments)
– moewe
Nov 18 at 5:53
1
It is the same situation as forbegin{lstlisting}[language={[LaTeX]TeX}]
. The inner[...]
have to be braced.
– Herbert
Nov 18 at 8:47
@Herbert: I found a bug inpstTriangle
. It cannot acceptRand
. For example:pstTriangle(0,0){A}(3,4){B}(!.5 Rand sub 10 mul 3){C}
does not compile.
– Artificial Stupidity
Nov 21 at 19:20
1
tx@Dict begin Rand end
– Herbert
Nov 21 at 21:07
@Herbert: Th anks.
– Artificial Stupidity
Nov 22 at 6:17
2
2
Use
deff#1{((#1-2)/(2*(#1)+1))} defg#1{((2+#1)/(1-2*(#1)))}
and psplot{-4}{5}{g{f{x}}}
, i.e. the usual curly braces instead of round ones. When you use deff(#1)
you are using delimited arguments which have problems when you nest calls (like the [
and ]
of optional arguments)– moewe
Nov 18 at 5:53
Use
deff#1{((#1-2)/(2*(#1)+1))} defg#1{((2+#1)/(1-2*(#1)))}
and psplot{-4}{5}{g{f{x}}}
, i.e. the usual curly braces instead of round ones. When you use deff(#1)
you are using delimited arguments which have problems when you nest calls (like the [
and ]
of optional arguments)– moewe
Nov 18 at 5:53
1
1
It is the same situation as for
begin{lstlisting}[language={[LaTeX]TeX}]
. The inner [...]
have to be braced.– Herbert
Nov 18 at 8:47
It is the same situation as for
begin{lstlisting}[language={[LaTeX]TeX}]
. The inner [...]
have to be braced.– Herbert
Nov 18 at 8:47
@Herbert: I found a bug in
pstTriangle
. It cannot accept Rand
. For example: pstTriangle(0,0){A}(3,4){B}(!.5 Rand sub 10 mul 3){C}
does not compile.– Artificial Stupidity
Nov 21 at 19:20
@Herbert: I found a bug in
pstTriangle
. It cannot accept Rand
. For example: pstTriangle(0,0){A}(3,4){B}(!.5 Rand sub 10 mul 3){C}
does not compile.– Artificial Stupidity
Nov 21 at 19:20
1
1
tx@Dict begin Rand end
– Herbert
Nov 21 at 21:07
tx@Dict begin Rand end
– Herbert
Nov 21 at 21:07
@Herbert: Th anks.
– Artificial Stupidity
Nov 22 at 6:17
@Herbert: Th anks.
– Artificial Stupidity
Nov 22 at 6:17
add a comment |
1 Answer
1
active
oldest
votes
up vote
10
down vote
accepted
The use of similar parameter text for f
and g
is what causes the problem here. The first occurrence of a (
...)
pair is used to extract the arguments. So, in
g(f(<x>))
passes the incomplete f(<x>
as the argument to g
. To get around this, brace the argument to avoid confusion:
documentclass{article}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g({f(x)})}
end{pspicture}
end{document}
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
10
down vote
accepted
The use of similar parameter text for f
and g
is what causes the problem here. The first occurrence of a (
...)
pair is used to extract the arguments. So, in
g(f(<x>))
passes the incomplete f(<x>
as the argument to g
. To get around this, brace the argument to avoid confusion:
documentclass{article}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g({f(x)})}
end{pspicture}
end{document}
add a comment |
up vote
10
down vote
accepted
The use of similar parameter text for f
and g
is what causes the problem here. The first occurrence of a (
...)
pair is used to extract the arguments. So, in
g(f(<x>))
passes the incomplete f(<x>
as the argument to g
. To get around this, brace the argument to avoid confusion:
documentclass{article}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g({f(x)})}
end{pspicture}
end{document}
add a comment |
up vote
10
down vote
accepted
up vote
10
down vote
accepted
The use of similar parameter text for f
and g
is what causes the problem here. The first occurrence of a (
...)
pair is used to extract the arguments. So, in
g(f(<x>))
passes the incomplete f(<x>
as the argument to g
. To get around this, brace the argument to avoid confusion:
documentclass{article}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g({f(x)})}
end{pspicture}
end{document}
The use of similar parameter text for f
and g
is what causes the problem here. The first occurrence of a (
...)
pair is used to extract the arguments. So, in
g(f(<x>))
passes the incomplete f(<x>
as the argument to g
. To get around this, brace the argument to avoid confusion:
documentclass{article}
usepackage{pst-plot}
deff(#1){((#1-2)/(2*(#1)+1))}% y=f(x)
defg(#1){((2+#1)/(1-2*(#1)))}% y=g(x) in which g is the inverse of f.
begin{document}
begin{pspicture}[algebraic](-4,-4)(6,6)
psaxes{->}(0,0)(-4,-4)(5.5,5.5)[$x$,0][$y$,90]
psset{linecolor=blue,linewidth=2pt}
psplot{-4}{5}{g({f(x)})}
end{pspicture}
end{document}
answered Nov 18 at 5:58
Werner
434k609531637
434k609531637
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460544%2ffail-to-invoke-g-fx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Use
deff#1{((#1-2)/(2*(#1)+1))} defg#1{((2+#1)/(1-2*(#1)))}
andpsplot{-4}{5}{g{f{x}}}
, i.e. the usual curly braces instead of round ones. When you usedeff(#1)
you are using delimited arguments which have problems when you nest calls (like the[
and]
of optional arguments)– moewe
Nov 18 at 5:53
1
It is the same situation as for
begin{lstlisting}[language={[LaTeX]TeX}]
. The inner[...]
have to be braced.– Herbert
Nov 18 at 8:47
@Herbert: I found a bug in
pstTriangle
. It cannot acceptRand
. For example:pstTriangle(0,0){A}(3,4){B}(!.5 Rand sub 10 mul 3){C}
does not compile.– Artificial Stupidity
Nov 21 at 19:20
1
tx@Dict begin Rand end
– Herbert
Nov 21 at 21:07
@Herbert: Th anks.
– Artificial Stupidity
Nov 22 at 6:17