1

The conversion from Latex (tex file prepared using elsarticle class) to word (docx) using pandoc is working fine however I am not getting the references at all (not within the text neither at the end of the article). I used the following code and had an error of "pandoc: Cannot decode byte '\xa8': Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream".

pandoc --citeproc input.tex --bibliography=mybiblio.bib --csl=ieee.csl -o document.docx

I am using latest version of pandoc (fresh installation two days ago). The .tex file is working fine in terms of formatting and references. Tried the following steps found by searching but they did not work;

Using filter=pandoc-citeproc in pandoc it asks me to use --citeproc

If I omit --citeproc in my coding, I do not get the error (also dont get the references as well).

Jabref coding is already set to UTF.

7
  • This might help: stackoverflow.com/questions/47954642/… Dec 4, 2020 at 8:39
  • Could you please write how can I use this command according to my example? I am not from this field.. I wrote: iconv -f utf-8 -t utf-8 -c input.tex And I had the following error, 'iconv' is not recognized as an internal or external command, operable program or batch file. pandoc iconv -f utf-8 -t utf-8 -c input.tex gave me the error of "unknown extension: 8"
    – Jack
    Dec 4, 2020 at 9:17
  • 1
    @Jack - You are on windows? You might need to install iconv first: Try cygwin or GnuWin32. Another way would be with Notepad++ "Encoding > Convert to UTF-8". Also, it looks like you need to recode your .bib-file
    – DG'
    Dec 4, 2020 at 10:12
  • 1
    I followed the method of using Notepad++ as per your suggestion and it is working fine. Thanks! @DG'
    – Jack
    Dec 4, 2020 at 11:02
  • pandoc -f markdown-raw_tex --citeproc input.tex --bibliography=mybiblio.bib --csl=ieee.csl -o document.docx, I would imagine Dec 4, 2020 at 12:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.