From LaTeX to .doc for ‘Comparative Politics’

These are largely notes for myself, but maybe others will find them useful.

As per my previous post, I’ve had a paper accepted. The next task is to adjust the manuscript so that it conforms to the journal’s style sheet, and then to get it into a .doc file for submission. I write in LaTeX, so the latter, at least, is non-trivial. After about a day of experimenting, here’s what I came up with.

First, switch to biblatex for handling your citations. It’s really easy and makes life much better! To do this, and go quite far in getting towards the desired document style, add the following code in the preamble of your tex file.


\usepackage[style=verbose-trad1, natbib=true, sortcites=true, block=space, isbn=false, url=false, doi=false, dashed=false, dateabbrev=false]{biblatex}
\bibliography{path/to/your.bib}

Now make sure that (nearly) all of your citations use the autocite command, rather than citep. (YMMV with \citet commands.) One great thing here is that \autocite is smart enough to handle punctuation immediately following the command in the right way. So, using foo bar \autocite{Hicks2012}. will get rendered as something like either “foo bar (Hicks 2012).” or “foo bar.1”, where the note points to the full reference. You can now toggle between the two by simply setting a different style= in the biblatex options (above), and there should be basically no manual editing required.

That gets you quite far towards the correct styles, but not all of the way. Put the following in your tex file’s preamble to tweak various things. In fact, for my own purposes, I have separated this out into a tex file of its own (called ‘comparativepoliticsstyles.tex’), which I include with \input{path/to/comparativepoliticsstyles.tex.


% % % % From http://tex.stackexchange.com/questions/10682/suppress-in-biblatex/10686#10686.

% Remove 'In:' for all biblatex refs
%\renewbibmacro{in:}{}

% Remove 'In:' for 'article' biblatex refs
\usepackage{biblatex}
\renewbibmacro{in:}{%
\ifentrytype{article}{}{%
\printtext{\bibstring{in}\intitlepunct}}}

% % % % From http://tex.stackexchange.com/questions/30704/enclosing-place-publication-in-parentheses.

\renewbibmacro*{publisher+location+date}{%
\printtext[parens]{% ADDED
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
}\nopunct% ADDED
\newunit}

\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
% \setunit*{\adddot}% DELETED
\setunit*{\addcolon}% ADDED
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}

% % % % From http://tex.stackexchange.com/questions/12806/guidelines-for-customizing-biblatex-styles.

\renewcommand*{\newunitpunct}{\addcomma\space}

% % % % My own formulation

% Suppress titles from opcit refs.
\renewbibmacro{cite:opcit}{}

% Make footnotes the same size as the normal text.
\renewcommand{\footnotesize}{\normalsize}

Almost there. You now need to run mk4ht oolatex your_file.tex from the command line. This will generate a .odt file that you can open with OpenOffice, and then convert to a .doc file. You’ll need to use the Tools->Footnotes/Endnotes dialog to position all footnotes at the end of the document, thus making them endnotes. (This is possible on the LaTeX side, but I found that autocites with multiple references came up empty when I did this.)

That should do it, except for the idiosyncracies I’ve probably forgotten.

Advertisements

3 thoughts on “From LaTeX to .doc for ‘Comparative Politics’

  1. Dear Prof. Hicks

    Thak you very much for this. Unfortunately, there is still a little problem in my bibliography, which I am not able to fix. When you put location+ publisher+ date in brackets, the comma/fullstop before the brackets, i.e. after the booktitle remains, whereas if it is a chapter/contribution in an edited volume, there is the cmma, after the brackets and before the pagerange missing,
    i.e. A book about something, (Oxford: OUP, 2012) pp.12-27.
    Did you find a solution how to get rid resp. add the missing commas?
    Thank you very much and best wishes
    Daniel

  2. Daniel,

    Hmm, I’m not sure about that. A quick google turned up the following, which may help: http://www.khirevich.com/latex/biblatex/ . Towards the end of that page, the author seems to describe using commands like \DeclareFieldFormat[article]{title}{#1} to adjust the positioning of trailing commas and periods within the different parts of references.

    Tim

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s