Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37728595
en ru br
ALT Linux repos
S:0.9.0-alt2.qa1
5.0: 0.9.0-alt2
4.1: 0.9.0-alt2
4.0: 0.9.0-alt2
3.0: 0.7.3-alt1

Group :: Communications
RPM: scmxx

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/usr/bin/perl
# =========================================================
# I wrote this little Perl script to convert the output
# of H. Sattlers scmxx into a printable LaTeX phonebook.
# The output will be in alphabetical order.
# -- J. Stein - stein@ph-cip.uni-koeln.de
# =========================================================

sub error
{
print <STDERR>, "scm2tex converts the output of scmxx into a LaTeX file\n";
print <STDERR>, " Usage:\n";
print <STDERR>, "scmxx --get --pbook=SM -f - | scm2tex > telbook.tex\n";
}

sub tex_header
{
print '\documentclass[a4paper,twocolumn]{article}',"\n";
print '\begin{document}',"\n";
print '\begin{description}',"\n";
}

sub tex_footer
{
print '\end{description}',"\n";
print '\end{document}',"\n";
}


sub convert
{
while ($zeile = <STDIN>)
{
$zeile =~ tr/"//d; # remove "
$zeile =~ tr/\n//d; # remove \n
$zeile =~ tr/!//d; # remove !

# TODO: Umlaute muessen noch umgewandelt werden

($index, $nummer, $name) = split /,/, $zeile;
%person = (%person, $name => $nummer);
}

@namenliste = keys %person;
tex_header;

foreach $namenliste (sort keys %person)
{
print '\item[', $namenliste, ']', $person{$namenliste}, "\n";
}

tex_footer;
}

# ==================== here starts the main part


if (not $ARGV[0])
{
convert;
}

else {
error;
# warn if an argument was given to scm2tex
};



 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin