# For GITLAB:

## modified tdr_diff script

If you already have the svn tdr_diff area (see SVN section below to download and extract the tarball), you can use this script attached as a drop-in replacement: place it in the same directory as the tdr_diff script, and do:

./gtdr_diff [path] [old commit] [new commit]

## manually

These instructions are for lxplus (Thanks to Emilien & Rui)

0. scl enable rh-git29 bash

1. edit: utils/general/cms-tdr.cls under the "\usepackage{ptdr-definitions}", put in the following two lines:

\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color}

2.PATH=/cvmfs/cms.cern.ch/external/tex/texlive/2017/bin/x86_64-linux/:\$PATH

3. Find out the version you want to use as reference via "git log HIN-XX-YYY.tex"

for example you want to compare the current version with version b174241c04ff018b67e600b4d3acde00816c3c0b

4. Run: latexdiff-vc -r b174241c04ff018b67e600b4d3acde00816c3c0b --append-context2cmd="abstract" HIN-XX-YYY.tex

this will create a texft file: HIN-18-009-diffb174241c04ff018b67e600b4d3acde00816c3c0b.tex (HIN-XX-XXX.tex-referenceVersion.tex)

N.B.: The option --flatten can be used to expand the base tex file out if you include tex from other source files with \input{}.

5. manually add the following line into this newly created tex file:

\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}} %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
%DIF FLOATSAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFdelFL}[1]{\DIFdel{#1}} %DIF PREAMBLE
\providecommand{\DIFdelbeginFL}{} %DIF PREAMBLE
\providecommand{\DIFdelendFL}{} %DIF PREAMBLE

6.Compile again, to create the colorful diff: utils/tdr b HIN-18-009-diffb174241c04ff018b67e600b4d3acde00816c3c0b.tex

The diff file will be created, but look carefully in the spit-out on the screed to see the location of the pdf file. For me (cm) on lxplus, was /tmp/user/somedirectoryCreatedByTdr/here.pdf

# For SVN:

## TDR Diff Utility instructions

NOTE 2017-09-01: Note that if this utility gives you problems, there is also a generic tdrDiff utility developed by Luca Perrozzi here: https://github.com/perrozzi/tdrdiff

WARNING: PLEASE, use this tool on lxplus (it works out of the box, and without fault on lxplus). On private laptop might get into problems that would require more time to fix/set.

This code takes two svn versions of a CMS paper and runs the latexdiff utility on each included .tex file to create a comparison of two versions of the paper, highlighted by blue and red text showing additions and deletions, respectively. An example of an output of the utility can be found here (pdf).

To use the utility:

• Go to the extracted directory
• Run the script via
./tdr_diff [relative path to paper/AN directory] [old svn tag] [new svn tag]

For example:

./tdr_diff ../pPb_cJet/papers/HIN-15-012 364180 364411

To see the svn history of a paper, just use

svn log

### Gotchas

• Please run the utility within the tdr_diff directory - i.e. the same directory that the latexdiff and Algorithm-Diff-1.15 directories are in, else the script will fail.
• The utility finds the CADi line by looking for an instance of "HIN" in the path to the paper. If you have multiple instances of "HIN" or if you're compiling a paper outside of the HI group, you can hard-code line 70 to be the proper line for your paper.
• This utility assumes your tdr script is in the /papers or the /notes directory in the path provided. If you have an alternate directory structure, you'll need to modify the script.

-- KurtJung - 2016-08-15

Topic attachments
I Attachment History Action Size Date Who Comment
ext gtdr_diff r2 r1 manage 9.8 K 2020-03-06 - 16:22 RanBi
Topic revision: r12 - 2020-09-18 - AustinBaty

Webs

Welcome Guest

 Cern Search TWiki Search Google Search Main All webs
Copyright &© 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback