From: tsd@tsdye.com (Thomas S. Dye)
To: Org-mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Add an attribute to the new LaTeX exporter
Date: Tue, 08 Jan 2013 14:22:11 -1000 [thread overview]
Message-ID: <m1lic3tdcc.fsf@poto.myhome.westell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch for new LaTeX exporter --]
[-- Type: text/x-patch, Size: 3397 bytes --]
From b1eeaf68296e765b5653e77ca0533b2f21808473 Mon Sep 17 00:00:00 2001
From: Thomas Dye <tsd@tsdye.com>
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
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
--
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
next reply other threads:[~2013-01-09 0:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-09 0:22 Thomas S. Dye [this message]
2013-01-09 15:09 ` [PATCH] Add an attribute to the new LaTeX exporter Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1lic3tdcc.fsf@poto.myhome.westell.com \
--to=tsd@tsdye.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).