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
yesterday
1
It is the same situation as forbegin{lstlisting}[language={[LaTeX]TeX}]
. The inner[...]
have to be braced.
– Herbert
yesterday
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 yesterday
Artificial Stupidity
4,4121832
4,4121832
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
yesterday
1
It is the same situation as forbegin{lstlisting}[language={[LaTeX]TeX}]
. The inner[...]
have to be braced.
– Herbert
yesterday
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
yesterday
1
It is the same situation as forbegin{lstlisting}[language={[LaTeX]TeX}]
. The inner[...]
have to be braced.
– Herbert
yesterday
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
yesterday
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
yesterday
1
1
It is the same situation as for
begin{lstlisting}[language={[LaTeX]TeX}]
. The inner [...]
have to be braced.– Herbert
yesterday
It is the same situation as for
begin{lstlisting}[language={[LaTeX]TeX}]
. The inner [...]
have to be braced.– Herbert
yesterday
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 yesterday
Werner
430k599481624
430k599481624
add a comment |
add a comment |
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
yesterday
1
It is the same situation as for
begin{lstlisting}[language={[LaTeX]TeX}]
. The inner[...]
have to be braced.– Herbert
yesterday