I am writing my PhD thesis in obsidian using this code to convert it to latex.
Now… in this tool, there is a way to “cancel” a certain part of the text by adding placeholders that the converter will take into account. For example:
#command_include_following_text(condition)
text here
#command_include_following_text_end
if condition is set to false, this text will not appear in the .pdf file, or in the latex version of the thesis.
Pandoc is more versatile tool than what you would get with Obsidian plugins. You can run customized scripts in Obsidian but the framework is limited to few plugins (Templater, QuickAdd, Shell Commands, Execute Code). Templater and QuickAdd are used with JavaScript while Shell Commands and Execute Code are not limitted to one language.
Edit: also Dataview provides scripting via JavaScript
If you want to do it programmatically (i.e. show/hide based on boolean variables), an easy way would be Dataview:
`$= if (true) dv.paragraph('This will appear.')`
`$= if (false) dv.paragraph('This will NOT appear.')`
Will produce the output:
This will appear.
If you’re not actually looking for a “programming” way to do it, and just mean “How to hide certain text in preview mode”, then you are looking for comments: