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

How to force position of plot like latex "figure" #29

Closed
VolkovIlia opened this issue Jul 21, 2021 · 5 comments
Closed

How to force position of plot like latex "figure" #29

VolkovIlia opened this issue Jul 21, 2021 · 5 comments

Comments

@VolkovIlia
Copy link

In latex I can specify position of figure by:

   \begin{figure}[htpb]
    ... figure contents...
    \end{figure}

How to do that in pandoc-plot?

@LaurentRDC
Copy link
Owner

Hi Ilia,

I'm not sure how to do this. pandoc-plot converts a code block to a figure block. In the conversion, some information is lost by pandoc. The precise information which is kept depends on the source format.

Are you converting from latex or to latex?

@LaurentRDC
Copy link
Owner

LaurentRDC commented Jul 27, 2021

I don't think this question is directly related to pandoc-plot. I'll close this for now but don't hesitate to re-open if you need more help.

@VolkovIlia
Copy link
Author

Sorry for waiting.

I use pandoc with pandoc-plot for writing articles. My workflow is markdown --> pdf + docx. But when I trying to add some plot (matplotlib) it appears somewhere in text after but not in direct place where I want. So, my question is how determine place for the plot?
Command that I use:

pandoc -F pandoc-plot -F pandoc-crossref  -F pandoc-chem-struct --highlight-style=kate -s -C -o  "$base".pdf "$file" | pandoc -F pandoc-plot -F pandoc-crossref   -F pandoc-chem-struct --highlight-style=kate -s -C -o  "$base".docx "$file" ;;

Structure that I use:

{.python .matplotlib caption="XRD" preamble=include.py #fig:XRD}

@LaurentRDC
Copy link
Owner

No worries.

There's no way to control figure placement with pandoc-plot. Figure placement is based on which input format pandoc understands. For example, if your source document is in Markdown, then there's no way to set figure placement. See for example jgm/pandoc#845.

I hope this helps. Keep an eye on jgm/pandoc#3177. What you're looking for will be implemented in the near future.

@VolkovIlia
Copy link
Author

Thanks! It working for me!)

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

No branches or pull requests

2 participants