1 #+TITLE: Org Export Reference Documentation
2 #+AUTHOR: Nicolas Goaziou
3 #+EMAIL: n.goaziou AT gmail DOT com
4 #+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
5 #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate
6 #+SEQ_TODO: TODO(t) INPROGRESS(i) WAITING(w@) | DONE(d) CANCELED(c@)
7 #+TAGS: Write(w) Update(u) Fix(f) Check(c) NEW(n)
12 [[file:../index.org][{Back to Worg's index}]]
14 This document is aimed at back-end developers for the generic export
15 engine =org-export.el=. It assumes a good understanding of Org
16 syntax --- as specified by /Org Elements/ --- from the reader.
18 It covers [[#back-end][back-end creation]] process, all [[#attributes][attributes]] associated to each
19 element or object type, properties offered by the [[#communication][communication
20 channel]] during export, the [[#filter-system][filter system]] internals and [[#toolbox][tools]] provided
26 A back-end is defined with ~org-export-define-backend~ macro. It
27 requires two mandatory arguments: the back-end name and its
28 translation table, an alist that associates element and object types
29 to translator functions. According to the macro doc-string:
32 These functions should return a string without any trailing space,
33 or nil. They must accept three arguments: the object or element
34 itself, its contents or nil when it isn't recursive and the property
35 list used as a communication channel.
37 Contents, when not nil, are stripped from any global indentation
38 (although the relative one is preserved). They also always end with
39 a single newline character.
41 If, for a given type, no function is found, that element or object
42 type will simply be ignored, along with any blank line or white
43 space at its end. The same will happen if the function returns the
44 nil value. If that function returns the empty string, the type will
45 be ignored, but the blank lines or white spaces will be kept.
47 In addition to element and object types, one function can be
48 associated to the ~template~ symbol and another one to the
51 The former returns the final transcoded string, and can be used to
52 add a preamble and a postamble to document's body. It must accept
53 two arguments: the transcoded string and the property list
54 containing export options.
56 The latter, when defined, is to be called on every text not
57 recognized as an element or an object. It must accept two
58 arguments: the text string and the information channel. It is an
59 appropriate place to protect special chars relative to the back-end.
62 Optionally, the macro can set-up back-end specific properties (like
63 values from specific buffer keywords) accessible from every
64 translator function with the ~:options-alist~ keyword. See
65 ~org-export-options-alist~ for details on the structure of the
68 As an example, the following excerpt from =e-latex= back-end
69 definition introduces three new buffer keywords (and their
70 headline's property counterpart), and redefine ~DATE~ default value:
72 #+BEGIN_SRC emacs-lisp
73 (org-export-define-backend e-latex
75 :options-alist ((:date "DATE" nil org-e-latex-date-format t)
76 (:latex-class "LATEX_CLASS" nil org-e-latex-default-class t)
77 (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
78 (:latex-header-extra "LATEX_HEADER" nil nil newline)))
81 It is also possible, with ~:export-block~ keyword, to associate
82 given block names to the ~export-block~ type. Such blocks can
83 contain raw code that will be directly inserted in the output, as
84 long as the corresponding translator function says so.
86 In the following example, in the ~e-html~ back-end, =HTML= blocks
87 are export blocks. The associated translator function inserts their
88 contents as-is, and ignores any other export block.
90 #+BEGIN_SRC emacs-lisp
91 (org-export-define-backend e-html
93 (export-block . org-e-html-export-block)
97 (defun org-e-html-export-block (export-block contents info)
98 "Transcode a EXPORT-BLOCK element from Org to HTML.
99 CONTENTS is nil. INFO is a plist used as a communication
101 (when (string= (org-element-property :type export-block) "HTML")
102 (org-element-property :value export-block)))
105 Eventually ~org-export-define-backend~ allows to define back-ends
106 specific filters. Refer to [[#filter-system][The Filter System]] section for more
109 If the new back-end shares most properties with another one,
110 ~org-export-define-derived-backend~ macro can be used to simplify
111 the process. In the example below, we implement a new back-end
112 which behaves like =e-latex= excepted for headlines and the
115 #+BEGIN_SRC emacs-lisp
116 (org-export-define-derived-backend my-latex e-latex
117 :translate-alist ((headline . custom-headline-translator)
118 (template . custom-template)))
121 Back-ends defined with either function can be registered in the
122 export dispatcher using special keyword =:menu-entry=. See macros
123 docstrings for more information.
125 * Elements Attributes
127 :CUSTOM_ID: attributes
130 Element attributes are accessed with ~org-element-property~
131 function. Other accessors relative to elements are
132 ~org-element-type~ and ~org-element-contents~.
134 Each greater element, element and object has a fixed set of
135 properties attached to it. Among them, four are shared by all
136 types: ~:begin~ and ~:end~, which refer to the beginning and ending
137 buffer positions of the considered element or object, ~:post-blank~,
138 which holds the number of blank lines, or white spaces, at its end
139 and ~:parent~ which refers to the element or object containing it.
141 Greater elements, elements and objects containing objects will have
142 ~:contents-begin~ and ~:contents-end~ properties to delimit
143 contents. Greater elements and elements accepting affiliated
144 keywords will also have a ~:post-affiliated~ property, referring to
145 the buffer position after any affiliated keyword, when applicable.
147 In addition to these properties, each element can optionally get
148 some more from affiliated keywords, namely: ~:attr_ascii~,
149 ~:attr_docbook~, ~:attr_html~, ~:attr_latex~, ~:attr_odt~,
150 ~:caption~, ~:header~, ~:name~, ~:plot~, and ~:results~.
152 At the lowest level, a ~:parent~ property is also attached to any
153 string, as a text property.
155 Other properties, specific to each element or object, are listed
162 - ~:info~ :: Information about function being called, as returned
163 by ~ob-babel-lob-get-info~ (string).
168 No specific property.
174 - ~:hiddenp~ :: Non-nil if the block is hidden (boolean).
180 - ~:duration~ :: Clock duration for a closed clock, or nil (string
182 - ~:status~ :: Status of current clock (symbol: ~closed~ or
184 - ~:value~ :: Timestamp associated to clock keyword (timestamp
191 - ~:value~ :: Contents (string).
197 - ~:value~ :: Comments, with pound signs (string).
203 - ~:value~ :: Comments, without block's boundaries (string).
204 - ~:hiddenp~ :: Non-nil if block is hidden (boolean).
210 - ~:value~ :: Full Sexp (string).
216 - ~:drawer-name~ :: Drawer's name (string).
217 - ~:hiddenp~ :: Non-nil if the drawer is hidden (boolean).
219 /Note relative to export:/ The idea behind drawers is that they are
220 transparent export-wise. By default, they should return their
227 - ~:arguments~ :: Block's parameters (string).
228 - ~:block-name~ :: Block's name (string).
229 - ~:drawer-name~ :: Drawer's name (string).
230 - ~:hiddenp~ :: Non-nil if the block is hidden (boolean).
236 - ~:ascii~ :: Entity's ASCII representation (string).
237 - ~:html~ :: Entity's HTML representation (string).
238 - ~:latex~ :: Entity's LaTeX representation (string).
239 - ~:latex-math-p~ :: Non-nil if entity's LaTeX representation
240 should be in math mode (boolean).
241 - ~:latin1~ :: Entity's Latin-1 encoding representation (string).
242 - ~:name~ :: Entity's name, without backslash nor brackets
244 - ~:use-brackets-p~ :: Non-nil if entity is written with optional
245 brackets in original buffer (boolean).
246 - ~:utf-8~ :: Entity's UTF-8 encoding representation (string).
252 - ~:hiddenp~ :: Non-nil if block is hidden (boolean).
253 - ~:label-fmt~ :: Format string used to write labels in current
254 block, if different from
255 ~org-coderef-label-format~ (string or nil).
256 - ~:language~ :: Language of the code in the block, if specified
258 - ~:number-lines~ :: Non-nil if code lines should be numbered.
259 A ~new~ value starts numbering from 1 wheareas ~continued~
260 resume numbering from previous numbered block (symbol: ~new~,
262 - ~:options~ :: Block's options located on the block's opening line
264 - ~:parameters~ :: Optional header arguments (string or nil).
265 - ~:preserve-indent~ :: Non-nil when indentation within the block
266 mustn't be modified upon export (boolean).
267 - ~:retain-labels~ :: Non-nil if labels should be kept visible upon
269 - ~:switches~ :: Optional switches for code block export (string or
271 - ~:use-labels~ :: Non-nil if links to labels contained in the
272 block should display the label instead of the
273 line number (boolean).
274 - ~:value~ :: Contents (string).
280 - ~:hiddenp~ :: Non-nil if block is hidden (boolean).
281 - ~:type~ :: Related back-end's name (string).
282 - ~:value~ :: Contents (string).
288 - ~:back-end~ :: Relative back-end's name (string).
289 - ~:value~ :: Export code (string).
295 - ~:value~ :: Contents, with colons (string).
297 ** Footnote Definition
301 - ~:label~ :: Label used for references (string).
303 ** Footnote Reference
307 - ~:inline-definition~ :: Footnote's definition, when inlined
308 (secondary string or nil).
309 - ~:label~ :: Footnote's label, if any (string or nil).
310 - ~:raw-definition~ :: Uninterpreted footnote's definition, when
311 inlined (string or nil).
312 - ~:type~ :: Determine whether reference has its definition inline,
313 or not (symbol: ~inline~, ~standard~).
319 In addition to the following list, any property specified in
320 a property drawer attached to the headline will be accessible as an
321 attribute (with underscores replaced with hyphens and a lowercase
322 name, i.e. ~:custom-id~).
324 - ~:archivedp~ :: Non-nil if the headline has an archive tag
326 - ~:closed~ :: Headline's CLOSED reference, if any (timestamp
328 - ~:commentedp~ :: Non-nil if the headline has a comment keyword
330 - ~:deadline~ :: Headline's DEADLINE reference, if any (timestamp
332 - ~:footnote-section-p~ :: Non-nil if the headline is a footnote
334 - ~:hiddenp~ :: Non-nil if the headline is hidden (boolean).
335 - ~:level~ :: Reduced level of the headline (integer).
336 - ~:pre-blank~ :: Number of blank lines between the headline and
337 the first non-blank line of its contents
339 - ~:priority~ :: Headline's priority, as a character (integer).
340 - ~:quotedp~ :: Non-nil if the headline contains a quote keyword
342 - ~:raw-value~ :: Raw headline's text, without the stars and the
344 - ~:scheduled~ :: Headline's SCHEDULED reference, if any (timestamp
346 - ~:tags~ :: Headline's tags, if any, without the archive
347 tag. (list of strings).
348 - ~:title~ :: Parsed headline's text, without the stars and the
349 tags (secondary string).
350 - ~:todo-keyword~ :: Headline's TODO keyword without quote and
351 comment strings, if any (string or nil).
352 - ~:todo-type~ :: Type of headline's TODO keyword, if any (symbol:
359 No specific property.
365 - ~:info~ :: Information about function called, as returned by
366 ~org-babel-lob-get-info~ (list).
368 /Note relative to export:/ Since Babel related blocks are expanded
369 before parsing, these can safely be ignored by back-ends.
375 - ~:language~ :: Language of the code in the block (string).
376 - ~:parameters~ :: Optional header arguments (string or nil).
377 - ~:value~ :: Source code (string).
383 In addition to the following list, any property specified in
384 a property drawer attached to the headline will be accessible as an
385 attribute (with underscores replaced with hyphens and a lowercase
386 name, i.e. ~:custom-id~).
388 - ~:closed~ :: Inlinetask's CLOSED reference, if any (timestamp
390 - ~:deadline~ :: Inlinetask's DEADLINE reference, if any (timestamp
392 - ~:hiddenp~ :: Non-nil if the headline is hidden (boolean).
393 - ~:level~ :: Reduced level of the inlinetask (integer).
394 - ~:priority~ :: Headline's priority, as a character (integer).
395 - ~:raw-value~ :: Raw inlinetask's text, without the stars and the
397 - ~:scheduled~ :: Inlinetask's SCHEDULED reference, if any
398 (timestamp object or nil).
399 - ~:tags~ :: Inlinetask's tags, if any (list of strings).
400 - ~:title~ :: Parsed inlinetask's text, without the stars and the
401 tags (secondary string).
402 - ~:todo-keyword~ :: Inlinetask's TODO keyword, if any (string or
404 - ~:todo-type~ :: Type of inlinetask's TODO keyword, if any
405 (symbol: ~done~, ~todo~).
411 No specific property.
417 - ~:bullet~ :: Item's bullet (string).
418 - ~:checkbox~ :: Item's check-box, if any (symbol: ~on~, ~off~,
420 - ~:counter~ :: Item's counter, if any. Literal counters become
422 - ~:raw-tag~ :: Uninterpreted item's tag, if any (string or nil).
423 - ~:tag~ :: Parsed item's tag, if any (secondary string or nil).
424 - ~:hiddenp~ :: Non-nil if item is hidden (boolean).
425 - ~:structure~ :: Full list's structure, as returned by
426 ~org-list-struct~ (alist).
432 - ~:key~ :: Keyword's name (string).
433 - ~:value~ :: Keyword's value (string).
435 /Note relative to export:/ Each back-end should, as far as
436 possible, support a number of common keywords. These include:
438 - Back-end relative keyword (i.e. "LATEX" for =e-latex=), which
439 should always return its value as-is.
441 - "TARGET" keyword, which should always return a nil value.
443 - "TOC" keyword. It accepts four common values: "headlines",
444 "tables", "figures", "listings". Also, "headlines" value can
445 have an optional numeric argument to specify depth of the
448 See [[#collect-headlines][~org-export-collect-headlines~]], [[#collect-tables][~org-export-collect-tables~]],
449 [[#collect-figures][~org-export-collect-figures~]] and [[#collect-listings][~org-export-collect-listings~]].
457 - ~:begin~ :: Buffer position at first affiliated keyword or at the
458 beginning of the first line of environment (integer).
459 - ~:end~ :: Buffer position at the first non-blank line after last
460 line of the environment, or buffer's end (integer).
461 - ~:post-blank~ :: Number of blank lines between last environment's
462 line and next non-blank line or buffer's end
464 - ~:value~ :: LaTeX code (string).
470 - ~:value~ :: LaTeX code (string).
476 No specific property.
482 - ~:application~ :: Name of application requested to open the link
483 in Emacs (string or nil). It only applies to
485 - ~:path~ :: Identifier for link's destination. It is usually the
486 link part with type, if specified, removed (string).
487 - ~:raw-link~ :: Uninterpreted link part (string).
488 - ~:search-option~ :: Additional information for file location
489 (string or nil). It only applies to "file" type links.
490 - ~:type~ :: Link's type. Possible types (string) are:
491 - ~coderef~ :: Line in some source code,
492 - ~custom-id~ :: Specific headline's custom-id,
493 - ~file~ :: External file,
494 - ~fuzzy~ :: Target, target keyword, a named element or an
495 headline in the current parse tree,
496 - ~id~ :: Specific headline's id,
497 - ~radio~ :: Radio-target.
498 It can also be any ~org-link-types~ element.
501 /Notes relative to export:/
503 - A fuzzy link leading to a target keyword should be ignored during
504 export: it's an invisible target.
506 - A fuzzy link with no description should display the
507 cross-reference number of its target. This number can be:
509 - If link's destination is a target object within a footnote, it
510 will be footnote's number.
512 - If link's destination is a target object in a list, it will be
515 - If link leads to a named element, it will be the sequence number
516 of that element among named elements of the same type.
518 - Otherwise, it will be the number of the headline containing
521 See [[#get-ordinal][~org-export-get-ordinal~]] function.
527 - ~:args~ :: Arguments passed to the macro (list of strings).
528 - ~:key~ :: Macro's name (string).
529 - ~:value~ :: Replacement text (string).
531 /Note relative to export:/ Macro expansion takes place before
532 buffer parsing. As such, export back-ends don't have to handle:
533 they'll never see them.
537 Element containing objects.
539 No specific property.
545 - ~:structure~ :: Full list's structure, as returned by
546 ~org-list-struct~ (alist).
547 - ~:type~ :: List's type (symbol: ~descriptive~, ~ordered~,
554 - ~:closed~ :: Timestamp associated to closed keyword, if any
555 (timestamp object or nil).
556 - ~:deadline~ :: Timestamp associated to deadline keyword, if any
557 (timestamp object or nil).
558 - ~:scheduled~ :: Timestamp associated to scheduled keyword, if any
559 (timestamp object or nil).
565 - ~:hiddenp~ :: Non-nil if drawer is hidden (boolean).
566 - ~:properties~ :: Properties defined in the drawer (alist).
572 - ~:hiddenp~ :: Non-nil if block is hidden (boolean).
578 - ~:value~ :: Quoted text (string).
584 - ~:raw-value~ :: Uninterpreted contents (string).
590 No specific property.
596 - ~:hiddenp~ :: Non-nil if block is hidden (boolean).
597 - ~:type~ :: Block's name (string).
603 - ~:hiddenp~ :: Non-nil if block is hidden (boolean).
604 - ~:label-fmt~ :: Format string used to write labels in current
605 block, if different from
606 ~org-coderef-label-format~ (string or nil).
607 - ~:language~ :: Language of the code in the block, if specified
609 - ~:number-lines~ :: Non-nil if code lines should be numbered.
610 A ~new~ value starts numbering from 1 wheareas ~continued~
611 resume numbering from previous numbered block (symbol: ~new~,
613 - ~:parameters~ :: Optional header arguments (string or nil).
614 - ~:preserve-indent~ :: Non-nil when indentation within the block
615 mustn't be modified upon export (boolean).
616 - ~:retain-labels~ :: Non-nil if labels should be kept visible upon
618 - ~:switches~ :: Optional switches for code block export (string or
620 - ~:use-labels~ :: Non-nil if links to labels contained in the
621 block should display the label instead of the
622 line number (boolean).
623 - ~:value~ :: Source code (string).
629 - ~:value~ :: Full cookie (string).
635 No specific property.
641 - ~:use-brackets-p~ :: Non-nil if contents are enclosed in curly
648 - ~:use-brackets-p~ :: Non-nil if contents are enclosed in curly
655 - ~:tblfm~ :: Formulas associated to the table, if any (string or
657 - ~:type~ :: Table's origin (symbol: ~table.el~, ~org~).
658 - ~:value~ :: Raw ~table.el~ table or nil (string or nil).
664 No specific property.
668 Element containing objects.
670 - ~:type~ :: Row's type (symbol: ~standard~, ~rule~).
676 - ~:value~ :: Target's ID (string).
679 Notes relatives to export:
681 - Target should become an anchor, if back-end permits it.
682 - Target's ID shouldn't be visible on export.
688 - ~:day-end~ :: Day part from timestamp end. If no ending date is
689 defined, it defaults to start day part (integer).
690 - ~:day-start~ :: Day part from timestamp start (integer).
691 - ~:hour-start~ :: Hour part from timestamp end. If no ending date
692 is defined, it defaults to start hour part, if
693 any (integer or nil).
694 - ~:hour-start~ :: Hour part from timestamp start, if specified
696 - ~:minute-start~ :: Minute part from timestamp end. If no ending
697 date is defined, it defaults to start minute part, if any
699 - ~:minute-start~ :: Minute part from timestamp start, if specified
701 - ~:month-end~ :: Month part from timestamp end. If no ending date
702 is defined, it defaults to start month part
704 - ~:month-start~ :: Month part from timestamp start (integer).
705 - ~:raw-value~ :: Raw timestamp (string).
706 - ~:repeater-type~ :: Type of repeater, if any (symbol: ~catch-up~,
707 ~restart~, ~cumulate~ or nil)
708 - ~:repeater-unit~ :: Unit of shift, if a repeater is defined
709 (symbol: ~year~, ~month~, ~week~, ~day~, ~hour~ or nil).
710 - ~:repeater-value~ :: Value of shift, if a repeater is defined
712 - ~:type~ :: Type of timestamp (symbol: ~active~, ~active-range~,
713 ~diary~, ~inactive~, ~inactive-range~).
714 - ~:year-end~ :: Year part from timestamp end. If no ending date
715 is defined, it defaults to start year part
717 - ~:year-start~ :: Year part from timestamp start (integer).
723 No specific property.
729 - ~:value~ :: Contents (string).
733 Element containing objects.
735 - ~:hiddenp~ :: Non-nil if block is hidden (boolean).
737 * The Communication Channel
739 :CUSTOM_ID: communication
742 This is the full list of properties available during transcode
743 process, with their category (~option~ or ~tree~) and their value
755 Current back-end used for transcoding.
762 String to write as creation information.
769 String to use as date.
776 Description text for the current data.
790 Tags for exclusion of sub-trees from export process.
793 - type :: list of strings
797 Hash table used to memoize results from [[#data][~org-export-data~]].
804 List of global tags for buffer. Used by [[#get-tags][~org-export-get-tags~]] to
805 get tags with inheritance.
807 - type :: list of strings
809 ** ~:footnote-definition-alist~
811 /Alist/ between footnote labels and their definition, as parsed
812 data. Only non-inline footnotes are represented in this /alist/.
813 Also, every definition isn't guaranteed to be referenced in the
814 parse tree. The purpose of this property is to preserve
815 definitions from oblivion – i.e. when the parse tree comes from
816 a part of the original buffer –, it isn't meant for direct use in
817 a back-end. To retrieve a definition relative to a reference, use
818 [[#get-footnote-definition][~org-export-get-footnote-definition~]] instead.
821 - type :: alist (STRING . LIST)
823 ** ~:headline-levels~
825 :CUSTOM_ID: headline-levels
828 Maximum level being exported as an headline. Comparison is done
829 with the relative level of headlines in the parse tree, not
830 necessarily with their actual level.
835 ** ~:headline-numbering~
837 Alist between headlines' beginning position and their numbering, as
838 a list of numbers – cf. [[#get-headline-number][~org-export-get-headline-number~]].
841 - type :: alist (INTEGER . LIST)
843 ** ~:headline-offset~
845 Difference between relative and real level of headlines in the
846 parse tree. For example, a value of -1 means a level 2 headline
847 should be considered as level 1 —
848 cf. [[#get-relative-level][~org-export-get-relative-level~]].
855 List of elements and objects that will be unconditionally ignored
859 - type :: list of elements
863 Alist between ID strings and destination file's path, relative to
867 - type :: alist (STRING . STRING)
871 Full path to input file, if any.
874 - type :: string or nil
878 List of keywords attached to data.
885 Default language used for translations.
892 Whole parse tree, available at any time during transcoding.
895 - type :: list (as returned by ~org-element-parse-buffer~)
897 ** ~:preserve-breaks~
899 Non-nil means transcoding should preserve all line breaks.
902 - type :: symbol (nil, t)
904 ** ~:section-numbers~
906 Non-nil means transcoding should add section numbers to headlines.
909 - type :: symbol (nil, t)
913 :CUSTOM_ID: select-tags
916 List of tags enforcing inclusion of sub-trees in transcoding. When
917 such a tag is present, sub-trees without it are /de facto/ excluded
918 from the process. See [[#use-select-tags][~:use-select-tags~]].
921 - type :: list of strings
925 List of targets raw names encountered in the parse tree. This is
926 used to partly resolve "fuzzy" links —
927 cf. [[#resolve-fuzzy-link][~org-export-resolve-fuzzy-link~]].
930 - type :: list of strings
932 ** ~:time-stamp-file~
934 Non-nil means transcoding should insert a time stamp in the output.
937 - type :: symbol (nil, t)
939 ** ~:translate-alist~
941 Alist between element and object types and transcoding functions
942 relative to the current back-end. Special keys ~template~ and
943 ~plain-text~ are also possible.
946 - type :: alist (SYMBOL . FUNCTION)
948 ** ~:use-select-tags~
950 :CUSTOM_ID: use-select-tags
953 When non-nil, a select tags has been found in the parse tree.
954 Thus, any headline without one will be filtered out. See
955 [[#select-tags][~:select-tags~]].
958 - type :: interger or nil
960 ** ~:with-archived-trees~
962 Non-nil when archived sub-trees should also be transcoded. If it
963 is set to the ~headline~ symbol, only the archived headline's name
967 - type :: symbol (nil, t, ~headline~)
971 Non-nil means author's name should be included in the output.
974 - type :: symbol (nil, t)
978 Non-nil means clock keywords should be exported.
981 - type :: symbol (nil, t)
985 Non-nil means a creation sentence should be inserted at the end of
986 the transcoded string. If the value is ~comment~, it should be
990 - type :: symbol (~comment~, nil, t)
994 Non nil means output should contain a date.
997 - type :: symbol (nil, t)
1001 Non-nil means drawers should be exported. If its value is a list
1002 of names, only drawers with such names will be transcoded.
1004 - category :: option
1005 - type :: symbol (nil, t) or list of strings
1009 Non-nil means output should contain author's email.
1011 - category :: option
1012 - type :: symbol (nil, t)
1014 ** ~:with-emphasize~
1016 Non-nil means emphasized text should be interpreted.
1018 - category :: option
1019 - type :: symbol (nil, t)
1021 ** ~:with-fixed-width~
1023 Non-nil if transcoder should interpret strings starting with
1024 a colon as a fixed-with — verbatim — area.
1026 - category :: option
1027 - type :: symbol (nil, t)
1029 ** ~:with-footnotes~
1031 Non-nil if transcoder should interpret footnotes.
1033 - category :: option
1034 - type :: symbol (nil, t)
1036 ** ~:with-plannings~
1038 Non-nil means transcoding should include planning info.
1040 - category :: option
1041 - type :: symbol (nil, t)
1045 Non-nil means transcoding should include priority cookies.
1047 - category :: option
1048 - type :: symbol (nil, t)
1050 ** ~:with-smart-quotes~
1052 Non-nil means activate smart quotes during export.
1054 - category :: option
1055 - type :: symbol (nil ,t)
1057 ** ~:with-special-strings~
1059 Non-nil means transcoding should interpret special strings in plain
1062 - category :: option
1063 - type :: symbol (nil, t)
1065 ** ~:with-sub-superscript~
1067 Non-nil means transcoding should interpret subscript and
1068 superscript. With a value of ~{}~, only interpret those using
1071 - category :: option
1072 - type :: symbol (nil, ~{}~, t)
1076 Non-nil means transcoding should interpret tables.
1078 - category :: option
1079 - type :: symbol (nil, t)
1083 Non-nil means transcoding should keep tags in headlines.
1084 A ~not-in-toc~ value will remove them from the table of contents,
1085 if any, nonetheless.
1087 - category :: option
1088 - type :: symbol (nil, t, ~not-in-toc~)
1092 Non-nil means transcoding should include headlines with a TODO
1093 keyword. A ~todo~ value will only include headlines with a TODO
1094 type keyword while a ~done~ value will do the contrary. If a list
1095 of strings is provided, only tasks with keywords belonging to that
1098 - category :: option
1099 - type :: symbol (t, ~todo~, ~done~, nil) or list of strings
1101 ** ~:with-timestamps~
1103 Non-nil means transcoding should include time stamps. Special
1104 value ~active~ (resp. ~inactive~) ask to export only active
1105 (resp. inactive) timestamps. Otherwise, completely remove them.
1107 - category :: option
1108 - type :: symbol: (~active~, ~inactive~, t, nil)
1112 Non-nil means that a table of contents has to be added to the
1113 output. An integer value limits its depth.
1115 - category :: option
1116 - type :: symbol (nil, t or integer)
1118 ** ~:with-todo-keywords~
1120 Non-nil means transcoding should include TODO keywords.
1122 - category :: option
1123 - type :: symbol (nil, t)
1127 :CUSTOM_ID: filter-system
1130 Filters sets are lists of functions. They allow to pre-process
1131 parse tree before export and to post-process output of each
1132 transcoded object or element.
1134 Each function in a set must accept three arguments: a string (or
1135 a parse tree as a special case), a symbol representing the current
1136 back-end, and the communication channel, as a plist.
1138 From the developer side, filters sets can be installed using
1139 ~:filters-alist~ keyword while defining the back-end with
1140 ~org-export-define-derived-backend~. Each association has a key
1141 among the following symbols and a function or a list of functions as
1144 - ~:filter-babel-call~
1146 - ~:filter-center-block~
1150 - ~:filter-comment-block~
1152 - ~:filter-dynamic-block~
1154 - ~:filter-example-block~
1155 - ~:filter-export-block~
1156 - ~:filter-export-snippet~
1157 - ~:filter-final-output~
1158 - ~:filter-fixed-width~
1159 - ~:filter-footnote-definition~
1160 - ~:filter-footnote-reference~
1161 - ~:filter-headline~
1162 - ~:filter-horizontal-rule~
1163 - ~:filter-inline-babel-call~
1164 - ~:filter-inline-src-block~
1165 - ~:filter-inlinetask~
1169 - ~:filter-latex-environment~
1170 - ~:filter-latex-fragment~
1171 - ~:filter-line-break~
1174 - ~:filter-paragraph~
1175 - ~:filter-parse-tree~
1176 - ~:filter-plain-list~
1177 - ~:filter-plain-text~
1178 - ~:filter-planning~
1179 - ~:filter-property-drawer~
1180 - ~:filter-quote-block~
1181 - ~:filter-quote-section~
1182 - ~:filter-radio-target~
1184 - ~:filter-special-block~
1185 - ~:filter-src-block~
1186 - ~:filter-strike-through~
1187 - ~:filter-statistics-cookie~
1188 - ~:filter-subscript~
1189 - ~:filter-superscript~
1191 - ~:filter-table-cell~
1192 - ~:filter-table-row~
1194 - ~:filter-timestamp~
1195 - ~:filter-underline~
1196 - ~:filter-verbatim~
1197 - ~:filter-verse-block~
1200 For example, =e-ascii= back-end implements a filter that makes sure
1201 headlines end with two blank lines:
1203 #+BEGIN_SRC emacs-lisp
1204 (org-export-define-backend e-ascii
1206 :filters-alist ((:filter-headline . org-e-ascii-filter-headline-blank-lines)
1207 (:filter-section . org-e-ascii-filter-headline-blank-lines)))
1209 (defun org-e-ascii-filter-section-blank-lines (headline back-end info)
1210 "Filter controlling number of blank lines after a section."
1211 (if (not (eq back-end 'e-ascii)) headline
1212 (let ((blanks (make-string 2 ?\n)))
1213 (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" blanks headline))))
1221 A whole set of tools is available to help build new exporters. Any
1222 function general enough to have its use across a couple of back-ends
1225 Many of them are high-level access to properties from the
1226 communication channel. As such, they should be preferred to
1227 straight access to communication channel, when possible.
1229 ** ~org-element-adopt-element~
1231 :CUSTOM_ID: adopt-element
1234 Add an element to the contents of another element.
1236 See also: [[#set-element][~org-element-set-element~]]
1238 ** ~org-element-set-element~
1240 :CUSTOM_ID: set-element
1243 Replace an element with another in the parse tree.
1245 See also: [[#adopt-element][~org-element-adopt-element~]].
1247 ** ~org-export-activate-smart-quotes~
1249 :CUSTOM_ID: activate-smart-quotes
1252 Transform quotes and apostrophes into their "smart" counterpart in
1255 It should be used after a check against ~:with-smart-quotes~ value
1256 in communication channel.
1258 Since this function needs the original string, it may be useful to
1259 apply others transformations (i.e. characters protection) on a copy
1260 of that string and provide the pristine original string as the
1263 For example, in ~e-html~ back-end, it is necessary to protect "<",
1264 ">" and "&" characters before calling this function. Here's an
1265 excerpt of the ~plain-text~ transcoder:
1267 #+BEGIN_SRC emacs-lisp
1268 (let ((output text))
1269 ;; Protect following characters: <, >, &.
1270 (setq output (org-e-html-encode-plain-text output))
1271 ;; Handle smart quotes. Be sure to provide original string since
1272 ;; OUTPUT may have been modified.
1273 (when (plist-get info :with-smart-quotes)
1274 (setq output (org-export-activate-smart-quotes output :html info text)))
1280 ** ~org-export-collect-figures~
1282 :CUSTOM_ID: collect-figures
1285 Return a list of all exportable figures in parse tree.
1287 Used to build a table of figures.
1289 See also: [[#collect-headlines][~org-export-collect-headlines~]],
1290 [[#collect-tables][~org-export-collect-tables~]], [[#collect-listings][~org-export-collect-listings~]].
1292 ** ~org-export-collect-footnote-definitions~
1294 :CUSTOM_ID: collect-footnote-definitions
1297 List actually used footnotes definitions in order to add footnote
1298 listings throughout the transcoded data.
1300 Feed it with the whole parse tree to get the full footnote listing.
1301 Feed it with the current headline to get partial footnote listing
1302 relative to that headline.
1304 Number, label, if any, and definition are provided.
1306 See also: [[#footnote-first-reference-p][~org-export-footnote-first-reference-p~]],
1307 [[#get-footnote-definition][~org-export-get-footnote-definition~]],
1308 [[#get-footnote-number][~org-export-get-footnote-number~]].
1310 ** ~org-export-collect-headlines~
1312 :CUSTOM_ID: collect-headlines
1315 Return a list of all exportable headlines, possibly limited to
1318 Used to build a table of contents.
1320 See also: [[#collect-tables][~org-export-collect-tables~]],
1321 [[#collect-figures][~org-export-collect-figures~]], [[#collect-listings][~org-export-collect-listings~]].
1323 ** ~org-export-collect-listings~
1325 :CUSTOM_ID: collect-listings
1328 Return a list of all exportable source blocks with a caption or
1329 a name in parse tree.
1331 Used to build a table of listings.
1333 See also: [[#collect-headlines][~org-export-collect-headlines~]],
1334 [[#collect-tables][~org-export-collect-tables~]], [[#collect-figures][~org-export-collect-figures~]].
1335 ** ~org-export-collect-tables~
1337 :CUSTOM_ID: collect-tables
1340 Return a list of all exportable tables with a caption or a name in
1343 Used to build a table of tables.
1345 See also: [[#collect-headlines][~org-export-collect-headlines~]],
1346 [[#collect-figures][~org-export-collect-figures~]], [[#collect-listings][~org-export-collect-listings~]].
1348 ** ~org-export-data~
1353 Transcode a given element, object, secondary string or string using
1356 It is used primarily to transcode secondary strings, like ~:title~.
1357 For example =e-beamer= back-end uses the following:
1359 #+BEGIN_SRC emacs-lisp
1360 (defun org-e-beamer-template (contents info)
1361 (let ((title (org-export-data (plist-get info :title) info)))
1365 ** ~org-export-first-sibling-p~
1367 :CUSTOM_ID: first-sibling-p
1370 Non-nil if an headline is the first of its siblings.
1372 Used to know when to start a list if headline's relative level is
1373 below the one specified in [[#headline-levels][~:headline-levels~]] property.
1375 See also: [[#get-relative-level][~org-export-get-relative-level~]],
1376 [[#number-to-roman][~org-export-number-to-roman~]], [[#last-sibling-p][~org-export-last-sibling-p~]].
1378 ** ~org-export-footnote-first-reference-p~
1380 :CUSTOM_ID: footnote-first-reference-p
1383 Non-nil when a footnote reference if the first reference relative
1386 Used when a back-end needs to attach the footnote definition only
1387 to the first occurrence of the corresponding label.
1389 See also: [[#collect-footnote-definitions][~org-export-collect-footnote-definitions~]],
1390 [[#get-footnote-definition][~org-export-get-footnote-definition~]],
1391 [[#get-footnote-number][~org-export-get-footnote-number~]].
1393 ** ~org-export-format-code-default~
1395 :CUSTOM_ID: format-code-default
1398 Return contents of a =src-block= or =example-block= element in
1399 a format suited for raw text or verbatim output. More
1400 specifically, it takes care of line numbering and labels
1401 integration depending of element's switches, but no formatting is
1402 otherwise applied to source code.
1404 See also: [[#format-code][~org-export-format-code~]], [[#unravel-code][~org-export-unravel-code~]].
1406 ** ~org-export-format-code~
1408 :CUSTOM_ID: format-code
1411 Helper function to format source code. It applies a given function
1412 on each line of the code, passing current line number and
1413 associated code reference label, if any, as arguments.
1415 See also: [[#format-code-default][~org-export-format-code-default~]], [[#get-loc][~org-export-get-loc~]],
1416 [[#unravel-code][~org-export-unravel-code~]].
1418 ** ~org-export-format-timestamp~
1420 :CUSTOM_ID: format-timestamp
1423 Format a timestamp object with an arbitrary format string.
1425 See also: [[#timestamp-has-time-p][~org-export-timestamp-has-time-p~]].
1427 ** ~org-export-get-caption~
1429 :CUSTOM_ID: get-caption
1432 Return the caption of a given element, as a secondary string. With
1433 an optional argument, return the short caption instead.
1435 As an example, =e-ascii= back-end, when creating a list of
1436 listings, uses the following:
1438 #+BEGIN_SRC emacs-lisp
1439 (defun org-e-ascii--list-listings (keyword info)
1440 (let ((title (org-e-ascii--translate "List of Listings" info)))
1446 ;; Use short name in priority, if available.
1447 (let ((caption (or (org-export-get-caption src-block t)
1448 (org-export-get-caption src-block))))
1449 (org-export-data caption info)
1451 (org-export-collect-listings info) "\n"))))
1454 See also: [[#read-attribute][~org-export-read-attribute~]].
1456 ** ~org-export-get-category~
1458 :CUSTOM_ID: get-category
1461 Return category associated to a given element or object. Unlike to
1462 the ~:category~ property from headlines and inlinetasks, this
1463 function handles inheritance and ~CATEGORY~ keywords. Therefore,
1464 it should be the preferred way to retrieve a category during
1467 See also: [[#get-node-property][~org-export-get-node-property~]].
1469 ** ~org-export-get-coderef-format~
1471 :CUSTOM_ID: get-coderef-format
1474 Return an appropriate format string for code reference links.
1476 See also: [[#resolve-coderef][~org-export-resolve-coderef~]].
1478 ** ~org-export-get-footnote-definition~
1480 :CUSTOM_ID: get-footnote-definition
1483 Retrieve the footnote definition relative to a given footnote
1486 If the footnote definition in inline, it is returned as a secondary
1487 string. Otherwise, it is full Org data.
1489 See also: [[#collect-footnote-definitions][~org-export-collect-footnote-definitions~]],
1490 [[#footnote-first-reference-p][~org-export-footnote-first-reference-p~]],
1491 [[#get-footnote-number][~org-export-get-footnote-number~]].
1493 ** ~org-export-get-footnote-number~
1495 :CUSTOM_ID: get-footnote-number
1498 Return the ordinal attached to a footnote reference or definition.
1500 See also: [[#collect-footnote-definitions][~org-export-collect-footnote-definitions~]],
1501 [[#footnote-first-reference-p][~org-export-footnote-first-reference-p~]],
1502 [[#get-footnote-definition][~org-export-get-footnote-definition~]].
1504 ** ~org-export-get-genealogy~
1506 :CUSTOM_ID: get-genealogy
1509 Return flat list of current object or element's parents from
1510 closest to farthest, along with their contents.
1512 See also: [[#get-next-element][~org-export-get-next-element~]], [[#get-parent][~org-export-get-parent~]],
1513 [[#get-parent-headline][~org-export-get-parent-headline~]],
1514 [[#get-parent-paragraph][~org-export-get-parent-paragraph~]],
1515 [[#get-previous-element][~org-export-get-previous-element~]].
1517 ** ~org-export-get-headline-number~
1519 :CUSTOM_ID: get-headline-number
1522 Return the section number of an headline, as a list of integers.
1524 See also: [[#headline-numbered-p][~org-export-headline-numbered-p~]],
1525 [[#number-to-roman][~org-export-number-to-roman~]].
1527 ** ~org-export-get-loc~
1532 Return count of accumulated lines of code from previous
1533 line-numbered =example-block= and =src-block= elements, according
1534 to current element's switches.
1536 In other words, the first line of code in the current block is
1537 supposed to be numbered as the returned value plus one, assuming
1538 its ~:number-lines~ properties is non-nil.
1540 See also: [[#format-code][~org-export-format-code~]], [[#unravel-code][~org-export-unravel-code~]].
1542 ** ~org-export-get-next-element~
1544 :CUSTOM_ID: get-next-element
1547 Return element (resp. object or string) after an element
1548 (resp. object), or nil.
1550 See also: [[#get-genealogy][~org-export-get-genealogy~]], [[#get-parent][~org-export-get-parent~]],
1551 [[#get-parent-headline][~org-export-get-parent-headline~]],
1552 [[#get-parent-paragraph][~org-export-get-parent-paragraph~]],
1553 [[#get-previous-element][~org-export-get-previous-element~]].
1555 ** ~org-export-get-node-property~
1557 :CUSTOM_ID: get-node-property
1560 Return the node property associated to an element or object. If
1561 the element is an headline, this is equivalent to reading the
1562 property with ~org-element-property~.
1564 Though, this function can optionally handle inheritance.
1566 See also: [[#get-category][~org-export-get-category~]].
1568 ** ~org-export-get-ordinal~
1570 :CUSTOM_ID: get-ordinal
1573 Associate a sequence number to any object or element. It is meant
1574 to be used to build captions.
1576 Also, it could be applied on a fuzzy link's destination, since such
1577 links are expected to be replaced with the sequence number of their
1578 destination, provided they have no description.
1580 Taken from =e-ascii= back-end, the following example shows how
1581 fuzzy links could be handled :
1583 #+BEGIN_SRC emacs-lisp :exports code
1584 (let ((type (org-element-property :type link)))
1587 ;; Do not apply a special syntax on fuzzy links pointing to targets.
1588 ((string= type "fuzzy")
1589 (let ((destination (org-export-resolve-fuzzy-link link info)))
1590 ;; Ignore invisible "#+TARGET: path".
1591 (unless (eq (org-element-type destination) 'keyword)
1592 ;; If link has a description, use it.
1593 (if (org-string-nw-p desc) desc
1595 (let ((number (org-export-get-ordinal destination info)))
1597 (if (atom number) (number-to-string number)
1598 (mapconcat 'number-to-string number ".")))))))))
1602 See also : [[#resolve-fuzzy-link][~org-export-resolve-fuzzy-link~]]
1604 ** ~org-export-get-parent-element~
1606 :CUSTOM_ID: get-parent-paragraph
1609 Return the first element containing provided object, if any.
1610 Return nil otherwise.
1612 See also: [[#get-genealogy][~org-export-get-genealogy~]], [[#get-parent][~org-export-get-parent~]],
1613 [[#get-parent-headline][~org-export-get-parent-headline~]],
1614 [[#get-previous-element][~org-export-get-previous-element~]], [[#get-next-element][~org-export-get-next-element~]].
1616 ** ~org-export-get-parent-headline~
1618 :CUSTOM_ID: get-parent-headline
1621 Return the headline containing provided element or object, if any.
1622 Return nil otherwise.
1624 See also: [[#get-genealogy][~org-export-get-genealogy~]],
1625 [[#get-next-element][~org-export-get-next-element~]], [[#get-parent][~org-export-get-parent~]],
1626 [[#get-parent-paragraph][~org-export-get-parent-paragraph~]],
1627 [[#get-previous-element][~org-export-get-previous-element~]].
1629 ** ~org-export-get-parent~
1631 :CUSTOM_ID: get-parent
1634 Return closest element containing current element or object, if
1635 any. Return nil otherwise.
1637 See also: [[#get-genealogy][~org-export-get-genealogy~]],
1638 [[#get-next-element][~org-export-get-next-element~]], [[#get-parent-paragraph][~org-export-get-parent-paragraph~]],
1639 [[#get-parent-headline][~org-export-get-parent-headline~]],
1640 [[#get-previous-element][~org-export-get-previous-element~]].
1642 ** ~org-export-get-previous-element~
1644 :CUSTOM_ID: get-previous-element
1647 Return element (resp. object or string) before an element
1648 (resp. object), or nil.
1650 See also: [[#get-genealogy][~org-export-get-genealogy~]],
1651 [[#get-next-element][~org-export-get-next-element~]], [[#get-parent][~org-export-get-parent~]],
1652 [[#get-parent-headline][~org-export-get-parent-headline~]],
1653 [[#get-parent-paragraph][~org-export-get-parent-paragraph~]].
1655 ** ~org-export-get-relative-level~
1657 :CUSTOM_ID: get-relative-level
1660 Return headline level, relatively to the lower headline level in
1661 the parsed tree. It is meant to be used over ~:level~ headline's
1664 See also:[[#first-sibling-p][~org-export-first-sibling-p~]],
1665 [[#get-headline-number][~org-export-get-headline-number~]],[[#headline-numbered-p][~org-export-headline-numbered-p~]],
1666 [[#last-sibling-p][~org-export-last-sibling-p~]].
1668 ** ~org-export-get-table-cell-at~
1670 :CUSTOM_ID: get-table-cell-at
1673 Return exportable cell object at a given position, or nil. Hence,
1674 position ~(0 . 0)~ will always point to the first exportable cell
1677 See also: [[#table-cell-address][~org-export-table-cell-address~]],
1678 [[#table-dimensions][~org-export-table-dimensions~]].
1680 ** ~org-export-get-tags~
1682 :CUSTOM_ID: get-tags
1685 Return list of exportable tags attached to a given headline or
1686 inlinetask element. With an optional argument, tags are inherited
1687 from parent headlines and ~FILETAGS~ keywords.
1689 In particular, it removes select tags and exclude tags. The
1690 function also accepts an arbitrary list of tags for further
1693 For example, =e-latex= back-end uses the following snippet in the
1694 inlinetask transcode function.
1696 #+BEGIN_SRC emacs-lisp
1697 (let ((title (org-export-data (org-element-property :title inlinetask) info))
1698 (todo (and (plist-get info :with-todo-keywords)
1699 (let ((todo (org-element-property :todo-keyword inlinetask)))
1700 (and todo (org-export-data todo info)))))
1701 (todo-type (org-element-property :todo-type inlinetask))
1702 (tags (and (plist-get info :with-tags)
1703 (org-export-get-tags inlinetask info)))
1704 (priority (and (plist-get info :with-priority)
1705 (org-element-property :priority inlinetask))))
1709 ** ~org-export-headline-numbered-p~
1711 :CUSTOM_ID: headline-numbered-p
1714 Non nil when a given headline should be numbered.
1716 See also: [[#get-headline-number][~org-export-get-headline-number~]],
1717 [[#get-relative-level][~org-export-get-relative-level~]].
1719 ** ~org-export-inline-image-p~
1721 :CUSTOM_ID: inline-image-p
1724 Non-nil when the link provided should be considered as an inline
1725 image. Note that it always return nil when the link has
1728 It accepts an optional set of rules in order to tweak the
1729 definition of an inline image, which is, by default, any link
1730 targetting a local file whose extension is either "png", "jpeg",
1731 "jpg", "gif", "tiff", "tif", "xbm", "xpm", "pbm", "pgm" or "ppm".
1733 A set of rules consists in an alist whose key is a type of link, as
1734 a string, and whose value is a regexp matching link's path. As an
1735 example, =e-html= back-end uses the following rules:
1737 #+BEGIN_SRC emacs-lisp
1738 '(("file" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'")
1739 ("http" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'")
1740 ("https" . "\\.\\(jpeg\\|jpg\\|png\\|gif\\|svg\\)\\'"))
1743 See also: [[#solidify-link-text][~org-export-solidify-link-text~]],
1744 [[#get-coderef-format][~org-export-get-coderef-format~]], [[#resolve-fuzzy-link][~org-export-resolve-fuzzy-link~]].
1746 ** ~org-export-last-sibling-p~
1748 :CUSTOM_ID: last-sibling-p
1751 Non-nil if an headline is the last of its siblings.
1753 Used to know when to close a list if headline's relative level is
1754 below the one specified in [[#headline-levels][~:headline-levels~]] property.
1756 See also: [[#get-relative-level][~org-export-get-relative-level~]],
1757 [[#number-to-roman][~org-export-number-to-roman~]], [[#first-sibling-p][~org-export-first-sibling-p~]].
1759 ** ~org-export-number-to-roman~
1761 :CUSTOM_ID: number-to-roman
1764 Convert numbers to roman numbers. It can be used to provide roman
1765 numbering for headlines and numbered lists.
1767 See also: [[#get-headline-number][~org-export-get-headline-number~]].
1769 ** ~org-export-read-attribute~
1771 :CUSTOM_ID: read-attribute
1774 Read a property from a given element as a plist. It can be used to
1775 normalize affiliated keywords' syntax. For example, the following
1776 affiliated keywords:
1779 ,#+ATTR_HTML: :width 10 :height 5
1780 ,#+ATTR_HTML: :file "filename.ext"
1783 would be returned as:
1785 #+BEGIN_SRC emacs-lisp
1786 '(:width 10 :height 5 :file "filename.ext")
1789 See also: [[#get-caption][~org-export-get-caption~]].
1791 ** ~org-export-resolve-coderef~
1793 :CUSTOM_ID: resolve-coderef
1796 Search for a code reference within ~src-block~ and ~example-block~
1797 elements. Return corresponding --possibly accumulated-- line
1798 number, or reference itself, depending on container's switches.
1800 See also : [[#get-coderef-format][~org-export-get-coderef-format~]],
1801 [[#resolve-fuzzy-link][~org-export-resolve-fuzzy-link~]], [[#resolve-id-link][~org-export-resolve-id-link~]],
1802 [[#resolve-radio-link][~org-export-resolve-radio-link~]].
1804 ** ~org-export-resolve-fuzzy-link~
1806 :CUSTOM_ID: resolve-fuzzy-link
1809 Search destination of a fuzzy link — i.e. it has a ~fuzzy~ ~:type~
1810 attribute – within the parsed tree, and return that element,
1813 See also: [[#get-ordinal][~org-export-get-ordinal~]], [[#resolve-coderef][~org-export-resolve-coderef~]],
1814 [[#resolve-id-link][~org-export-resolve-id-link~]], [[#resolve-radio-link][~org-export-resolve-radio-link~]],
1815 [[#solidify-link-text][~org-export-solidify-link-text~]].
1817 ** ~org-export-resolve-id-link~
1819 :CUSTOM_ID: resolve-id-link
1822 Search headline targetted by an id link --- i.e. it has a ~id~ or
1823 ~custom-id~ ~:type~ attribute --- within the parse tree. Return
1824 the matching headline in the tree, the name of the external file,
1825 as a string, or nil.
1827 See also : [[#resolve-coderef][~org-export-resolve-coderef~]],
1828 [[#resolve-fuzzy-link][~org-export-resolve-fuzzy-link~]], [[#resolve-radio-link][~org-export-resolve-radio-link~]],
1829 [[#solidify-link-text][~org-export-solidify-link-text~]].
1831 ** ~org-export-resolve-radio-link~
1833 :CUSTOM_ID: resolve-radio-link
1836 Return first radio target object matching a radio link --- that is
1837 with a ~radio~ ~:type~ attribute --- in the parse tree, or nil.
1839 Typically, target's contents are exported through ~org-export-data~
1840 and used as link description, as in the following excerpt from
1843 #+BEGIN_SRC emacs-lisp
1844 (defun org-e-latex-link (link desc info)
1845 (let* ((type (org-element-property :type link))
1849 ((string= type "radio")
1850 (let ((destination (org-export-resolve-radio-link link info)))
1852 (format "\\hyperref[%s]{%s}"
1853 (org-export-solidify-link-text path)
1854 (org-export-data (org-element-contents destination) info)))))
1858 See also : [[#resolve-coderef][~org-export-resolve-coderef~]],
1859 [[#resolve-fuzzy-link][~org-export-resolve-fuzzy-link~]], [[#resolve-id-link][~org-export-resolve-id-link~]],
1860 [[#solidify-link-text][~org-export-solidify-link-text~]].
1862 ** ~org-export-solidify-link-text~
1864 :CUSTOM_ID: solidify-link-text
1867 Normalize a string, replacing most non-standard characters with
1870 Used to turn targets names into safer versions for links.
1872 See also: [[#inline-image-p][~org-export-inline-image-p~]],
1873 [[#resolve-id-link][~org-export-resolve-id-link~]], [[#resolve-fuzzy-link][~org-export-resolve-fuzzy-link~]],
1874 [[#resolve-radio-link][~org-export-resolve-radio-link~]].
1876 ** ~org-export-table-cell-address~
1878 :CUSTOM_ID: table-cell-address
1881 Return row and column of a given cell object. Positions are
1882 0-indexed and only exportable rows and columns are considered. The
1883 function returns nil if called on a non-exportable cell.
1885 See also: [[#get-table-cell-at][~org-export-get-table-cell-at~]],
1886 [[#table-dimensions][~org-export-table-dimensions~]].
1888 ** ~org-export-table-cell-alignment~
1890 :CUSTOM_ID: table-cell-alignment
1893 Return expected alignment for the contents of a given cell object.
1894 It can be either ~left~, ~right~ or ~center~.
1896 See also: [[#table-cell-borders][~org-export-table-cell-borders~]],
1897 [[#table-cell-width][~org-export-table-cell-width~]].
1899 ** ~org-export-table-cell-borders~
1901 :CUSTOM_ID: table-cell-borders
1904 Indicate expected borders for a given cell object. When non-nil,
1905 return value is a list of symbols among ~top~, ~bottom~, ~above~,
1906 ~below~, ~left~ and ~right~.
1908 Special values ~top~ and ~bottom~ only happen for cells in,
1909 respectively, the first and the last exportable rows.
1911 See also: [[#table-cell-alignment][~org-export-table-cell-alignment~]],
1912 [[#table-cell-width][~org-export-table-cell-width~]].
1914 ** ~org-export-table-cell-ends-colgroup-p~
1916 :CUSTOM_ID: table-cell-ends-colgroup-p
1919 Non-nil when a table cell object ends a column group.
1921 See also: [[#table-cell-starts-colgroup-p][~org-export-table-cell-starts-colgroup-p~]].
1923 ** ~org-export-table-cell-starts-colgroup-p~
1925 :CUSTOM_ID: table-cell-starts-colgroup-p
1928 Non-nil when a table cell object starts a column group.
1930 See also: [[#table-cell-ends-colgroup-p][~org-export-table-cell-ends-colgroup-p~]].
1932 ** ~org-export-table-cell-width~
1934 :CUSTOM_ID: table-cell-width
1937 Return expected width for contents of a given cell object.
1939 Only width specified explicitely through meta-data is considered.
1940 If no such information can be found, return nil instead.
1942 Some back-end may still need to know the actual width of exported
1943 cell's contents in order to compute column's width. In that case,
1944 every cell in the column must be transcoded in order to find the
1945 widest one. The snippet below, extracted from =org-e-ascii.el=
1946 illustrates a possible implementation.
1948 #+BEGIN_SRC emacs-lisp
1949 (or (org-export-table-cell-width table-cell info)
1950 (let* ((max-width 0)
1951 (table (org-export-get-parent-table table-cell info))
1952 (specialp (org-export-table-has-special-column-p table))
1953 (col (cdr (org-export-table-cell-address table-cell info))))
1957 ;; For each exportable row, get the cell at column COL and
1958 ;; transcode its contents. Then compare its length with
1959 ;; MAX-WIDTH and keep the greater of two.
1963 (org-element-contents
1964 (elt (if specialp (car (org-element-contents row))
1965 (org-element-contents row))
1973 See also: [[#table-cell-alignment][~org-export-table-cell-alignment~]],
1974 [[#table-cell-borders][~org-export-table-cell-borders~]].
1976 ** ~org-export-table-dimensions~
1978 :CUSTOM_ID: table-dimensions
1981 Return the number of exportable rows and columns in a given table.
1983 See also: [[#get-table-cell-at][~org-export-get-table-cell-at~]],
1984 [[#table-cell-address][~org-export-table-cell-address~]].
1986 ** ~org-export-table-has-header-p~
1988 :CUSTOM_ID: table-has-header-p
1991 Non-nil when table has at least two row groups.
1993 See also: [[#table-has-special-column-p][~org-export-table-has-special-column-p~]],
1994 [[#table-row-is-special-p][~org-export-table-row-is-special-p~]].
1996 ** ~org-export-table-has-special-column-p~
1998 :CUSTOM_ID: table-has-special-column-p
2001 Non-nil when first column in the table only contains meta-data.
2003 See also: [[#table-has-header-p][~org-export-table-has-header-p~]],
2004 [[#table-row-is-special-p][~org-export-table-row-is-special-p~]].
2006 ** ~org-export-table-row-ends-header-p~
2008 :CUSTOM_ID: table-row-ends-header-p
2011 Non-nil when a table row element ends table's header.
2013 See also: [[#table-row-ends-rowgroup-p][~org-export-table-row-ends-rowgroup-p~]],
2014 [[#table-row-group][~org-export-table-row-group~]],
2015 [[#table-row-starts-header-p][~org-export-table-row-starts-header-p~]],
2016 [[#table-row-starts-rowgroup-p][~org-export-table-row-starts-rowgroup-p~]].
2018 ** ~org-export-table-row-ends-rowgroup-p~
2020 :CUSTOM_ID: table-row-ends-rowgroup-p
2023 Non-nil when a a table row element ends a rowgroup, header
2026 See also: [[#table-cell-starts-ends-header-p][~org-export-table-row-ends-header-p~]],
2027 [[#table-row-group][~org-export-table-row-group~]],
2028 [[#table-row-starts-header-p][~org-export-table-row-starts-header-p~]],
2029 [[#table-row-starts-rowgroup-p][~org-export-table-row-starts-rowgroup-p~]].
2031 ** ~org-export-table-row-group~
2033 :CUSTOM_ID: table-row-group
2036 Return row group number for a given table row element.
2038 See also: [[#table-cell-starts-ends-header-p][~org-export-table-row-ends-header-p~]],
2039 [[#table-row-ends-rowgroup-p][~org-export-table-row-ends-rowgroup-p~]],
2040 [[#table-row-starts-header-p][~org-export-table-row-starts-header-p~]],
2041 [[#table-row-starts-rowgroup-p][~org-export-table-row-starts-rowgroup-p~]].
2043 ** ~org-export-table-row-is-special-p~
2045 :CUSTOM_ID: table-row-is-special-p
2048 Non-nil a given table row element only contains meta-data.
2050 See also: [[#table-has-header-p][~org-export-table-has-header-p~]],
2051 [[#table-has-special-column-p][~org-export-table-has-special-column-p~]].
2053 ** ~org-export-table-row-starts-header-p~
2055 :CUSTOM_ID: table-row-starts-header-p
2058 Non-nil when a table row element starts table's header.
2060 See also: [[#table-cell-starts-ends-header-p][~org-export-table-row-ends-header-p~]],
2061 [[#table-row-ends-rowgroup-p][~org-export-table-row-ends-rowgroup-p~]],
2062 [[#table-row-group][~org-export-table-row-group~]],
2063 [[#table-row-starts-rowgroup-p][~org-export-table-row-starts-rowgroup-p~]].
2065 ** ~org-export-table-row-starts-rowgroup-p~
2067 :CUSTOM_ID: table-row-starts-rowgroup-p
2070 Non-nil when a table row element starts a rowgroup, header
2073 See also: [[#table-cell-starts-ends-header-p][~org-export-table-row-ends-header-p~]],
2074 [[#table-row-ends-rowgroup-p][~org-export-table-row-ends-rowgroup-p~]],
2075 [[#table-row-group][~org-export-table-row-group~]],
2076 [[#table-row-starts-header-p][~org-export-table-row-starts-header-p~]].
2078 ** ~org-export-timestamp-has-time-p~
2080 :CUSTOM_ID: timestamp-has-time-p
2083 Non-nil when a timestamp has hours and minutes.
2085 It is useful to know which format strings to use for a timestampn.
2087 See also: [[#format-timestamp][~org-export-format-timestamp~]].
2089 ** ~org-export-translate~
2091 Translate a string, i.e. "Table of Contents", according to language
2094 Refer to ~org-export-dictionary~ variable for the list of all
2097 ** ~org-export-unravel-code~
2099 :CUSTOM_ID: unravel-code
2102 Clean source code from an =example-block= or a =src-block= element
2103 and extract code references out of it.
2105 Its purpose is to allow to transform raw source code first and then
2106 integrate line numbers or references back into the final output.
2107 That final task can be achieved with the help of
2108 ~org-export-format-code~ function.
2110 See also: [[#format-code][~org-export-format-code~]],
2111 [[#format-code-default][~org-export-format-code-default~]], [[#get-loc][~org-export-get-loc~]].
2113 ** ~org-export-with-backend~
2115 :CUSTOM_ID: with-backend
2118 Export an element or object using locally another back-end.
2120 In a derived back-end, it may be used as a fall-back function once
2121 all specific cases have been handled. Thus, =e-beamer= back-end,
2122 derived from =e-latex=, takes care of every internal link type and
2123 delagates everything else to its parent back-end:
2125 #+BEGIN_SRC emacs-lisp
2126 (let ((type (org-element-property :type link))
2127 (path (org-element-property :path link)))
2129 ;; Handle every internal link type, but be careful to ignore "id"
2130 ;; type links pointing to external files.
2131 ((equal type "radio") ...)
2132 ((and (member type '("custom-id" "fuzzy" "id"))
2133 (let ((destination (if (string= type "fuzzy")
2134 (org-export-resolve-fuzzy-link link info)
2135 (org-export-resolve-id-link link info))))
2136 (case (org-element-type destination)
2139 ;; Otherwise, use `e-latex' back-end.
2140 (t (org-export-with-backend 'e-latex link contents info))))
2145 # sentence-end-double-space: t