3

My thesis is written in many tex files and I would like to have it proofread. However, the proof reader is requesting the thesis in MS Word format.

Although the generated PDF can easily be converted into the requested format, the citations will be replaced by numbers instead of the \cite{xx} in the raw tex document.

Is there a way to keep and produce \cite{xx} as it is in the generated PDF file?

EDIT: I am not asking about how to convert latex documents into MS Word. I am already able to do that. I am asking about how to keep and produce \cite{xx} as it is in the generated PDF file?

  • Could they proofread it in PDF format? – musarithmia Feb 16 '16 at 18:07
  • You didn't ask this, but my guess is you're also interested in seeing the accompanying bibkeys to cross-reference. Why not just use the showkeys package? – Werner Feb 16 '16 at 18:11
  • @andrewCashner no, the proof reader I am interested in accepts only word documents. If I could do what I am asking about, it will be an easy job: simply copy and paste the proofread sentences back to tex files. – PatternRecognition Feb 16 '16 at 18:15
  • @werner If I can change the options so it produces '\cite{}' and not only the keys, it will be exactly what I am looking for! Otherwise, I would need to add '\cite{}' around each single reference key in the proofread sentences, which will be a HUGE task. – PatternRecognition Feb 16 '16 at 18:21
  • Possible duplicate of Latex to MS word – WYSIWYG Feb 16 '16 at 18:40
5

Here is an option:

enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{xparse,letltxmacro,natbib}

\AtEndDocument{\nocite{*}}% Include all references
\LetLtxMacro\oldcite\cite
\RenewDocumentCommand{\cite}{o m}{%
  {\ttfamily\string\cite\string{\detokenize{#2}\string}}%
}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{abc,
  title = {Title - ABC},
  author = {A Author and B Author and C Author},
  journal = {Journal ABC},
  year = {1234}}
@article{def,
  title = {Title - DEF},
  author = {D Author and E Author and F Author},
  journal = {Journal DEF},
  year = {5678}}
\end{filecontents*}

\begin{document}

As can be seen in~\cite{abc}, we use~\cite[p.\ 5]{def}.

\bibliographystyle{apalike}
\bibliography{\jobname}

\end{document}

The above assumes you're only using \cite for citations. The call to \nocite{*} also assumes that you'll be including all citations in your bibliography file as part of your bibliography.

You can change the format from \ttfamily to something else, if needed. It's purely meant to distinguish code from actual document content.

  • To not change the layout, one could use the original cite, and put the detokenized source in a zero-width box in footnote position or slightly above the produced citation. – user4686 Feb 17 '16 at 7:51
  • @jfbu: Yes. Placing it just above the original \cite would be similar to what is provided by showkeys. – Werner Feb 17 '16 at 7:55
  • Thank you very much. Could you please show how I can do the same with \textit{} \ref{} ? – PatternRecognition Feb 17 '16 at 8:26
  • @PatternRecognition: What does \textit have to do with it? – Werner Feb 17 '16 at 15:02
  • @Werner I just wanted to preserve the italicization of words after copying the proof read back to latex. It is not, however, as important as \ref{}. Thank you again for your responses. – PatternRecognition Feb 17 '16 at 15:15
4

You could redefine the \cite command so that it prints itself instead of the citation:

\renewcommand{\cite}[1]{\textbackslash cite\{#1\}}}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.