From fc587b06c20e865636f16104c13b3f239680e7bf Mon Sep 17 00:00:00 2001 From: Max Nikulin Date: Wed, 28 Jun 2023 22:40:40 +0700 Subject: [PATCH v2] org-faq.org: Inline comments * org-faq.org (Export): New heading describing workarounds for inline comments. --- org-faq.org | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/org-faq.org b/org-faq.org index ab661395..42cd2ef4 100644 --- a/org-faq.org +++ b/org-faq.org @@ -4492,6 +4492,38 @@ ** How can I suppress the page number in the footer of an exported PDF? : #+LATEX: \thispagestyle{empty} +** Is it possible to add inline comments? +:PROPERTIES: +:CUSTOM_ID: inline-comments +:END: + +Unfortunately [[https://orgmode.org/manual/Comment-Lines.html][comments]] +in Org mode are block-level elements, so they break paragraphs. + +As a workaround choose a non-standard export backend name and use it in +[[https://orgmode.org/worg/org-syntax.html#Export_Snippets][export snippets]]: +=@@comment: rewrite it @@= or even =@@c: be concise@@=. +It is safer to avoid export snippets having no other content before or after them +on the same line. +#+begin_src org +The following line may become a patagraph separator. +@@comment: might give unexpected effect @@ +Put some text before @@comment: a better variant +@@ and after instread. +#+end_src + +Alternatives are: +a [[https://orgmode.org/manual/Macro-Replacement.html][macro]] +expanding to nothing, +a [[https://orgmode.org/manual/Adding-Hyperlink-Types.html][custom link type]] +exporting to empty string, +[[https://orgmode.org/manual/Structure-of-Code-Blocks.html][source code blocks]] +with exporting and evaluation suppressed through default header arguments. + +Unfortunately sites for hosting of open source code projects +do not support such tricks and inline comments may appear in formatted +=README.org= or other files. + * Backup #+index: Backup -- 2.25.1