Category Archives: Uncategorized

Latexdiff in TexShop, how to highlight changes between two latex files.

Often times, you may want to see changes between two latex files: let’s say old.tex and new.tex file.

There is a simple workaround that creates diff.tex file using latexdiff. I have tried to use texdiff and compiled using texshop but it spits lots of errors (protect/TLS ….).

Alternative is using latexdiff and it works like charm in my case. Locate two tex files in a folder and run the following command.

 

 latexdiff old.tex new.tex > diff.tex

 

You should be able to compile diff.tex file if you can compile new.tex and old.tex files. The below is an example how it looks like.

Using gedit for editing MATLAB script in Ubuntu

By default, gedit recognises *.m file as object-c file and this causes unwanted syntax highlighting in gedit.

There is a workaround to fix this. Note that if you update gedit or mime type sets that overwrite your modification and you need to this again afterward.

gedit uses mime type for text management and all rules can be found from

 

/usr/share/mime/packages/freedesktop.org.xml

 

Let’s open this file with sudo.

Looking for <mime-type type=”text/x-objcsrc”> and this mime-type is for object-c source code.

For some reason, *.m file is mapped as object-c file <glob pattern=”*.m”/>, just before <mime-type type=”text/x-ocaml”> line.

Let’s change <glob pattern=”*.m”/> to<glob pattern=”*.c”/> and save it.

Finally, the following command updates your modification and gedit will use Octave syntax that properly displays MATLAB script.

 

sudo update-mime-database /usr/share/mime

 

Give this try and let me know whether this works or not.