2

I am writing a German document in Org-mode and exporting to Latex. To use the longtable environment, I use:

#+ATTR_LATEX: :environment longtable
|-|-|-|

In this way, a long table is exported as expected. For the table cut at any page, the text "Continued on next page" is added at the end of the page (exported by Org mode). Adding German babel does not change the message exported by Org-mode. My question is: How to make Org mode conform to the document language? Otherwise, how can I manually override (change) the message in Org mode export?

What I have:

#+Language: de
#+LATEX_HEADER: \usepackage[ngerman]{babel}
#+LATEX_HEADER: \usepackage{german,longtable}

I appreciate your help!

  • The #+LANGUAGE: attribute works well for me. See my answer. If this does not work for you please add more information: emacs-version, org-version and a minimal self-contained example for reconstruction of the problem. Please also test with emacs -Q to avoid configuration errors. – Tobias Jun 15 '17 at 13:55
3

Add

#+LANGUAGE: de

at the top of your document or customize the value of the option org-export-default-language if you write many documents in German.

See the documentation of Export Settings.

Example that works for me with emacs 25.1.1 and org-version 9.0.5:

#+LANGUAGE: de
#+LATEX_HEADER: \usepackage[ngerman]{babel}

* LaTeX

#+ATTR_LATEX: :environment longtable
|-------------+--------+---|
| 3.8.3.45754 | 3.9.0. |   |
|-------------+--------+---|
|           1 |      8 |   |
|           2 |      7 |   |
|           3 |      6 |   |
|           4 |      5 |   |
|           5 |      3 |   |
|           6 |      2 |   |
|           7 |      4 |   |
|           8 |     19 |   |
|           9 |     18 | f |
|          10 |     17 |   |
|          11 |     16 |   |
|          12 |     15 |   |
|          13 |     14 |   |
|          14 |     13 |   |
|          15 |     11 |   |
|          16 |     10 |   |
|          17 |      1 |   |
|          18 |     12 |   |
|          19 |      9 |   |
|           1 |      8 |   |
|           2 |      7 |   |
|           3 |      6 |   |
|           4 |      5 |   |
|           5 |      3 |   |
|           6 |      2 |   |
|           7 |      4 |   |
|           8 |     19 |   |
|           9 |     18 | f |
|          10 |     17 |   |
|          11 |     16 |   |
|          12 |     15 |   |
|          13 |     14 |   |
|          14 |     13 |   |
|          15 |     11 |   |
|          16 |     10 |   |
|          17 |      1 |   |
|          18 |     12 |   |
|          19 |      9 |   |
|           1 |      8 |   |
|           2 |      7 |   |
|           3 |      6 |   |
|           4 |      5 |   |
|           5 |      3 |   |
|           6 |      2 |   |
|           7 |      4 |   |
|           8 |     19 |   |
|           9 |     18 | f |
|          10 |     17 |   |
|          11 |     16 |   |
|          12 |     15 |   |
|          13 |     14 |   |
|          14 |     13 |   |
|          15 |     11 |   |
|          16 |     10 |   |
|          17 |      1 |   |
|          18 |     12 |   |
|          19 |      9 |   |
  • I think he already did this – jue Jun 15 '17 at 13:37
  • @jue It works for me. org-version 9.0.5, emacs: 25.1.1 – Tobias Jun 15 '17 at 13:44
  • this did not work for me and the questioner wrote this already in his question. See code at "What I have:" But on the other hand, I only use org-version 8.2.10. – jue Jun 15 '17 at 13:48
  • Addition to above comment: What I get is a german "Inhaltsverzeichnis" but an english "Continued on next page" #+Language or #+LANGUAGE does not seem to matter. – jue Jun 15 '17 at 13:57
  • @jue Nice that you can reconstruct the problem. Do you have an entry for "Continued on next page" in org-export-dictionary? In function org-latex-table-row is there (org-latex--translate "Continued from previous page" info) in it or is org-latex--translate missing? – Tobias Jun 15 '17 at 14:00
3

Here is a solution to do it manually.
Execute this code before doing the export:

(defun my-latex-filter-continue-string (text backend info)
    "Ensure \"_\" are properly handled in LaTeX export."
    (when (org-export-derived-backend-p backend 'latex)
        (replace-regexp-in-string "Continued on next page" "Weiter auf nächster Seite" text)))

(add-to-list 'org-export-filter-table-functions
             'my-latex-filter-continue-string)

Have A look into org-mode manual to find more information:

Edit: if you, the reader, has this problem, check your org-version. If you are at version 8.2.10. or lower you have 3 options:

  1. Upgrade org-mode to version 9.x (9.0.5 has been reported to work)
  2. Use the code I gave above, e.g. put it in your init.el, then on every export the string will be replaced.
  3. enhance the functions involved and update org-export-dictionary with the appropriate translation string

Of course my solution can be adapted to similar problems, also for newer org-mode versions. :)

Edit2: Out of curiosity I had a look at the third option.
Sadly the mentioned string is hard coded in function org-latex-table-row (table-row contents info) which you can find in file ox-latex.el.
To change the output you have to replace the string in the function.

  • For new versions of org-mode see Answer from Tobias and the comments there – jue Jun 15 '17 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.