Skip to main content
#+SUBTITLE:
Source Link
mankoff
  • 4.3k
  • 1
  • 25
  • 41

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:

#+TITLE: Foo @@latex:\\@@ Bar

I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this:

#+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar

Source: https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html

If such newline characters are needed to be added at multiple places in the document, replacing this verbose @@latex:\\@@ @@html:<br>@@ string with an org mode MACRO would be better suited.

A MACRO definition like below can be placed at the top of the document or in a common "org config" file that's included in your org documents:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@

The MACRO can then be used for formatting the title as below:

#+TITLE: Foo {{{NEWLINE}}} Bar

The advantages of using the MACRO approach are:

  • The org mode document is easier to read
  • If the need arises to change the definition of {{{NEWLINE}}} to support a new export format, then that change needs to be done at just one place.

Example:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@ @@ascii:|@@

NOTE: @@ascii:|@@ won't insert a newline in ascii exports; it will simply place the pipe character | wherever {{{NEWLINE}}} was used in the org doc.

Finally, the #+SUBTITLE keyword may also help.

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:

#+TITLE: Foo @@latex:\\@@ Bar

I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this:

#+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar

Source: https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html

If such newline characters are needed to be added at multiple places in the document, replacing this verbose @@latex:\\@@ @@html:<br>@@ string with an org mode MACRO would be better suited.

A MACRO definition like below can be placed at the top of the document or in a common "org config" file that's included in your org documents:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@

The MACRO can then be used for formatting the title as below:

#+TITLE: Foo {{{NEWLINE}}} Bar

The advantages of using the MACRO approach are:

  • The org mode document is easier to read
  • If the need arises to change the definition of {{{NEWLINE}}} to support a new export format, then that change needs to be done at just one place.

Example:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@ @@ascii:|@@

NOTE: @@ascii:|@@ won't insert a newline in ascii exports; it will simply place the pipe character | wherever {{{NEWLINE}}} was used in the org doc.

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:

#+TITLE: Foo @@latex:\\@@ Bar

I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this:

#+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar

Source: https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html

If such newline characters are needed to be added at multiple places in the document, replacing this verbose @@latex:\\@@ @@html:<br>@@ string with an org mode MACRO would be better suited.

A MACRO definition like below can be placed at the top of the document or in a common "org config" file that's included in your org documents:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@

The MACRO can then be used for formatting the title as below:

#+TITLE: Foo {{{NEWLINE}}} Bar

The advantages of using the MACRO approach are:

  • The org mode document is easier to read
  • If the need arises to change the definition of {{{NEWLINE}}} to support a new export format, then that change needs to be done at just one place.

Example:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@ @@ascii:|@@

NOTE: @@ascii:|@@ won't insert a newline in ascii exports; it will simply place the pipe character | wherever {{{NEWLINE}}} was used in the org doc.

Finally, the #+SUBTITLE keyword may also help.

Elaborated the solution with the use of org mode macro
Source Link
Kaushal Modi
  • 26k
  • 4
  • 83
  • 191

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:

#+TITLE: Foo @@latex:\\@@ Bar

I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this:

#+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar

Source: https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html

If such newline characters are needed to be added at multiple places in the document, replacing this verbose @@latex:\\@@ @@html:<br>@@ string with an org mode MACRO would be better suited.

A MACRO definition like below can be placed at the top of the document or in a common "org config" file that's included in your org documents:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@

The MACRO can then be used for formatting the title as below:

#+TITLE: Foo {{{NEWLINE}}} Bar

The advantages of using the MACRO approach are:

  • The org mode document is easier to read
  • If the need arises to change the definition of {{{NEWLINE}}} to support a new export format, then that change needs to be done at just one place.

Example:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@ @@ascii:|@@

NOTE: @@ascii:|@@ won't insert a newline in ascii exports; it will simply place the pipe character | wherever {{{NEWLINE}}} was used in the org doc.

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:

#+TITLE: Foo @@latex:\\@@ Bar

I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this:

#+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar

Source: https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:

#+TITLE: Foo @@latex:\\@@ Bar

I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this:

#+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar

Source: https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html

If such newline characters are needed to be added at multiple places in the document, replacing this verbose @@latex:\\@@ @@html:<br>@@ string with an org mode MACRO would be better suited.

A MACRO definition like below can be placed at the top of the document or in a common "org config" file that's included in your org documents:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@

The MACRO can then be used for formatting the title as below:

#+TITLE: Foo {{{NEWLINE}}} Bar

The advantages of using the MACRO approach are:

  • The org mode document is easier to read
  • If the need arises to change the definition of {{{NEWLINE}}} to support a new export format, then that change needs to be done at just one place.

Example:

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@ @@ascii:|@@

NOTE: @@ascii:|@@ won't insert a newline in ascii exports; it will simply place the pipe character | wherever {{{NEWLINE}}} was used in the org doc.

Source Link
mankoff
  • 4.3k
  • 1
  • 25
  • 41

Org mode 8 no longer accepts LaTeX characters like that. The correct way to do it is embed export snippets in the title:

#+TITLE: Foo @@latex:\\@@ Bar

I assume therefore that if you want to export newlines in both LaTeX and HTML, the code might have to look like this:

#+TITLE: Foo @@latex:\\@@ @@html:<br>@@ Bar

Source: https://lists.gnu.org/archive/html/emacs-orgmode/2014-09/msg00466.html