Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have footer that draws on a svn version data field (package: svn-multi). I would like to perform a simple calculation that subtracts a number from the reported version.

The footer code is \lfoot{Ver: \textcolor{red}{1:}\textcolor{red}{\svnkw{LastChangedRevision}}}

Currently \svnkw{LastCHangedRevision} is set at 286 so for this and future reports I need it to present 'LastCHangedRevision-285'

In response to MWE request:

\documentclass[a4paper]{article}

% Versioning
\usepackage{svn-multi}
\svnidlong {$HeadURL:  $}{$LastChangedDate: 2012-02-21 10:20:32 +0000 (Tue, 21 Feb 2012) $}{$LastChangedRevision: 287 $}{$LastChangedBy: $}
\svnid{$Id: BESA-2012.tex 287 2012-02-21 10:20:32Z $}

\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{color, lastpage}
\renewcommand\headrulewidth{0.0pt} \renewcommand\footrulewidth{0.2pt}
\lhead{} \chead{} \rhead{}
\cfoot{\svnkw{LastChangedDate}} \lfoot{Ver:
\textcolor{red}{1:}\textcolor{red}{\svnkw{LastChangedRevision}}}
\rfoot{\thepage/\pageref{LastPage}}

\begin{document}
share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  egreg Feb 21 '12 at 10:39

1 Answer 1

up vote 1 down vote accepted

You can use the \numexpr command:

\lfoot{Ver: \textcolor{red}{1:%
  \number\numexpr\svnkw{LastChangedRevision}-285\relax}}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.