public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Rainer M Krug <Rainer-vfylz/Ys1k4@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Cc: BP Jonsson <bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org>
Subject: Re: Conversion tex to docx - endfloat package?
Date: Fri, 27 Nov 2015 10:37:11 +0100	[thread overview]
Message-ID: <m2d1uvrdfc.fsf@krugs.de> (raw)
In-Reply-To: <56575DF7.2050202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (BP Jonsson's message of "Thu, 26 Nov 2015 20:31:03 +0100")

[-- Attachment #1: Type: text/plain, Size: 2579 bytes --]

BP Jonsson <bpj-J3H7GcXPSITLoDKTGw+V6w-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org> writes:

> 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.

Yes - I was aware if this, and I have other issues because of this as
well (siunitx package).

>
> You can read about using filters here:
>
> <https://github.com/jgm/pandoc/blob/master/README#L400>

Thanks - useful resource.

>
> 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!

Yes - this is exactly what I want to do. I want to collect all table and
figure floats at the end, ideally one section with the header "Figures" with
the figures, a scond header with the name "Tables" with the table floats.

I tried your filters in a make file as follow:

,----
| sed -e 's/pdf/png/g' ASMOptim.tex > ASMOptim.pandoc.tex
| pandoc --bibliography=ASMOptim.bib --filter pandoc-collect-floats.pl --filter pandoc-citeproc  ASMOptim.pandoc.tex -o ASMOptim_0.1.4+.docx
| pandoc: Error running filter pandoc-collect-floats.pl
| fd:4: hClose: resource vanished (Broken pipe)
`----

but as you can see, the filter pandoc-collect-floats.pl raises an error.

Any ideas what is causing this?

Thanks a lot,

Rainer


>
> /bpj
>

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

  parent reply	other threads:[~2015-11-27  9:37 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
     [not found]     ` <56575DF7.2050202-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-11-27  9:37       ` Rainer M Krug [this message]
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=m2d1uvrdfc.fsf@krugs.de \
    --to=rainer-vfylz/ys1k4@public.gmane.org \
    --cc=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).