jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.61k stars 3.38k forks source link

Allow to center images without caption in Beamer #3995

Closed paulmenzel closed 7 years ago

paulmenzel commented 7 years ago

Pandoc 1.19.2.1 from Ubuntu 17.10

# Something about the speaker

-   First fact
-   Second fact

![Organisation logo](images/logo.png)

-   Something about the organisation

This way, there is a caption as described in the manual. But that is not wanted. So, add a non-breaking space, gets rid of the caption but doesn’t center the image anymore.

# Something about the speaker

-   First fact
-   Second fact

![Organisation logo](images/logo.png)\

-   Something about the organisation

Wanting a centered image without caption should be common on slides.

jgm commented 7 years ago

You could always add a class with image attributes and add some CSS to make sure that images with that class are centered.

paulmenzel commented 7 years ago

Do CSS attributes also work with LaTeX Beamer?

mb21 commented 7 years ago

Pandoc doesn't aim to be a layout engine, see http://pandoc.org/CONTRIBUTING.html#out-of-scope

However, you can change your LaTeX template or even write raw TeX (for both, see the MANUAL).

paulmenzel commented 7 years ago

I know that I can write raw TeX, but than I’d loose the possibility to convert it to reveal.js for example.

As there is already a way to pass attributes like width and height in curly braces, it be great to also be able to display the position. That doesn’t go against Pandoc’s goal. So please re-open.

jgm commented 7 years ago

Another option is to use a filter. Add a center class:

![Organisation logo](images/logo.png){.center}\

For HTML/reveal.js, you just need to add some appropriate CSS. For LaTeX/Beamer, you can use a filter that finds images with the center class and adds a bit of raw TeX to do the centering.

jmmcd commented 4 years ago

Another option is to use   as the caption:

![ ](img/path/file.png)
dreirund commented 1 year ago

Another solution is to switch off captions in the preamble:

Create a file LaTeX_additional_preamble.tex with

\usepackage{caption}
\DeclareCaptionFormat{empty}{}\captionsetup{format=empty}

and pass it to pandoc via -H LaTeX_additional_preamble.tex.