latexdiff don't work in table with scaleboxMake Latexdiff work on big, complex projectLatexdiff with...

Effect of "wrong" driver with slightly long RS-485 stubs

Rationale to prefer local variables over instance variables?

Why do we see a rainbow of colors reflected off a CD or DVD?

Naming Characters after Friends/Family

Plagiarism of code by other PhD student

The (Easy) Road to Code

How do you write a macro that takes arguments containing paragraphs?

Should I use HTTPS on a domain that will only be used for redirection?

Adjust starting of second line

Why aren't there more gauls like Obelix?

“I had a flat in the centre of town, but I didn’t like living there, so …”

Split a number into equal parts given the number of parts

How do I enter < and > on a broken keyboard?

Is every open circuit a capacitor?

How can I handle a player who pre-plans arguments about my rulings on RAW?

What is the purpose of a disclaimer like "this is not legal advice"?

Can a Tiny Servant be used as a messenger?

Can I solder 12/2 Romex to extend wire 5 ft?

Specific Chinese carabiner QA?

PTIJ: What dummy is the Gemara referring to?

Can an earth elemental drown/bury its opponent underground using earth glide?

Number of folds to form a cube, using a square paper?

How can friction do no work in case of pure rolling?

What's Bob's age again?



latexdiff don't work in table with scalebox


Make Latexdiff work on big, complex projectLatexdiff with subfilesProblem in LaTeXDifflatexdiff: exclude caption textNew figure in LatexdiffLatexdiff figureLatexdiff with two column layoutlatexdiff problems with SCfigurelatexdiff and letHow to use Latexdiff with TexLive













2















When revise my manuscript, I found latexdiff can't label changes in tables. For example, there are two tex files before and after revision:



Before revision



documentclass{article}
usepackage{graphicx}

begin{document}
begin{table}
centering
caption{Example}
scalebox{0.8}{begin{tabular}{lcc}
A & 1 & 1 \
B & 2 & 2 \
end{tabular}}
end{table}
end{document}


After revision



documentclass{article}
usepackage{graphicx}

begin{document}
begin{table}
centering
caption{New Example}
scalebox{0.8}{
begin{tabular}{lcc}
C & 3 & 3 \
D & 4 & 4 \
end{tabular}}
end{table}
end{document}


The diff.tex is followed:



documentclass{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL old.tex Thu Mar 7 08:20:20 2019
%DIF ADD new.tex Thu Mar 7 08:19:50 2019
usepackage{graphicx}
%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]{{protectcolor{blue}uwave{#1}}} %DIF PREAMBLE
providecommand{DIFdel}[1]{{protectcolor{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
%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
newcommand{DIFscaledelfig}{0.5}
%DIF HIGHLIGHTGRAPHICS PREAMBLE %DIF PREAMBLE
RequirePackage{settobox} %DIF PREAMBLE
RequirePackage{letltxmacro} %DIF PREAMBLE
newsavebox{DIFdelgraphicsbox} %DIF PREAMBLE
newlength{DIFdelgraphicswidth} %DIF PREAMBLE
newlength{DIFdelgraphicsheight} %DIF PREAMBLE
% store original definition of includegraphics %DIF PREAMBLE
LetLtxMacro{DIFOincludegraphics}{includegraphics} %DIF PREAMBLE
newcommand{DIFaddincludegraphics}[2][]{{color{blue}fbox{DIFOincludegraphics[#1]{#2}}}} %DIF PREAMBLE
newcommand{DIFdelincludegraphics}[2][]{% %DIF PREAMBLE
sbox{DIFdelgraphicsbox}{DIFOincludegraphics[#1]{#2}}% %DIF PREAMBLE
settoboxwidth{DIFdelgraphicswidth}{DIFdelgraphicsbox} %DIF PREAMBLE
settoboxtotalheight{DIFdelgraphicsheight}{DIFdelgraphicsbox} %DIF PREAMBLE
scalebox{DIFscaledelfig}{% %DIF PREAMBLE
parbox[b]{DIFdelgraphicswidth}{usebox{DIFdelgraphicsbox}\[-baselineskip] rule{DIFdelgraphicswidth}{0em}}llap{resizebox{DIFdelgraphicswidth}{DIFdelgraphicsheight}{% %DIF PREAMBLE
setlength{unitlength}{DIFdelgraphicswidth}% %DIF PREAMBLE
begin{picture}(1,1)% %DIF PREAMBLE
thicklineslinethickness{2pt} %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,0){framebox(1,1){}}}% %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,0){line( 1,1){1}}}% %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,1){line(1,-1){1}}}% %DIF PREAMBLE
end{picture}% %DIF PREAMBLE
}hspace*{3pt}}} %DIF PREAMBLE
} %DIF PREAMBLE
LetLtxMacro{DIFOaddbegin}{DIFaddbegin} %DIF PREAMBLE
LetLtxMacro{DIFOaddend}{DIFaddend} %DIF PREAMBLE
LetLtxMacro{DIFOdelbegin}{DIFdelbegin} %DIF PREAMBLE
LetLtxMacro{DIFOdelend}{DIFdelend} %DIF PREAMBLE
DeclareRobustCommand{DIFaddbegin}{DIFOaddbegin letincludegraphicsDIFaddincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFaddend}{DIFOaddend letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelbegin}{DIFOdelbegin letincludegraphicsDIFdelincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelend}{DIFOaddend letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
LetLtxMacro{DIFOaddbeginFL}{DIFaddbeginFL} %DIF PREAMBLE
LetLtxMacro{DIFOaddendFL}{DIFaddendFL} %DIF PREAMBLE
LetLtxMacro{DIFOdelbeginFL}{DIFdelbeginFL} %DIF PREAMBLE
LetLtxMacro{DIFOdelendFL}{DIFdelendFL} %DIF PREAMBLE
DeclareRobustCommand{DIFaddbeginFL}{DIFOaddbeginFL letincludegraphicsDIFaddincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFaddendFL}{DIFOaddendFL letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelbeginFL}{DIFOdelbeginFL letincludegraphicsDIFdelincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelendFL}{DIFOaddendFL letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF

begin{document}
begin{table}
centering
caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
DIFdelbeginFL %DIFDELCMD < scalebox{0.8}{begin{tabular}{lcc}
%DIFDELCMD < A & 1 & 1 \
%DIFDELCMD < B & 2 & 2 \
%DIFDELCMD < end{tabular}}
%DIFDELCMD < %%%
DIFdelendFL DIFaddbeginFL scalebox{0.8}{
begin{tabular}{lcc}
C & 3 & 3 \
D & 4 & 4 \
end{tabular}}
DIFaddendFL end{table}
end{document}


Actually, I have found the question lies on the scalebox{}{}. If I don't use scalebox, the diff.tex is
enter image description here



This is what I want.



However, when use scalebox, it would be



enter image description here



But in practice my table is very wide so I have to use scalebox. My question is, is there any method to keep table fit to text width, meanwhile make latexdiff work?










share|improve this question







New contributor




Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • welcome to tex.se!

    – Zarko
    14 hours ago











  • do you really want to put a table in scalebox ? It usually produces very poor result, it is usually far better to use small or tiny etc and use font size consistent with the rest of the document.

    – David Carlisle
    7 hours ago
















2















When revise my manuscript, I found latexdiff can't label changes in tables. For example, there are two tex files before and after revision:



Before revision



documentclass{article}
usepackage{graphicx}

begin{document}
begin{table}
centering
caption{Example}
scalebox{0.8}{begin{tabular}{lcc}
A & 1 & 1 \
B & 2 & 2 \
end{tabular}}
end{table}
end{document}


After revision



documentclass{article}
usepackage{graphicx}

begin{document}
begin{table}
centering
caption{New Example}
scalebox{0.8}{
begin{tabular}{lcc}
C & 3 & 3 \
D & 4 & 4 \
end{tabular}}
end{table}
end{document}


The diff.tex is followed:



documentclass{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL old.tex Thu Mar 7 08:20:20 2019
%DIF ADD new.tex Thu Mar 7 08:19:50 2019
usepackage{graphicx}
%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]{{protectcolor{blue}uwave{#1}}} %DIF PREAMBLE
providecommand{DIFdel}[1]{{protectcolor{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
%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
newcommand{DIFscaledelfig}{0.5}
%DIF HIGHLIGHTGRAPHICS PREAMBLE %DIF PREAMBLE
RequirePackage{settobox} %DIF PREAMBLE
RequirePackage{letltxmacro} %DIF PREAMBLE
newsavebox{DIFdelgraphicsbox} %DIF PREAMBLE
newlength{DIFdelgraphicswidth} %DIF PREAMBLE
newlength{DIFdelgraphicsheight} %DIF PREAMBLE
% store original definition of includegraphics %DIF PREAMBLE
LetLtxMacro{DIFOincludegraphics}{includegraphics} %DIF PREAMBLE
newcommand{DIFaddincludegraphics}[2][]{{color{blue}fbox{DIFOincludegraphics[#1]{#2}}}} %DIF PREAMBLE
newcommand{DIFdelincludegraphics}[2][]{% %DIF PREAMBLE
sbox{DIFdelgraphicsbox}{DIFOincludegraphics[#1]{#2}}% %DIF PREAMBLE
settoboxwidth{DIFdelgraphicswidth}{DIFdelgraphicsbox} %DIF PREAMBLE
settoboxtotalheight{DIFdelgraphicsheight}{DIFdelgraphicsbox} %DIF PREAMBLE
scalebox{DIFscaledelfig}{% %DIF PREAMBLE
parbox[b]{DIFdelgraphicswidth}{usebox{DIFdelgraphicsbox}\[-baselineskip] rule{DIFdelgraphicswidth}{0em}}llap{resizebox{DIFdelgraphicswidth}{DIFdelgraphicsheight}{% %DIF PREAMBLE
setlength{unitlength}{DIFdelgraphicswidth}% %DIF PREAMBLE
begin{picture}(1,1)% %DIF PREAMBLE
thicklineslinethickness{2pt} %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,0){framebox(1,1){}}}% %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,0){line( 1,1){1}}}% %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,1){line(1,-1){1}}}% %DIF PREAMBLE
end{picture}% %DIF PREAMBLE
}hspace*{3pt}}} %DIF PREAMBLE
} %DIF PREAMBLE
LetLtxMacro{DIFOaddbegin}{DIFaddbegin} %DIF PREAMBLE
LetLtxMacro{DIFOaddend}{DIFaddend} %DIF PREAMBLE
LetLtxMacro{DIFOdelbegin}{DIFdelbegin} %DIF PREAMBLE
LetLtxMacro{DIFOdelend}{DIFdelend} %DIF PREAMBLE
DeclareRobustCommand{DIFaddbegin}{DIFOaddbegin letincludegraphicsDIFaddincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFaddend}{DIFOaddend letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelbegin}{DIFOdelbegin letincludegraphicsDIFdelincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelend}{DIFOaddend letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
LetLtxMacro{DIFOaddbeginFL}{DIFaddbeginFL} %DIF PREAMBLE
LetLtxMacro{DIFOaddendFL}{DIFaddendFL} %DIF PREAMBLE
LetLtxMacro{DIFOdelbeginFL}{DIFdelbeginFL} %DIF PREAMBLE
LetLtxMacro{DIFOdelendFL}{DIFdelendFL} %DIF PREAMBLE
DeclareRobustCommand{DIFaddbeginFL}{DIFOaddbeginFL letincludegraphicsDIFaddincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFaddendFL}{DIFOaddendFL letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelbeginFL}{DIFOdelbeginFL letincludegraphicsDIFdelincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelendFL}{DIFOaddendFL letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF

begin{document}
begin{table}
centering
caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
DIFdelbeginFL %DIFDELCMD < scalebox{0.8}{begin{tabular}{lcc}
%DIFDELCMD < A & 1 & 1 \
%DIFDELCMD < B & 2 & 2 \
%DIFDELCMD < end{tabular}}
%DIFDELCMD < %%%
DIFdelendFL DIFaddbeginFL scalebox{0.8}{
begin{tabular}{lcc}
C & 3 & 3 \
D & 4 & 4 \
end{tabular}}
DIFaddendFL end{table}
end{document}


Actually, I have found the question lies on the scalebox{}{}. If I don't use scalebox, the diff.tex is
enter image description here



This is what I want.



However, when use scalebox, it would be



enter image description here



But in practice my table is very wide so I have to use scalebox. My question is, is there any method to keep table fit to text width, meanwhile make latexdiff work?










share|improve this question







New contributor




Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • welcome to tex.se!

    – Zarko
    14 hours ago











  • do you really want to put a table in scalebox ? It usually produces very poor result, it is usually far better to use small or tiny etc and use font size consistent with the rest of the document.

    – David Carlisle
    7 hours ago














2












2








2








When revise my manuscript, I found latexdiff can't label changes in tables. For example, there are two tex files before and after revision:



Before revision



documentclass{article}
usepackage{graphicx}

begin{document}
begin{table}
centering
caption{Example}
scalebox{0.8}{begin{tabular}{lcc}
A & 1 & 1 \
B & 2 & 2 \
end{tabular}}
end{table}
end{document}


After revision



documentclass{article}
usepackage{graphicx}

begin{document}
begin{table}
centering
caption{New Example}
scalebox{0.8}{
begin{tabular}{lcc}
C & 3 & 3 \
D & 4 & 4 \
end{tabular}}
end{table}
end{document}


The diff.tex is followed:



documentclass{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL old.tex Thu Mar 7 08:20:20 2019
%DIF ADD new.tex Thu Mar 7 08:19:50 2019
usepackage{graphicx}
%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]{{protectcolor{blue}uwave{#1}}} %DIF PREAMBLE
providecommand{DIFdel}[1]{{protectcolor{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
%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
newcommand{DIFscaledelfig}{0.5}
%DIF HIGHLIGHTGRAPHICS PREAMBLE %DIF PREAMBLE
RequirePackage{settobox} %DIF PREAMBLE
RequirePackage{letltxmacro} %DIF PREAMBLE
newsavebox{DIFdelgraphicsbox} %DIF PREAMBLE
newlength{DIFdelgraphicswidth} %DIF PREAMBLE
newlength{DIFdelgraphicsheight} %DIF PREAMBLE
% store original definition of includegraphics %DIF PREAMBLE
LetLtxMacro{DIFOincludegraphics}{includegraphics} %DIF PREAMBLE
newcommand{DIFaddincludegraphics}[2][]{{color{blue}fbox{DIFOincludegraphics[#1]{#2}}}} %DIF PREAMBLE
newcommand{DIFdelincludegraphics}[2][]{% %DIF PREAMBLE
sbox{DIFdelgraphicsbox}{DIFOincludegraphics[#1]{#2}}% %DIF PREAMBLE
settoboxwidth{DIFdelgraphicswidth}{DIFdelgraphicsbox} %DIF PREAMBLE
settoboxtotalheight{DIFdelgraphicsheight}{DIFdelgraphicsbox} %DIF PREAMBLE
scalebox{DIFscaledelfig}{% %DIF PREAMBLE
parbox[b]{DIFdelgraphicswidth}{usebox{DIFdelgraphicsbox}\[-baselineskip] rule{DIFdelgraphicswidth}{0em}}llap{resizebox{DIFdelgraphicswidth}{DIFdelgraphicsheight}{% %DIF PREAMBLE
setlength{unitlength}{DIFdelgraphicswidth}% %DIF PREAMBLE
begin{picture}(1,1)% %DIF PREAMBLE
thicklineslinethickness{2pt} %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,0){framebox(1,1){}}}% %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,0){line( 1,1){1}}}% %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,1){line(1,-1){1}}}% %DIF PREAMBLE
end{picture}% %DIF PREAMBLE
}hspace*{3pt}}} %DIF PREAMBLE
} %DIF PREAMBLE
LetLtxMacro{DIFOaddbegin}{DIFaddbegin} %DIF PREAMBLE
LetLtxMacro{DIFOaddend}{DIFaddend} %DIF PREAMBLE
LetLtxMacro{DIFOdelbegin}{DIFdelbegin} %DIF PREAMBLE
LetLtxMacro{DIFOdelend}{DIFdelend} %DIF PREAMBLE
DeclareRobustCommand{DIFaddbegin}{DIFOaddbegin letincludegraphicsDIFaddincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFaddend}{DIFOaddend letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelbegin}{DIFOdelbegin letincludegraphicsDIFdelincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelend}{DIFOaddend letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
LetLtxMacro{DIFOaddbeginFL}{DIFaddbeginFL} %DIF PREAMBLE
LetLtxMacro{DIFOaddendFL}{DIFaddendFL} %DIF PREAMBLE
LetLtxMacro{DIFOdelbeginFL}{DIFdelbeginFL} %DIF PREAMBLE
LetLtxMacro{DIFOdelendFL}{DIFdelendFL} %DIF PREAMBLE
DeclareRobustCommand{DIFaddbeginFL}{DIFOaddbeginFL letincludegraphicsDIFaddincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFaddendFL}{DIFOaddendFL letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelbeginFL}{DIFOdelbeginFL letincludegraphicsDIFdelincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelendFL}{DIFOaddendFL letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF

begin{document}
begin{table}
centering
caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
DIFdelbeginFL %DIFDELCMD < scalebox{0.8}{begin{tabular}{lcc}
%DIFDELCMD < A & 1 & 1 \
%DIFDELCMD < B & 2 & 2 \
%DIFDELCMD < end{tabular}}
%DIFDELCMD < %%%
DIFdelendFL DIFaddbeginFL scalebox{0.8}{
begin{tabular}{lcc}
C & 3 & 3 \
D & 4 & 4 \
end{tabular}}
DIFaddendFL end{table}
end{document}


Actually, I have found the question lies on the scalebox{}{}. If I don't use scalebox, the diff.tex is
enter image description here



This is what I want.



However, when use scalebox, it would be



enter image description here



But in practice my table is very wide so I have to use scalebox. My question is, is there any method to keep table fit to text width, meanwhile make latexdiff work?










share|improve this question







New contributor




Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












When revise my manuscript, I found latexdiff can't label changes in tables. For example, there are two tex files before and after revision:



Before revision



documentclass{article}
usepackage{graphicx}

begin{document}
begin{table}
centering
caption{Example}
scalebox{0.8}{begin{tabular}{lcc}
A & 1 & 1 \
B & 2 & 2 \
end{tabular}}
end{table}
end{document}


After revision



documentclass{article}
usepackage{graphicx}

begin{document}
begin{table}
centering
caption{New Example}
scalebox{0.8}{
begin{tabular}{lcc}
C & 3 & 3 \
D & 4 & 4 \
end{tabular}}
end{table}
end{document}


The diff.tex is followed:



documentclass{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL old.tex Thu Mar 7 08:20:20 2019
%DIF ADD new.tex Thu Mar 7 08:19:50 2019
usepackage{graphicx}
%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]{{protectcolor{blue}uwave{#1}}} %DIF PREAMBLE
providecommand{DIFdel}[1]{{protectcolor{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
%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
newcommand{DIFscaledelfig}{0.5}
%DIF HIGHLIGHTGRAPHICS PREAMBLE %DIF PREAMBLE
RequirePackage{settobox} %DIF PREAMBLE
RequirePackage{letltxmacro} %DIF PREAMBLE
newsavebox{DIFdelgraphicsbox} %DIF PREAMBLE
newlength{DIFdelgraphicswidth} %DIF PREAMBLE
newlength{DIFdelgraphicsheight} %DIF PREAMBLE
% store original definition of includegraphics %DIF PREAMBLE
LetLtxMacro{DIFOincludegraphics}{includegraphics} %DIF PREAMBLE
newcommand{DIFaddincludegraphics}[2][]{{color{blue}fbox{DIFOincludegraphics[#1]{#2}}}} %DIF PREAMBLE
newcommand{DIFdelincludegraphics}[2][]{% %DIF PREAMBLE
sbox{DIFdelgraphicsbox}{DIFOincludegraphics[#1]{#2}}% %DIF PREAMBLE
settoboxwidth{DIFdelgraphicswidth}{DIFdelgraphicsbox} %DIF PREAMBLE
settoboxtotalheight{DIFdelgraphicsheight}{DIFdelgraphicsbox} %DIF PREAMBLE
scalebox{DIFscaledelfig}{% %DIF PREAMBLE
parbox[b]{DIFdelgraphicswidth}{usebox{DIFdelgraphicsbox}\[-baselineskip] rule{DIFdelgraphicswidth}{0em}}llap{resizebox{DIFdelgraphicswidth}{DIFdelgraphicsheight}{% %DIF PREAMBLE
setlength{unitlength}{DIFdelgraphicswidth}% %DIF PREAMBLE
begin{picture}(1,1)% %DIF PREAMBLE
thicklineslinethickness{2pt} %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,0){framebox(1,1){}}}% %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,0){line( 1,1){1}}}% %DIF PREAMBLE
{color[rgb]{1,0,0}put(0,1){line(1,-1){1}}}% %DIF PREAMBLE
end{picture}% %DIF PREAMBLE
}hspace*{3pt}}} %DIF PREAMBLE
} %DIF PREAMBLE
LetLtxMacro{DIFOaddbegin}{DIFaddbegin} %DIF PREAMBLE
LetLtxMacro{DIFOaddend}{DIFaddend} %DIF PREAMBLE
LetLtxMacro{DIFOdelbegin}{DIFdelbegin} %DIF PREAMBLE
LetLtxMacro{DIFOdelend}{DIFdelend} %DIF PREAMBLE
DeclareRobustCommand{DIFaddbegin}{DIFOaddbegin letincludegraphicsDIFaddincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFaddend}{DIFOaddend letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelbegin}{DIFOdelbegin letincludegraphicsDIFdelincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelend}{DIFOaddend letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
LetLtxMacro{DIFOaddbeginFL}{DIFaddbeginFL} %DIF PREAMBLE
LetLtxMacro{DIFOaddendFL}{DIFaddendFL} %DIF PREAMBLE
LetLtxMacro{DIFOdelbeginFL}{DIFdelbeginFL} %DIF PREAMBLE
LetLtxMacro{DIFOdelendFL}{DIFdelendFL} %DIF PREAMBLE
DeclareRobustCommand{DIFaddbeginFL}{DIFOaddbeginFL letincludegraphicsDIFaddincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFaddendFL}{DIFOaddendFL letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelbeginFL}{DIFOdelbeginFL letincludegraphicsDIFdelincludegraphics} %DIF PREAMBLE
DeclareRobustCommand{DIFdelendFL}{DIFOaddendFL letincludegraphicsDIFOincludegraphics} %DIF PREAMBLE
%DIF END PREAMBLE EXTENSION ADDED BY LATEXDIFF

begin{document}
begin{table}
centering
caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
DIFdelbeginFL %DIFDELCMD < scalebox{0.8}{begin{tabular}{lcc}
%DIFDELCMD < A & 1 & 1 \
%DIFDELCMD < B & 2 & 2 \
%DIFDELCMD < end{tabular}}
%DIFDELCMD < %%%
DIFdelendFL DIFaddbeginFL scalebox{0.8}{
begin{tabular}{lcc}
C & 3 & 3 \
D & 4 & 4 \
end{tabular}}
DIFaddendFL end{table}
end{document}


Actually, I have found the question lies on the scalebox{}{}. If I don't use scalebox, the diff.tex is
enter image description here



This is what I want.



However, when use scalebox, it would be



enter image description here



But in practice my table is very wide so I have to use scalebox. My question is, is there any method to keep table fit to text width, meanwhile make latexdiff work?







latexdiff






share|improve this question







New contributor




Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 14 hours ago









Shenghua LuShenghua Lu

111




111




New contributor




Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Shenghua Lu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • welcome to tex.se!

    – Zarko
    14 hours ago











  • do you really want to put a table in scalebox ? It usually produces very poor result, it is usually far better to use small or tiny etc and use font size consistent with the rest of the document.

    – David Carlisle
    7 hours ago



















  • welcome to tex.se!

    – Zarko
    14 hours ago











  • do you really want to put a table in scalebox ? It usually produces very poor result, it is usually far better to use small or tiny etc and use font size consistent with the rest of the document.

    – David Carlisle
    7 hours ago

















welcome to tex.se!

– Zarko
14 hours ago





welcome to tex.se!

– Zarko
14 hours ago













do you really want to put a table in scalebox ? It usually produces very poor result, it is usually far better to use small or tiny etc and use font size consistent with the rest of the document.

– David Carlisle
7 hours ago





do you really want to put a table in scalebox ? It usually produces very poor result, it is usually far better to use small or tiny etc and use font size consistent with the rest of the document.

– David Carlisle
7 hours ago










1 Answer
1






active

oldest

votes


















1














scalebox is treated as an un-safe command by default, hence being commented out by %DIFDELCMD. Appending scalebox to the list of text command seems solve your problem. Check doc of latexdiff for more info.



latexdiff --append-textcmd="scalebox" old.tex new.tex > diff.tex


Selected lines of diff.tex



begin{document}
begin{table}
centering
caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
scalebox{0.8}{
begin{tabular}{lcc}
DIFdelbeginFL DIFdelFL{A }DIFdelendFL DIFaddbeginFL DIFaddFL{C }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL \
DIFdelbeginFL DIFdelFL{B }DIFdelendFL DIFaddbeginFL DIFaddFL{D }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL \
end{tabular}}
end{table} end{document}


Output



image showing output of latexdiff with scalebox






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    Shenghua Lu is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478124%2flatexdiff-dont-work-in-table-with-scalebox%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    scalebox is treated as an un-safe command by default, hence being commented out by %DIFDELCMD. Appending scalebox to the list of text command seems solve your problem. Check doc of latexdiff for more info.



    latexdiff --append-textcmd="scalebox" old.tex new.tex > diff.tex


    Selected lines of diff.tex



    begin{document}
    begin{table}
    centering
    caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
    scalebox{0.8}{
    begin{tabular}{lcc}
    DIFdelbeginFL DIFdelFL{A }DIFdelendFL DIFaddbeginFL DIFaddFL{C }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL \
    DIFdelbeginFL DIFdelFL{B }DIFdelendFL DIFaddbeginFL DIFaddFL{D }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL \
    end{tabular}}
    end{table} end{document}


    Output



    image showing output of latexdiff with scalebox






    share|improve this answer






























      1














      scalebox is treated as an un-safe command by default, hence being commented out by %DIFDELCMD. Appending scalebox to the list of text command seems solve your problem. Check doc of latexdiff for more info.



      latexdiff --append-textcmd="scalebox" old.tex new.tex > diff.tex


      Selected lines of diff.tex



      begin{document}
      begin{table}
      centering
      caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
      scalebox{0.8}{
      begin{tabular}{lcc}
      DIFdelbeginFL DIFdelFL{A }DIFdelendFL DIFaddbeginFL DIFaddFL{C }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL \
      DIFdelbeginFL DIFdelFL{B }DIFdelendFL DIFaddbeginFL DIFaddFL{D }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL \
      end{tabular}}
      end{table} end{document}


      Output



      image showing output of latexdiff with scalebox






      share|improve this answer




























        1












        1








        1







        scalebox is treated as an un-safe command by default, hence being commented out by %DIFDELCMD. Appending scalebox to the list of text command seems solve your problem. Check doc of latexdiff for more info.



        latexdiff --append-textcmd="scalebox" old.tex new.tex > diff.tex


        Selected lines of diff.tex



        begin{document}
        begin{table}
        centering
        caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
        scalebox{0.8}{
        begin{tabular}{lcc}
        DIFdelbeginFL DIFdelFL{A }DIFdelendFL DIFaddbeginFL DIFaddFL{C }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL \
        DIFdelbeginFL DIFdelFL{B }DIFdelendFL DIFaddbeginFL DIFaddFL{D }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL \
        end{tabular}}
        end{table} end{document}


        Output



        image showing output of latexdiff with scalebox






        share|improve this answer















        scalebox is treated as an un-safe command by default, hence being commented out by %DIFDELCMD. Appending scalebox to the list of text command seems solve your problem. Check doc of latexdiff for more info.



        latexdiff --append-textcmd="scalebox" old.tex new.tex > diff.tex


        Selected lines of diff.tex



        begin{document}
        begin{table}
        centering
        caption{DIFaddbeginFL DIFaddFL{New }DIFaddendFL Example}
        scalebox{0.8}{
        begin{tabular}{lcc}
        DIFdelbeginFL DIFdelFL{A }DIFdelendFL DIFaddbeginFL DIFaddFL{C }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL & DIFdelbeginFL DIFdelFL{1 }DIFdelendFL DIFaddbeginFL DIFaddFL{3 }DIFaddendFL \
        DIFdelbeginFL DIFdelFL{B }DIFdelendFL DIFaddbeginFL DIFaddFL{D }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL & DIFdelbeginFL DIFdelFL{2 }DIFdelendFL DIFaddbeginFL DIFaddFL{4 }DIFaddendFL \
        end{tabular}}
        end{table} end{document}


        Output



        image showing output of latexdiff with scalebox







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 10 hours ago

























        answered 11 hours ago









        Johannes ZJohannes Z

        341110




        341110






















            Shenghua Lu is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Shenghua Lu is a new contributor. Be nice, and check out our Code of Conduct.













            Shenghua Lu is a new contributor. Be nice, and check out our Code of Conduct.












            Shenghua Lu is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478124%2flatexdiff-dont-work-in-table-with-scalebox%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

            Castillo d'Acher Características Menú de navegación

            Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...