diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-10-07 22:32:03 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-10-07 22:32:03 +0200 |
commit | cbe1d76dc277194f7f0ea5d90617b84184dfc72d (patch) | |
tree | e275d65b7e978427d5014c2fe7de1625e4cb9e44 | |
parent | 25b3fd06bef38c3c95a03c8b0e17b4054f3ab122 (diff) | |
download | org-mode-cbe1d76dc277194f7f0ea5d90617b84184dfc72d.tar.gz |
ox-texinfo: Fix quotations
* lisp/ox-texinfo.el (org-texinfo-quote-block): Do not use NAME
keyword as the emphasized tag. Use a dedicated :tag attribute
instead. Also add :author attribute.
* doc/org-manual.org (Quotations in Texinfo export): New section.
-rw-r--r-- | doc/org-manual.org | 29 | ||||
-rw-r--r-- | lisp/ox-texinfo.el | 11 |
2 files changed, 35 insertions, 5 deletions
diff --git a/doc/org-manual.org b/doc/org-manual.org index 2c0ad7c..faaf7a1 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -14852,6 +14852,35 @@ and specify the text using Texinfo code, as shown in the example: [[ridt.pdf]] #+end_example +*** Quotations in Texinfo export +:PROPERTIES: +:DESCRIPTION: Quote block attributes. +:END: + +#+cindex: @samp{ATTR_TEXINFO}, keyword +You can write the text of a quotation within a quote block (see +[[*Paragraphs]]). You may also emphasize some text at the beginning of +the quotation with the =:tag= attribute. + +#+begin_example +,#+ATTR_TEXINFO: :tag Warning +,#+BEGIN_QUOTE +Striking your thumb with a hammer may cause severe pain and discomfort. +,#+END_QUOTE +#+end_example + +To specify the author of the quotation, use the =:author= attribute. + +#+begin_example +,#+ATTR_TEXINFO: :author King Arthur +,#+BEGIN_QUOTE +The Lady of the Lake, her arm clad in the purest shimmering samite, +held aloft Excalibur from the bosom of the water, signifying by divine +providence that I, Arthur, was to carry Excalibur. That is why I am +your king. +,#+END_QUOTE +#+end_example + *** Special blocks in Texinfo export :PROPERTIES: :DESCRIPTION: Special block attributes. diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 7bfdc03..825f95f 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1345,11 +1345,12 @@ holding contextual information." "Transcode a QUOTE-BLOCK element from Org to Texinfo. CONTENTS holds the contents of the block. INFO is a plist holding contextual information." - (let* ((title (org-element-property :name quote-block)) - (start-quote (concat "@quotation" - (when title - (format " %s" title))))) - (format "%s\n%s@end quotation" start-quote contents))) + (let ((tag (org-export-read-attribute :attr_texinfo quote-block :tag)) + (author (org-export-read-attribute :attr_texinfo quote-block :author))) + (format "@quotation%s\n%s%s\n@end quotation" + (if tag (concat " " tag) "") + contents + (if author (concat "\n@author " author) "")))) ;;;; Radio Target |