--- latexdiff.pl 2015-04-19 16:00:38.000000000 -0600 +++ latexdiff.pl 2015-12-15 19:14:13.581563397 -0700 @@ -1434,7 +1434,7 @@ sub flatten { $bblfile=~s/\.tex$//; $bblfile.=".bbl"; - if ( ($includeonly) = ($preamble =~ m/\\includeonly{(.*?)}/ ) ) { + if ( ($includeonly) = ($preamble =~ m/\\includeonly\{(.*?)}/ ) ) { $includeonly =~ s/,/|/g; } else { $includeonly = '.*?'; @@ -1443,7 +1443,7 @@ sub flatten { print STDERR "DEBUG: includeonly $includeonly\n" if $debug; # recursively replace \\input and \\include files - $text=~s/(^(?:[^%\n]|\\%)*)\\input{(.*?)}|\\include{(${includeonly}(?:\.tex)?)}/{ + $text=~s/(^(?:[^%\n]|\\%)*)\\input\{(.*?)}|\\include\{(${includeonly}(?:\.tex)?)}/{ $begline=(defined($1)? $1 : "") ; $fname = $2 if defined($2) ; $fname = $3 if defined($3) ; @@ -1460,7 +1460,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 { @@ -1471,7 +1471,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 @@ -2166,7 +2166,7 @@ sub marktags { sub preprocess { for (@_) { # Change \{ to \QLEFTBRACE and \} to \QRIGHTBRACE - s/(?