Strange error for passing parameter to forestset to draw tree

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite












I am trying to draw a simple probability tree, where the probabilites could sometimes be fraction or decimals., this means, I will have to adjust the spacing. So I tried the below code. This produces tree but label gone, and error thrown.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style 3 args=
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased, my edge label=abovexshift=-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


Output:
enter image description here



Error:
enter image description here










share|improve this question























  • Might be useful if you also cite the error
    – daleif
    Nov 24 at 14:15










  • I have added the screenshot
    – Paari Vendhan
    Nov 24 at 14:16














up vote
5
down vote

favorite












I am trying to draw a simple probability tree, where the probabilites could sometimes be fraction or decimals., this means, I will have to adjust the spacing. So I tried the below code. This produces tree but label gone, and error thrown.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style 3 args=
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased, my edge label=abovexshift=-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


Output:
enter image description here



Error:
enter image description here










share|improve this question























  • Might be useful if you also cite the error
    – daleif
    Nov 24 at 14:15










  • I have added the screenshot
    – Paari Vendhan
    Nov 24 at 14:16












up vote
5
down vote

favorite









up vote
5
down vote

favorite











I am trying to draw a simple probability tree, where the probabilites could sometimes be fraction or decimals., this means, I will have to adjust the spacing. So I tried the below code. This produces tree but label gone, and error thrown.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style 3 args=
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased, my edge label=abovexshift=-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


Output:
enter image description here



Error:
enter image description here










share|improve this question















I am trying to draw a simple probability tree, where the probabilites could sometimes be fraction or decimals., this means, I will have to adjust the spacing. So I tried the below code. This produces tree but label gone, and error thrown.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style 3 args=
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased, my edge label=abovexshift=-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


Output:
enter image description here



Error:
enter image description here







tikz-pgf tikz-styles forest arguments






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 at 15:14









Bernard

163k768192




163k768192










asked Nov 24 at 14:14









Paari Vendhan

3387




3387











  • Might be useful if you also cite the error
    – daleif
    Nov 24 at 14:15










  • I have added the screenshot
    – Paari Vendhan
    Nov 24 at 14:16
















  • Might be useful if you also cite the error
    – daleif
    Nov 24 at 14:15










  • I have added the screenshot
    – Paari Vendhan
    Nov 24 at 14:16















Might be useful if you also cite the error
– daleif
Nov 24 at 14:15




Might be useful if you also cite the error
– daleif
Nov 24 at 14:15












I have added the screenshot
– Paari Vendhan
Nov 24 at 14:16




I have added the screenshot
– Paari Vendhan
Nov 24 at 14:16










1 Answer
1






active

oldest

votes

















up vote
6
down vote



accepted










There are actually 2 issues.




  1. style 3 args does not exist, use style n args=3{... instead.

  2. You define for the 2nd argument xshift=#2 but add one more xshift when you are saying my edge label=abovexshift=-2mm0.002.

Working code:



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=3
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here



Simpler code: pgfkeys already accept comma-separated arguments, which is illustrated in my edge label=above,xshift=-3mm0.002. And instead the xshift you my just use above left or below left etc., as in my edge label=below left0.998.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=2
edge label=node[midway, font=sffamilyscriptsize,#1]#2,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above,xshift=-3mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease,my edge label=below left0.998
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here






share|improve this answer






















  • Instead of above and a negative xshift you may also try above left.
    – marmot
    Nov 24 at 14:25










  • thanks marmot :) any way I could make that optional also, so I need not always give that some default value?
    – Paari Vendhan
    Nov 24 at 14:52











  • @PaariVendhan Yes, of course, with pgfkeys. (Sorry, I was hibernating.) What do you want to make default? (Will decouple now again for one hour.)
    – marmot
    Nov 24 at 17:24











  • No, not default, just optional (so even if i do not pass anything, nothing happens foreg, what happens if i did not send xshift value - result should be if what if i did not use xshift in the style)
    – Paari Vendhan
    Nov 24 at 17:35






  • 1




    @PaariVendhan nodes already allow for optional keys, so IMHO you only need 2 arguments, not three. I illustrated this in another example.
    – marmot
    Nov 24 at 18:07










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461558%2fstrange-error-for-passing-parameter-to-forestset-to-draw-tree%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
6
down vote



accepted










There are actually 2 issues.




  1. style 3 args does not exist, use style n args=3{... instead.

  2. You define for the 2nd argument xshift=#2 but add one more xshift when you are saying my edge label=abovexshift=-2mm0.002.

Working code:



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=3
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here



Simpler code: pgfkeys already accept comma-separated arguments, which is illustrated in my edge label=above,xshift=-3mm0.002. And instead the xshift you my just use above left or below left etc., as in my edge label=below left0.998.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=2
edge label=node[midway, font=sffamilyscriptsize,#1]#2,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above,xshift=-3mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease,my edge label=below left0.998
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here






share|improve this answer






















  • Instead of above and a negative xshift you may also try above left.
    – marmot
    Nov 24 at 14:25










  • thanks marmot :) any way I could make that optional also, so I need not always give that some default value?
    – Paari Vendhan
    Nov 24 at 14:52











  • @PaariVendhan Yes, of course, with pgfkeys. (Sorry, I was hibernating.) What do you want to make default? (Will decouple now again for one hour.)
    – marmot
    Nov 24 at 17:24











  • No, not default, just optional (so even if i do not pass anything, nothing happens foreg, what happens if i did not send xshift value - result should be if what if i did not use xshift in the style)
    – Paari Vendhan
    Nov 24 at 17:35






  • 1




    @PaariVendhan nodes already allow for optional keys, so IMHO you only need 2 arguments, not three. I illustrated this in another example.
    – marmot
    Nov 24 at 18:07














up vote
6
down vote



accepted










There are actually 2 issues.




  1. style 3 args does not exist, use style n args=3{... instead.

  2. You define for the 2nd argument xshift=#2 but add one more xshift when you are saying my edge label=abovexshift=-2mm0.002.

Working code:



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=3
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here



Simpler code: pgfkeys already accept comma-separated arguments, which is illustrated in my edge label=above,xshift=-3mm0.002. And instead the xshift you my just use above left or below left etc., as in my edge label=below left0.998.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=2
edge label=node[midway, font=sffamilyscriptsize,#1]#2,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above,xshift=-3mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease,my edge label=below left0.998
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here






share|improve this answer






















  • Instead of above and a negative xshift you may also try above left.
    – marmot
    Nov 24 at 14:25










  • thanks marmot :) any way I could make that optional also, so I need not always give that some default value?
    – Paari Vendhan
    Nov 24 at 14:52











  • @PaariVendhan Yes, of course, with pgfkeys. (Sorry, I was hibernating.) What do you want to make default? (Will decouple now again for one hour.)
    – marmot
    Nov 24 at 17:24











  • No, not default, just optional (so even if i do not pass anything, nothing happens foreg, what happens if i did not send xshift value - result should be if what if i did not use xshift in the style)
    – Paari Vendhan
    Nov 24 at 17:35






  • 1




    @PaariVendhan nodes already allow for optional keys, so IMHO you only need 2 arguments, not three. I illustrated this in another example.
    – marmot
    Nov 24 at 18:07












up vote
6
down vote



accepted







up vote
6
down vote



accepted






There are actually 2 issues.




  1. style 3 args does not exist, use style n args=3{... instead.

  2. You define for the 2nd argument xshift=#2 but add one more xshift when you are saying my edge label=abovexshift=-2mm0.002.

Working code:



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=3
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here



Simpler code: pgfkeys already accept comma-separated arguments, which is illustrated in my edge label=above,xshift=-3mm0.002. And instead the xshift you my just use above left or below left etc., as in my edge label=below left0.998.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=2
edge label=node[midway, font=sffamilyscriptsize,#1]#2,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above,xshift=-3mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease,my edge label=below left0.998
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here






share|improve this answer














There are actually 2 issues.




  1. style 3 args does not exist, use style n args=3{... instead.

  2. You define for the 2nd argument xshift=#2 but add one more xshift when you are saying my edge label=abovexshift=-2mm0.002.

Working code:



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=3
edge label=node[midway, font=sffamilyscriptsize, #1,xshift=#2]#3,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above-2mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here



Simpler code: pgfkeys already accept comma-separated arguments, which is illustrated in my edge label=above,xshift=-3mm0.002. And instead the xshift you my just use above left or below left etc., as in my edge label=below left0.998.



documentclassarticle
usepackage[utf8]inputenc

usepackage[linguistics]forest
usepackagephilex


forestset
my edge label/.style n args=2
edge label=node[midway, font=sffamilyscriptsize,#1]#2,
,


titleProblem customizing forest tree
authorparthi292929
dateNovember 2018



begindocument

maketitle

sectionIntroduction

scalebox1.2
beginforest
for tree=grow'=east
[0
[Diseased,my edge label=above,xshift=-3mm0.002
[Positive
]
[Negative(FN)
]
]
[No Disease,my edge label=below left0.998
[Positive
]
[Negative
]
]
]
]
endforest



enddocument


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 24 at 18:16

























answered Nov 24 at 14:23









marmot

79.8k490169




79.8k490169











  • Instead of above and a negative xshift you may also try above left.
    – marmot
    Nov 24 at 14:25










  • thanks marmot :) any way I could make that optional also, so I need not always give that some default value?
    – Paari Vendhan
    Nov 24 at 14:52











  • @PaariVendhan Yes, of course, with pgfkeys. (Sorry, I was hibernating.) What do you want to make default? (Will decouple now again for one hour.)
    – marmot
    Nov 24 at 17:24











  • No, not default, just optional (so even if i do not pass anything, nothing happens foreg, what happens if i did not send xshift value - result should be if what if i did not use xshift in the style)
    – Paari Vendhan
    Nov 24 at 17:35






  • 1




    @PaariVendhan nodes already allow for optional keys, so IMHO you only need 2 arguments, not three. I illustrated this in another example.
    – marmot
    Nov 24 at 18:07
















  • Instead of above and a negative xshift you may also try above left.
    – marmot
    Nov 24 at 14:25










  • thanks marmot :) any way I could make that optional also, so I need not always give that some default value?
    – Paari Vendhan
    Nov 24 at 14:52











  • @PaariVendhan Yes, of course, with pgfkeys. (Sorry, I was hibernating.) What do you want to make default? (Will decouple now again for one hour.)
    – marmot
    Nov 24 at 17:24











  • No, not default, just optional (so even if i do not pass anything, nothing happens foreg, what happens if i did not send xshift value - result should be if what if i did not use xshift in the style)
    – Paari Vendhan
    Nov 24 at 17:35






  • 1




    @PaariVendhan nodes already allow for optional keys, so IMHO you only need 2 arguments, not three. I illustrated this in another example.
    – marmot
    Nov 24 at 18:07















Instead of above and a negative xshift you may also try above left.
– marmot
Nov 24 at 14:25




Instead of above and a negative xshift you may also try above left.
– marmot
Nov 24 at 14:25












thanks marmot :) any way I could make that optional also, so I need not always give that some default value?
– Paari Vendhan
Nov 24 at 14:52





thanks marmot :) any way I could make that optional also, so I need not always give that some default value?
– Paari Vendhan
Nov 24 at 14:52













@PaariVendhan Yes, of course, with pgfkeys. (Sorry, I was hibernating.) What do you want to make default? (Will decouple now again for one hour.)
– marmot
Nov 24 at 17:24





@PaariVendhan Yes, of course, with pgfkeys. (Sorry, I was hibernating.) What do you want to make default? (Will decouple now again for one hour.)
– marmot
Nov 24 at 17:24













No, not default, just optional (so even if i do not pass anything, nothing happens foreg, what happens if i did not send xshift value - result should be if what if i did not use xshift in the style)
– Paari Vendhan
Nov 24 at 17:35




No, not default, just optional (so even if i do not pass anything, nothing happens foreg, what happens if i did not send xshift value - result should be if what if i did not use xshift in the style)
– Paari Vendhan
Nov 24 at 17:35




1




1




@PaariVendhan nodes already allow for optional keys, so IMHO you only need 2 arguments, not three. I illustrated this in another example.
– marmot
Nov 24 at 18:07




@PaariVendhan nodes already allow for optional keys, so IMHO you only need 2 arguments, not three. I illustrated this in another example.
– marmot
Nov 24 at 18:07

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f461558%2fstrange-error-for-passing-parameter-to-forestset-to-draw-tree%23new-answer', 'question_page');

);

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






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?