emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Centering side-by-side images in latex/pdf export
@ 2017-01-12 10:24 knubee
  0 siblings, 0 replies; 2+ messages in thread
From: knubee @ 2017-01-12 10:24 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1961 bytes --]

I recently opened some .org files from a year ago and tried to generate new
PDFs from them. There have been significant updates to emacs, org-mode, and
the relevant LaTeX packages I use, so some parts of the source had to be
changed. Mostly, everything is working now except for generating PDFs with
centered, side by side images.

Here is what used to work:

    #+BEGIN_center
    #+ATTR_LaTeX: :height 0.2\textwidth
    [[image1.png]]
    #+ATTR_LaTeX: :height 0.2\textwidth
    [[image2.png]]
    #+END_center

I am currently using emacs 26.0.50, orgmode 9.0.3, with TeX Live 2016 on
Debian and the example above results in images that are stacked on top of
each other. When I examine the TeX source, this is the result:

    \begin{center}
    \begin{center}
    \includegraphics[height=0.2\textwidth]{image1.png}
    \end{center}
    \begin{center}
    \includegraphics[height=0.2\textwidth]{image2.png}
    \end{center}
    \end{center}

I assume this is related to recent change in org-mode where images are
centered by default. However, the following change to the org source does
not solve the problem.

    #+ATTR_LaTeX: :height 0.2\textwidth
    [[image1.png]]
    #+ATTR_LaTeX: :height 0.2\textwidth
    [[image2.png]]

The images are still stacked on top of each other (although the outer
"\center" calls are no longer present in resulting tex source):

    \begin{center}
    \includegraphics[height=0.2\textwidth]{image1.png}
    \end{center}
    \begin{center}
    \includegraphics[height=0.2\textwidth]{image2.png}
    \end{center}

I am able to get the images side by side if I disable org-mode's automatic
centering:

    #+ATTR_LaTeX: :height 0.2\textwidth :center
    [[image1.png]]
    #+ATTR_LaTeX: :height 0.2\textwidth :center
    [[image2.png]]

But how can I get side by side images centered? Perhaps the answer is very
 simple and obvious, but I have tried many other changes and been unable to
accomplish this.

thanks in advance.

[-- Attachment #2: Type: text/html, Size: 2543 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Centering side-by-side images in latex/pdf export
       [not found] <708f08e1afcd4532b9916fb78df6028f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2017-01-13  6:34 ` Eric S Fraga
  0 siblings, 0 replies; 2+ messages in thread
From: Eric S Fraga @ 2017-01-13  6:34 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

On Thursday, 12 Jan 2017 at 10:24, knubee wrote:
> I recently opened some .org files from a year ago and tried to
> generate new PDFs from them. There have been significant updates to
> emacs, org-mode, and the relevant LaTeX packages I use, so some parts
> of the source had to be changed. Mostly, everything is working now
> except for generating PDFs with centered, side by side images.

[...]

> I am able to get the images side by side if I disable org-mode's
> automatic centering:
>
>     #+ATTR_LaTeX: :height 0.2\textwidth :center
>     [[image1.png]]
>     #+ATTR_LaTeX: :height 0.2\textwidth :center
>     [[image2.png]]
>
> But how can I get side by side images centered? Perhaps the answer is
> very simple and obvious, but I have tried many other changes and been
> unable to accomplish this.

Put those 4 lines within the #+begin_center ... #+end_center?  Works for
me.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.3-201-ga51c6f

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-13  8:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <708f08e1afcd4532b9916fb78df6028f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-01-13  6:34 ` Centering side-by-side images in latex/pdf export Eric S Fraga
2017-01-12 10:24 knubee

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