Discussion:
script problem
Antonio Olivares
2021-04-21 21:08:42 UTC
Permalink
Dear kind FreeBSD folks,

I have downloaded the source code for a mathematics book, Vector Calculus
http://www.mecmath.net/


It has a script called cal3book.sh

I have made changes from #!/bin/bash to #!/bin/sh and added some code
so that the files m3Dplain.mp and m3Dsty01.mp are skipped from being
metaposted. These files are not in texlive2021 for some reason or
another and I do not know how to add them as easily if I were using
miktex install on the fly option.

Script is as follows:
.................................................................................................
#!/bin/sh
if [ $# -eq 0 ] && [ != m3Dplain.mp ] && [ != m3Dsty01.mp ]; then
for x in *.mp
do # if [ $# -eq 0 ] export TEX=latex
TEX=latex
mpost $x
done
fi
latex -interaction=nonstopmode calc3book.tex
makeindex -s myindex.ist -o calc3book.ind calc3book.idx
latex -interaction=nonstopmode calc3book.tex
makeindex calc3book.nlo -s nomencl.ist -o calc3book.nls
bibtex calc3book
latex -interaction=nonstopmode calc3book.tex
latex -interaction=nonstopmode calc3book.tex
dvips -j0 -t letter -Pps -G0 -z calc3book.dvi -o
ps2pdf14 -dALLOWPSTRANSPARENCY -dMaxSubsetPct=100 -dSubsetFonts=true
-dEmbedAllFonts=true -dPDFSETTINGS=/printer calc3book.ps
................................................................................

How can I skip from those files being metaposted? The scripted worked
in FreeBSD 12 to FreeBSD 12.2-RELEASE but not in FreeBSD 13.

Thank you in advance,


Antonio
Norman Gray
2021-04-21 22:16:10 UTC
Permalink
Antonio, hello.
Post by Antonio Olivares
I have made changes from #!/bin/bash to #!/bin/sh and added some code
so that the files m3Dplain.mp and m3Dsty01.mp are skipped from being
metaposted. These files are not in texlive2021 for some reason or
another and I do not know how to add them as easily if I were using
miktex install on the fly option.
It looks like the m3D package [1], where those files from from, is a
little old, and may not be compatible with the current version of mpost.
That may be why it's not readily available as part of a current
TeXLive. Certainly, when I try (just now) to build this book from the
sources, and install m3D locally, the build of torus.mp fails with an
error which smells to me strongly of version-skew.

If I press on, I see that the source depends on a picins.sty package,
which appears [2] to be a LaTeX 2.09 package (ie, _very_ old).

I suspect it would be challenging to build the book from its sources,
using a half-way recent release of TeXLive. It doesn't look impossible,
but it might well involve some non-trivial hacking of the source, which
it might be better to encourage the author to embark on.

Good luck!

Norman


[1] http://www-math.univ-poitiers.fr/~phan/m3Dplain.html
[2] https://www.ctan.org/pkg/picins
--
Norman Gray : https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK
Antonio Olivares
2021-04-21 23:56:30 UTC
Permalink
Post by Norman Gray
Antonio, hello.
Post by Antonio Olivares
I have made changes from #!/bin/bash to #!/bin/sh and added some code
so that the files m3Dplain.mp and m3Dsty01.mp are skipped from being
metaposted. These files are not in texlive2021 for some reason or
another and I do not know how to add them as easily if I were using
miktex install on the fly option.
It looks like the m3D package [1], where those files from from, is a
little old, and may not be compatible with the current version of mpost.
That may be why it's not readily available as part of a current TeXLive.
Certainly, when I try (just now) to build this book from the sources, and
install m3D locally, the build of torus.mp fails with an error which smells
to me strongly of version-skew.
Post by Norman Gray
If I press on, I see that the source depends on a picins.sty package,
which appears [2] to be a LaTeX 2.09 package (ie, _very_ old).
Post by Norman Gray
I suspect it would be challenging to build the book from its sources,
using a half-way recent release of TeXLive. It doesn't look impossible,
but it might well involve some non-trivial hacking of the source, which it
might be better to encourage the author to embark on.
Post by Norman Gray
Good luck!
Norman
[1] http://www-math.univ-poitiers.fr/~phan/m3Dplain.html
[2] https://www.ctan.org/pkg/picins
--
Norman Gray : https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK
Dear Sir

The book gets created, but the file torus.mp fails to build. The m3D
files, I have put the files m3D* on the same directory and the picins.sty.
The question is how the metapost files get processed by the script.
Something changed because the script did run the metapost files and got
their output and them latex'd the source files and it worked in FreeBSD 12
but not in FreeBSD 13. I do not know what causes this?

I had to
$ for i in *.mp ; TEX=latex mpost "$i": done;

Otherwise I get message that many files missing. This part worked before
and now it does not.

I want to metapost the files except the m3D* files, it worked in previous
versions but not new version.


Thank you for helping.

Best Regards,


Antonio
Norman Gray
2021-04-22 09:29:57 UTC
Permalink
Antonio, hello.
Post by Antonio Olivares
The book gets created, but the file torus.mp fails to build. The m3D
files, I have put the files m3D* on the same directory and the
picins.sty.
The question is how the metapost files get processed by the script.
Something changed because the script did run the metapost files and got
their output and them latex'd the source files and it worked in FreeBSD 12
but not in FreeBSD 13. I do not know what causes this?
I had to
$ for i in *.mp ; TEX=latex mpost "$i": done;
I think that, in this case, you'd be better with

export TEX=latex
for f in fig*.mp; do mpost $f; done

That is, only process the fig*.mp files, and skip the torus.mp file,
which appears to be the only one which uses the m3D macros.

(setting TEX is for the benefit of mpost, as it specifies the language
used for the btex...etex calls within the .mp files.)

If, after that, I do

latex calc3book

then I have to ignore the error message about the missing torus.0 (you
could probably comment this call out in the sources), and I get an error
about a missing \bf command

I can add \let\bf\relax to the top of calc3book.tex (after the
\documentclass line), and comment out the includegraphics{torus.0} from
calcbook-chapter4.tex

latex calc3book
bibtex calc3book
latex calc3book.tex
makeindex -s myindex.ist -o calc3book.ind calc3book.idx
makeindex calc3book.nlo -s nomencl.ist -o calc3book.nls
latex calc3book.tex
dvips -j0 -t letter -Pps -G0 -z calc3book.dvi -o
ps2pdf14 -dALLOWPSTRANSPARENCY -dMaxSubsetPct=100
-dSubsetFonts=true -dEmbedAllFonts=true -dPDFSETTINGS=/printer
calc3book.ps

...then produces a PDF (which appears to be a decent-looking book, by
the way).

So the version problem you discovered is that the current TeXLive mpost
is too new for the m3D macros, and the current version of scrbook is too
new for the document (which uses obsolete \bf). I think it would be
useful for you to report both problems to the book's author, as well as
(apparent) success in using TeXLive 2021 to process the book.

Good luck!

Norman
--
Norman Gray : https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK
Antonio Olivares
2021-04-22 15:12:00 UTC
Permalink
Post by Norman Gray
Antonio, hello.
Post by Antonio Olivares
The book gets created, but the file torus.mp fails to build. The m3D
files, I have put the files m3D* on the same directory and the picins.sty.
The question is how the metapost files get processed by the script.
Something changed because the script did run the metapost files and got
their output and them latex'd the source files and it worked in FreeBSD 12
but not in FreeBSD 13. I do not know what causes this?
I had to
$ for i in *.mp ; TEX=latex mpost "$i": done;
I think that, in this case, you'd be better with
export TEX=latex
for f in fig*.mp; do mpost $f; done
That is, only process the fig*.mp files, and skip the torus.mp file,
which appears to be the only one which uses the m3D macros.
(setting TEX is for the benefit of mpost, as it specifies the language
used for the btex...etex calls within the .mp files.)
If, after that, I do
latex calc3book
then I have to ignore the error message about the missing torus.0 (you
could probably comment this call out in the sources), and I get an error
about a missing \bf command
I can add \let\bf\relax to the top of calc3book.tex (after the
\documentclass line), and comment out the includegraphics{torus.0} from
calcbook-chapter4.tex
latex calc3book
bibtex calc3book
latex calc3book.tex
makeindex -s myindex.ist -o calc3book.ind calc3book.idx
makeindex calc3book.nlo -s nomencl.ist -o calc3book.nls
latex calc3book.tex
dvips -j0 -t letter -Pps -G0 -z calc3book.dvi -o
ps2pdf14 -dALLOWPSTRANSPARENCY -dMaxSubsetPct=100
-dSubsetFonts=true -dEmbedAllFonts=true -dPDFSETTINGS=/printer
calc3book.ps
...then produces a PDF (which appears to be a decent-looking book, by
the way).
So the version problem you discovered is that the current TeXLive mpost
is too new for the m3D macros, and the current version of scrbook is too
new for the document (which uses obsolete \bf). I think it would be
useful for you to report both problems to the book's author, as well as
(apparent) success in using TeXLive 2021 to process the book.
Good luck!
Norman
--
Norman Gray : https://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK
Dear Sir,

Your solution works much better because it does not process the files
from m3D*. I copied them and pasted them in the same directory along
with picins.sty.
Post by Norman Gray
export TEX=latex
for f in fig*.mp; do mpost $f; done
I commented out the torus.1 in chapter4*.tex file and it compiles
fine, with the exception of that file. Thank you very much for your
help.

Best Regards,


Antonio

Continue reading on narkive:
Loading...