Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating figures: force position #845

Closed
kovla opened this issue May 3, 2013 · 11 comments
Closed

Floating figures: force position #845

kovla opened this issue May 3, 2013 · 11 comments

Comments

@kovla
Copy link

kovla commented May 3, 2013

It doesn't look like this issue has been raised before, so here goes. In Markdown, one currently has two options to specify a graphical image:

  1. As a figure with caption.
  2. As an inline image without caption.

Upon conversion to PDF a figure with caption would float, most often landing on the final page of the document. While it is possible to force the image to remain in place, this occurs at the cost of losing the caption.

This has been discussed here: http://bit.ly/18hElYg, but the workaround is not very elegant, and certainly breaks the automated workflow.

@tonytonyjan
Copy link

+1
and float package conflicts with fixltx2e package.

@posiczko
Copy link

FWIW:

The sub-elegant workaround @kovla mentions which involves float package, outputing from pandoc into tex, forcing figure not to float with placement specifier of H to the figures, can generate TOC, but you must rerun your latex twice (at least this is the case with xelatex).

@edusantana
Copy link

I got a warning saying that fixltx2e is no longer needed?:

Package fixltx2e Warning: fixltx2e is not required with releases after 2015
(fixltx2e)                All fixes are now in the LaTeX kernel.
(fixltx2e)                See the latexrelease package for details.

@jgm
Copy link
Owner

jgm commented May 31, 2016

Yes -- it's just a warning, so I think it's harmless to
leave it in for a while longer, given that some users may
still have pre-2015 latex versions.

+++ Eduardo de Santana Medeiros Alexandre [May 29 16 13:10 ]:

I got a warning saying that fixltx2e is no longer needed?:
Package fixltx2e Warning: fixltx2e is not required with releases after 2015
(fixltx2e) All fixes are now in the LaTeX kernel.
(fixltx2e) See the latexrelease package for details.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, [1]view it on GitHub, or [2]mute the
thread.

References

  1. Floating figures: force position #845 (comment)
  2. https://github.com/notifications/unsubscribe/AAAL5E5QeLKvhPac4nLR81GoN3XAWESjks5qGfLTgaJpZM4AoLED

@faridcher
Copy link

This solution worked for me:

http://stackoverflow.com/a/33801326/1407737

@krakrjak
Copy link

krakrjak commented Jan 5, 2017

Ditto: @faridcher
To implement the snippet linked above just make a fix-captions.tex file with the given contents and modify your pandoc command line to contain -H fix-captions.tex and you are good to go.

@mb21
Copy link
Collaborator

mb21 commented Mar 2, 2018

@faridcher's solution seems to be adequate, thus closing this issue.

@mb21 mb21 closed this as completed Mar 2, 2018
@wilx
Copy link
Contributor

wilx commented Mar 2, 2018

It might be enough to override default placement like this:

\makeatletter
\def\fps@figure{h}
\makeatother

@mirageglobe
Copy link

@wilx

thus for the pandoc markdown it will be like this?

---
header-includes: |
  \makeatletter
  \def\fps@figure{h}
  \makeatother
---

@quizilkend
Copy link

@wilx

thus for the pandoc markdown it will be like this?

---
header-includes: |
  \makeatletter
  \def\fps@figure{h}
  \makeatother
---

This seems to work.

@MrSauna
Copy link

MrSauna commented Dec 4, 2022

This was not working for me. I had to change the h to uppercase H. I do not know what is technically happening but it seems to be working.

---
header-includes: |
  \makeatletter
  \def\fps@figure{H}
  \makeatother
---

pandoc 2.19.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests