3

I am currently starting to write a thesis. As I am using R for statistics, I actually would like to use LaTeX and the knitR package for the text but I also have doubts to use it as the work might be published and the journal might only accept rtf or doc formats. I noticed that this topic has already been discussed elsewhere (http://www.tex.ac.uk/FAQ-fmtconv.html, Which is the best import / export LaTeX tool?) but the threads have not been very helpful to me (lack of software skills on my part). So I hope someone has some simple answers for me.

My problem looks like this: I have a knitR document including plots and citations:

\documentclass{article}

% bib file
\usepackage{filecontents}
\begin{filecontents}{references.bib}
@article{key,
  author="Author",
  title="Title",
  year="2016"
  }
\end{filecontents}
\usepackage{natbib}


\begin{document}

%text
test \cite{key}

%R script
<<eval=T, echo=T>>=
hist(rnorm(100))
@


\bibliographystyle{plainnat}
\bibliography{references}

\end{document}

I tried the following to convert the document into an rtf file:

1) LaTeX2RTF: problem was that diagrams and citations were not converted

2) R 'connect3' package using the following code (same problem as LaTeX2RTF)

library(connect3)

x<-read.latex(file,path)

tex<-x$tex
path<-x$path
name<-'test2'

write.rtf(tex,path,name)

3) I also saw the thread describing tex4ht but the setup for windows operating system seemed terribly unhandy to me (https://www.tug.org/applications/tex4ht/mn-mswin.html)

So I'd like to ask how you are adressing this problem and if you could describe the solution in a simple way.

Thanks so much for your help!

Community
  • 1
  • 1
ehi
  • 409
  • 8
  • 23
  • 1
    If it were me, I'd invest my time in using `bookdown` (https://bookdown.org/yihui/bookdown/) and write my code carefully so as to have a document that can be rendered in either HTML or LaTeX. I believe the conversion tools to go from HTML to RTF are more robust than those going from PDF to RTF. – Benjamin Jun 01 '16 at 10:33
  • My dissertation is written in LaTeX but my adviser insists on reviewing it with track changes in Word. I use Microsoft's built-in converter for translating PDF documents to Word. I've tried a few of the converters you mention, and they haven't worked as well for me as Word's. The conversion is still far from perfect, but it may get you close enough. Open Word, click Open Other Documents, select your compiled PDF, and Word will convert it into an editable document. – Pete Barwis Jun 03 '16 at 00:22

1 Answers1

2

I found two solutions that work quite well: 1) http://www.sciweavers.org/convert-latex-to-rtf 2) https://www.lyx.org/ I hope this will help someone

ehi
  • 409
  • 8
  • 23