1

I have a large number of text files containing data in a certain format. I want to wrap this data with a header and nicely typeset it. The way it is warped might change, so I want to do this dynamically (in the spirit of TeX). The way I tried to do it is by first defining a new command :

\newcommand{\structure}[3]{  
\textbf{#1} --- #2    
#3
}

Then calling the command with my data and parameters as arguments:

\structure{My Title 1}{Subtitle 1}{   
A    0.224571  -0.024053   1.077491 \\ 
B    0.124803   0.005365   3.895348 \\ 
C    0.129247   1.219604   1.804850 \\ 
D    0.142554   1.186492   1.781366 \\ 
}

However, the particular spacing and formatting in my data is lost this way.

How can I keep the formatting dynamic, yet retain the information in the origin format?

Raphaël
  • 111
  • 1
    If R is a option for you, this example load a comma delimited (.csv) to make a simple LaTeX table. The R functions xtable and kable have a lot of formatting options for data tables. Otherwise (you cannot use R with knitr) take a look to the datatool LaTeX package. – Fran Sep 24 '19 at 22:10
  • 2
    You can have a look at pgfplotstable too – BambOo Sep 24 '19 at 22:12
  • Or cvsimple, or (the more complex) datatool. – CarLaTeX Sep 25 '19 at 06:05

0 Answers0