1

There are two .tex files, one is the original tex file named Old.tex and the other revised tex file named New.tex.

I need Latexdiff to formulate a PDF that highlighting the revisions I've made.

If the diff.tex is derived by latexdiff New.tex Old.tex > diff.tex then everything is normal except the derived PDF is totally opposite from what I need.

If the diff.tex is derived by latexdiff Old.tex New.tex > diff.tex, which is legit and is what I need, then the derived file would report many errors shown as below.

Content below is newly-added in the New.tex and where is most of the errors occurred:

\begin{equation}\label{rotatingspeed}
    n_{11} = \frac{\pi\omega_r D}{30 \sqrt H}.
\end {equation}

By Eq. \ref{rotatingspeed}, when the hydraulic head alters, the unit rotating speed of the turbine would alter if the rotating speed of generator remains still. It would lead the turbine to the decreasing of efficiency, wearing and vibrating. If the DFIG is adopted, the turbine would operate at the optimal rotating speed since the system has gained more degrees of freedom.

As suggested by the characteristic of the turbine, the output of the generating system $P_1$ could be derived through the following transforming:

\begin{equation}\label{outputofgenerating}
    P_1 = HQ\gamma\eta_{total} = 9.81 H Q \eta_{total}.
\end{equation}

The latexdiff.tex:

\begin{equation}\DIFadd{\label{rotatingspeed}
    n_{11} = \frac{\pi\omega_r D}{30 \sqrt H}.
\end }{\DIFadd{equation}}
\DIFadd{

By Eq. \ref{rotatingspeed}, when the hydraulic head alters, the unit rotating speed of the turbine would alter if the rotating speed of generator remains still. It would lead the turbine to the decreasing of efficiency, wearing and vibrating. If the DFIG is adopted, the turbine would operate at the optimal rotating speed since the system has gained more degrees of freedom.

As suggested by the characteristic of the turbine, the output of the generating system $P_1$ could be derived through the following transforming:

\begin{equation}\label{outputofgenerating}
    P_1 = HQ\gamma\eta_{total} = 9.81 H Q \eta_{total}.
}\end{equation}
line 555: Argument of \end has an extra }. \end }
line 555: Paragraph ended before \end was complete. \end }
line 555: Missing $ inserted. \end }
line 555: Missing } inserted. \end }
line 555: Missing } inserted. \end }
line 555: Missing } inserted. \end }
line 555: Missing } inserted. \end }
line 555: Display math should end with $$. \end }
line 555: Extra }, or forgotten \endgroup. \end }
line 555: Missing $ inserted. \end }
line 555: Limit controls must follow a math operator. \end }
line 555: Undefined control sequence. \end }
line 555: Extra }, or forgotten $. \end }
line 555: Extra }, or forgotten $. \end }
line 555: Extra }, or forgotten $. \end }
line 564: Paragraph ended before \UL@onmath was complete. }
3
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Oct 2, 2021 at 11:22
  • 1
    generating a valid latex document from a diff isn't an exact science it can fail as you show here. If you provided a small example based on your real code then perhaps someone could suggest a method to produce a valid diff in that case. Oct 2, 2021 at 11:29
  • 1
    you have not provided a test in the form anyone can use to reproduce the problem but I assume that the problem is your use of \end {equation} with a space in the middle which prevented latexdiff spotting the end of the equation. Oct 2, 2021 at 14:31

1 Answer 1

2

Note that latexdiff generated

\DIFadd{\label{rotatingspeed}
    n_{11} = \frac{\pi\omega_r D}{30 \sqrt H}.
\end }

where \end has no argument and will generate errors. This is presumably because of the unusual (although valid latex) spacing in

\begin{equation}\label{rotatingspeed}
    n_{11} = \frac{\pi\omega_r D}{30 \sqrt H}.
\end {equation}

where you have a space after \end so latexdiff did not find \end{equation} until the end of the following equation.

1
  • Problem Solved! Thank you.
    – Jianing_Fu
    Oct 3, 2021 at 6:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .