part2tex

Introduction

Often the partlists or BOMs (Bills Of Material) are included in project documentations. Good documentation is often typeset with LaTeX, therefore the partlists have to be converted what has to be done manually (without this utility) and results in several drawbacks:

  • It’s not scriptable (no automation)
  • As soon something in the schematic changes, the changes have to be tracked manually
  • Order numbers have to be entered by hand into the TeX code what makes an update procedure even more painful

part2tex tries to circumvent these problems by means of the following design ideas:

  • Separation of the partlist and associated data (e.g. order numbers)
  • Being a command line tool it enables scriptability
  • Using other features like pro- and epilogue self contained LaTeX documents can be generated

part2tex currently works only for EAGLE partlists exported from the Shematic editor, but it wouldn’t require great effort to support other formats (feel free to contact me, see below).

Usage

part2tex <source> [switches] [options [optionargs]]

Switches

Switches are groupable (i.e. -ps instead of -p -s)

-p
Enable “Package” column.

-d
Enable “Device” column.

-l
Enable “Library” column.

-s
Enable “Sheet” column.

-c
Add an empty column after all columns.

-z
Enable \hline output after each table row.

-h
Print help.

Options

-T<target-file>
Change the output file name. By default it is the source file name plus .tex.

-P<prologue>
LaTeX code which is printed before the part list table.

-E<epilogue>
LaTeX code which is printed after the part list table.

-C<column-file>
Path to a column file. For further information see column files below.

Columns and Column Files

The perhaps most powerful feature of part2tex are the column files. Column files allow the separation of data from the partlist. With a column file the user can enter entries for a new column by assigning the row entry to a part. The syntax for column files is as follows:

// column name (currently not used)
<:New Column>
// assigning values to certain "part-rows"
<R1:Row Entry 000>
<R5:...>
...
<R10:Row Entry 010>

When adding column files the order in the command line controls the order in the resulting table. The order of the columns available in part2tex can be illustrated as follows:

[Part][Value][Package][Device][Library][Sheet] ...
    ... [Col-File0][...][Col-FileN][EmptyCol0][...][EmptyColM]

The “Part” and “Value” columns are on by default, all other columns have to be switched on on purpose. Empty columns can be added to the end of all columns by adding as many -c switches as empty columns are desired, grouping is allowed (-cccc).

Example

This is the part2tex command and should be on one single line:

part2tex main-board.parts.txt
    -T"main-board.parts.txt.tex"
    -psz -Cmain-board.farnell.col
    -P"\documentclass[a4paper,twoside,10pt]{article} \usepackage{longtable} \begin{document}
       \begin{small} \ttfamily \begin{longtable}[l]{|p{3.5cm}||l|l|l|l|} \hline
       \bf{Part}&\bf{Value}&\bf{Package}&\bf{Sheet}&\bf{Farnell} \\\\ 
       \hline\hline \endfirsthead \hline 
       \bf{Part}&\bf{Value}&\bf{Package}&\bf{Sheet}&\bf{Farnell}\\\\
       \hline\hline \endhead \caption{...}\\\\ \endfoot \hline \caption{...}\\\\ \endlastfoot"
    -E"\end{longtable} \rmfamily \end{small} \end{document}"

This command generates a pdf from the TeX output.

pdflatex main-board.parts.txt.tex

The column file [main-board.farnell.col]:reveal hidden content

The part list exported from EAGLE [main-board.parts.txt]reveal hidden content

The resulting LaTeX file [main-board.parts.txt.tex]reveal hidden content

Finally the resulting pdf looks like this:reveal hidden content

Releases

Sources
Sources for compilation.

2007.02.28part2tex-00.00.zip


Win32 Binaries
Precompiled binary for win32 systems (perhaps the mingwm10.dll is required but this is not sure).

2007.02.28part2tex-bin-00.00.zip

Build

The package contains a makefile for the mingw build environment. Makefiles for other systems should be easily created by simply changing some variables. I would appreciate it if anyone could send me a working makefile for other systems.

Contact/Discussion/Comments

Feel free to send emails to cls [at] nebadje [dot] org.

Thanx [cls] 2007/02/28 12:55

FAQ

Q: Bla?

Answer.

 
neblab/part2tex.txt · Last modified: 2007/03/01 11:18 by cls
 
Nebadje Controls You