From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: [PATCH] Add an attribute to the new LaTeX exporter Date: Tue, 08 Jan 2013 14:22:11 -1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsjRG-0002bL-1c for emacs-orgmode@gnu.org; Tue, 08 Jan 2013 19:22:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsjRE-0000dU-LH for emacs-orgmode@gnu.org; Tue, 08 Jan 2013 19:22:37 -0500 Received: from oproxy11-pub.bluehost.com ([173.254.64.10]:53348) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TsjRE-0000dM-CL for emacs-orgmode@gnu.org; Tue, 08 Jan 2013 19:22:36 -0500 Received: from [72.253.173.33] (port=50272 helo=poto.myhome.westell.com) by box472.bluehost.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1TsjQo-0005eR-J1 for emacs-orgmode@gnu.org; Tue, 08 Jan 2013 17:22:11 -0700 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode --=-=-= Content-Type: text/plain Aloha all, A journal is asking for a section of figure legends created like this: \section*{Figure Legends} \begin{figure}[!ht] \begin{center} %\includegraphics[width=4in]{figure_name.2.eps} \end{center} \caption{ {\bf Bold the first sentence.} Rest of figure 2 caption. Caption should be left justified, as specified by the options to the caption package. } \label{Figure_label} \end{figure} The attached patch introduces an attribute to toggle commenting the \includegraphics call. All the best, Tom --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-New-LaTeX-exporter-Added-an-attribute.patch Content-Description: Patch for new LaTeX exporter >From b1eeaf68296e765b5653e77ca0533b2f21808473 Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Tue, 8 Jan 2013 14:04:14 -1000 Subject: [PATCH] New LaTeX exporter: Added an attribute * contrib/lisp/org-e-latex.el: Added an attribute, :comment-include, to toggle commenting the \includegraphics call. Journals sometimes ask for a list of figure captions. --- contrib/lisp/org-e-latex.el | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el index 7987369..79ae355 100644 --- a/contrib/lisp/org-e-latex.el +++ b/contrib/lisp/org-e-latex.el @@ -74,13 +74,15 @@ ;; (i.e. "inparaenum"). The second one allows to specify optional ;; arguments for that environment (square brackets are not mandatory). ;; -;; Images accept `:float', `:placement' and `:options' as attributes. -;; `:float' accepts a symbol among `wrap', `multicolumn', and -;; `figure', which defines the float environment for the table (if -;; unspecified, an image with a caption will be set in a "figure" -;; environment). `:placement' is a string that will be used as -;; argument for the environment chosen. `:options' is a string that -;; will be used as the optional argument for "includegraphics" macro. +;; Images accept `:float', `:placement', `:comment-include', and +;; `:options' as attributes. `:float' accepts a symbol among `wrap', +;; `multicolumn', and `figure', which defines the float environment +;; for the table (if unspecified, an image with a caption will be set +;; in a "figure" environment). `:comment-include' is a boolean that +;; toggles whether to comment out the \includegraphics +;; call. `:placement' is a string that will be used as argument for +;; the environment chosen. `:options' is a string that will be used +;; as the optional argument for "includegraphics" macro. ;; ;; This back-end also offers enhanced support for footnotes. Thus, it ;; handles nested footnotes, footnotes in tables and footnotes in item @@ -1745,6 +1747,10 @@ used as a communication channel." ((eq float 'figure) (format "[%s]" org-e-latex-default-figure-position)) (t "")))) + (comment-include + (let ((cmt-inc (plist-get attr :comment-include))) + (cond (cmt-inc "%") + (t "")))) ;; Options for "includegraphics" macro. Make sure it is ;; a string with square brackets when non empty. Default to ;; `org-e-latex-image-default-option' when possible. @@ -1760,16 +1766,16 @@ used as a communication channel." (case float (wrap (format "\\begin{wrapfigure}%s \\centering -\\includegraphics%s{%s} -%s\\end{wrapfigure}" placement options path caption)) +%s\\includegraphics%s{%s} +%s\\end{wrapfigure}" placement comment-include options path caption)) (multicolumn (format "\\begin{figure*}%s \\centering -\\includegraphics%s{%s} -%s\\end{figure*}" placement options path caption)) +%s\\includegraphics%s{%s} +%s\\end{figure*}" placement comment-include options path caption)) (figure (format "\\begin{figure}%s \\centering -\\includegraphics%s{%s} -%s\\end{figure}" placement options path caption)) +%s\\includegraphics%s{%s} +%s\\end{figure}" placement comment-include options path caption)) (t (format "\\includegraphics%s{%s}" options path))))) (defun org-e-latex-link (link desc info) -- 1.8.0.2 --=-=-= Content-Type: text/plain -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com --=-=-=--