Package Init

This commit is contained in:
qiegewala 2020-02-24 09:49:27 +08:00
parent 23be70400a
commit 235948b488
9 changed files with 2677 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- latex2html-2002-2-1/config/config.pl.gsfont 2002-09-28 07:15:01.000000000 +0200
+++ latex2html-2002-2-1/config/config.pl 2005-03-16 10:50:17.392513136 +0100
@@ -1176,7 +1176,7 @@
push(@right_paths,L2hos->path2os($testpath));
$gs_lib = 1;
}
- $testpath .= "${dd}fonts" unless($testpath =~ /\Q$dd\Efonts$/i);
+ $testpath .= "${dd}fonts" unless($testpath =~ /\Q$dd\Efonts/i);
if(!$gs_fonts && -d $testpath) {
push(@right_paths,L2hos->path2os($testpath));
$gs_fonts = 1;

View File

@ -0,0 +1,26 @@
--- latex2html-2K.1beta/versions/table.pl.tabularx Fri Nov 14 11:10:52 1997
+++ latex2html-2K.1beta/versions/table.pl Wed Jan 24 15:11:01 2001
@@ -121,6 +121,10 @@
$htmlcolspec .= "<COL ALIGN=RIGHT>";
push(@colspec,"$cellopen=RIGHT NOWRAP>$content_mark$cellclose");
$cols++;
+ } elsif ( $char eq "X" ) {
+ $htmlcolspec .= "<COL ALIGN=JUSTIFY>";
+ push(@colspec,"$cellopen=LEFT>$content_mark$cellclose");
+ $cols++;
} elsif ( $char eq "p" ) {
$colspec =~ s/$next_pair_rx//;
($pts,$len) = &convert_length($2);
@@ -170,7 +174,11 @@
local($_) = @_;
s/$next_pair_rx//;
local($pts,$len) = &convert_length($2);
- &do_env_tabular($_," width=$pts");
+ if ($pts != "") {
+ &do_env_tabular($_," width=$pts");
+ } else {
+ &do_env_tabular($_);
+ }
}
sub do_env_tabular {

1316
latex2html.1 Normal file

File diff suppressed because it is too large Load Diff

174
latex2html.spec Normal file
View File

@ -0,0 +1,174 @@
Name: latex2html
Version: 2018.3
Release: 3
Summary: A utility that converts LaTeX documents to web pages in HTML
License: GPLv2+
URL: http://www.latex2html.org/
Source0: https://github.com/latex2html/latex2html/archive/v%{version}.tar.gz
Source1: latex2html.1
Source2: pstoimg.1
Source3: texexpand.1
Patch0: latex2html-2K.1beta-tabularx.patch
Patch1: latex2html-2002-2-1-gsfont.patch
BuildRequires: perl-interpreter perl-generators ghostscript netpbm-progs tex(latex)
Requires: tex(latex) tex(dvips) tex(url.sty) netpbm-progs
BuildArch: noarch
%description
LaTeX2HTML replicates the basic structure of a LaTeX document as a set of
interconnected HTML files which can be explored using automatically generated
navigation panels. The cross-references, citations, footnotes, the table of
contents and the lists of figures and tables, are also translated into hypertext
links. Formatting information which has equivalent tags in HTML (lists, quotes,
paragraph breaks, type styles, etc.) is also converted appropriately. The
remaining heavily formatted items such as mathematical equations, pictures or
tables are converted to images which are placed automatically at the correct
positions in the final HTML document.
%package help
Summary: Documentation for latex2html
%description help
Documentation for latex2html
%prep
%autosetup -p1
rm -f L2hos/{Dos,Mac,OS2,Win32}.pm
rm -rf cweb2html
rm -f readme.hthtml
cd ..
cp -a %{name}-%{version} %{name}-%{version}JA
cd %{name}-%{version}JA
%build
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} ./
./configure --program-prefix=%{?_program_prefix} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} \
--includedir=%{_includedir} --libdir=%{_datadir}/latex2html --libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--infodir=%{_infodir} --shlibdir=%{_datadir}/latex2html --with-texpath=%{_datadir}/texmf/tex/latex/html
perl -pi -e "s,/usr/(share/)?lib,%{_datadir}," cfgcache.pm
make
cd ..
cd %{name}-%{version}JA
perl -pi -e "s,/usr/bin/dvips,/usr/bin/pdvips," cfgcache.pm
perl -pi -e "s,/usr/bin/latex,/usr/bin/platex," cfgcache.pm
./configure --program-prefix=%{?_program_prefix} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} \
--includedir=%{_includedir} --libdir=%{_datadir}/jlatex2html --libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--infodir=%{_infodir} --shlibdir=%{_datadir}/jlatex2html --with-texpath=%{_datadir}/texmf/tex/latex/html
perl -pi -e "s,/usr/(share/)?lib,%{_datadir},;
s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm
make
perl -pi -e "s,\\\$\{dd}pstoimg,\\\$\{dd}jpstoimg, ;
s,\\\$\{dd}texexpand,\\\$\{dd}jtexexpand," l2hconf.pm
mv latex2html jlatex2html
mv pstoimg jpstoimg
mv texexpand jtexexpand
cd ..
%install
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
sed -i "s,%{buildroot},," l2hconf.pm
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/texexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/pstoimg,;
s,/.*\\\$\{dd}*icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," latex2html
make install
rm -rf %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig \
%{buildroot}%{_datadir}/latex2html/docs/ \
%{buildroot}%{_datadir}/latex2html/example/
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/pstoimg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/texexpand
sed -i "s,%{buildroot},," cfgcache.pm
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}';," cfgcache.pm
perl -pi -e "s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
install -m0644 *.pm %{buildroot}%{_datadir}/latex2html
chmod +x %{buildroot}%{_datadir}/latex2html/makeseg/makeseg %{buildroot}%{_datadir}/latex2html/makemap
mkdir -p %{buildroot}%{_mandir}/man1
install -m0644 *.1 %{buildroot}%{_mandir}/man1
cd ..
cd %{name}-%{version}JA
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
perl -pi -e "s,latex2html pstoimg texexpand,jlatex2html jpstoimg jtexexpand," config/install.pl
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/jtexexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/jpstoimg,;
s,/.*\\\$\{dd}icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}styles\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," jlatex2html
sed -i "s,%{buildroot},," l2hconf.pm
make install
rm -rf %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig \
%{buildroot}%{_datadir}/jlatex2html/docs/ \
%{buildroot}%{_datadir}/jlatex2html/example/
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jpstoimg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jtexexpand
sed -i "s,%{buildroot},," cfgcache.pm
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}JA';," cfgcache.pm
perl -pi -e "s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
install -m0644 *.pm %{buildroot}%{_datadir}/jlatex2html
chmod +x %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg %{buildroot}%{_datadir}/jlatex2html/makemap
cd ..
rm -f %{buildroot}%{_datadir}/texmf/tex/latex/html/url.sty
%post
[ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null || :
%postun
[ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null || :
%check
make check
cd ../%{name}-%{version}JA
make check
%files
%doc {LICENSE,LICENSE.orig,README.md,FAQ,BUGS,docs,example}
%{_bindir}/latex2html
%{_bindir}/pstoimg
%{_bindir}/texexpand
%{_bindir}/jlatex2html
%{_bindir}/jpstoimg
%{_bindir}/jtexexpand
%dir %{_datadir}/latex2html
%{_datadir}/latex2html/*
%dir %{_datadir}/texmf/tex/latex/html
%{_datadir}/texmf/tex/latex/html/*
%dir %{_datadir}/jlatex2html
%{_datadir}/jlatex2html/*
%files help
%{_mandir}/man1/latex2html.1.gz
%{_mandir}/man1/texexpand.1.gz
%{_mandir}/man1/pstoimg.1.gz
%changelog
* Thu Feb 20 2020 lihao <lihao129@huawei.com> - 2018.3-3
- Package init

174
latex2html.spec.bak Normal file
View File

@ -0,0 +1,174 @@
Name: latex2html
Version: 2018.3
Release: 3
Summary: A utility that converts LaTeX documents to web pages in HTML
License: GPLv2+
URL: http://www.latex2html.org/
Source0: https://github.com/latex2html/latex2html/archive/v%{version}.tar.gz
Source1: latex2html.1
Source2: pstoimg.1
Source3: texexpand.1
Patch0: latex2html-2K.1beta-tabularx.patch
Patch1: latex2html-2002-2-1-gsfont.patch
BuildRequires: perl-interpreter perl-generators ghostscript netpbm-progs tex(latex)
Requires: tex(latex) tex(dvips) tex(url.sty) netpbm-progs
BuildArch: noarch
%description
LaTeX2HTML replicates the basic structure of a LaTeX document as a set of
interconnected HTML files which can be explored using automatically generated
navigation panels. The cross-references, citations, footnotes, the table of
contents and the lists of figures and tables, are also translated into hypertext
links. Formatting information which has equivalent tags in HTML (lists, quotes,
paragraph breaks, type styles, etc.) is also converted appropriately. The
remaining heavily formatted items such as mathematical equations, pictures or
tables are converted to images which are placed automatically at the correct
positions in the final HTML document.
%package_help
%prep
%autosetup -a 0 -c -n %{name}-%{version} -p1
for i in Dos Mac OS2 Win32; do
rm -f L2hos/${i}.pm
done
rm -rf cweb2html
rm -f readme.hthtml
cd ..
cp -a %{name}-%{version} %{name}-%{version}JA
cd %{name}-%{version}JA
%build
cd %{name}-%{version}
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} ./
./configure --program-prefix=%{?_program_prefix} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} \
--includedir=%{_includedir} --libdir=%{_datadir}/latex2html --libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--infodir=%{_infodir} --shlibdir=%{_datadir}/latex2html --with-texpath=%{_datadir}/texmf/tex/latex/html
perl -pi -e "s,/usr/(share/)?lib,%{_datadir}," cfgcache.pm
make
cd ..
cd %{name}-%{version}JA
perl -pi -e "s,/usr/bin/dvips,/usr/bin/pdvips," cfgcache.pm
perl -pi -e "s,/usr/bin/latex,/usr/bin/platex," cfgcache.pm
./configure --program-prefix=%{?_program_prefix} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} \
--includedir=%{_includedir} --libdir=%{_datadir}/jlatex2html --libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--infodir=%{_infodir} --shlibdir=%{_datadir}/jlatex2html --with-texpath=%{_datadir}/texmf/tex/latex/html
perl -pi -e "s,/usr/(share/)?lib,%{_datadir},;
s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm
make
perl -pi -e "s,\\\$\{dd}pstoimg,\\\$\{dd}jpstoimg, ;
s,\\\$\{dd}texexpand,\\\$\{dd}jtexexpand," l2hconf.pm
for i in latex2html pstoimg texexpand ; do
mv ${i} j${i}
done
cd ..
%install
cd %{name}-%{version}
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
sed -i "s,%{buildroot},," l2hconf.pm
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/texexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/pstoimg,;
s,/.*\\\$\{dd}*icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," latex2html
make install
rm -rf %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig \
%{buildroot}%{_datadir}/latex2html/docs/ \
%{buildroot}%{_datadir}/latex2html/example/
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/pstoimg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/texexpand
sed -i "s,%{buildroot},," cfgcache.pm
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}';," cfgcache.pm
perl -pi -e "s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
install -m0644 *.pm %{buildroot}%{_datadir}/latex2html
chmod +x %{buildroot}%{_datadir}/latex2html/makeseg/makeseg %{buildroot}%{_datadir}/latex2html/makemap
mkdir -p %{buildroot}%{_mandir}/man1
install -m0644 *.1 %{buildroot}%{_mandir}/man1
cd ..
cd %{name}-%{version}JA
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
perl -pi -e "s,latex2html pstoimg texexpand,jlatex2html jpstoimg jtexexpand," config/install.pl
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/jtexexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/jpstoimg,;
s,/.*\\\$\{dd}icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}styles\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," jlatex2html
sed -i "s,%{buildroot},," l2hconf.pm
make install
rm -rf %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig \
%{buildroot}%{_datadir}/jlatex2html/docs/ \
%{buildroot}%{_datadir}/jlatex2html/example/
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jpstoimg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jtexexpand
sed -i "s,%{buildroot},," cfgcache.pm
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}JA';," cfgcache.pm
perl -pi -e "s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
install -m0644 *.pm %{buildroot}%{_datadir}/jlatex2html
chmod +x %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg %{buildroot}%{_datadir}/jlatex2html/makemap
cd ..
rm -f %{buildroot}%{_datadir}/texmf/tex/latex/html/url.sty
%post
[ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null || :
%postun
[ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null || :
%check
make -C %{name}-%{version} check
make -C %{name}-%{version}JA check
%files
%doc latex2html-%{version}/{LICENSE,LICENSE.orig,README.md,FAQ,BUGS,docs,example}
%{_bindir}/latex2html
%{_bindir}/pstoimg
%{_bindir}/texexpand
%{_bindir}/jlatex2html
%{_bindir}/jpstoimg
%{_bindir}/jtexexpand
%dir %{_datadir}/latex2html
%{_datadir}/latex2html/*
%dir %{_datadir}/texmf/tex/latex/html
%{_datadir}/texmf/tex/latex/html/*
%dir %{_datadir}/jlatex2html
%{_datadir}/jlatex2html/*
%files help
%{_mandir}/man1/latex2html.1.gz
%{_mandir}/man1/texexpand.1.gz
%{_mandir}/man1/pstoimg.1.gz
%changelog
* Thu Feb 20 2020 lihao <lihao129@huawei.com> - 2018.3-3
- Package init

173
latex2html.spec.bak2 Normal file
View File

@ -0,0 +1,173 @@
Name: latex2html
Version: 2018.3
Release: 3
Summary: A utility that converts LaTeX documents to web pages in HTML
License: GPLv2+
URL: http://www.latex2html.org/
Source0: https://github.com/latex2html/latex2html/archive/v%{version}.tar.gz
Source1: latex2html.1
Source2: pstoimg.1
Source3: texexpand.1
Patch0: latex2html-2K.1beta-tabularx.patch
Patch1: latex2html-2002-2-1-gsfont.patch
BuildRequires: perl-interpreter perl-generators ghostscript netpbm-progs tex(latex)
Requires: tex(latex) tex(dvips) tex(url.sty) netpbm-progs
BuildArch: noarch
%description
LaTeX2HTML replicates the basic structure of a LaTeX document as a set of
interconnected HTML files which can be explored using automatically generated
navigation panels. The cross-references, citations, footnotes, the table of
contents and the lists of figures and tables, are also translated into hypertext
links. Formatting information which has equivalent tags in HTML (lists, quotes,
paragraph breaks, type styles, etc.) is also converted appropriately. The
remaining heavily formatted items such as mathematical equations, pictures or
tables are converted to images which are placed automatically at the correct
positions in the final HTML document.
%package_help
%prep
%autosetup -p1
for i in Dos Mac OS2 Win32; do
rm -f L2hos/${i}.pm
done
rm -rf cweb2html
rm -f readme.hthtml
cd ..
cp -a %{name}-%{version} %{name}-%{version}JA
cd %{name}-%{version}JA
%build
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} ./
./configure --program-prefix=%{?_program_prefix} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} \
--includedir=%{_includedir} --libdir=%{_datadir}/latex2html --libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--infodir=%{_infodir} --shlibdir=%{_datadir}/latex2html --with-texpath=%{_datadir}/texmf/tex/latex/html
perl -pi -e "s,/usr/(share/)?lib,%{_datadir}," cfgcache.pm
make
cd ..
cd %{name}-%{version}JA
perl -pi -e "s,/usr/bin/dvips,/usr/bin/pdvips," cfgcache.pm
perl -pi -e "s,/usr/bin/latex,/usr/bin/platex," cfgcache.pm
./configure --program-prefix=%{?_program_prefix} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} \
--includedir=%{_includedir} --libdir=%{_datadir}/jlatex2html --libexecdir=%{_libexecdir} \
--localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--infodir=%{_infodir} --shlibdir=%{_datadir}/jlatex2html --with-texpath=%{_datadir}/texmf/tex/latex/html
perl -pi -e "s,/usr/(share/)?lib,%{_datadir},;
s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm
make
perl -pi -e "s,\\\$\{dd}pstoimg,\\\$\{dd}jpstoimg, ;
s,\\\$\{dd}texexpand,\\\$\{dd}jtexexpand," l2hconf.pm
for i in latex2html pstoimg texexpand ; do
mv ${i} j${i}
done
cd ..
%install
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
sed -i "s,%{buildroot},," l2hconf.pm
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/texexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/pstoimg,;
s,/.*\\\$\{dd}*icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," latex2html
make install
rm -rf %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig \
%{buildroot}%{_datadir}/latex2html/docs/ \
%{buildroot}%{_datadir}/latex2html/example/
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/pstoimg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/texexpand
sed -i "s,%{buildroot},," cfgcache.pm
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}';," cfgcache.pm
perl -pi -e "s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
install -m0644 *.pm %{buildroot}%{_datadir}/latex2html
chmod +x %{buildroot}%{_datadir}/latex2html/makeseg/makeseg %{buildroot}%{_datadir}/latex2html/makemap
mkdir -p %{buildroot}%{_mandir}/man1
install -m0644 *.1 %{buildroot}%{_mandir}/man1
cd ..
cd %{name}-%{version}JA
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
perl -pi -e "s,latex2html pstoimg texexpand,jlatex2html jpstoimg jtexexpand," config/install.pl
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/jtexexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/jpstoimg,;
s,/.*\\\$\{dd}icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}styles\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," jlatex2html
sed -i "s,%{buildroot},," l2hconf.pm
make install
rm -rf %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig \
%{buildroot}%{_datadir}/jlatex2html/docs/ \
%{buildroot}%{_datadir}/jlatex2html/example/
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jpstoimg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jtexexpand
sed -i "s,%{buildroot},," cfgcache.pm
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}JA';," cfgcache.pm
perl -pi -e "s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
install -m0644 *.pm %{buildroot}%{_datadir}/jlatex2html
chmod +x %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg %{buildroot}%{_datadir}/jlatex2html/makemap
cd ..
rm -f %{buildroot}%{_datadir}/texmf/tex/latex/html/url.sty
%post
[ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null || :
%postun
[ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null || :
%check
make check
cd ../%{name}-%{version}JA
make check
%files
%doc {LICENSE,LICENSE.orig,README.md,FAQ,BUGS,docs,example}
%{_bindir}/latex2html
%{_bindir}/pstoimg
%{_bindir}/texexpand
%{_bindir}/jlatex2html
%{_bindir}/jpstoimg
%{_bindir}/jtexexpand
%dir %{_datadir}/latex2html
%{_datadir}/latex2html/*
%dir %{_datadir}/texmf/tex/latex/html
%{_datadir}/texmf/tex/latex/html/*
%dir %{_datadir}/jlatex2html
%{_datadir}/jlatex2html/*
%files help
%{_mandir}/man1/latex2html.1.gz
%{_mandir}/man1/texexpand.1.gz
%{_mandir}/man1/pstoimg.1.gz
%changelog
* Thu Feb 20 2020 lihao <lihao129@huawei.com> - 2018.3-3
- Package init

415
pstoimg.1 Normal file
View File

@ -0,0 +1,415 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "PSTOIMG 1"
.TH PSTOIMG 1 "2005-03-20" "perl v5.8.4" "User Contributed Perl Documentation"
.SH "NAME"
pstoimg \- Convert a PostScript file to a bitmap image using
Ghostscript and the Netpbm utilities
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fBpstoimg\fR \fB\-help\fR | \fB\-version\fR
.PP
\&\fBpstoimg\fR
[\ \fB\-antialias\fR\ ]
[\ \fB\-aaliastext\fR\ ]
[\ \fB\-center\fR\ \fInum\fR\ ]
[\ \fB\-color\fR\ \fInum\fR\ ]
[\ \fB\-crop\fR\ \fIcode\fR\ ]
[\ \fB\-debug\fR\ ]
[\ \fB\-density\fR\ \fInum\fR]
[\ \fB\-depth\fR\ \fInum\fR\ ]
[\ \fB\-discard\fR\ ]
[\ \fB\-flip\fR\ \fIcode\fR\ ]
[\ \fB\-geometry\fR\ \fIX\fRx\fIY\fR\ ]
[\ \fB\-interlaced\fR\ ]
[\ \fB\-margins\fR\ \fIX\fR,\fIY\fR\ ]
[\ \fB\-multipage\fR\ ]
[\ \fB\-out\fR\ \fIfile\fR\ ]
[\ \fB\-quiet\fR\ ]
[\ \fB\-rightjustify\fR\ \fInum\fR\ ]
[\ \fB\-scale\fR\ \fInum\fR\ ]
[\ \fB\-tmp\fR\ \fIpath\fR\ ]
[\ \fB\-topjustify\fR\ [\fBx\fR]\fInum\fR\ ]
[\ \fB\-transparent\fR\ ]
[\ \fB\-type\fR\ \fItype\fR\ ]
[\ \fB\-shoreup\fR\ \fInum\fR[\fBd\fR]\ ]
[\ \fB\-white\fR\ ]
\&\fIfile\fR
[\ \fIfile2\fR\ ...\ ]
.SH "OPTIONS"
.IX Header "OPTIONS"
The command line options may be abbreviated to the shortest unique
prefix.
.IP "\fB\-help\fR" 4
.IX Item "-help"
Show this help page and exit.
.IP "\fB\-version\fR" 4
.IX Item "-version"
Show the release and version of pstoimg and exit.
.IP "\fB\-antialias\fR" 4
.IX Item "-antialias"
Use Ghostscript's anti-aliasing feature for rendering \*(L"softer\*(R" images.
This applies to lines and edges of polygonal and oval or circular shapes.
Only valid if Ghostscipt 4.03 or higher is installed.
.IP "\fB\-aaliastext\fR" 4
.IX Item "-aaliastext"
Use Ghostscript's anti-aliasing feature for \*(L"smoother\*(R" font characters,
without the jagged edges. Similar to \fB\-antialias\fR for graphic components.
Only valid if Ghostscipt 4.03 or higher is installed.
.IP "\fB\-center\fR \fInum\fR" 4
.IX Item "-center num"
Add the appropriate amount of whitespace to the left of the image so
that the image appears to be centered in a total width of \fInum\fR pixels.
.IP "\fB\-crop\fR \fIcode\fR" 4
.IX Item "-crop code"
Crop the bitmap from the given directions. \fIcode\fR may be a string of
several cropping instructions, which are executed strictly in the given
order. Possible values are: \fBh\fR (horizontal, i.e. crop top and
bottom), \fBv\fR (vertical), \fBtblr\fR (top, bottom, left, right) and \fBa\fR (all
directions). A special case is \fBs\fR: \*(L"shave\*(R" the image at the bottom, but only
if a single line of whitespace exists.
.IP "\fB\-debug\fR" 4
.IX Item "-debug"
Turn on debugging output. This can get rather verbose. Any intermediate
files generated are not removed to help debugging.
.IP "\fB\-density\fR \fInum\fR" 4
.IX Item "-density num"
The density (resolution) in \s-1DPI\s0 in which to render the bitmap. The default
is 72.
.IP "\fB\-depth\fR \fInum\fR or \fB\-color\fR \fInum\fR" 4
.IX Item "-depth num or -color num"
Specify the color depth of the bitmap. Legal values are 1 (black & white),
8 (256 colors) and 24 (true color).
.IP "\fB\-discard\fR" 4
.IX Item "-discard"
Delete the input postscript file if the conversion was successful. Setting
the environment \s-1DISCARD\s0 to a true value (as perl sees it) has the same
effect.
.IP "\fB\-flip\fR \fIcode\fR" 4
.IX Item "-flip code"
Flip all generated output bitmaps. The following codes are recognized:
lr (flip left\-right), tb (flip top\-bottom), xy (flip bottom/left\-top/right),
r90 and ccw (rotate by 90 degrees counterclockwise), r270 and cw (rotate
90 degrees clockwise) and r180 (rotate 180 degrees).
.IP "\fB\-geometry\fR \fIX\fRx\fIY\fR" 4
.IX Item "-geometry XxY"
Render only this \*(L"window\*(R" of the PostScript file. If given, this option
can dramatically reduce memory requirements and speed up conversion. The
geometry is automatically detected in case of \s-1EPS\s0 files (Encapsulated
PostScript).
.IP "\fB\-interlaced\fR" 4
.IX Item "-interlaced"
Generate an interlaced bitmap. Interlaced images build up from coarse to
fine as they are loaded. This option may not work on every installation
and/or bitmap type, depending of the capabilities of external programs.
.IP "\fB\-margins\fR \fIX\fR,\fIY\fR" 4
.IX Item "-margins X,Y"
The offset of the rectangle in the postscript file that is going to be
rendered from top/left. Can be used together with \fB\-geometry\fR to further
reduce the size of the intermediate bitmap file generated by Ghostscript.
.IP "\fB\-multipage\fR" 4
.IX Item "-multipage"
Process a multi-page PostScript file, i.e. create an individual bitmap
for every page. The resulting files are numbered: The decimal number
(starting with 1) is appended to the basename of the PostScript input
file (or the basename of the filename specified with \fB\-out\fR), while
keeping the extension.
.IP "\fB\-out\fR \fIfile\fR" 4
.IX Item "-out file"
The file where to write the bitmap. If multiple PostScript files are
supplied on the command line, this option is ignored. The bitmap type
extension is appended automatically if \fIfile\fR does not contain a dot.
In connection with \fB\-multipage\fR \fIfile\fR is extended by the page number
as shown in this example:
.Sp
\&\-outfile foo.gif \-\-\-\-\-\-\-\-> foo1.gif, foo2.gif, ...
.IP "\fB\-quiet\fR" 4
.IX Item "-quiet"
Do not print anything except error messages.
.IP "\fB\-rightjustify\fR \fInum\fR" 4
.IX Item "-rightjustify num"
Add the appropriate amount of whitespace to the left of the image so that
it appears to be aligned to the right in a total width of \fInum\fR pixels.
.IP "\fB\-scale\fR \fIfactor\fR" 4
.IX Item "-scale factor"
Scale the image by \fIfactor\fR. Valid choices are any numbers greater than
zero. Useful choices are numbers between 0.1 \- 5.
Large numbers may generate very large intermediate files and will take
longer to process. If this option is omitted, the environment \s-1SCALE\s0 is
considered.
.IP "\fB\-shoreup\fR \fInum\fR[\fBd\fR]" 4
.IX Item "-shoreup num[d]"
Make height and width of the bitmap(s) an exact multiple of \fInum\fR. If
\&\fInum\fR is followed by a \*(L"d\*(R", then half the extra vertical space is placed
underneath. This option is useful, if you want to have \*(L"blown\-up\*(R" images
of high quality for print, but downscale them in \s-1HTML\s0 using
\&\f(CW\*(C`<IMG WIDTH=x HEIGHT=y>\*(C'\fR. If the actual image is is not an
integer multiple of x,y then browsers tend to display distorted images.
.IP "\fB\-tmp\fR \fIpath\fR" 4
.IX Item "-tmp path"
Use \fIpath\fR to store temporary files. Defaults to /tmp on this
installation. This parameter can be set by the environment \fB\s-1TMP\s0\fR or
\&\fB\s-1TEMP\s0\fR, too.
.IP "\fB\-topjustify\fR [\fBx\fR]\fInum\fR" 4
.IX Item "-topjustify [x]num"
Add padding whitespace to the image so that it gets a defined height.
If an integer value is given, it defines the total height. The whitespace
is added at the bottom. If the number is preceded by \*(L"x\*(R", then this
multiple of the image height is added as whitespace at the bottom.
.IP "\fB\-transparent\fR" 4
.IX Item "-transparent"
Generate transparent bitmaps, i.e. the background color (white) is
transparent if viewed with certain viewers (e.g. browsers). This option
may not be available due to missing capabilities of external
programs.
.IP "\fB\-type\fR \fItype\fR" 4
.IX Item "-type type"
Instruct pstoimg to render the bitmap in \fItype\fR format. Depending on
the local installation, pstoimg is capable of generating either \s-1GIF\s0 or
\&\s-1PNG\s0 bitmaps. This site features the following types: png gif
.Sp
If omitted, the first type in this list is taken.
.IP "\fB\-white\fR" 4
.IX Item "-white"
Remove TeX's page color information from the PostScript file before
converting so that a white background is used.
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBpstoimg\fR iterates over the given input files and runs them through
Ghostscipt. The resulting pnm (portable anymap files) are processed
with different Netpbm tools (cropping, color mapping, aligning, ...)
and finally converted into (currently) either \s-1GIF\s0 or \s-1PNG\s0 format. The
bitmaps can now be included e.g. in \s-1WWW\s0 pages.
.PP
The PostScript file is converted as is. If a valid bounding box is
found (\s-1EPS\s0 format), then only this area is converted. The image is
\&\fInot\fR cropped by default.
.SH "RETURN VALUE"
.IX Header "RETURN VALUE"
.IP "0" 4
if everything went all right
.IP "x" 4
.IX Item "x"
(x != 0) something went wrong. See the message output.
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.ie n .IP """pstoimg foo.ps""" 4
.el .IP "\f(CWpstoimg foo.ps\fR" 4
.IX Item "pstoimg foo.ps"
Convert the first page of foo.ps to the default bitmap type.
.ie n .IP """pstoimg \-type png \-crop a \-trans \-interlace foo.ps""" 4
.el .IP "\f(CWpstoimg \-type png \-crop a \-trans \-interlace foo.ps\fR" 4
.IX Item "pstoimg -type png -crop a -trans -interlace foo.ps"
Same as above, but force png output and crop all the whitespace
around the image and make the color white transparent and
generate an interlaced bitmap.
.ie n .IP """pstoimg \-multi \-out bar \-type gif \-crop a foo.ps""" 4
.el .IP "\f(CWpstoimg \-multi \-out bar \-type gif \-crop a foo.ps\fR" 4
.IX Item "pstoimg -multi -out bar -type gif -crop a foo.ps"
Consider foo.ps a multiple page PostScript file and create output
files bar1.gif, bar2.gif, etc.
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
.IP "\s-1DENSITY\s0, \s-1DEPTH\s0, \s-1DEBUG\s0, \s-1DISCARD\s0" 4
.IX Item "DENSITY, DEPTH, DEBUG, DISCARD"
See \fB\-density\fR, \fB\-depth\fR, \fB\-debug\fR, \fB\-discard\fR, respectively.
.IP "\s-1GS_LIB\s0" 4
.IX Item "GS_LIB"
This variable is set to the path(s) where Ghostscript libraries have
been found on this system during configuration, but only if the built-in
paths are not correct. This fixes the problem of relocation that is quite
common on Win32 installations. This behavior can be overridden by
setting \s-1GS_LIB\s0 manually before starting pstoimg.
.IP "\s-1LATEX2HTMLDIR\s0" 4
.IX Item "LATEX2HTMLDIR"
The directory where the LaTeX2HTML library and perl modules are found.
Defaults to \*(L"/usr/share/latex2html\*(R" on this installation.
.IP "\s-1OUTFILE\s0" 4
.IX Item "OUTFILE"
Setting this has the same effect as specifying \fB\-out\fR. Please do not rely
on this feature any more, it will disappear from the next releases!
.IP "\s-1PAPERSIZE\s0" 4
.IX Item "PAPERSIZE"
The papersize to use by Ghostscript to render the image. pstoimg tries
hard to optimize for rendering on the smallest possible bitmap size.
Still this option is there to enable tuning by hand, although it is
deprecated. If pstoimg finds a better setting, this parameter is ignored.
.IP "\s-1SCALE\s0" 4
.IX Item "SCALE"
See the discussion of \fB\-scale\fR.
.IP "\s-1TMP\s0 and \s-1TEMP\s0" 4
.IX Item "TMP and TEMP"
Unless overridden by \fB\-tmp\fR, these variables denote a directory where
to store temporary files. \s-1TMP\s0 is considered first, then \s-1TEMP\s0.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
gs, pnmcrop, pnmquant, pbmmake, pnmcat, pnmfile, pnmflip, ppmtogif,
pnmtopng, giftool, giftrans.
.SH "NOTES"
.IX Header "NOTES"
Several people have suggested to use ImageMagick's convert instead of
pstoimg. A few comments on this: convert uses (of course) Ghostscript
for conversion of PostScript to bitmap, so one still needs gs. And
for the special requirements of LaTeX2HTML convert's features are not
sufficient. The ImageMagick toolset has everything in place, but it
has some overhead that can prove killing when processing some 100
images. pstoimg only does what it really has to, so it should be
quite efficient. Don't get me wrong \- I like ImageMagick, but not in
the context of LaTeX2HTML.
.SH "CAVEATS"
.IX Header "CAVEATS"
This utility is automatically configured and built to work on the
local setup. If this setup changes (e.g. some of the external commands
are moved), the script has be be reconfigured.
.PP
Despite the portability of perl, a pstoimg configured on \s-1UNIX\s0 will
probably not work on Win32 and vice versa.
.SH "BUGS"
.IX Header "BUGS"
This is a major enhancement release, so there may be a few bugs. As
the user inteface changed a bit, some of your tools that were using
pstoimg may not work any more.
.PP
Please report bugs to latex2html@tug.org, stating the (debug) output
of pstoimg, your perl version and the versions of the external tools.
Best is to include the cfgcache.pm file from the configuration procedure.
.SH "AUTHOR"
.IX Header "AUTHOR"
Marek Rouchal <marek@saftsack.fs.uni\-bayreuth.de>
.SH "HISTORY"
.IX Header "HISTORY"
This script went through a long evolution, beginning with a modification
of Doug Crabill's <dgc@cs.purdue.edu> ps2epsi script.
The first perl version was done by Nikos Drakos <nikos@cbl.leeds.ac.uk>.
It was gradually improved by numerous LaTeX2HTML developers:
Ross Moore <ross@mpce.mq.edu.au>, Jens Lippmann
<lippmann@rbg.informatik.tu\-darmstadt.de> and others (sorry for not
mentioning everyone and thanks for your contributions).

388
texexpand.1 Normal file
View File

@ -0,0 +1,388 @@
.rn '' }`
.de Sh
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp
.if t .sp .5v
.if n .sp
..
.de Ip
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.de Vb
.ft CW
.nf
.ne \\$1
..
.de Ve
.ft R
.fi
..
.ie n \{\
.ds -- \(*W-
.ds PI pi
.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
.ds L" ""
.ds R" ""
.ds M" """
.ds S" """
.ds N" """""
.ds T" """""
.ds L' '
.ds R' '
.ds M' '
.ds S' '
.ds N' '
.ds T' '
'br\}
.el\{\
.ds -- \(em\|
.tr \*(Tr
.ds L" ``
.ds R" ''
.ds M" ``
.ds S" ''
.ds N" ``
.ds T" ''
.ds L' `
.ds R' '
.ds M' `
.ds S' '
.ds N' `
.ds T' '
.ds PI \(*p
'br\}
.\" If the F register is turned on, we'll generate
.\" index entries out stderr for the following things:
.\" TH Title
.\" SH Header
.\" Sh Subsection
.\" Ip Item
.\" X<> Xref (embedded
.\" Of course, you have to process the output yourself
.\" in some meaninful fashion.
.if \nF \{
.de IX
.tm Index:\\$1\t\\n%\t"\\$2"
..
.nr % 0
.rr F
.\}
.TH TEXEXPAND 1 "perl 5.005, patch 03" "29/Jan/2000" "User Contributed Perl Documentation"
.UC
.if n .hy 0
.if n .na
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.de CQ \" put $1 in typewriter font
.ft CW
'if n "\c
'if t \\&\\$1\c
'if n \\&\\$1\c
'if n \&"
\\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
'.ft R
..
.\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
. \" AM - accent mark definitions
.bd B 3
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds ? ?
. ds ! !
. ds /
. ds q
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
. ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
. ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
.ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
.ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
.ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.ds oe o\h'-(\w'o'u*4/10)'e
.ds Oe O\h'-(\w'O'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds v \h'-1'\o'\(aa\(ga'
. ds _ \h'-1'^
. ds . \h'-1'.
. ds 3 3
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
. ds oe oe
. ds Oe OE
.\}
.rm #[ #] #H #V #F C
.SH "NAME"
texexpand \- expand \einput and \einclude statements in a TeX file
.SH "DESCRIPTION"
General translation mechanism:
.PP
The main program latex2html calls texexpand with the document name
in order to expand some of its \einput and \einclude statements, here
also called \*(L'merging\*(R', and to write a list of sensitized style, class,
input, or include file names.
When texexpand has finished, all is contained in one file, TMP_foo.
(assumed foo.tex is the name of the document to translate).
.PP
In this version, texexpand cares for following environments
that may span include files / section boundaries:
a) \ebegin{comment}
b) \f(CW%begin\fR{comment}
c) \ebegin{any} introduced with \eexcludecomment
d) \f(CW%begin\fR{any}
e) \ebegin{verbatim}
f) \ebegin{latexonly}
g) \f(CW%begin\fR{latexonly}
.PP
e) \- g) prevent texexpand from expanding input files, but the environment
content goes fully into the output file.
.PP
Together with each merging of \einput etc. there are so-called %%%texexpand
markers accompanying the boundary.
.PP
When latex2html reads in the output file, it uses these markers to write
each part to a separate file, and process them further.
.Sh "Detailed technical notes:"
1. \f(CW%begin\fR{latexonly} and \f(CW%end\fR{latexonly} have to be on a separate line.
Anything between these tags (including the tags) is discarded.
.PP
2. \ebegin{latexonly} and \eend{latexonly} have to be on a separate line.
Anything between these tags (including the tags) is not expanded.
.PP
3. [%\e]begin{"to exclude"} and [%\e]end{"to exclude"} have to be on a
separate line.
Anything between these tags (including the tags) is discarded.
.PP
4. \ebegin{verbatim/verbatim*} and \eend{verbatim/verbatim*} have to be
on a separate line.
Anything between these tags (including the tags) is not expanded.
.PP
5. The scope of any such tags may extend over several files.
The opening tag for latexonly may occur on a different include level
than the closing tag.
The opening tag for verbatim/"to exclude\*(R" must occur within the same
file than the closing tag.
.PP
6. Warnings are printed when the document has been parsed and open
tags remain.
.PP
7. When in a \*(L"to exclude"/verbatim environment, texexpand won't recognize
\s-1ANY\s0 command except the corresponding closing tag.
There cannot be any nested constructions.
This behaviour is identical to that of LaTeX.
.PP
8. \ebegin{latexonly},\eend{latexonly} may be nested, whereas
\f(CW%begin\fR{latexonly},%end{latexonly} may not be nested.
.PP
9. A \*(L"%\*(R" tag cannot close a \*(L"\e\*(R" tag, and vice versa.
.PP
10. Every \e\fIdocument\fR\|(class|style), \eusepackage, \einput and \einclude command
has to be on a separate line.
.PP
11. Everything behind a `%\*(R' that isn't preceded by a `\e\*(R' is regarded as
a comment, i.e. it is printed but not interpreted.
.PP
12. If any command listed in 10. is preceded by an occurence of `\everb\*(R' or
`\elatex\*(R' then it is \s-1NOT\s0 interpreted. This crashes on lines like this:
blah blah \everb+foo foo+ \einput{bar} % bar won't be loaded!
.PP
13. Packages provided via \eusepackage are handled the same way as
`options\*(R' in \e\fIdocument\fR\|(class|style), i.e. they are included when
\-auto_exclude is off, the package isn't in \f(CW@dont_include\fR *\s-1OR\s0* the
package is in \f(CW@do_include\fR (new). They are added to the style file
together with their options if the file itself hasn't been merged.
\edocumentclass[options]{class} searches for every option.clo,
\edocumentstyle[options]{style} searches for every option.sty.
\eusepackage[options]{packages} searches for every package.sty.
.PP
14. Each texinputs directory is searched for input files/styles. If it
ends in `//\*(R', the whole subdirectory tree is searched.
.PP
15. \einput / \einclude merge the given file (if found under the given
name or with .tex extension) if its basename is in \f(CW@do_include\fR or if it
isn't in \f(CW@dont_include\fR or if the given filename doesn't end in
\&.sty/.clo/.cls when \-auto_exclude is set.
.Sh "Notes"
Recognizes \edocumentclass, \edocumentstyle, \eusepackage, \eRequirePackage,
\ebegin{verbatim}...\eend{verbatim}, \f(CW%begin\fR{latexonly}...%end{latexonly},
\ebegin{latexonly}...\eend{latexonly}, \einput, \einclude, \everb, \elatex
\eendinput, \eend{document}
\eincludecomment, \eexcludecomment
\ebegin{"to exclude"}, \eend{"to exclude"}
\f(CW%begin\fR{"to exclude"}, \f(CW%end\fR{"to exclude"}
.SH "The gory Details"
Include and parse a file.
This routine is recursive, see also &process_input_include_file,
&process_document_header, and &process_package_cmd.
.PP
Two global flags control the states of texexpand.
o \f(CW$active\fR is true if we should interprete the lines to expand
files, check for packages, etc.
o \f(CW$mute\fR is true if we should prevent the lines from going into the out file.
.PP
We have three general states of texexpand:
1) interprete the lines and pass them to the out file
This is the normal case. Corresponding: \f(CW$active\fR true, \f(CW$mute\fR false
.PP
.Vb 3
\& 2) interprete minimal and suppress them
\&This is when parsing inside a comment environment, which
\&also would retain its body from LaTeX. => $active false, $mute true
.Ve
.Vb 4
\& 3) interprete minimal and pass the lines to the out file
\&This is inside a verbatim or latexonly environment.
\&The line of course must be at least interpreted to determine the closing tag.
\&=> $active false, $mute false
.Ve
Any environment may extend over several include files.
Any environement except verbatim and latexonly may have its
opening or closing tag on different input levels.
The comment and verbatim environments cannot be nested, as
is with LaTeX.
We must at least parse verbatim/comment environments in
latexonly environments, to catch fake latexonly tags.
.PP
The work scheme:
Five functions influence texexpand's behavior.
o &process_file opens the given file and parses the non-comment part in
order to set \f(CW$active\fR and \f(CW$mute\fR (see above).
It calls &interprete to interprete the non-comment content and either
continues with the next line of its file or terminates if &interprete
detected the \eend{document} or an \eendinput.
.PP
o &interprete handles some LaTeX tags with respect to the three states
controlled by \f(CW$active\fR and \f(CW$mute\fR.
Regarding to \einput|include, \e\fIdocument\fR\|(class|style), and
\e(use|Require)package the functions &process_input_include_file,
&process_document_header, and &process_package_cmd are called respectively.
.PP
o These three functions check if the file name or option files are enabled
or disabled for merging (via TEXE_DO_INCLUDE or TEXE_DONT_INCLUDE).
Any file that is to include will be \*(L'merged\*(R' into the current file, i.e.
the function &process_file is called at this place in time (recursively).
This will stop interpretation at the current line in file, start with the
new file to process and continues with the next line as soon as the new
file is interpreted to its end.
.PP
The call tree (noweb+xy.sty would be handy here):
.PP
.Vb 13
\& main
\& |
\& v
\& +->process_file
\& | |
\& | v
\& | interprete (with respect to the current line, one of that three)
\& | | | |
\& | v v v
\& | process_input_include_file process_document_header process_package_cmd
\& | | | |
\& | v v v
\& +----+---------------------------+------------------------+
.Ve
Bugs:
o Since the latexonly environment is not parsed, its contents
might introduce environments which are not recognized.
.PP
o The closing tag for latexonly is not found if hidden inside
an input file.
.PP
o One environment tag per line, yet!
.PP
o If I would have to design test cases for this beast I would
immediately desintegrate into a logic cloud.
.PP
Notes:
.PP
o Ok, I designed test cases for it.
Please refer to test \*(L'expand\*(R' of the regression test suite
in the developers\*(R' module of the l2h repository.
.PP
o \-unsegment feature:
In this (rare) case, the user wants to translate a segmented document
not in segments but in a whole (for testing, say).
We enable this by recognizing the \esegment command in &interprete,
causing the segment file to be treated like \einput but loosing the first
lines prior to \estartdocument (incl.), as controlled via \f(CW$segmentfile\fR.
On how to segment a document you are best guided by section
``Document Segmentation'\*(R' of the LaTeX2HTML manual.
.SH "CAVEATS"
This utility is automatically configured and built to work on the
local setup. If this setup changes (e.g. some of the external commands
are moved), the script has be be reconfigured.
.SH "Authors"
.PP
.Vb 8
\& Based on texexpand by Robert Thau, MIT AI lab, including modifications by
\& Franz Vojik <vojik@de.tu-muenchen.informatik>
\& Nikos Drakos <nikos@cbl.leeds.ac.uk>
\& Sebastian Rahtz <spqr@uk.ac.tex.ftp>
\& Maximilian Ott <max@com.nec.nj.ccrl>
\& Martin Boyer
\& Herbert Swan
\& Jens Lippmann
.Ve
.rn }` ''

BIN
v2018.3.tar.gz Normal file

Binary file not shown.