浏览代码

Fix commit 6632ea.

Bastien Guerry 13 年之前
父节点
当前提交
f2598e41ac
共有 1 个文件被更改,包括 38 次插入8 次删除
  1. 38 8
      lisp/org-latex.el

+ 38 - 8
lisp/org-latex.el

@@ -218,6 +218,7 @@ For example, adding an entry
 will cause \\usepackage[utf8x]{inputenc} to be used for buffers that
 will cause \\usepackage[utf8x]{inputenc} to be used for buffers that
 are written as utf8 files."
 are written as utf8 files."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type '(repeat
   :type '(repeat
 	  (cons
 	  (cons
 	   (string :tag "Derived from buffer")
 	   (string :tag "Derived from buffer")
@@ -283,6 +284,7 @@ markup defined, the first one in the association list will be used."
 (defcustom org-export-latex-tag-markup "\\textbf{%s}"
 (defcustom org-export-latex-tag-markup "\\textbf{%s}"
   "Markup for tags, as a printf format."
   "Markup for tags, as a printf format."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'string)
   :type 'string)
 
 
 (defcustom org-export-latex-timestamp-markup "\\textit{%s}"
 (defcustom org-export-latex-timestamp-markup "\\textit{%s}"
@@ -293,6 +295,7 @@ markup defined, the first one in the association list will be used."
 (defcustom org-export-latex-timestamp-inactive-markup "\\textit{%s}"
 (defcustom org-export-latex-timestamp-inactive-markup "\\textit{%s}"
   "A printf format string to be applied to inactive time stamps."
   "A printf format string to be applied to inactive time stamps."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'string)
   :type 'string)
 
 
 (defcustom org-export-latex-timestamp-keyword-markup "\\texttt{%s}"
 (defcustom org-export-latex-timestamp-keyword-markup "\\texttt{%s}"
@@ -302,11 +305,12 @@ markup defined, the first one in the association list will be used."
 
 
 (defcustom org-export-latex-href-format "\\href{%s}{%s}"
 (defcustom org-export-latex-href-format "\\href{%s}{%s}"
   "A printf format string to be applied to href links.
   "A printf format string to be applied to href links.
-The format must contain either two %s instances or just one.  
-If it contains two %s instances, the first will be filled with 
+The format must contain either two %s instances or just one.
+If it contains two %s instances, the first will be filled with
 the link, the second with the link description.  If it contains
 the link, the second with the link description.  If it contains
 only one, the %s will be filled with the link."
 only one, the %s will be filled with the link."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'string)
   :type 'string)
 
 
 (defcustom org-export-latex-hyperref-format "\\hyperref[%s]{%s}"
 (defcustom org-export-latex-hyperref-format "\\hyperref[%s]{%s}"
@@ -314,11 +318,13 @@ only one, the %s will be filled with the link."
 The format must contain one or two %s instances.  The first one
 The format must contain one or two %s instances.  The first one
 will be filled with the link, the second with its description."
 will be filled with the link, the second with its description."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'string)
   :type 'string)
 
 
 (defcustom org-export-latex-footnote-separator "\\textsuperscript{,}\\,"
 (defcustom org-export-latex-footnote-separator "\\textsuperscript{,}\\,"
   "Text used to separate footnotes."
   "Text used to separate footnotes."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'string)
   :type 'string)
 
 
 (defcustom org-export-latex-quotes
 (defcustom org-export-latex-quotes
@@ -336,6 +342,7 @@ For each item in a CONS, the first string is a regexp
 for allowed characters before/after the quote, the second
 for allowed characters before/after the quote, the second
 string defines the replacement string for this quote."
 string defines the replacement string for this quote."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type '(list
   :type '(list
 	  (cons :tag "Opening quote"
 	  (cons :tag "Opening quote"
 		(string :tag "Regexp for char before")
 		(string :tag "Regexp for char before")
@@ -361,6 +368,7 @@ string defines the replacement string for this quote."
   "When non-nil, the caption is set above the table.  When nil,
   "When non-nil, the caption is set above the table.  When nil,
 the caption is set below the table."
 the caption is set below the table."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'boolean)
   :type 'boolean)
 
 
 (defcustom org-export-latex-tables-column-borders nil
 (defcustom org-export-latex-tables-column-borders nil
@@ -478,6 +486,7 @@ Code blocks exported with the listings package (controlled by the
 `org-export-latex-listings' variable) can be named in the style
 `org-export-latex-listings' variable) can be named in the style
 of noweb."
 of noweb."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'boolean)
   :type 'boolean)
 
 
 (defcustom org-export-latex-minted-langs
 (defcustom org-export-latex-minted-langs
@@ -499,6 +508,7 @@ with:
 pygmentize -L lexers
 pygmentize -L lexers
 "
 "
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type '(repeat
   :type '(repeat
 	  (list
 	  (list
 	   (symbol :tag "Major mode       ")
 	   (symbol :tag "Major mode       ")
@@ -522,6 +532,7 @@ black keywords.
 Note that the same options will be applied to blocks of all
 Note that the same options will be applied to blocks of all
 languages."
 languages."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type '(repeat
   :type '(repeat
 	  (list
 	  (list
 	   (string :tag "Listings option name ")
 	   (string :tag "Listings option name ")
@@ -545,6 +556,7 @@ will result in src blocks being exported with
 as the start of the minted environment. Note that the same
 as the start of the minted environment. Note that the same
 options will be applied to blocks of all languages."
 options will be applied to blocks of all languages."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type '(repeat
   :type '(repeat
 	  (list
 	  (list
 	   (string :tag "Minted option name ")
 	   (string :tag "Minted option name ")
@@ -586,11 +598,13 @@ and `org-export-with-tags' instead."
 (defcustom org-latex-default-figure-position "htb"
 (defcustom org-latex-default-figure-position "htb"
   "Default position for latex figures."
   "Default position for latex figures."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'string)
   :type 'string)
 
 
 (defcustom org-export-latex-tabular-environment "tabular"
 (defcustom org-export-latex-tabular-environment "tabular"
   "Default environment used to build tables."
   "Default environment used to build tables."
   :group 'org-export-latex
   :group 'org-export-latex
+  :version "24.1"
   :type 'string)
   :type 'string)
 
 
 (defcustom org-export-latex-inline-image-extensions
 (defcustom org-export-latex-inline-image-extensions
@@ -657,6 +671,18 @@ This function should accept the file name as its single argument."
 		   "bibtex %b"
 		   "bibtex %b"
 		   "pdflatex -interaction nonstopmode -output-directory %o %f"
 		   "pdflatex -interaction nonstopmode -output-directory %o %f"
 		   "pdflatex -interaction nonstopmode -output-directory %o %f"))
 		   "pdflatex -interaction nonstopmode -output-directory %o %f"))
+	  (const :tag "2 runs of xelatex"
+		 ("xelatex -interaction nonstopmode -output-directory %o %f"
+		   "xelatex -interaction nonstopmode -output-directory %o %f"))
+	  (const :tag "3 runs of xelatex"
+		 ("xelatex -interaction nonstopmode -output-directory %o %f"
+		   "xelatex -interaction nonstopmode -output-directory %o %f"
+		   "xelatex -interaction nonstopmode -output-directory %o %f"))
+	  (const :tag "xelatex,bibtex,xelatex,xelatex"
+		 ("xelatex -interaction nonstopmode -output-directory %o %f"
+		   "bibtex %b"
+		   "xelatex -interaction nonstopmode -output-directory %o %f"
+		   "xelatex -interaction nonstopmode -output-directory %o %f"))
 	  (const :tag "texi2dvi"
 	  (const :tag "texi2dvi"
 		 ("texi2dvi -p -b -c -V %f"))
 		 ("texi2dvi -p -b -c -V %f"))
 	  (const :tag "rubber"
 	  (const :tag "rubber"
@@ -667,6 +693,7 @@ This function should accept the file name as its single argument."
   '("aux" "idx" "log" "out" "toc" "nav" "snm" "vrb")
   '("aux" "idx" "log" "out" "toc" "nav" "snm" "vrb")
   "The list of file extensions to consider as LaTeX logfiles."
   "The list of file extensions to consider as LaTeX logfiles."
   :group 'org-export-pdf
   :group 'org-export-pdf
+  :version "24.1"
   :type '(repeat (string :tag "Extension")))
   :type '(repeat (string :tag "Extension")))
 
 
 (defcustom org-export-pdf-remove-logfiles t
 (defcustom org-export-pdf-remove-logfiles t
@@ -1224,7 +1251,7 @@ numbered sections and lower levels as unnumbered sections."
 					     org-export-target-aliases))))
 					     org-export-target-aliases))))
 	 (sectioning org-export-latex-sectioning)
 	 (sectioning org-export-latex-sectioning)
 	 (depth org-export-latex-sectioning-depth)
 	 (depth org-export-latex-sectioning-depth)
-	 main-heading sub-heading)
+	 main-heading sub-heading ctnt)
     (when (symbolp (car sectioning))
     (when (symbolp (car sectioning))
       (setq sectioning (funcall (car sectioning) level heading))
       (setq sectioning (funcall (car sectioning) level heading))
       (when sectioning
       (when sectioning
@@ -1291,10 +1318,13 @@ numbered sections and lower levels as unnumbered sections."
 		 (delete-region (point-at-bol 0) (point))
 		 (delete-region (point-at-bol 0) (point))
 	       (insert (format "\\begin{%s}\n"
 	       (insert (format "\\begin{%s}\n"
 			       (symbol-name org-export-latex-low-levels))))
 			       (symbol-name org-export-latex-low-levels))))
-	     (insert (format "\n\\item %s\\\\\n%s%%"
-			     heading
-			     (if label (format "\\label{%s}" label) "")))
-	     (insert (org-export-latex-content content))
+	     (let ((ctnt (org-export-latex-content content)))
+	       (insert (format (if (not (equal (replace-regexp-in-string "\n" "" ctnt) ""))
+				   "\n\\item %s\\\\\n%s%%"
+				 "\n\\item %s\n%s%%")
+			       heading
+			       (if label (format "\\label{%s}" label) "")))
+	       (insert ctnt))
 	     (cond ((stringp subcontent) (insert subcontent))
 	     (cond ((stringp subcontent) (insert subcontent))
 		   ((listp subcontent) (org-export-latex-sub subcontent)))
 		   ((listp subcontent) (org-export-latex-sub subcontent)))
 	     (insert (format "\\end{%s} %% ends low level\n"
 	     (insert (format "\\end{%s} %% ends low level\n"
@@ -2231,7 +2261,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 		;; a LaTeX issue, but we here implement a work-around anyway.
 		;; a LaTeX issue, but we here implement a work-around anyway.
 		(setq path (org-export-latex-protect-amp path)
 		(setq path (org-export-latex-protect-amp path)
 		      desc (org-export-latex-protect-amp desc)))
 		      desc (org-export-latex-protect-amp desc)))
-	      (insert 
+	      (insert
 	       (if (string-match "%s.*%s" org-export-latex-href-format)
 	       (if (string-match "%s.*%s" org-export-latex-href-format)
 		   (format org-export-latex-href-format path desc)
 		   (format org-export-latex-href-format path desc)
 		 (format org-export-latex-href-format path))))
 		 (format org-export-latex-href-format path))))