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 define a new command like this:

\newcommand{\rowcol}[4]{ %
    \multicolumn{#1}{#3}{\multirow{#2}{*}{#4}} %
}

I then use it inside the column as,

\rowcol{2}{2}{|c|}{Factor}}&\multicolumn{2}{c|}{Replication}&Total \\ \cline{3-4}

Is there any mistake in doing this, I'm getting error.

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

There's a redundant closing brace after Factor. The following works:

\documentclass{article}

\usepackage{multirow}

\newcommand{\rowcol}[4]{%
  \multicolumn{#1}{#3}{\multirow{#2}{*}{#4}}%
}

\begin{document}

\begin{tabular}{ccccc}
\rowcol{2}{2}{|c|}{Factor}&\multicolumn{2}{c|}{Replication}&Total \\ \cline{3-4}
\end{tabular}

\end{document}

Note that if you put spaces before comment signs, you might as well omit those signs altogether.

share|improve this answer
    
Thank you, I should have seen that... I am sorry to ask such a question without debugging... But, thank you anyway –  therimalaya Sep 2 '12 at 19:40
add comment

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.