February 1, 2013

## Natural Scrolling in Linux

This is just a quickie.

Recently I started working at a company where all the devstations are MacMinis. I never used Macs before, but so far so good.
The only thing that was annoying me was my brain farts when moving from natural scrolling (1) to the common people scrolling.

1. Natural Scrolling is how they call the mac osx scrolling, where you roll down your mouse whell to roll up the scrollbar, and roll up the mouse whell to roll down the scrollbar.

I decided to have my Linux use natural scrolling and get rid of this, and it’s quite easy!

$echo "pointer = 1 2 3 5 4 7 6 8 9 10 11 12" >> ~/.Xmodmap$ xmodmap ~/.Xmodmap

The synaptics driver uses the buttons 4 and 5 for up and down scrolling, and with the above xmodmap configuration we’re just swapping the two of them!

Extra: If you’d like to change this on the fly with a GUI, there’s the “NaturalScrolling” project on github. But I didn’t test it.
https://github.com/cemmanouilidis/naturalscrolling#readme

July 24, 2012

## Spliting BibTeX references into different categories

I tend to write all my academic papers in LaTeX. I like the idea of it, I like the separation of content and style, I think the output looks good *most* of the times, and, above all, I think managing bibliography with latex is the best option so far.

This post is about managing references. Specifically, about when you want to split your latex references in different categories. Maybe you’d like to list Books and Journals apart from other references, maybe you’re writing a review, a state-of-the-art analysis, and you’d like to separate the analyzed works from others you cite along. I had to do both, and found a few different options.

So, here they are:

#### 1. Using different .bib files for each category

Example:

\documentclass{article}
\usepackage{bibtopic}

\begin{document}
\bibliographystyle{alpha}
\section{Citing things}
\cite{somebook}. \cite{otherbook}, \cite{somepaper}.

% File books.bib is use for this listing:
\begin{btSect}{books}
\section{References from books}
\btPrintCited
\end{btSect}

% File articles.bib is used here, and the listing is in
% plain-format instead of the standard alpha:
\begin{btSect}[plain]{articles}
\section{References from articles}
\btPrintCited
\section{Articles not cited}
\btPrintNotCited
\end{btSect}

% Print alll entries from internet.bib:
\begin{btSect}{Internet}
\section{References from teh Internets}
\btPrintAll
\end{btSect}
\end{document}


#### 2. Using a single .bib, and manually separating references using different citation commands

This creates a different citation command (“citesel” in the example) for each category other than the
default one.

Example:

\documentclass{article}
\usepackage{multibib}
\newcites{sel}{Selected works}

\begin{document}
\cite{ref1}
\citesel{ref2}

% Selected works (refs.bib)
\bibliographystylesel{spmpsci}
\bibliographysel{refs}

% Other (refs.bib)
\bibliographystyle{spmpsci}
\bibliography{refs}

\end{document}


#### 3. Split based on reference properties

You can use other properties than type to filter them. You should read the manual if that’s the case!

Example:

\documentclass{article}
\usepackage[defernumbers=true]{biblatex}

\addbibresource{\refs.bib}
\nocite{*}

\begin{document}

\printbibliography[title={Books},type=book]
\printbibliography[title={Other References},nottype=book]

\end{document}

July 16, 2012

## Using local jars in a maven project

Maven is great, really, but sometimes you just have to use that obscure jar library that isn’t in any maven repository. You know, not everyone uses maven.

So, how do you handle this type of dependencies? This is what I do, and you might find it useful: I create a local repository within the project. This way you can put everything in you version control system, and have maven deal with everything. Also, if you have several subprojects using the same library, you can create the local repository in the toplevel.

OK. Sounds good, right? Here’s how I do it:

1. Create a directory under the project. I always use “lib”
2. Install the jar libs to this directory using:
$mvn install:install-file -Dfile=<jar_file> -DgroupId=<groupId> -DartifactId=<artifactId> -Dversion=<version> -Dpackaging=jar -DlocalRepositoryPath=<path_to_lib_dir> 3. Add the repository to you POM file: <repositories> <repository> <id>lib</id> <url>file://${project.basedir}/lib</url>
</repository>
</repositories>

4. Add the dependencies for whatever jars you’ve added to your local repo
5. Joy.

And that’s it. If you want to share a different solution, please do.

July 11, 2012

## What is this about?

I find it always hard to start blogging. I’ve tried it before, several times. It always goes like this:

1. Create blog
2. Get really excited about it
3. Post a few things
4. Make a list of things to talk about when you have the time to write
5. Get distracted by life, the universe, and everything
6. Lost interest

So, yeah. I blog heavily for a month and then it dies.

This is it. Wish me luck, and all the best to you excelent almost non-existent readers!