-
Go to the
Overleafwebsite and move your original files in a new folder. For example, I would first make a folder:organd copy all the originally submitted files there. Or if you already have originally submtted files in a separate folder, I would rename it toorg. These files should be not be changed, because these files will be compared with your revised files for making track changes in PDF. -
Make a folder for revised files. For example, I would make a new folder, named
rev. -
Copy the files in the
orgfolder to therevfolder. I found no straightforward way to copy files between different folders inOverleaf. So I download original files from theorgfolder to my hard drive, and then upload those files to therevfolder. -
Go back to
Overleaf. In theMenu, change theMain documentto the main tex file in your newrevfolder.
Note that we will not change any files in the org folder. We will revise files in the rev folder.
The changes I describe below should be made for the main tex file (for example, my_main.tex) in the rev folder. Do not change any files in the org folder.
- Go to the top of the document and add the lines below if they do not already exist.
\usepackage{lineno}
\usepackage[usenames, dvipsnames]{color}- Find
\end{spacing}or\end{document}in your main file. Copy and paste the following lines right before these two. Depending on your document\end{spacing}may not exist, but\end{document}should exist.
\nolinenumbers
\clearpage{}
\setcounter{equation}{0}
\setcounter{figure}{0}
\setcounter{table}{0}
\setcounter{page}{1}
\setcounter{section}{0}
\makeatletter
\renewcommand{\theequation}{L\arabic{equation}}
\renewcommand{\thefigure}{L\arabic{figure}}
\renewcommand{\thetable}{L\arabic{table}}
\renewcommand{\thesection}{L\arabic{section}}
\renewcommand{\thepage}{L\arabic{page}}
\renewcommand{\bibnumfmt}[1]{[L#1]}
\renewcommand{\citenumfont}[1]{L#1}
%NewInRevision
\newenvironment{reviewer}{\par\addvspace{\baselineskip}\small\color{BlueViolet}}{\par\addvspace{\baselineskip}} %\fontfamily{cmvtt}\selectfont
{\Huge Rebuttal Letter}-
Revise. Do not worry about preserving old parts, they are all kept in the files you stored in the
orgfolder. -
If you need to cite certain parts of your paper by line number do the following.
\linelabel{ln:revised:begin:LMILdiamond} I revised this part. \linelabel{ln:revised:end:LMILdiamond}To cite these parts by line numbers,
Lines \ref{ln:revised:begin:LMILdiamond}--\ref{ln:revised:end:LMILdiamond}. We added this new sentence in this revision.In the provided template, your rebuttal letter is included in the main tex file together with other parts. Go to the line below:
{\Huge Rebuttal Letter}-
Below these lines, you begin writing your rebuttal letter.
-
Copy the following lines to the area and then start writing rebuttal letter.
\section{Editor}
\begin{reviewer}
Copy reviewers comments here.
\end{reviewer}
Write your answers here.
\begin{reviewer}
Copy reviewers comments here.
\end{reviewer}
Write your answers here.
\section{Reviewer \# 1}
\begin{reviewer}
Copy reviewers comments here.
\end{reviewer}
Write your answers here.
\begin{reviewer}
Copy reviewers comments here.
\end{reviewer}
Write your answers here.
\section{Reviewer \# 2}
\begin{reviewer}
Copy reviewers comments here.
\end{reviewer}
Write your answers here.
\begin{reviewer}
Copy reviewers comments here.
\end{reviewer}
Write your answers here.
We will make a new tex file with tracking information. The tracked tex files will be saved in diff folder.
(Warning) The following workflow was tested only for Ubuntu and Mac OSX.
Source: https://www.reddit.com/r/LaTeX/comments/2o98fq/latexdiff_frustration/
-
latexdifffromMacTeX,TeX Live, andhomebrewcould make different results, particularly types of errors. Try all three and find the best working one for you.MacTex's version is typically in/Library/TeX/texbin/latexdiff.TeX Liveis in/usr/local/texlive/2019/bin/x86_64-darwin.homebrewshould be in/usr/local/bin. To setup for one of these, you can add path. For example,export PATH=/usr/local/texlive/2019/bin/x86_64-darwin:$PATH. -
Download of your
orgfolder fromOverleaf. -
Dowload of your
revfolder fromOverleaf. Of course you may use whatever name you want. Y
(Warning) Your original submission files and new revision files must exist in separate folders. Those separate folders must have all the necessary files, such as *.aux, *.blb, figure pdfs, etc. If you mix old and new files in the same folder, you will get a lot of errors.
-
It is not absolutely necessary, but you may want to separately compile the main tex files in the
orgfolder andrevfolder to pdf's. -
Open a terminal and go to the newly made folder containing both
organdrevfolders. You can now executelatexdiffthrough one of the followings.
latexdiff -p diff-pre.tex --flatten --disable-citation-markup --replace-context2cmd="\author" --exclude-safecmd="in" ./org/main.tex ./rev/main.tex > ./diff/main.tex--flatten : this option is not necessary anymore even when \include, \input, or \includegraphics exist in latex file.
--subtype=“SAFE” : this option does not seem to change anything
--disable-citation-markup : this option make no tracking for citation. OK option to avoid confusion because latexdiff does not distinguish new and old citations.
--appendsafecmd="nu.*,v.*,such.*{,}" : this option is not recognized by latexdiff anymore (as of 2024-05-13).
For PNAS, add the following option to latexdiff
--replace-context2cmd="significancestatement" - Then finally
pdflatex diff.tex.
Only problem here is that this procedure does not take care of citation changes. But so far this is the best I could find.
- If
bibunitsand normal bibliography citations are mixed, thenlatexdiffcan fail. In this case, remove either one of the two and simplify. - You need to have a
diff-pre.texfile in the current folder. If you had errors and try to recompile, make sure you delete all the files includingaux,blg, andbbl.
(2024-06-08) It appears that latest latexdiff no longer has problem with strike through text. Use one below instead:
\RequirePackage[normalem]{ulem}
\RequirePackage{color}
\definecolor{light-gray}{gray}{0.6}
\definecolor{lblue}{rgb}{0.6,0.6,1}
%DIF PREAMBLE
\RequirePackage[stable]{footmisc} %DIF PREAMBLE
%\RequirePackage{changebar} %DIF PREAMBLE
%\providecommand{\DIFadd}[1]{#1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{\textcolor{blue}{#1}} %DIF PREAMBLE
%\providecommand{\DIFdel}[1]{{\protect\color{red} [..\footnote{removed: #1}]}\xspace}
\providecommand{\DIFdel}[1]{{\protect\color{lblue}\sout{#1}}}
%DIF PREAMBLE in the line above, strike through often has issues with math and others. So I am trying color differences for removed.
%DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
%\providecommand{\DIFaddbegin}{\protect\color{blue}} %DIF PREAMBLE
%\providecommand{\DIFaddend}{\protect\color{black}} %DIF PREAMBLE
%\providecommand{\DIFdelbegin}{\protect\cbdelete} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}} %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFaddbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFaddendFL}{} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLEThis file will decide the format for tracking. Currently striking through text creates a lot of problem, likely with Math text. Therefore, the file below make light-gray color for the deleted parts. The added parts will be in blue and the unchanged part will bein black.
\RequirePackage{color}
\definecolor{light-gray}{gray}{0.6}
%DIF PREAMBLE
\RequirePackage[stable]{footmisc} %DIF PREAMBLE
%\RequirePackage{changebar} %DIF PREAMBLE
%\providecommand{\DIFadd}[1]{#1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{\textcolor{blue}{#1}} %DIF PREAMBLE
%\providecommand{\DIFdel}[1]{{\protect\color{red} [..\footnote{removed: #1}]}\xspace}
\providecommand{\DIFdel}[1]{\textcolor{light-gray}{#1}} %DIF PREAMBLE
% in the line above, strike through often has issues with math and others.
% So I am trying color differences for removed.
%DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
%\providecommand{\DIFaddbegin}{\protect\color{blue}} %DIF PREAMBLE
%\providecommand{\DIFaddend}{\protect\color{black}} %DIF PREAMBLE
%\providecommand{\DIFdelbegin}{\protect\cbdelete} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddFL}[1]{\DIFadd{#1}} %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFaddbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFaddendFL}{} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLE