TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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.