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 want to create a table containing lots of "+","-" and "0", which depend on the column and row number by (quite simple) mathematical formulas which are known to me. I could enter the signs by hand but i think it would be better to generate them automatically somehow, i.e. to implement the logic which determines the entrys, for two reasons:

  • My formulas may turn out to be wrong some day...
  • It is in the spirit of dividing layout and content.

To give you an impression, i have scanned a sketch on paper.

enter image description here

As you can see, there are actually four entrys for each row and column. I'd like to know if anyone here has some hints on how to realize something like that.

share|improve this question
see this answer to merge columns. This should also help with multirows. As for the generation of the +,-,0 this could be easly done in an external program like Excel or DoE software and then using excel2latex get the start of a table in LaTeX –  Leeser Aug 2 '12 at 15:04
Where is the problem? If you can calculate the value then do it. –  Ulrike Fischer Aug 2 '12 at 15:04
Ok, with the multirow and multicol package it is quite nice to format the table and enter the entrys by hand. How can i automate the process of entering the values? –  Robert Rauch Aug 2 '12 at 16:19
With pgfplotstable you typeset tables from data files or mathematical expressions. –  Ignasi Aug 2 '12 at 16:21
add comment

1 Answer

You don't really need any extra packages for this, picture mode is quite useful here. I made up a random formula to decide between 0, +, -, and also to aid debugging have an additional output of the two integers being used (twice the label, more or less).

enter image description here









\multiput(45,25)(30,0){8}{\makebox(0,0){\the\ci \global\advance\ci1}}

\multiput(25,45)(0,30){8}{\makebox(0,0){\the\cj \global\advance\cj1}}

\makebox(0,0){\raisebox{-12pt}{\tiny \the\ci\,\the\cj \global\advance\cj1}}


share|improve this answer
This looks quite promising. Unfourtunately I will not have time to work on this until august 14th, but i will report on my progress then. Thank you very much! –  Robert Rauch Aug 3 '12 at 12:45
add comment

Your Answer


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.