Skip to content

Commit

Permalink
fixed bug in toLatex()
Browse files Browse the repository at this point in the history
  • Loading branch information
brandmaier committed Oct 1, 2024
1 parent a177c55 commit 4a7baea
Show file tree
Hide file tree
Showing 5 changed files with 372 additions and 224 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ misc
cran-comments.md
^CRAN-SUBMISSION$
^\.github$
^\.httr-oauth$
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Meta
/doc/
/Meta/
cran_comments.md
CRAN*
CRAN*
.httr-oauth
61 changes: 46 additions & 15 deletions R/render_tree.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
render_tree <-
function(node, with_tex_escape=TRUE, alternative_edge_labels=TRUE,root=NULL, prev_node=NULL, latex_mapping=NULL,parameter.names=NULL, stars=TRUE, linewidth=1,dash.threshold=1,ci=FALSE,sd=FALSE, parameter.order=NULL)
{

#pre <- "\\begin{sidewaysfigure} \n
pre <- "% make sure to add these packages:\n% \\usepackage{pst-all}\n% \\usepackage{graphicx}\n\n\\resizebox{\\textwidth}{!}{ \n "
post <- "}"# \n \\end{sidewaysfigure}\n "

content <- render_tree_recursively(node, with_tex_escape, alternative_edge_labels, root, prev_node, latex_mapping,parameter.names,stars, linewidth, dash.threshold, ci, sd, parameter.order );

output <- paste(pre,content,post)

return(output);


}
function(node,
with_tex_escape = TRUE,
alternative_edge_labels = TRUE,
root = NULL,
prev_node = NULL,
latex_mapping = NULL,
parameter.names = NULL,
stars = TRUE,
linewidth = 1,
dash.threshold = 1,
ci = FALSE,
sd = FALSE,
parameter.order = NULL)
{
#pre <- "\\begin{sidewaysfigure} \n
pre <-
"% make sure to add these packages:\n% \\usepackage{pst-all}\n% \\usepackage{graphicx}\n\n\\resizebox{\\textwidth}{!}{ \n "
post <- "}"

# \n \\end{sidewaysfigure}\n "

content <-
render_tree_recursively(
node,
with_tex_escape,
alternative_edge_labels,
root,
prev_node,
latex_mapping,
parameter.names,
stars,
linewidth,
dash.threshold,
ci,
sd,
parameter.order
)


output <- paste(pre, content, post)

return(output)



}
Loading

0 comments on commit 4a7baea

Please sign in to comment.