With this post I propose some of the common tools I use as a PhD candidate in order to make things easy in life. Most of the time scientific papers need to be written. Those papers are all written in Latex.
Reference management
I currently use and can recommend Mendeley for easy access to all the references and paper you might come across. It also supports a chrome plugin which lets you store any paper on the fly. Moreover it also supports highlighting and comments on any paper.
Latex tips
Latex is the tool to make any reasonable paper. I generally do not look into papers which are obviously written in word, because I think that lacks some amount of professionality. Of course there are some good word templates … but also bad ones. Can’t say that about Latex.
Mendeley integration - easy referencing
There are a ton of tools to support latex compiliation, even online ones e.g. Overleaf and Sharelatex, but they all lack a crutial component when writing papers: proper support for citing from an preexisting library.
Therefore I generally use latexing in conjunction with sublime-text. Latexing is a great tool, which supports Mendeley referencing from a remotly - synced library. Install sublime-text e.g.:
pacaur -S aur/sublime-text-dev
Then install pacage control, which is a great sublime-text package manager, by opening the command line with ctrl+\
`, pasting the following code and pressing enter (more infos at Package control):
import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
Aterwards search for Latexing (press ctrl + shift + p
and type latexing) and install it.
After installation, the Mendeley sync needs to be set up. Therefore just refer to the instruction on the latexing website.
If everything is done correctly you can simply open any .tex document and try to cite any paper you have in your library with \cite{ABC12}
. An automatic download of the reference into a .bib file (default name is Remote.bib) is triggered.
Cleverref
One of the biggest problems when writing latex documents is referencing previous sections and figures. Even though in general there is no big problem with references, consistency is key (e.g. always writing Section 3.1 in captial instead of lower case). Moreover, most people do not want to write the necessary as it can be seen in Section \ref{sec:Section1}
in order to correctly reference the section.
Therefore there is cleverref. Cleverref does all these things automatically, e.g. completes a \cref{fig:figure}
to figure 1.2
. Captial characters can be printed with a captial \Cref
.
Pandoc
Pandoc is a unversal format converter which e.g., converts a markdown documen such as this into HTML or latex or whatever format one can wish. In my reasearch it is mostlyused for table format translation, especially for markdown to latex formatting. Since latex tables are really problematic in most of the times, since you either need to use some online generator or some self written script to reenter previous results.
The installation instructions for Pandoc can be seen on their homepage.
After installing, one can convert e.g., markdown to html tables, such as the following table, named as table.md
:
Model | Framesize | Binary | Multi Class
---|--- | --- | --- | --- |
DNN | 400 | 0.637 % | 0.832%
CNN | 560 | 0.912 % | 1.110%
Then one can convert this table to latex by using pandoc: pandoc -s table.md -o table.tex
. The result will be a full latex document, whereas in the \begin{document}
section the resulting table can be found.
Automatic SSH mounting
For most of the time I run my experiments on a remote cluster. While it is mostly sufficient to just ssh
onto the cluster and do some stuff, sometimes (when I write larger code bases) I prefer to use sublime with the remote option. Sublime supports this kind of functionality.
At first I used the gvfs
mounting system, which comes with thunar. It’s simple: just enter your ssh address into the thunar search bar e.g. ssh://user@myserver:port/PATH
, but there are some bugs. Most notably, when a disconnect occurs, thunar and gvfs is not going to like it and some nasty service not provided
will appear. Afaik this is not even fixable with killing thunar/ssh/sshfs/gvfs and restart.
Therefore, I moved to a much more convienient solution: on demand sshfs. SSHFs can be easily installed on any linux:
sudo pacman -S sshfs
For an automatic mount (on demand), edit as root /etc/fuse
:
sudo vim /etc/fuse
user@host:/remote/folder /mount/point fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/YOURUSERDIR/.ssh/id_rsa,allow_other,reconnect 0 0
Here, just edit the Identityfile and the remote/local folder. Note that in order to work properly, ssh-keygen
needs to be used for non-password authentification with ssh
.