BP Jonsson 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: > > Thanks - useful resource. > > You can find such a filter as I described before here: > > > > 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: Rainerkrugsde PGP: 0x0F52F982