Skip to content

Commit

Permalink
Added information about disabling image floating (noraj#44)
Browse files Browse the repository at this point in the history
* Added information about disabling image floating

* Fix typo in FAQ.md

Co-authored-by: Alexandre ZANNI <16578570+noraj@users.noreply.github.com>

---------

Co-authored-by: Alexandre ZANNI <16578570+noraj@users.noreply.github.com>
  • Loading branch information
jwhenry28 and noraj authored Apr 2, 2023
1 parent f6cef2d commit ad93904
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,20 @@ Then testing all syntax highlight styles for all languages:
```zsh
$ for s in $(pandoc --list-highlight-styles); do pandoc --template eisvogel --highlight-style $s -o highlight-$s.pdf highlight-languages.md; done;
```

## Why are my images formatted in the wrong locations?

This is a [known and open issue with pandoc](https://github.com/jgm/pandoc/issues/845). A simple hack is to create a file called `disable_float.tex` with the following content:

```latex
\usepackage{float}
\let\origfigure\figure
\let\endorigfigure\endfigure
\renewenvironment{figure}[1][2] {
\expandafter\origfigure\expandafter[H]
} {
\endorigfigure
}
```

Then add `-H path/to/disable_float.tex` to your `pandoc` command when rendering the report. This will force `pandoc` to render the images in the order that they appear in the original Markdown file while also preserving their captions. [Source](http://stackoverflow.com/a/33801326/1407737).

0 comments on commit ad93904

Please sign in to comment.