I am writing a document in (a variant of) Bookdown, and would like some text to appear only in the gitbook format, not in other formats. I would therefore like a parameter that is TRUE when knitting to gitbook and FALSE otherwise.
Currently I am using knitr::pandoc_to("html"), which almost does the job, except that it is TRUE when knitting to plain html as well as gitbook. The obvious alternative, knitr::pandoc_to("gitbook"), does nothing. Is there a parameter – or a way to define a parameter – that is TRUE only when knitting to gitbook, and not for other html-based formats?