Include Iverson Bracket in R documentation -
i wanting include iverson bracket in r documentation (unless there's better way represent information; i'm no mathematician). looks this.
here have valid latex code such expression
w_{neg}=\left\{\begin{matrix} 1 & \sum{(x_i^{n})}>0 \\ 0 & \sum{(x_i^{n}})=0 \end{matrix}\right.
i tried include code below:
#' w_{neg}=\left\{\begin{matrix} #' 1 & \sum{(x_i^{n})}>0 \\ #' 0 & \sum{(x_i^{n}})=0 #' \end{matrix}\right.
in details section of roxygen2
produces error seen below when compiling pdf documentation:
creating pdf output latex ... warning: running command '"c:\progra~2\miktex~1.9\miktex\bin\texi2dvi.exe" --pdf "rd2.tex" -i "c:/r/r-30~1.1/share/texmf/tex/latex" -i "c:/r/r-30~1.1/share/texmf/bibtex/bst"' had status 1 error : running 'texi2dvi' on 'rd2.tex' failed latex errors: ! misplaced alignment tab character &. <argument> \left \{\begin {matrix} 1 & \sum {(x_i^{n})}>0 \\ 0 & \sum {(x_i^... l.5566 \sum{(x_i^{n}})=0 \end{matrix}\right.}{} ! emergency stop. <argument> \left \{\begin {matrix} 1 & \sum {(x_i^{n})}>0 \\ 0 & \sum {(x_i^... l.5566 \sum{(x_i^{n}})=0 \end{matrix}\right.}{} ! ==> fatal error occurred, no output pdf file produced! error in running tools::texi2pdf()
how can include iverson bracket in r documentation (unless there's better way represent in case that's better approach)? note removal of these lines allows package compile.
i utilized following in roxygen2 documentation , worked:
#' \deqn{w_{neg}=\left\{\begin{array}{cc} #' 1 & \sum{(x_i^{n})}>0 \\ #' 0 & \sum{(x_i^{n}})=0 #' \end{array}\right.}
Comments
Post a Comment