Skip to content

Commit

Permalink
Back to Amazon!
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Jan 1, 2024
1 parent e73a0e5 commit b009610
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 22 deletions.
30 changes: 8 additions & 22 deletions book3/amazonbook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,25 @@ rm tmp.* *.tmp *.aux
pandoc A0-preface.mkd -o tmp.prefacex.tex
sed < tmp.prefacex.tex 's/section{/section*{/' > tmp.preface.tex
cat [0-9]*.mkd | $MY_PYTHON verbatim.py | iconv -f utf8 -t ascii//TRANSLIT > tmp.verbatim
pandoc -s -N -f markdown+definition_lists -t latex --toc --default-image-extension=jpg -V fontsize:10pt -V documentclass:book --template=template.latex -o tmp.tex < tmp.verbatim
pandoc -s -N -f markdown+definition_lists -t latex --toc --default-image-extension=png -V fontsize:10pt -V documentclass:book --template=template.latex -o tmp.tex < tmp.verbatim
pandoc [A-Z][A-Z]*.mkd -o tmp.app.tex

sed < tmp.app.tex -e 's/subsubsection{/xyzzy{/' -e 's/subsection{/plugh{/' -e 's/section{/chapter{/' -e 's/xyzzy{/subsection{/' -e 's/plugh{/section{/' > tmp.appendix.tex

# For Amazon we stick with jpg
# sed < tmp.tex '/includegraphics/s/jpg/eps/' | sed 's"includegraphics{../photos"includegraphics[height=3.0in]{../photos"' | iconv -f utf8 -t ascii//TRANSLIT > tmp.sed
# sed < tmp.tex '/includegraphics/s/jpg/eps/' | sed 's"includegraphics{../photos"includegraphics[height=3.0in]{../photos"' | iconv -f utf8 -t ascii//TRANSLIT > tmp.sed
sed < tmp.tex 's"includegraphics{../photos"includegraphics[height=3.0in]{../photos"' | iconv -f utf8 -t ascii//TRANSLIT > tmp.sed
diff tmp.sed tmp.tex

$MY_PYTHON texpatch.py < tmp.sed | iconv -f utf8 -t ascii//TRANSLIT > tmp.patch

mv tmp.patch tmp.tex
if [ -f .chinese ] ; then
xelatex tmp
makeindex tmp
xelatex tmp
mv tmp.pdf x.pdf
else
latex tmp
makeindex tmp
latex tmp
dvipdf tmp.dvi x.pdf
# dvips tmp.dvi
# ps2pdf13 -dProcessColorModel=/DeviceGray -sColorConversionStrategy=Gray -dPDFSETTINGS=/prepress -dEmbedAllFonts=true tmp.ps x13.pdf
# ps2pdf14 -dProcessColorModel=/DeviceGray -sColorConversionStrategy=Gray -dPDFSETTINGS=/prepress -dEmbedAllFonts=true tmp.ps x14.pdf
fi
pdflatex tmp
makeindex tmp
pdflatex tmp

if [[ "$OSTYPE" == "darwin"* ]]; then
open x.pdf
elif [[ "$OSTYPE" == "linux-gnu" && -n "$DISPLAY" ]]; then
xdg-open x.pdf
else
echo "Output on x.pdf"
fi
mv tmp.pdf x.pdf

open x.pdf
rm tmp.*
13 changes: 13 additions & 0 deletions images/eps_convert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/bash

for f in *.eps
do
b=`basename $f .eps`
p=$b.png
if test -f $p; then
echo "Skipping $fp"
continue
fi
echo "Processing $f"
open $f
done
Binary file added images/join.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/pda2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/program-oo-bs4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/program-oo-code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/program-oo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/program.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/relational.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/soa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/socket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/string.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/twitter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/xml-tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b009610

Please sign in to comment.