From: Nicolas Goaziou <n.goaziou@gmail.com>
To: feng shu <tumashu@gmail.com>
Cc: Bastien <bzg@gnu.org>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] (update) Add :caption attribute to #+ATTR_LATEX property
Date: Mon, 01 Jul 2013 23:38:15 +0200 [thread overview]
Message-ID: <8761wuq7ug.fsf@gmail.com> (raw)
In-Reply-To: <CAJpRBmfto__OT36kxzAs+Pmdw46pKRZT9DTR66vpih_mQU608g@mail.gmail.com> (feng shu's message of "Mon, 1 Jul 2013 07:08:55 +0800")
Hello,
feng shu <tumashu@gmail.com> writes:
> Thanks for your help. This is V4 patch.
Thanks for the update. More comments below.
> +@item :caption
> +By default, you should use @code{#+caption} keyword to add a table caption.
> +If you want to add caption with complex or special latex commands, you can use
> +@code{:caption} attribute. It will precedence over @code{#+caption} keyword.
> +It should be set with raw latex command and nothing in it will be
> +interpreted by Org.
You need to use upper cases for keywords: @code{#+CAPTION}. Also,
sentences are expected to end with two spaces and latex should be typed
@LaTeX{}. Here is a suggestion (note that I'm not a wording expert):
@code{#+CAPTION} keyword is the simplest way to set a caption for
a table (@pxref{Images and tables}). If you need more advanced commands
for that task, you can use @code{:caption} attribute instead. Its value
should be raw @LaTeX{} code. It has precedence over @code{#+CAPTION}.
> +When export the below example to latex, the table caption will be set
> +with latex command @code{\bicaption@{Heading A@}@{Heading B@}} instead of
> +@code{#+CAPTION} keywords.
In the example below, @LaTeX{} command @code{\bicaption@{Heading
A@}@{Heading B@}} will set the caption. (I think you can drop the rest
of the sentence).
> -@code{:width} and @code{:height} attributes. It is also possible to add any
> -other option with the @code{:options} attribute, as shown in the following
> -example:
> +@code{:width} and @code{:height} attributes. If you want to set image
> +caption with special latex command, you can use @code{:caption} attribute,
> +for example:
Besides the missing two spaces at the end of the sentence, I suggest the
following:
You can specify specify image width or height with, respectively,
@code{:width} and @code{:height} attributes. It is also possible to add any
other option with the @code{:options} attribute, as shown in the following
example:
EXAMPLE
If you need a specific command for the caption, use @code{:caption}
attribute. It will override standard @code{#+CAPTION} value, if any.
EXAMPLE?
Also, you don't seem to document the feature for special blocks.
> - (short (org-export-get-caption element t)))
> - (cond
> - ((and (not main) (equal label-str "")) "")
> - ((not main) (concat label-str "\n"))
> - ;; Option caption format with short name.
> - (short (format "\\caption[%s]{%s%s}\n"
> - (org-export-data short info)
> - label-str
> - (org-export-data main info)))
> - ;; Standard caption format.
> - (t (format "\\caption{%s%s}\n" label-str (org-export-data main info))))))
> + (short (org-export-get-caption element t))
> + (caption-from-attr-latex (org-export-read-attribute :attr_latex element :caption)))
> + (cond ((org-string-nw-p caption-from-attr-latex)
> + (concat caption-from-attr-latex "\n"))
> + ((and (not main) (equal label-str "")))
Why do you drop the return value (empty string) here?
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2013-07-01 21:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-29 23:10 [PATCH] (update) Add :caption attribute to #+ATTR_LATEX property feng shu
2013-06-30 11:46 ` Nicolas Goaziou
2013-06-30 14:27 ` feng shu
2013-06-30 20:27 ` Bastien
2013-06-30 23:08 ` feng shu
2013-07-01 13:10 ` Bastien
2013-07-01 21:38 ` Nicolas Goaziou [this message]
2013-07-01 23:58 ` feng shu
2013-07-02 17:03 ` 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=8761wuq7ug.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=tumashu@gmail.com \
/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).