{"id":1082,"date":"2025-07-05T09:59:13","date_gmt":"2025-07-05T09:59:13","guid":{"rendered":"https:\/\/doublelayer.eu\/vilab\/?p=1082"},"modified":"2025-09-14T16:16:40","modified_gmt":"2025-09-14T16:16:40","slug":"showing-difference-in-files","status":"publish","type":"post","link":"https:\/\/doublelayer.eu\/vilab\/2025\/07\/05\/showing-difference-in-files\/","title":{"rendered":"Showing difference in files"},"content":{"rendered":"\n<p>We are submitting the review &#8220;<a href=\"https:\/\/chemrxiv.org\/engage\/chemrxiv\/article-details\/67ed469081d2151a02b33a98\" data-type=\"link\" data-id=\"https:\/\/chemrxiv.org\/engage\/chemrxiv\/article-details\/67ed469081d2151a02b33a98\">Twenty Years After: Scaling Relations in Oxygen Electrocatalysis and Beyond<\/a>&#8220;<\/p>\n\n\n\n<p>I have made so many changes to the LaTeX code that latexdiff gives 99+ errors. UPDATE: the errors were related to table and equations. To fix them I played with &#8211;math-markup=none and &#8211;add-to-config PICTURENEV=tabular, but eventually just fixed the Tables and specific errors.<\/p>\n\n\n\n<p>There are two ways to get <a href=\"https:\/\/www.overleaf.com\/learn\/latex\/Articles\/How_to_use_latexdiff_on_Overleaf\">diff in overleaf<\/a>, which I use. <\/p>\n\n\n\n<p>In search for an alternative, have tested DiffPDF and Meld. The result looks useful, yet unsuitable for submitting them to the editor. So, this post should have a label &#8220;do not know how&#8221; instead of usual &#8220;know-how&#8221;. Still, fun.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1024x612.png\" alt=\"\" class=\"wp-image-1083\" srcset=\"https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1024x612.png 1024w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-300x179.png 300w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-768x459.png 768w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1536x917.png 1536w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-220x131.png 220w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image.png 1914w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1-1024x612.png\" alt=\"\" class=\"wp-image-1084\" srcset=\"https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1-1024x612.png 1024w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1-300x179.png 300w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1-768x459.png 768w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1-1536x918.png 1536w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1-220x131.png 220w, https:\/\/doublelayer.eu\/vilab\/wp-content\/uploads\/2025\/07\/image-1.png 1914w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To make the last printscreen, I did the following.<\/p>\n\n\n\n<p>Installed packages in Linux\/Ubuntu\/WSL2.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get -y install meld calibre parallel<\/code><\/pre>\n\n\n\n<p>Saved the following code in a file named &#8220;diffdoc&#8221; (with no extensions) inside directory &#8220;\/usr\/local\/bin&#8221;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>usage=\"\n*** usage:\n\ndiffepub - compare text in two files. Valid format for input files are:\nMOBI, LIT, PRC, EPUB, ODT, HTML, CBR, CBZ, RTF, TXT, PDF and LRS.\n\ndiffepub -h | FILE1 FILE2\n\n-h print this message\n\nExample:\ndiffepub my_file1.pdf my_file2.pdf\ndiffepub my_file1.epub my_file2.epub\n\nv0.2 (added parallel and 3 files processing)\n\"\n\n#parse command line options\nwhile getopts \"h\" OPTIONS ; do\n  case ${OPTIONS} in\n    h|-help) echo \"${usage}\"; exit;;\n  esac\ndone\nshift $(($OPTIND - 1))\n\n#check if first 2 command line arguments are files\nif &#91; -z \"$1\" ] || &#91; -z \"$2\" ] || &#91; ! -f \"$1\" ] || &#91; ! -f \"$2\" ]\nthen\n  echo \"ERROR: input files do not exist.\"\n  echo\n  echo \"$usage\"\n  exit\nfi\n\n\n\n#create temporary files (first &amp; last 10 characters of\n# input files w\/o extension)\nfile1=`basename \"$1\" | sed -r -e '\ns\/\\..*$\/\/                     #strip file extension\ns\/(^.{1,10}).*(.{10})\/\\1__\\2\/ #take first-last 10 chars\ns\/$\/_XXX.txt\/                 #add tmp file extension\n'`\nTMPFILE1=$(mktemp --tmpdir \"$file1\")\n\nfile2=`basename \"$2\" | sed -r -e '\ns\/\\..*$\/\/                     #strip file extension\ns\/(^.{1,10}).*(.{10})\/\\1__\\2\/ #take first-last 10 chars\ns\/$\/_XXX.txt\/                 #add tmp file extension\n'`\nTMPFILE2=$(mktemp --tmpdir \"$file2\")\n\nif &#91; \"$#\" -gt 2 ] \nthen\n  file3=`basename \"$3\" | sed -r -e '\n  s\/\\..*$\/\/                     #strip file extension\n  s\/(^.{1,10}).*(.{10})\/\\1__\\2\/ #take first-last 10 chars\n  s\/$\/_XXX.txt\/                 #add tmp file extension\n  '`\n  TMPFILE3=$(mktemp --tmpdir \"$file3\")\nfi\n\n#convert to txt and compare using meld\ndoit(){ #to solve __space__ between filenames and parallel\n  ebook-convert $1\n}\nexport -f doit\nif &#91; \"$#\" -gt 2 ] \nthen\n  (parallel doit ::: \"$1 $TMPFILE1\" \\\n                     \"$2 $TMPFILE2\" \\\n                     \"$3 $TMPFILE3\" ) &amp;&amp;\n  (meld \"$TMPFILE1\" \"$TMPFILE2\" \"$TMPFILE3\")\nelse\n  (parallel doit ::: \"$1 $TMPFILE1\" \\\n                     \"$2 $TMPFILE2\" ) &amp;&amp;\n  (meld \"$TMPFILE1\" \"$TMPFILE2\")\nfi<\/code><\/pre>\n\n\n\n<p>Made sure the owner is me and it has execution permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown $USER:$USER \/usr\/local\/bin\/diffepub\nsudo chmod 700 \/usr\/local\/bin\/diffepub<\/code><\/pre>\n\n\n\n<p>Run it on two pdf files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>diffdoc FILE1.pdf FILE2.pdf<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>We are submitting the review &#8220;Twenty Years After: Scaling Relations in Oxygen Electrocatalysis and Beyond&#8220; I have made so many changes to the LaTeX code that latexdiff gives 99+ errors. UPDATE: the errors were related to table and equations. To fix them I played with &#8211;math-markup=none and &#8211;add-to-config PICTURENEV=tabular, but eventually just fixed the Tables&hellip; <a class=\"read-more\" href=\"https:\/\/doublelayer.eu\/vilab\/2025\/07\/05\/showing-difference-in-files\/\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1082","post","type-post","status-publish","format-standard","hentry","category-know-how"],"_links":{"self":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/1082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/comments?post=1082"}],"version-history":[{"count":4,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/1082\/revisions"}],"predecessor-version":[{"id":1134,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/1082\/revisions\/1134"}],"wp:attachment":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/media?parent=1082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/categories?post=1082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/tags?post=1082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}