| @@ -1,6 +1,6 @@ |
| 1 | 1 | #+TITLE: Export |
| 2 | | #+DESCRIPTION: Exporting Org files from orgstar to HTML, Markdown, PDF, Word, RTF, plain text and iCalendar, and to LaTeX, ODT and ASCII through Emacs; copying as rich text. |
| 3 | | #+LEDE: orgstar exports HTML, Markdown, PDF, Word, RTF, plain text and iCalendar itself, and the Mac download version hands LaTeX, ODT, ASCII and LaTeX-made PDF to Emacs. |
| 2 | #+DESCRIPTION: Exporting Org files from orgstar to HTML, Markdown, PDF, Word, RTF, plain text, iCalendar and LaTeX, and to ODT and ASCII through Emacs; copying as rich text. |
| 3 | #+LEDE: orgstar exports HTML, Markdown, PDF, Word, RTF, plain text, iCalendar and LaTeX itself, and the Mac download version hands ODT, ASCII and LaTeX-made PDF to Emacs. |
| 4 | 4 | |
| 5 | 5 | * Exporting a file |
| 6 | 6 | |
| @@ -18,7 +18,7 @@ Export works on the file in the current editor, using its text as it is now, sav |
| 18 | 18 | | RTF | Export to RTF | — | — | no | |
| 19 | 19 | | Plain text | Export to Plain Text | — | — | no | |
| 20 | 20 | | PDF through LaTeX | Export to PDF with Emacs | =C-c C-e l p= | =SPC m e l p=, =C-c C-e l p= | yes | |
| 21 | | | LaTeX | Export to LaTeX with Emacs | =C-c C-e l l= | =C-c C-e l l= | yes | |
| 21 | | LaTeX | Export to LaTeX | =C-c C-e l l= | =C-c C-e l l= | no | |
| 22 | 22 | | ODT | Export to ODT with Emacs | =C-c C-e o o= | =C-c C-e o o= | yes | |
| 23 | 23 | | ASCII text | Export to Plain Text with Emacs | =C-c C-e t u= | =C-c C-e t u= | yes | |
| 24 | 24 | | iCalendar | Export to iCalendar | =C-c C-e c f= | =C-c C-e c f= | no | |
| @@ -29,13 +29,13 @@ The keys follow Emacs's export dispatcher (=org-export-dispatch=). =C-c C-e= on |
| 29 | 29 | |
| 30 | 30 | All fourteen commands are in File ▸ Export and in the command palette. They write the export beside the Org file, with the same name and the format's extension: =.html=, =.md=, =.pdf=, =.docx=, =.rtf=, =.tex=, =.odt=, =.txt= or =.ics=. The two agenda-file commands are the exceptions; see [[*iCalendar export][iCalendar export]]. =#+EXPORT_FILE_NAME:= names it instead, as in Org: relative to the Org file's folder (or absolute, or starting with =~=), with its extension replaced by the format's, so =#+EXPORT_FILE_NAME: out/report= writes =out/report.html=. A file already there is replaced. The message area shows "Exported to /name/". |
| 31 | 31 | |
| 32 | | The [[file:../install.org][Mac App Store version]] has the ten commands that don't need Emacs; File ▸ Export, the export dialog and the command palette leave out the other four, and a key bound to Export to PDF with Emacs runs Export to PDF. When the export file, or an =#+INCLUDE:= or =#+SETUPFILE:=, is outside your folders, orgstar first asks for access to its folder; for the export file, Save Elsewhere… instead picks another place. See [[file:../install.org][Install]]. |
| 32 | The [[file:../install.org][Mac App Store version]] has the eleven commands that don't need Emacs; File ▸ Export, the export dialog and the command palette leave out the other three, and a key bound to Export to PDF with Emacs runs Export to PDF. When the export file, or an =#+INCLUDE:= or =#+SETUPFILE:=, is outside your folders, orgstar first asks for access to its folder; for the export file, Save Elsewhere… instead picks another place. See [[file:../install.org][Install]]. |
| 33 | 33 | |
| 34 | 34 | ** The export dialog |
| 35 | 35 | |
| 36 | 36 | *Export…* in the command palette, or =⇧⌘E= in the Mac preset, opens a dialog. The Emacs and Doom presets have no key for it; bind =app.export-dialog= in =keymap.toml= if you want one (see [[file:03-keys.org][Keys and commands]]). The dialog has: |
| 37 | 37 | |
| 38 | | - *Format*: HTML, Markdown, PDF, Word, Rich Text (RTF), Plain text, PDF via LaTeX (Emacs), ODT (Emacs), LaTeX (Emacs), Plain text, ASCII (Emacs) or iCalendar. |
| 38 | - *Format*: HTML, Markdown, PDF, Word, Rich Text (RTF), Plain text, PDF via LaTeX (Emacs), ODT (Emacs), LaTeX, Plain text, ASCII (Emacs) or iCalendar. The App Store version lists LaTeX last. |
| 39 | 39 | - *Scope*: the whole file, or the subtree at the caret (Org's =C-s= in the dispatcher). A subtree is exported as a document of its own: its heading is the title, its text the body, and its child headings move up a level. iCalendar is the exception: there the subtree's heading is an entry like any other. The file's =#+= keywords still apply, and the heading's =EXPORT_TITLE=, =EXPORT_AUTHOR=, =EXPORT_DATE=, =EXPORT_EMAIL=, =EXPORT_OPTIONS=, =EXPORT_SELECT_TAGS=, =EXPORT_EXCLUDE_TAGS=, =EXPORT_HTML_HEAD= and =EXPORT_HTML_HEAD_EXTRA= properties override them. Its planning line and property drawer are left out. The choice is available when the caret is under a heading. |
| 40 | 40 | - *Body only*: leave out the title and the page around the text (Org's =C-b=). HTML is then the table of contents, the text and the footnotes, without =<html>=, =<head>= or the title; Markdown has no title heading. Not available for PDF, Word, RTF, plain text, ODT and iCalendar. |
| 41 | 41 | - *Destination*: where =#+EXPORT_FILE_NAME:= says, or the subtree's =EXPORT_FILE_NAME= property for a subtree, else beside the Org file. *Choose…* picks another place and name. Changing the format changes the extension. |
| @@ -46,7 +46,7 @@ The dialog remembers the format and the *Open after export* setting. The PDF set |
| 46 | 46 | |
| 47 | 47 | ** On iOS |
| 48 | 48 | |
| 49 | | The Export menu offers HTML, Markdown, PDF, Word, Rich Text (RTF), Plain Text and iCalendar, and Copy as Rich Text. It is under More in the editor, and in the toolbar in the reader. Choosing one opens the share sheet with the exported file, named after the Org file or its =#+EXPORT_FILE_NAME:=. Send it to another app, or use Save to Files to keep it. The export is the same as on the Mac. LaTeX, ODT, ASCII and PDF through LaTeX are not available on iOS, nor are the agenda-file iCalendar exports. |
| 49 | The Export menu offers HTML, Markdown, PDF, Word, Rich Text (RTF), Plain Text, iCalendar and LaTeX, and Copy as Rich Text. It is under More in the editor, and in the toolbar in the reader. Choosing one opens the share sheet with the exported file, named after the Org file or its =#+EXPORT_FILE_NAME:=. Send it to another app, or use Save to Files to keep it. The export is the same as on the Mac, except that LaTeX has no =\author= unless the file has =#+AUTHOR:=. ODT, ASCII and PDF through LaTeX are not available on iOS, nor are the agenda-file iCalendar exports. |
| 50 | 50 | |
| 51 | 51 | * HTML export |
| 52 | 52 | |
| @@ -217,6 +217,25 @@ Export to PDF makes the HTML export into a PDF, laid out and split into pages by |
| 217 | 217 | |
| 218 | 218 | For typeset output with LaTeX's classes and packages, use Export to PDF with Emacs instead (see /Exporting through Emacs/). |
| 219 | 219 | |
| 220 | * LaTeX export |
| 221 | |
| 222 | Export to LaTeX writes the =.tex= file that Emacs's =org-latex-export-to-latex= writes under =emacs -Q= (Org 9.8.7), without Emacs, on the Mac and iOS. It has the same preamble, sectioning, lists, tables, verbatim source blocks, figures, footnotes, links and escaping. Two things differ: the =\label= keys are made from the document, so they stay the same between exports, where Emacs picks new random ones each time; and =\author= is the name of the Mac's user account, which is what =user-full-name= usually is, unless the file has =#+AUTHOR:=. |
| 223 | |
| 224 | It reads: |
| 225 | |
| 226 | | Keyword | Effect | |
| 227 | |--------------------------+--------------------------------------------------------------------------| |
| 228 | | =#+LATEX_CLASS:= | =article= (the default), =report= or =book=, with Org's default sectioning | |
| 229 | | =#+LATEX_CLASS_OPTIONS:= | Replaces =[11pt]= in =\documentclass= | |
| 230 | | =#+LATEX_HEADER:= | Lines added after the packages | |
| 231 | | =#+LATEX_HEADER_EXTRA:= | Lines added after those | |
| 232 | | =#+LATEX_COMPILER:= | =pdflatex= (the default), =xelatex= or =lualatex=: the packages for that engine | |
| 233 | | =#+ATTR_LATEX:= | On tables (=:environment=, =:align=, =:width=, =:float=, =:placement=, =:center=, =:font=, =:caption=, =:options=), images (=:width=, =:height=, =:scale=, =:options=, =:float=, =:placement=, =:center=), lists, quote, example and special blocks | |
| 234 | |
| 235 | =#+TITLE=, =#+SUBTITLE=, =#+AUTHOR=, =#+DATE=, =#+KEYWORDS=, =#+DESCRIPTION=, =#+LANGUAGE= and =#+OPTIONS= work as in Emacs, as do the tags and =COMMENT= that leave headings out (see /Which headings are exported/). Body-only and subtree export are in the export dialog. |
| 236 | |
| 237 | A file with something this export doesn't handle stops with "Can't export to LaTeX: " and what it was, rather than giving a =.tex= that differs from Emacs's: a LaTeX class other than the three, Babel or Polyglossia in the header, citations, radio targets, inline tasks, table.el tables, inline source blocks and calls, =#+CALL=, source blocks exported with their results, footnote definitions of several paragraphs, footnotes in headings, tables or item tags, =:mode math= and long tables, =UNNUMBERED= and =ALT_TITLE=, and =#+OPTIONS= items other than =toc=, =num=, =H=, =tags=, =todo=, =pri=, =^=, =tex=, =title=, =author=, =date=, =-= and =timestamp= set to something other than Org's default. A link Emacs can't resolve stops the export in both. In the download version, when Emacs is installed, such a file is exported by Emacs instead (see /Exporting through Emacs/). |
| 238 | |
| 220 | 239 | * Word, RTF and plain text |
| 221 | 240 | |
| 222 | 241 | Export to Word, Export to RTF and Export to Plain Text make the HTML export into a document of that kind, as the system reads HTML: headings, emphasis, links, colored keywords and code, lists, and tables. Word files (=.docx=) are written by orgstar itself, so tables come through as Word tables; RTF keeps them too on the Mac. On iOS, where the system's HTML reader keeps no tables, Word's tables are made from the HTML export's tables, with header cells bold and the cells' text without its styles; RTF and plain text there have the cells' text but no table. Plain text is the same text without its styles: list bullets and table cells are kept, separated by tabs. Fonts are Helvetica Neue for text and Menlo for code, and the colors are the light ones. |
| @@ -272,7 +291,7 @@ Differences from Org: diary sexps (=%%(…)= lines and =<%%(…)>= timestamps) a |
| 272 | 291 | |
| 273 | 292 | * Publishing |
| 274 | 293 | |
| 275 | | Publishing (=org-publish=) exports a folder of Org files to a folder of HTML or Markdown files, copies other files beside them, and can write a sitemap. Projects are =[[publish]]= tables in =config.toml=, as =org-publish-project-alist= entries are in Emacs: |
| 294 | Publishing (=org-publish=) exports a folder of Org files to a folder of HTML, Markdown or LaTeX files, copies other files beside them, and can write a sitemap. Projects are =[[publish]]= tables in =config.toml=, as =org-publish-project-alist= entries are in Emacs: |
| 276 | 295 | |
| 277 | 296 | #+BEGIN_SRC toml |
| 278 | 297 | [[publish]] |
| @@ -305,7 +324,7 @@ components = "notes static" |
| 305 | 324 | | =recursive= | Files in subfolders too | =false= | |
| 306 | 325 | | =exclude= | An Emacs regexp on the file's path under =base-directory=; matching files are left out | | |
| 307 | 326 | | =include= | More files, relative to =base-directory=, separated by spaces | | |
| 308 | | | =publishing-function= | =org-html-publish-to-html=, =org-md-publish-to-md= or =org-publish-attachment= (copied as they are), several separated by spaces | =org-html-publish-to-html= | |
| 327 | | =publishing-function= | =org-html-publish-to-html=, =org-md-publish-to-md=, =org-latex-publish-to-latex= or =org-publish-attachment= (copied as they are), several separated by spaces | =org-html-publish-to-html= | |
| 309 | 328 | | =body-only= | The export's body only | =false= | |
| 310 | 329 | | =auto-sitemap= | Write a sitemap into =base-directory= and publish it with the rest | =false= | |
| 311 | 330 | | =sitemap-filename= | The sitemap's name | ="sitemap.org"= | |
| @@ -331,16 +350,15 @@ A file whose published copy is newer than it is skipped, as Org skips files that |
| 331 | 350 | |
| 332 | 351 | * Exporting through Emacs |
| 333 | 352 | |
| 334 | | On the Mac, PDF, LaTeX, ODT and plain text exports are done by Emacs, with the =ox= functions Emacs's dispatcher uses: |
| 353 | On the Mac, PDF, ODT and plain text exports are done by Emacs, with the =ox= functions Emacs's dispatcher uses: |
| 335 | 354 | |
| 336 | 355 | | Format | Function | |
| 337 | 356 | |------------+-----------------------------| |
| 338 | 357 | | PDF | =org-latex-export-to-pdf= | |
| 339 | | | LaTeX | =org-latex-export-to-latex= | |
| 340 | 358 | | ODT | =org-odt-export-to-odt= | |
| 341 | 359 | | Plain text | =org-ascii-export-to-ascii= | |
| 342 | 360 | |
| 343 | | The [[file:../install.org][Mac App Store version]] doesn't run Emacs and has none of these exports. |
| 361 | LaTeX goes to Emacs (=org-latex-export-to-latex=) only for a file orgstar's own LaTeX export can't write as Emacs would; see /LaTeX export/. The [[file:../install.org][Mac App Store version]] doesn't run Emacs and has none of these exports. |
| 344 | 362 | |
| 345 | 363 | orgstar runs =emacs -Q --batch= in the Org file's folder. It opens the file, replaces its contents with the editor's current text without saving, and calls the function. Emacs writes the result beside the file, as it would itself; with a destination chosen in the export dialog, orgstar then moves it there. The message area shows "Exporting with Emacs…" and then "Exported to /name/". |
| 346 | 364 | |