emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Eric S Fraga <e.fraga@ucl.ac.uk>
Cc: Emacs Org mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: [patch] give tables their own default placement in LaTeX export
Date: Thu, 10 Nov 2022 02:19:02 +0000	[thread overview]
Message-ID: <87sfirk0vd.fsf@localhost> (raw)
In-Reply-To: <87sfsgs644.fsf@ucl.ac.uk>

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> attached is a small patch to give tables their own default placement in
> LaTeX export.  Up to now, tables have used the default placement for
> figures but figures and tables are very different creatures so it does
> not make sense to have just one default for both.

Thanks for the patch, and sorry for the late reply.
This looks like a useful addition.

> This patch unfortunately could break documents (if people have changed
> the default for figures, expecting that change to apply to tables as
> well) but I see no way to avoid this.  So maybe not worth incorporating
> but I leave that decision to others.

There is a way to avoid this. See the comments below.

> Subject: [PATCH] lisp/ox-latex.el: give tables their own placement default
> * ox-latex.el (org-latex--org-table): define and use a new variable,
> org-latex-default-table-position, for setting the default placement
> option for the export of tables.

Please start sentences from capital letter and quote `symbols'.

> +*** Tables now have separate default placement option for LaTeX export
> +
> +Tables and figures now have separate settings for the default
> +placement in LaTeX export.

Please mention the new variable name.

> +(defcustom org-latex-default-table-position "htbp"

You can use

(defcustom org-latex-default-table-position nil

as the default value. Then, you can fallback for figure position in the
code when the value is nil. Need to update docstring accordingly.

> +  "Default position for LaTeX tables."
> +  :group 'org-export-latex
> +  :type 'string
> +  :version "26.1"

:version is not needed.

> +  :package-version '(Org . "9.0")


>  	  (or (plist-get attributes :placement)
> -	      (format "[%s]" (plist-get info :latex-default-figure-position))))
> +	      (format "[%s]" (plist-get info :latex-default-table-position))))

Can use

(or (plist-get info :latex-default-table-position)
    (plist-get info :latex-default-figure-position))

Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

  reply	other threads:[~2022-11-10  2:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18 12:37 [patch] give tables their own default placement in LaTeX export Eric S Fraga
2022-11-10  2:19 ` Ihor Radchenko [this message]
2023-04-05  9:33   ` Ihor Radchenko

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:

  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=87sfirk0vd.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \


* 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


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).