public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BP Jonsson <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Conversion tex to docx - endfloat package?
Date: Thu, 26 Nov 2015 20:31:03 +0100	[thread overview]
Message-ID: <56575DF7.2050202@gmail.com> (raw)
In-Reply-To: <7e3777d8-7ceb-4493-83bc-3b972a1cdb76-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

Den 2015-11-26 kl. 13:39, skrev Rainer M Krug:
> Hi
>
> I am using pandoc to convert a tex document to docx for my co-authors
> (which works very nicely!), and they want to have figures and tables at
> the end of the document.
>
> I am using in LaTeX the package endfloat for this. Using pdflatex, this
> works perfectly to generate the pdf, but when I use pandoc to convert
> the tex to a docx, the package "endfloat" is ignored and all floats are
> where they would be without "endfloat".
>
> Is there a way to force all floats (figures and tables) to the end of
> the document in pandoc?

I should have mentioned before that pandoc doesn't compile the 
LaTeX, it just parses the LaTeX markup into an AST, discarding 
anything it cannot represent, and builds a document in another 
format from the AST.

However pandoc lets you run filters on the AST after having read 
the original document and before constructing the new document,
and it is (was) fairly simple towrite a filter which collects all 
figures and tables at a designated place in the document.

You can read about using filters here:

<https://github.com/jgm/pandoc/blob/master/README#L400>

You can find such a filter as I described before here:

<https://gist.github.com/bpj/f591a9e29fe974fa791f>

There are both a perl and a python version.
Make sure to read the description!

EDIT: it occurs to me that you sprobably want to put all tables 
together in one place and all figures together in another place.
Reply to this mail if that is the case!

/bpj


  parent reply	other threads:[~2015-11-26 19:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 12:39 Rainer M Krug
     [not found] ` <7e3777d8-7ceb-4493-83bc-3b972a1cdb76-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2015-11-26 15:30   ` BP Jonsson
2015-11-26 19:31   ` BP Jonsson [this message]
     [not found]     ` <56575DF7.2050202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-11-27  9:37       ` Rainer M Krug
2015-11-27 14:48   ` Rainer M Krug
2015-11-27 19:42   ` John MacFarlane
     [not found]     ` <20151127194235.GA49129-jF64zX8BO091tJRe0FUodcM6rOWSkUom@public.gmane.org>
2022-01-09 17:11       ` Christopher Barrington-Leigh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56575DF7.2050202@gmail.com \
    --to=bpj-j3h7gcxpsitlodktgw+v6w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).