diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 2affcba..83115c3 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -165,38 +165,39 @@ This option can also be set with the +OPTIONS line, e.g. \"-:nil\"." :type '(string :tag "File or URL")) (defcustom org-export-language-setup - '(("en" "Author" "Date" "Table of Contents" "Footnotes") - ("ca" "Autor" "Data" "Índex" "Peus de pàgina") - ("cs" "Autor" "Datum" "Obsah" "Pozn\xe1mky pod carou") - ("da" "Ophavsmand" "Dato" "Indhold" "Fodnoter") - ("de" "Autor" "Datum" "Inhaltsverzeichnis" "Fußnoten") - ("eo" "Aŭtoro" "Dato" "Enhavo" "Piednotoj") - ("es" "Autor" "Fecha" "Índice" "Pies de página") - ("fi" "Tekijä" "Päivämäärä" "Sisällysluettelo" "Alaviitteet") - ("fr" "Auteur" "Date" "Table des matières" "Notes de bas de page") - ("hu" "Szerzõ" "Dátum" "Tartalomjegyzék" "Lábjegyzet") - ("is" "Höfundur" "Dagsetning" "Efnisyfirlit" "Aftanmálsgreinar") - ("it" "Autore" "Data" "Indice" "Note a piè di pagina") - ("nl" "Auteur" "Datum" "Inhoudsopgave" "Voetnoten") - ("no" "Forfatter" "Dato" "Innhold" "Fotnoter") - ("nb" "Forfatter" "Dato" "Innhold" "Fotnoter") ;; nb = Norsk (bokm.l) - ("nn" "Forfattar" "Dato" "Innhald" "Fotnotar") ;; nn = Norsk (nynorsk) - ("pl" "Autor" "Data" "Spis treści" "Przypis") - ("sv" "Författare" "Datum" "Innehåll" "Fotnoter")) + '(("en" "Author" "Date" "Table of Contents" "Footnotes" "english") + ("ca" "Autor" "Data" "Índex" "Peus de pàgina" "canadien") + ("cs" "Autor" "Datum" "Obsah" "Pozn\xe1mky pod carou" "czech") + ("da" "Ophavsmand" "Dato" "Indhold" "Fodnoter" "danish") + ("de" "Autor" "Datum" "Inhaltsverzeichnis" "Fußnoten" "ngerman") + ("eo" "Aŭtoro" "Dato" "Enhavo" "Piednotoj" "esperanto") + ("es" "Autor" "Fecha" "Índice" "Pies de página" "spanish") + ("fi" "Tekijä" "Päivämäärä" "Sisällysluettelo" "Alaviitteet" "finnish") + ("fr" "Auteur" "Date" "Table des matières" "Notes de bas de page" "francais") + ("hu" "Szerzõ" "Dátum" "Tartalomjegyzék" "Lábjegyzet" "magyar") + ("is" "Höfundur" "Dagsetning" "Efnisyfirlit" "Aftanmálsgreinar" "icelandic") + ("it" "Autore" "Data" "Indice" "Note a piè di pagina" "italian") + ("nl" "Auteur" "Datum" "Inhoudsopgave" "Voetnoten" "dutch") + ("no" "Forfatter" "Dato" "Innhold" "Fotnoter" "norsk") + ("nb" "Forfatter" "Dato" "Innhold" "Fotnoter" "norsk") ;; nb = Norsk (bokm.l) + ("nn" "Forfattar" "Dato" "Innhald" "Fotnotar" "nynorsk") ;; nn = Norsk (nynorsk) + ("pl" "Autor" "Data" "Spis treści" "Przypis" "polish") + ("sv" "Författare" "Datum" "Innehåll" "Fotnoter" "english")) "Terms used in export text, translated to different languages. Use the variable `org-export-default-language' to set the language, or use the +OPTION lines for a per-file setting." :group 'org-export-general :type '(repeat (list - (string :tag "HTML language tag") + (string :tag "HTML and LaTeX language tag") (string :tag "Author") (string :tag "Date") (string :tag "Table of Contents") - (string :tag "Footnotes")))) + (string :tag "Footnotes") + (string :tag "LaTeX's babel language option")))) (defcustom org-export-default-language "en" - "The default language of HTML export, as a string. + "The default language of HTML and LaTeX export, as a string. This should have an association in `org-export-language-setup'." :group 'org-export-general :type 'string) @@ -1204,7 +1205,7 @@ on this string to produce the exported version." ;; Remove #+TBLFM and #+TBLNAME lines (org-export-handle-table-metalines) - + ;; Run the final hook (run-hooks 'org-export-preprocess-final-hook) @@ -2762,8 +2763,8 @@ Does include HTML export options as well as TODO and CATEGORY stuff." #+AUTHOR: %s #+EMAIL: %s #+DATE: %s -#+DESCRIPTION: -#+KEYWORDS: +#+DESCRIPTION: +#+KEYWORDS: #+LANGUAGE: %s #+OPTIONS: H:%d num:%s toc:%s \\n:%s @:%s ::%s |:%s ^:%s -:%s f:%s *:%s <:%s #+OPTIONS: TeX:%s LaTeX:%s skip:%s d:%s todo:%s pri:%s tags:%s @@ -2772,7 +2773,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff." #+EXPORT_EXCLUDE_TAGS: %s #+LINK_UP: %s #+LINK_HOME: %s -#+XSLT: +#+XSLT: #+CATEGORY: %s #+SEQ_TODO: %s #+TYP_TODO: %s diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 33bfc5e..5aaea45 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -73,6 +73,22 @@ org-closed-string"\\)") "Regexp matching special time planning keywords plus the time after it.") +(defvar org-export-latex-language + "en" + "Export language code extracted from LANGUAGE key of `org-default-export-plist' +and `org-infile-export-plist'") +(defvar org-export-latex-babel-option + nil + "LaTeX's babel package option extraced from 5th element of +`org-export-language-setup' using `org-export-latex-language'") + +(defcustom org-export-latex-default-inputenc "utf8" + "Default option value for LaTeX's inputenc package. +This value is used only if the correct value could not be determined +otherweise." + :group 'org-export-latex + :type 'string) + (defvar latexp) ; dynamically scoped from org.el (defvar re-quote) ; dynamically scoped from org.el (defvar commentsp) ; dynamically scoped from org.el @@ -258,8 +274,9 @@ For example \orgTITLE for #+TITLE." :type 'boolean) (defcustom org-export-latex-date-format - "%d %B %Y" - "Format string for \\date{...}." + "\\today" + "Format string for \\date{...} as aceepted by `format-time-string'. +E.g. '%d %B %Y' or use LaTeX's '\\today'-command" :group 'org-export-latex :type 'string) @@ -694,15 +711,19 @@ when PUB-DIR is set, use this as the publishing directory." (error "Need a file name to be able to export"))) (message "Exporting to LaTeX...") + (org-unmodified (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) '(:org-license-to-kill nil)))) (org-update-radio-target-regexp) (org-export-latex-set-initial-vars ext-plist arg) + (setq org-export-opt-plist org-export-latex-options-plist) + (org-install-letbind) (run-hooks 'org-export-latex-after-initial-vars-hook) + (let* ((wcf (current-window-configuration)) (opt-plist org-export-latex-options-plist) (region-p (org-region-active-p)) @@ -1205,6 +1226,15 @@ LEVEL indicates the default depth for export." org-export-latex-options-plist (org-combine-plists (org-default-export-plist) ext-plist (org-infile-export-plist)) + + org-export-latex-language (or + (plist-get (org-combine-plists (org-default-export-plist) + (org-infile-export-plist)) :language) + "en") + org-export-latex-babel-option (nth + 5 + (assoc org-export-latex-language org-export-language-setup)) + org-export-latex-class (or (and (org-region-active-p) (save-excursion @@ -1232,6 +1262,13 @@ LEVEL indicates the default depth for export." (and (re-search-forward "^#\\+LaTeX_CLASS_OPTIONS:[ \t]*\\(.*?\\)[ \t]*$" nil t) (match-string 1)))) (plist-get org-export-latex-options-plist :latex-class-options)) + + org-export-latex-class-options + (cond (org-export-latex-class-options + (replace-regexp-in-string "\\[" (concat "[" org-export-latex-babel-option ",") org-export-latex-class-options)) + (t + (concat org-export-latex-class-options "[" org-export-latex-babel-option "]"))) + org-export-latex-class (or (car (assoc org-export-latex-class org-export-latex-classes)) (error "No definition for class `%s' in `org-export-latex-classes'" @@ -1355,7 +1392,7 @@ If END is non-nil, it is the end of the region." (match-string 0)) (remove-text-properties (match-beginning 0) (match-end 0) '(:org-license-to-kill t)))))))))))) - + (defvar org-export-latex-header-defs nil "The header definitions that might be used in the LaTeX body.") @@ -1735,7 +1772,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (string-match "\\, the file is not part of Emacs and loading it will require that you have downloaded and properly installed @@ -2610,8 +2610,8 @@ See also `org-agenda-jump-prefer-future'." The default is to do the same as configured in `org-read-date-prefer-future'. But you can alse set a deviating value here. This may t or nil, or the symbol `org-read-date-prefer-future'." - :group 'org-agenda - :group 'org-time + :group 'org-agenda + :group 'org-time :type '(choice (const :tag "Use org-aread-date-prefer-future" org-read-date-prefer-future) @@ -3199,6 +3199,7 @@ will be appended." (defcustom org-export-latex-default-packages-alist '(("AUTO" "inputenc" t) ("T1" "fontenc" t) + ("" "babel" nil) ("" "fixltx2e" nil) ("" "graphicx" t) ("" "longtable" nil) @@ -3220,6 +3221,7 @@ The packages in this list are needed by one part or another of Org-mode to function properly. - inputenc, fontenc: for basic font and character selection +- babel: internationalization - textcomp, marvosymb, wasysym, latexsym, amssym: for various symbols used for interpreting the entities in `org-entities'. You can skip some of these packages if you don't use any of the symbols in it.