hi to all,

documenting my latest java project i required a possibility to include source code into a pdf. searching for and testing different apps i did not find a solution that fitted my needs. lists could have, but i wanted differentiable background color for the code represantation, and found no way to implement this with reasonable effort.

so i wrote a small java app, which i call Src2TeX4Lyx (yes it was a long night before i saw the sun rise 8-)) ). basically it reads a file and converts it to a TeX longtable. it can either be used as standalone application* or be included into lyx over the /usr/share/lyx/external_templates (section vim) file which i attach to this email. you find the source code as well as the required file in the jar file, also attached to this email. (jar -xvf Src2TeX4Lyx.jar)

Src2TeX4Lyx comes with a lot of configuration options covering fontsize, indentindentation when line breaking, linespacing, maximal characters per line, tablength in spaces, encoding format, background color, foreground color, auto line numbering, numbering color, syntax highlighting**, footer and header insertion with timestamp of file modification, document creation date, file name. if you use it without the -na option (which is default) on an error your will get a window describing what went wrong.

to get detailed information just save attached jar file and type
java -jar <path to>/Src2TeX4Lyx.jar -h

you may extract the source code from the jar, modify under the terms of gpl.

a full documentation is pending, but i just have no time to get it done. still the stuff works (see http://www.programmerz.net/download for example pdfs) and i felt the urge to send it to the community. send emails to increase the priority of getting the docs done...

Src2TeX4Lyx is free for friends, contributors, programmers, students, space agencies, government, educational purposes, the firms sun and sgi, open source os users, or anyone who has a smart joke to communicate (i may use that one on my homepage - m$ jokes necessarily don't have to be smart). all other will want to accept a license fee of 23 euro per user applying with a brief email.

luigi monaco / zdys

smile, life's too short
email:[EMAIL PROTECTED] gpg pub key on request

* should, i didn't test it, if there is problem it will probably be a lacking usepackage in the pshead.tex preamble..

** build your own syntax highlighting file:
file: <name to use with the -sh options>.syntax -> save to jar // see java.syntax
syntax highlighting is defined in two modes a) wordrecognition b) stream start- end
a)
worddelimiters{
# whatever you think should separate words
}worddelimiters
word{
# colors{
# words to highlight with color
# }
}
streams{
# what starts the streammode
# what stops the stream mode
# there is keyword defined:LINEEND
# color to use in stream mode
}streams
indentation here is only used for clarifying the syntax, don't use it in the syntax file itself.

Attachment: Src2TeX4Lyx.jar
Description: Zip archive

Attachment: external_templates
Description: Binary data

Reply via email to