Browse Source

Fix some problems with the new LaTeX setup

Carsten Dominik 15 years ago
parent
commit
b385c98d26
1 changed files with 23 additions and 11 deletions
  1. 23 11
      lisp/org.el

+ 23 - 11
lisp/org.el

@@ -2943,6 +2943,8 @@ will be appended."
 (defcustom org-export-latex-default-packages-alist
 (defcustom org-export-latex-default-packages-alist
   '(("AUTO" "inputenc")
   '(("AUTO" "inputenc")
     ("T1"   "fontenc")
     ("T1"   "fontenc")
+    (""     "textcomp")
+    (""     "fixltx2e")
     (""     "graphicx")
     (""     "graphicx")
     (""     "longtable")
     (""     "longtable")
     (""     "float")
     (""     "float")
@@ -2954,7 +2956,10 @@ will be appended."
     (""     "wasysym")
     (""     "wasysym")
     (""     "latexsym")
     (""     "latexsym")
     (""     "amssymb")
     (""     "amssymb")
-    (""     "hyperref"))
+    (""     "hyperref")
+;    (""     "microtype")
+    "\\tolerance=1000"
+    )
   "Alist of default packages to be inserted in the header.
   "Alist of default packages to be inserted in the header.
 Change this only if one of the packages here causes an incompatibility
 Change this only if one of the packages here causes an incompatibility
 with another package you are using.
 with another package you are using.
@@ -2976,9 +2981,11 @@ some other package that conflicts with one of the default packages.
 Each cell is of the format \( \"options\" \"package\" \)."
 Each cell is of the format \( \"options\" \"package\" \)."
   :group 'org-export-latex
   :group 'org-export-latex
   :type '(repeat
   :type '(repeat
-	  (list
-	   (string :tag "options")
-	   (string :tag "package"))))
+	  (choice 
+	   (string :tag "A line of LaTeX")
+	   (list :tag "options/package pair"
+		 (string :tag "options")
+		 (string :tag "package")))))
 
 
 (defcustom org-export-latex-packages-alist nil
 (defcustom org-export-latex-packages-alist nil
   "Alist of packages to be inserted in every LaTeX the header.
   "Alist of packages to be inserted in every LaTeX the header.
@@ -2991,9 +2998,11 @@ Make sure that you only lis packages here which:
 - do not conflict with the setup in `org-format-latex-header'."
 - do not conflict with the setup in `org-format-latex-header'."
   :group 'org-export-latex
   :group 'org-export-latex
   :type '(repeat
   :type '(repeat
-	  (list
-	   (string :tag "options")
-	   (string :tag "package"))))
+	  (choice 
+	   (string :tag "A line of LaTeX")
+	   (list :tag "options/package pair"
+		 (string :tag "options")
+		 (string :tag "package")))))
 
 
 (defgroup org-appearance nil
 (defgroup org-appearance nil
   "Settings for Org-mode appearance."
   "Settings for Org-mode appearance."
@@ -15332,7 +15341,7 @@ EXTRA is a string."
 	(setq rpl (if (or (match-end 1) (not extra))
 	(setq rpl (if (or (match-end 1) (not extra))
 		      "" (concat extra "\n"))
 		      "" (concat extra "\n"))
 	      tpl (replace-match rpl t t tpl))
 	      tpl (replace-match rpl t t tpl))
-      (if pkg (setq end (org-latex-packages-to-string pkg))))
+      (if pkg (setq end (concat end "\n" (org-latex-packages-to-string pkg)))))
 
 
     (if (string-match "\\S-" end)
     (if (string-match "\\S-" end)
 	(concat tpl "\n" end)
 	(concat tpl "\n" end)
@@ -15341,10 +15350,13 @@ EXTRA is a string."
 (defun org-latex-packages-to-string (pkg &optional newline)
 (defun org-latex-packages-to-string (pkg &optional newline)
   "Turn an alist of packages into a string with the \\usepackage macros."
   "Turn an alist of packages into a string with the \\usepackage macros."
   (setq pkg (mapconcat (lambda(p)
   (setq pkg (mapconcat (lambda(p)
-			 (if (equal "" (car p))
-			     (format "\\usepackage{%s}" (cadr p))
+			 (cond
+			  ((stringp p) p)
+			  ((equal "" (car p))
+			   (format "\\usepackage{%s}" (cadr p)))
+			  (t
 			   (format "\\usepackage[%s]{%s}"
 			   (format "\\usepackage[%s]{%s}"
-				   (car p) (cadr p))))
+				   (car p) (cadr p)))))
 		       pkg
 		       pkg
 		       "\n"))
 		       "\n"))
   (if newline (concat pkg "\n") pkg))
   (if newline (concat pkg "\n") pkg))