Preparing LaTeX files using Sed/AWK for processing with latex2html


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Preparing LaTeX files using Sed/AWK for processing with latex2html
# 1  
Old 12-15-2005
Preparing LaTeX files using Sed/AWK for processing with latex2html

As the title states, my issue involves preparing LaTeX documents for processing with latex2html.

Within my LaTeX docs I have used a package which allows me to cleanly display source code listings. However the package is not supported by latex2html which, when processed, does not display the listing at all. An example of the command employed within a LaTeX doc is shown below:

Code:
\lstinputlisting[label=sc:rfdec,caption=RF Decipher]{source/rfdec.c}

I wish to substitute any occurances of the above lines into the following format:

Code:
\begin{verbatim}
\\ Filename: source/rfdec.c
\\ Coded by: ...
\\ Date:     ...
\\ Location: ...
#include <signal.h>
#include <time.h>

static void sig_rf(int)

int main(void)
{
  .
  .
  .
}
\end{verbatim}
\label{sc:rfdec}

Any suggestions?
# 2  
Old 12-16-2005
Make use of the sed feature given in the links below.
5.5 Append, Insert, and Change
5.11 Reading and Writing Files
# 3  
Old 12-16-2005
Nice one bud. Will look into them right away.
# 4  
Old 01-15-2008
Quote:
Originally Posted by oski
Nice one bud. Will look into them right away.
Did you find a solution to your problem? I am also looking for a way to use lst listings with latex2html so perhaps you can share your conversion script? Even when it would be incomplete, you could help me a lot.

Thanks a lot in advance,
Pieter
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing multiple files to awk for processing in bash script

Hi, I'm using awk command in bash script. I'm able to pass multiple files to awk for processing.The code i can use is as below(sample code) #!/bin/bash awk -F "," 'BEGIN { ... ... ... }' file1 file2 file3 In the above code i'm passing the file names manually and it is fine till my... (7 Replies)
Discussion started by: shree11
7 Replies

2. Shell Programming and Scripting

Processing multiple files awk

hai i need my single awk script to act on 4 trace files of ns2 and to calculate througput and it should print result from each trace file in a single trace file. i tried with the following code but it doesnt work awk -f awkscript inputfile1 inputfile2 inputfile3 inputfile4>outputfile ... (4 Replies)
Discussion started by: sarathyy
4 Replies

3. Shell Programming and Scripting

Parsing txt, xml files and preparing csv file

Hi, I need to parse text, xml files to get the statistic numbers and prepare summary csv file. What is the best way to parse these file and prepare csv file. Any idea you have , please? Regards, (2 Replies)
Discussion started by: LinuxLearner
2 Replies

4. Shell Programming and Scripting

awk script processing data from 2 files

Hi! I have 2 files containing data that I need to process at the same time, I have problems in reading a different number of lines from the different files. Here is an explanation of what I need to do (possibly with an awk script). File "samples.txt" contains data in the format: time_instant... (6 Replies)
Discussion started by: Alice236
6 Replies

5. Shell Programming and Scripting

Multiline parenthesis matching, with e.g. SED script, in LaTeX doc

In a LaTeX manuscript, I need to replace many occurrences of \emph{some string} with some string, i.e. whatever string is inside. The string inside often may extend over several lines, and there may be other occurences of curly brackets inside it. So for example \emph{this \it{is} a... (5 Replies)
Discussion started by: sune
5 Replies

6. Shell Programming and Scripting

Processing files using awk

Hi I have files in our UNIX directory like the below -rw-r--r-- 1 devinfo devsupp 872 Sep 14 02:09 IMGBTREE27309_12272_11_1_0_FK.idx0 -rw-r--r-- 1 devinfo devsupp 872 Sep 14 02:09 IMGBTREE27309_12272_11_0_0_PK.idx0 -rw-r--r-- 1 devinfo devsupp 432 Sep 14... (7 Replies)
Discussion started by: rbmuruga
7 Replies

7. UNIX for Dummies Questions & Answers

single output of awk script processing multiple files

Helllo UNIX Forum :) Since I am posting on this board, yes, I am new to UNIX! I read a copy of "UNIX made easy" from 1990, which felt like a making a "computer-science time jump" backwards ;) So, basically I have some sort of understanding what the basic concept is. Problem Description:... (6 Replies)
Discussion started by: Kasimir
6 Replies

8. Shell Programming and Scripting

Writing output into different files while processing file using AWK

Hi, I am trying to do the following using AWK program. 1. Read the input data file 2. Parse the record and see if it contains errors 3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen Here is what I have done -... (6 Replies)
Discussion started by: vidyak
6 Replies

9. Shell Programming and Scripting

text processing ( sed/awk)

hi.. I have a file having record on in 1 line.... I want every 400 characters in a new line... means in 1st line 1-400 in 2nd line - 401-800 etc pl help. (12 Replies)
Discussion started by: clx
12 Replies

10. Shell Programming and Scripting

processing a file with sed and awk

Hello, I have what is probably a simple task in text manipulation, but I just can't wrap my brain around it. I have a text file that looks something like the following. Note that some have middle initials in the first field and some don't. john.r.smith:john.smith@yahoo.com... (4 Replies)
Discussion started by: manouche
4 Replies
Login or Register to Ask a Question