ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* caption in TSV tables
@ 2008-06-13  7:48 Jan-Erik Hägglöf
  0 siblings, 0 replies; only message in thread
From: Jan-Erik Hägglöf @ 2008-06-13  7:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

Hi All ConTeXt lovers!

I am studying physics at Örebro University in Sweden and often produce
documents report from experiments. For Me it naturally fells in to use
Context typesetting together with tools like octave and Gnuplot. 

The issue until now, has been when you need to transer data from octave
output textfiles to a representable table in a context document.

Hardwriting all \NC and \HL stuff together with cut and paste method is
time consuming. But thanks to Hans, Wolfgang, Taco and Mojca I successfully
manage to import experiment values from a textfile (that also Gnuplot
can read and do graphic) to a nice table with caption so you can refer
to it in the textflow.

So I decided to contribute my successfull result in attached
examplefiles.

Thanks and all wishes!

Jan-Erik Hägglöf 



[-- Attachment #2: tsvmall.tex --]
[-- Type: text/x-matlab, Size: 682 bytes --]

% engine=luatex
\mainlanguage[sv]
\setupinteraction[state=start]
\setupcolors[state=start]
% \environments
\usemodule[database]
\unprotect
\startsetups TSV:unix
 \catcode \#=\@@comment
\stopsetups
\protect
\defineseparatedlist[TSV][separator=tab,before=,after=,first=\bTR,last=\eTR,left=\bTD,right=\eTD]
\setupTABLE[r][1][style=bold,background=color,backgroundcolor=gray]
\starttext
\placetable[here][tab:test]{caption}
{\bgroup
\bTABLE
\startTSV 
time $ T $(s)	Decay  $ \frac{d\nu}{dt} $ 	error $ \delta \nu'=\sqrt{\nu} $
\stopTSV
\processseparatedfile[TSV][sndfall.dat] 
\eTABLE \egroup}

As you can see in table(\ref[t][tab:test]) it works out well in this experiment.
\stoptext

[-- Attachment #3: sndfall.dat --]
[-- Type: text/plain, Size: 296 bytes --]

# time decay errors
24.5	38.528	6.21
44.5	24.139	4.91
64.5	17.250	4.15
84.5	12.806	3.58
104.5	8.361	2.89
129	6.278	2.51
159	4.861	2.2
189	3.917	1.98
219	3.973	1.99
249	2.973	1.72
279	2.556	1.6
322.5	2.150	1.47
382.5	1.739	1.32
442.5	1.150	1.07
502.5	0.750	0.87
562.5	0.628	0.79



















[-- Attachment #4: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-13  7:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-13  7:48 caption in TSV tables Jan-Erik Hägglöf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).