[Tex/LaTex] Convert a novel typed in Word (just dialogue text,no math) to LaTeX

formattingword-to-latex

I know many of you will think this elementary – but I would like opinions. I need to know if I'm doing it horribly wrong before I continue doing 45+ chapters! I apologize if this isn't the proper place – but I'm really trying to learn!

I'm trying to convert a novel that has been typed in Word — no equations — just text with some light formatting, lots of dialogue etc…. So in my VERY limited knowledge of LaTeX I have done this. Can you please tell me if I'm on the right track?

My method:

  1. Open Chapter in Open Office
  2. Export using Writer2LaTeX extension
  3. Open the exported file in WinEdt
  4. Delete all preamble coding and just have \chapter{} for the preamble
  5. Delete \end{document} from the end of the document
  6. Replace {\textquoteright} with ' (it puts this on all conjunctions and just for neatness and readability I'd rather just see the ' than the code)
  7. Save

In my master document I insert the chapters using the \include command (at the suggestion of someone here)

So…. I know it seems like it's a very round about way of doing it… but is it okay? My reasoning for using Writer2LaTeX extension is because it seems to take care of the opening and closing quotations using {\textquotedblleft} and {\textquotedblright} and it also uses \textit for italics. Otherwise I think I'd have to go find all those and enter coding by hand correct?

My master file has the following code:

\documentclass[10pt]{memoir}


\usepackage{mathpazo}
\usepackage[margin=1in, paperwidth=6in, paperheight=9in]{geometry}
\usepackage{indentfirst}
\pagestyle{plain}

\emergencystretch=1.5em


\renewcommand*{\chapnamefont}{\normalfont\HUGE\bfseries\sffamily}
\renewcommand*{\chapnumfont}{\normalfont\HUGE\bfseries\sffamily}
\renewcommand*{\afterchapternum}{}
\renewcommand*{\printchaptertitle}[1]{}


\begin{document}

\include{Chapter1v2}

\include{chapter02}

\end{document}

Best Answer

From Word to LaTeX via Writer2LaTeX

I will not repeat the manual of Writer2LaTeX, which you should read. But after some years I've got some practical experience:

  • It is usefull to delete as much of the layout in Word as possible.
  • The whole text should be in one language, make sure that Open/LibreOffice gets that as well. Otherwise you'll end with hundreds of \foreignlanguage-commands or similiar.
  • Experiment with the different possibilities of Writer2LaTeX. But I found the option "very tidy article" (my translation from German "sehr aufgeräumter Artikel") produces the best output.
  • Find the most complicated chapter, and really experiment with it until you are satisfied.
  • Clutterd, complicated code after \begin{document} indicates that something is going wrong.
  • Usually UTF8 is a good encoding. Depending on your editor on the LaTeX-side be carefull that the editor recognises UTF8 and that you really got that encoding.
  • If you have to change or delete a mass of, let's say, \\ \\ \\, this is a very good moment to learn a bit about "regular expressions". Doing deletions and changes manually, especially with 45 chapters, will probably take much longer than learning regexp.

Often it is faster to learn something about LaTeX by reading an introduction and the manual of a package (you get the manual by typing texdoc packagename on the command line), than wildly guessing how something could work.