-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misplaced alignment tab character & when equations contain split/align #258
Comments
Thanks for preparing MWE. This is working now. |
It's seems to not be working for \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
|
@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. |
main.tex
A.tex (pre-commit)\chapter{Chap name}
Pre-align: A.tex (commited)\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 terminal cmd:
main-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 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.latexdiff a.tex b.tex > c.tex
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 6aef2ad off master):
The text was updated successfully, but these errors were encountered: