Pin Table to LaTeX table

The pins2tex script converts a "tab-separated value" (TSV) file into the body of a LaTeX table.

Shell usage:
awk -f pins2tex.awk input.tsv > output.tex
Makefile rule:
%.tex : %.tsv
	awk -f pins2tex.awk $< > $@
Here's a fragment of an actual input file:
# All LVDS signals are here. Others are on J2.
J1	1	GND
J1	20	VPCLK+	Command/HK clock
J1	21	CCLK+	ASIC Cclk
J1	3	CCLK-

The script ignores blank lines.

The script converts lines that start with "#-" to "\hline" directives to draw a horizontal line across the table. It ignores other lines starting with "#".

"TAB" characters separate fields.

The first four fields in each line become the four columns in the table. The script ignores any additional fields.

For the third field only, the script translates the gEDA overbar indicators ("\_") to LaTeX overbar commands.

The output file contains the body of a four column LaTeX table. The following LaTeX commands typeset that output (assumed to be in the file J1.tex):

 Connector & Pin & Signal & Description \\

Adjust the LaTeX as needed for your document.

Copyright 2010, all rights reserved unless specified otherwise. is maintained by DJ Delorie