Wednesday, August 19, 2015

Imagemagick in bash, resize images

The following command will resize an image to a height of 100:
convert example.png -resize x100 example.png
 Src: http://www.howtogeek.com/109369/how-to-quickly-resize-convert-modify-images-from-the-linux-terminal/

Tuesday, August 4, 2015

Latex Temporarily disable superscript in citation

The following example changes \setcitestyle locally and puts it in macro \citen. \setcitestyle of package natbib (2010/09/13 8.31b) contains a space right at the beginning of the macro definition by an uncommented end of line, the trick with \romannumeral removes this space.
\documentclass{article}
\usepackage[square]{natbib}
\setcitestyle{super}

\newcommand*{\citen}[1]{%
  \begingroup
    \romannumeral-`\x % remove space at the beginning of \setcitestyle
    \setcitestyle{numbers}%
    \cite{#1}%
  \endgroup   
}

\begin{document}
Package \textsf{accsupp}\cite{oberdiek:accsupp}.
This figure is reproduce from reference~\citen{oberdiek:zref}.
\bibliographystyle{plainnat}
\raggedright
\bibliography{oberdiek-bundle}
\end{document}
Result
Inside moving arguments (e.g., \caption) macro \citen can be protected using \protect or by using \DeclareRobustCommand for the definition:
\newcommand*{\citen}{}% generate error, if `\citen` is already in use
\DeclareRobustCommand*{\citen}[1]{%
  \begingroup
    \romannumeral-`\x % remove space at the beginning of \setcitestyle
    \setcitestyle{numbers}%
    \cite{#1}%
  \endgroup
}
 
Source: http://tex.stackexchange.com/questions/94178/temporarily-disable-superscript-in-citation