-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make conditional block in Rmarkdown #72
Comments
Very interesting use case based on this : apply An opportunity to show |
I did not know this was also possible with Latex (see the knitr example) \documentclass{article}
\newif\ifmyboolean
\begin{document}
<<setup>>=
myboolean='true' # or set it to 'false'
@
% assign true or false to myboolean
\myboolean\Sexpr{myboolean}
\ifmyboolean
hello, foo!
\else
hey, bar!
\fi
\end{document} |
Related to #113 I think we can add more recipes based on examples in questions for conditional execution or echoing of chunks. Conditional |
I think these are special cases or applications of https://bookdown.org/yihui/rmarkdown-cookbook/chunk-variable.html so we can probably close this one. |
A small recipe about conditional block
if
in inline r block :`r if(test) {do}`
eval
with a variable defineRelated SO question
Related Knitr example
The text was updated successfully, but these errors were encountered: