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:
I wish to substitute any occurances of the above lines into the following format:
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
latex::encode
LaTeX::Encode(3pm) User Contributed Perl Documentation LaTeX::Encode(3pm)NAME
LaTeX::Encode - encode characters for LaTeX formatting
SYNOPSIS
use LaTeX::Encode;
$latex = latex_encode($text, %options);
VERSION
This manual page describes version 0.03 of the "LaTeX::Encode" module.
DESCRIPTION
This module provides a function to encode text that is to be formatted with LaTeX. It encodes characters that are special to LaTeX or that
are represented in LaTeX by LaTeX commands.
The special characters are: "" (command character), "{" (open group), "}" (end group), "&" (table column separator), "#" (parameter
specifier), "%" (comment character), "_" (subscript), "^" (superscript), "~" (non-breakable space), "$" (mathematics mode).
Note that some of the LaTeX commands for characters are defined in the LaTeX "textcomp" package. If your text includes such characters,
you will need to include the following lines in the preamble to your LaTeX document.
usepackage[T1]{fontenc}
usepackage{textcomp}
The function is useful for encoding data that is interpolated into LaTeX document templates, say with "Template::Plugin::Latex" (shameless
plug!).
SUBROUTINES /METHODS
"latex_encode($text, %options)"
Encodes the specified text such that it is suitable for processing with LaTeX. The behaviour of the filter is modified by the options:
"except"
Lists the characters that should be excluded from encoding. By default no special characters are excluded, but it may be useful to
specify "except = "\{}"" to allow the input string to contain LaTeX commands such as "this is \textbf{bold} text" (the doubled
backslashes in the strings represent Perl escapes, and will be evaluated to single backslashes).
"iquotes"
If true then single or double quotes around words will be changed to LaTeX single or double quotes; double quotes around a phrase
will be converted to "``" and "''" and single quotes to "`" and "'". This is sometimes called "intelligent quotes"
"use_textcomp"
By default the "latex_encode" filter will encode characters with the encodings provided by the "textcomp" LaTeX package (for
example the Pounds Sterling symbol is encoded as "\textsterling{}"). Setting "use_textcomp = 0" turns off these encodings. NOT
YET IMPLEMENTED
EXAMPLES
The following snippet shows how data from a database can be encoded and inserted into a LaTeX table, the source of which is generated with
"LaTeX::Table".
my $sth = $dbh->prepare('select col1, col2, col3 from table where $expr');
$sth->execute;
while (my $href = $sth->fetchrow_hashref) {
my @row;
foreach my $col (qw(col1 col2 col3)) {
push(@row, latex_encode($href->{$col}));
}
push @data, @row;
}
my $headings = [ [ 'Col1', 'Col2', 'Col3' ] ];
my $table = LaTeX::Table->new( { caption => 'My caption',
label => 'table:caption',
type => 'xtab',
header => $header,
data => @data } );
my $table_text = $table->generate_string;
Now $table_text can be interpolated into a LaTeX document template.
DIAGNOSTICS
None. You could probably break the "latex_encode" function by passing it an array reference as the options, but there are no checks for
that.
CONFIGURATION AND ENVIRONMENT
Not applicable.
DEPENDENCIES
The "HTML::Entities" and "Pod::LaTeX" modules were used for building the encoding table in "LaTeX::Encode::EncodingTable", but this is not
rebuilt at installation time. The "LaTeX::Driver" module is used for formatting the character encodings reference document.
INCOMPATIBILITIES
None known.
BUGS AND LIMITATIONS
Not all LaTeX special characters are included in the encoding tables (more may be added when I track down the definitions).
The "use_textcomp" option is not implemented.
AUTHOR
Andrew Ford <a.ford@ford-mason.co.uk>
LICENSE AND COPYRIGHT
Copyright (C) 2007 Andrew Ford. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
Template::Plugin::Latex
perl v5.10.0 2007-10-02 LaTeX::Encode(3pm)