TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
Could they proofread it in PDF format? – Andrew Cashner Feb 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 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 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 at 18:21
    
Possible duplicate of Latex to MS word – WYSIWYG Feb 16 at 18:40
up vote 5 down vote accepted

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.

share|improve this answer
    
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. – jfbu Feb 17 at 7:51
    
@jfbu: Yes. Placing it just above the original \cite would be similar to what is provided by showkeys. – Werner Feb 17 at 7:55
    
Thank you very much. Could you please show how I can do the same with \textit{} \ref{} ? – PatternRecognition Feb 17 at 8:26
    
@PatternRecognition: What does \textit have to do with it? – Werner Feb 17 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 at 15:15

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

\renewcommand{\cite}[1]{\textbackslash cite\{#1\}}}
share|improve this answer
    
Thank you very much. – PatternRecognition Feb 17 at 8:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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