diff -up ./latexdiff.pl.orig ./latexdiff.pl --- ./latexdiff.pl.orig 2015-12-28 19:15:33.000000000 -0500 +++ ./latexdiff.pl 2016-06-22 15:46:24.444571914 -0400 @@ -1465,7 +1465,7 @@ sub flatten { $bblfile=~s/\.tex$//; $bblfile.=".bbl"; - if ( ($includeonly) = ($preamble =~ m/\\includeonly{(.*?)}/ ) ) { + if ( ($includeonly) = ($preamble =~ m/\\includeonly\{(.*?)}/ ) ) { $includeonly =~ s/,/|/g; } else { $includeonly = '.*?'; @@ -1474,7 +1474,7 @@ sub flatten { print STDERR "DEBUG: includeonly $includeonly\n" if $debug; # recursively replace \\input and \\include files - 1 while $text=~s/(^(?:[^%\n]|\\%)*)\\input{(.*?)}|\\include{(${includeonly}(?:\.tex)?)}/{ + 1 while $text=~s/(^(?:[^%\n]|\\%)*)\\input\{(.*?)}|\\include\{(${includeonly}(?:\.tex)?)}/{ $begline=(defined($1)? $1 : "") ; $fname = $2 if defined($2) ; $fname = $3 if defined($3) ; @@ -1491,7 +1491,7 @@ sub flatten { "$begline$newpage$replacement$newpage"; }/exgm; # replace bibliography with bbl file if it exists - $text=~s/(^(?:[^%\n]|\\%)*)\\bibliography{(.*?)}/{ + $text=~s/(^(?:[^%\n]|\\%)*)\\bibliography\{(.*?)}/{ if ( -f $bblfile ){ $replacement=read_file_with_encoding(File::Spec->catfile($bblfile), $encoding); } else { @@ -1502,7 +1502,7 @@ sub flatten { "$begline$replacement"; }/exgm; # replace subfile with contents (subfile package) - $text=~s/(^(?:[^%\n]|\\%)*)\\subfile{(.*?)}/{ + $text=~s/(^(?:[^%\n]|\\%)*)\\subfile\{(.*?)}/{ $begline=(defined($1)? $1 : "") ; $fname = $2; # # add tex extension unless there is a three letter extension already @@ -2244,7 +2244,7 @@ sub take_comments_and_enter_from_frac() sub preprocess { for (@_) { # Change \{ to \QLEFTBRACE, \} to \QRIGHTBRACE, and \& to \AMPERSAND - s/(?