miércoles, 1 de abril de 2015

Glossary and acronyms with LaTeX



My template to create glossaries in LaTeX with a description and an associated acronym.  I substitute every term "EEE" by the new glossary term and the term "Expanded" by the expanded version (e.g. EEE -> NYC, Expanded -> New York City).

%%% define the acronym and use the %see= option
\newglossaryentry{EEE}{
  type=\acronymtype,
  name={EEE\glsadd{EEEg}},
  description={Expanded},
  descriptionplural={\glsentrydesc{EEE}s},
  first={\glsentrydesc{EEE} (EEE)\glsadd{EEEg}},
  firstplural={\glsentrydescplural{EEE} (\glsentryplural{EEE})\glsadd{EEEg}},
  %see=[Glossary:]{EEEg}
}

\newglossaryentry{EEEg}{
  name={EEE},
  description={TODO: description}
}
Be careful with the plural of the terms, as in this template it only adds an 's' at the end of the description and acronym, in special cases just modify the fields accordingly.

I store all the glossary terms in a file named glossary.tex in a separated folder 00_frontmatter
You need to load the package glossaries at the beginning of the file. I added some options for the table of contents and something else.
\usepackage[toc,seeautonumberlist,acronym]{glossaries}
 
Then, I add this lines in the preamble of the file (before the \begin{document})
%% GLOSSARY
\makeglossaries
\loadglsentries[main]{00_frontmatter/glossary}

Inside the document where I want to print the acronyms:
\printglossary[type=\acronymtype]

 Finally, at the end of the document I print the glossary with:
\printglossary[type=main]

jueves, 26 de marzo de 2015

LaTeX apalike citation style

If you tried the apalike citation format you realized that LaTeX is not able to break the citations into two lines. In this case, LaTex just extends the citation from the margins (expecting that you print in the margins of your publication).

(Image from the original source linked below)

This problem can be solved with the package Natbib created by Patrick Daly. Natbib has additional options but in my case -- in order to simplify thing -- I just loaded the package with the option of square brackets []:

\usepackage[square]{natbib}

And changed all the \cite commands by \citep (see other formats in the wikibooks). Instead of changing the hundreds of citations that I wrote in my thesis, I opted to rename the cite command to citep:

\renewcommand{\cite}{\citep}

The bibliography style should remain unchanged:

\bibliographystyle{apalike}

source: http://tex.stackexchange.com/questions/437/line-breaking-or-hyphenation-of-references-in-apalike/447#447

sábado, 14 de febrero de 2015

Remove orphan packages in Debian

deborphan is a program that finds orphan packages and just lists them. It has other options but I am not explaining them here.


In Debian it can be installed just with:

sudo aptitude install deborphan

or

sudo apt-get install deborphan

Then, just run the program to print the list of orphan packages. It does not need root privileges as it only prints out the name of the packages.

deborphane

 Then it is up to you if you want to remove everything or just some of the packages. I am not completly sure if it is safe to remove all of them, read more in the original source.

If you want to remove one of them just use your package manager to remove them as usual:

sudo aptitude remove 'the_name_of_the_package'

Or use "purge" instead of remove to clean completly the package with all its configuration files.

source: https://www.debian-administration.org/article/134/Removing_unnecessary_packages_with_deborphan