emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Peter Davis <pfd@pfdstudio.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Vertically aligning images in tables?
Date: Fri, 15 Jan 2016 16:44:07 +0000	[thread overview]
Message-ID: <87ziw6vlm0.fsf@delle7240.chemeng.ucl.ac.uk> (raw)
In-Reply-To: <6sw6c7fuxzvmu6.fsf@BO-C02PWE1MG8WN.home> (Peter Davis's message of "Thu, 14 Jan 2016 17:05:21 -0500")

On Thursday, 14 Jan 2016 at 17:05, Peter Davis wrote:
> I'm trying to place three images side-by-side to they're top-aligned,
> but I can't see to find a way to get org-mode to do this. My
> current code is:
>
> +----
> | #+MACRO: p  \includegraphics[scale=.3]{$1}
> | #+ATTR_LATEX: :align {p{5cm} p{5cm} p{5cm}}
> | | {{{p(./A.png)}}} | {{{p(./B.png)}}} | {{{p(./C.png)}}}   |
> +----
>
> As far as I can tell from LaTeX doc, the p attribute is supposed to
> top-align the contents, but it's not doing that.

Yes and no... :-)

The p directive will top align in the sense that the first line of each
entry will be at the top of the vertical space provided for the row once
all columns in the row have been defined.  However, the images will be
bottom aligned on the baseline of the first line in that row and all the
columns will have the same baseline.  The height of the first line in
each paragraph will all be the same, equal to the maximum of the heights
of the first lines in all the columns.  Therefore, if the images have
different heights, they will not be aligned with respect to the tops of
the images.  

I hope this makes sense.

A solution is to use a parbox of the right (and equal) height for each
image.  Enclose the includegraphics within a parbox but you will have to
preset the height to use...  

HTH,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.3-449-gd85ff3

  parent reply	other threads:[~2016-01-15 16:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 22:05 Vertically aligning images in tables? Peter Davis
2016-01-15 12:16 ` Rasmus
2016-01-15 16:44 ` Eric S Fraga [this message]
2016-01-15 17:03 ` Eric S Fraga
2016-01-15 17:10 ` John Hendy
  -- strict thread matches above, loose matches on Subject: below --
2016-01-15 15:16 Peter Davis
2016-01-15 17:13 ` Rasmus
2016-01-15 17:15   ` Rasmus
2016-01-15 18:18 Peter Davis
2016-01-15 18:24 Peter Davis
2016-01-15 19:36 ` John Hendy
2016-01-15 18:26 Peter Davis

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=87ziw6vlm0.fsf@delle7240.chemeng.ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=pfd@pfdstudio.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).