Closed MBradbury closed 2 years ago
Thanks for preparing MWE. This is working now.
It's seems to not be working for latexdiff-vc
.
Similar example as above:
\begin{align}
\begin{split}\label{chap3:eq:r2}
\mathrm{R^2} ={}& 1 - \bigg\lbrack\sum_{i=1}^{N}(z_i - \widehat{z}_i) \bigg/ \sum_{i=1}^{N}(z_i - \overline{z}_i)\bigg\rbrack
\end{split}\\
\begin{split}\label{chap3:eq:mse}
\mathrm{MSE} ={}& \frac{1}{N}\sum_{i=1}^{N}(z_i - \widehat{z}_i)^{2}
\end{split}\\
\begin{split}\label{chap3:eq:mae}
\mathrm{MAE} ={}&\frac{1}{N}\sum_{i=1}^{N}\lvert(z_i - \widehat{z}_i)\rvert
\end{split}
\end{align}
producing diff such:
\begin{align}
\DIFadd{\begin{split}\label{chap3:eq:r2}
\mathrm{R^2} ={}& 1 - \bigg\lbrack\sum_{i=1}^{N}(z_i - \widehat{z}_i) \bigg/ \sum_{i=1}^{N}(z_i - \overline{z}_i)\bigg\rbrack
\end{split}}\\
\DIFadd{\begin{split}\label{chap3:eq:mse}
\mathrm{MSE} ={}& \frac{1}{N}\sum_{i=1}^{N}(z_i - \widehat{z}_i)^{2}
\end{split}}\\
\DIFadd{\begin{split}\label{chap3:eq:mae}
\mathrm{MAE} ={}&\frac{1}{N}\sum_{i=1}^{N}\lvert(z_i - \widehat{z}_i)\rvert
\end{split}
}\end{align}
using
This is LATEXDIFF 1.3.2 (Algorithm::Diff 1.15 so, Perl v5.26.1)
(c) 2004-2021 F J Tilmann
@AguirreNicolas I tested the example of MBradybury, so your case must be subtly different. Would you mind providing old and new file for your example as it's otherwise ambiguous.
Hi both, looks like @AguirreNicolas is using an older version before the fix was included.
@ftilmann
\documentclass[11pt,twoside]{book}
\usepackage{amsmath,amssymb,amsfonts,amsbsy,latexsym,mathtools,bm}%,bbm}
\begin{document}
\include{A}
\end{document}
\chapter{Chap name}
Pre-align:
\chapter{Chap name}
Pre-align:
Post-align/split:
\begin{align}
\begin{split}\label{chap3:eq:r2}
\mathrm{R^2} ={}& 1 - \bigg\lbrack\sum_{i=1}^{N}(z_i - \widehat{z}_i) \bigg/ \sum_{i=1}^{N}(z_i - \overline{z}_i)\bigg\rbrack
\end{split}\\
\begin{split}\label{chap3:eq:mse}
\mathrm{MSE} ={}& \frac{1}{N}\sum_{i=1}^{N}(z_i - \widehat{z}_i)^{2}
\end{split}\\
\begin{split}\label{chap3:eq:mae}
\mathrm{MAE} ={}&\frac{1}{N}\sum_{i=1}^{N}\lvert(z_i - \widehat{z}_i)\rvert
\end{split}
\end{align}
bla bla bla
latexdiff-vc --flatten --git -r xxx_comit_hash_xxx main.tex > diff.tex
\documentclass[11pt,twoside]{book}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL /tmp/TRaKNRRQ2s/latexdiff-vc-8c1adf67796d252c21c57531ebed54c196968fbb/main.tex Wed Nov 9 06:41:55 2022
%DIF ADD main.tex Wed Nov 9 06:41:27 2022
\usepackage{amsmath,amssymb,amsfonts,amsbsy,latexsym,mathtools,bm}%,bbm}
%DIF PREAMBLE EXTENSION ADDED BY LATEXDIFF
%DIF UNDERLINE PREAMBLE %DIF PREAMBLE
\RequirePackage[normalem]{ulem} %DIF PREAMBLE
\RequirePackage{color}\definecolor{RED}{rgb}{1,0,0}\definecolor{BLUE}{rgb}{0,0,1} %DIF PREAMBLE
\providecommand{\DIFadd}[1]{{\protect\color{blue}\uwave{#1}}} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{{\protect\color{red}\sout{#1}}} %DIF PREAMBLE
%DIF SAFE PREAMBLE %DIF PREAMBLE
\providecommand{\DIFaddbegin}{} %DIF PREAMBLE
\providecommand{\DIFaddend}{} %DIF PREAMBLE
\providecommand{\DIFdelbegin}{} %DIF PREAMBLE
\providecommand{\DIFdelend}{} %DIF PREAMBLE
\providecommand{\DIFmodbegin}{} %DIF PREAMBLE
\providecommand{\DIFmodend}{} %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
%DIF COLORLISTINGS PREAMBLE %DIF PREAMBLE
\RequirePackage{listings} %DIF PREAMBLE
\RequirePackage{color} %DIF PREAMBLE
\lstdefinelanguage{DIFcode}{ %DIF PREAMBLE
%DIF DIFCODE_UNDERLINE %DIF PREAMBLE
moredelim=[il][\color{red}\sout]{\%DIF\ <\ }, %DIF PREAMBLE
moredelim=[il][\color{blue}\uwave]{\%DIF\ >\ } %DIF PREAMBLE
} %DIF PREAMBLE
\lstdefinestyle{DIFverbatimstyle}{ %DIF PREAMBLE
language=DIFcode, %DIF PREAMBLE
basicstyle=\ttfamily, %DIF PREAMBLE
columns=fullflexible, %DIF PREAMBLE
keepspaces=true %DIF PREAMBLE
} %DIF PREAMBLE
\lstnewenvironment{DIFverbatim}{\lstset{style=DIFverbatimstyle}}{} %DIF PREAMBLE
\lstnewenvironment{DIFverbatim*}{\lstset{style=DIFverbatimstyle,showspaces=true}}{} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF
\begin{document}
\newpage \chapter{Chap name}
Pre-align:
\DIFaddbegin
\DIFadd{Post-align/split:
}
\begin{align}
\DIFadd{\begin{split}\label{chap3:eq:r2}
\mathrm{R^2} ={}& 1 - \bigg\lbrack\sum_{i=1}^{N}(z_i - \widehat{z}_i) \bigg/ \sum_{i=1}^{N}(z_i - \overline{z}_i)\bigg\rbrack
\end{split}}\\
\DIFadd{\begin{split}\label{chap3:eq:mse}
\mathrm{MSE} ={}& \frac{1}{N}\sum_{i=1}^{N}(z_i - \widehat{z}_i)^{2}
\end{split}}\\
\DIFadd{\begin{split}\label{chap3:eq:mae}
\mathrm{MAE} ={}&\frac{1}{N}\sum_{i=1}^{N}\lvert(z_i - \widehat{z}_i)\rvert
\end{split}
}\end{align}
\DIFadd{bla bla bla }\DIFaddend \newpage
\end{document}
@MBradbury @ftilmann You are absolutly right. I was in 1.3.2 (from CTAN) Just update to 1.3.3., and work properly.
Thank you guys!
Great to hear this. Apologies for the delayed update of the CTAN version. I have initiated this now, and 1.3.3 should be distributed through CTAN in the next few days.
Running latexdiff when changing two equations each with a split in it to a single align with both the splits in it leads to a pdflatex compile error. Removing the
\DIFadd{
}
around the split environment allows the produced file to compile. This is likely to be a duplicate of #109.Trying the following does not prevent the
\DIFadd{
}
from being added around split.However, adding the align environment to ARRENV does prevent \DIFadd being added.
a.tex:
b.tex:
c.tex:
Version information (I'm using 6aef2adfd80726c32934e3ec7dab363ddc3f8af8 off master):