For weird reasons, my tables (as produced by my statistics software, Stata) have \cmidrule{3-6}
whenever they should have \cmidrule{4-7}
. In my statistics software I can change the cmidrule, by I can not change th span it produces.
As a fix I want to define a new command \cmidruleshiftedbyone
which autimatically adds 1 to the start and the end of the span and passes this on to \cmidrule
.
I don't understand how the arguments for \cmidrule
can be parsed and changed, otherwise I'd like to do something like
\documentclass{article}
\usepackage{booktabs}
%I know this wont work, I just have this to illustrate what I am trying to do:
\usepackage{calc}
\newcommand{\cmidruleshiftedbyone}[1]{\cmidrule{{#1}+{1-1}}
\begin{document}
\begin{tabular}{ccc}
1 & 2 & 3 \\\cmidruleshiftedbyone(lr){1-2} %I wan this to actually span 2-3
\end{tabular}
\end{document}