forked from fricas/fricas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generate book.pdf with postscript files
- Loading branch information
Showing
15 changed files
with
183 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#------------------------------------------------------------------ | ||
#--- | ||
#--- FriCAS | ||
#--- Copyright (C) 2013, 2014, 2020 Ralf Hemmecke <[email protected]> | ||
#--- Copyright (C) 2013, 2014, 2020, 2024 Ralf Hemmecke <[email protected]> | ||
#--- Copyright (C) 2024 Qian Yun <[email protected]> | ||
#--- | ||
#------------------------------------------------------------------ | ||
# The main targets of this Makefile are "all" and "doc". | ||
# Other useful targets are "localdoc", "book.pdf", "stamp-html". | ||
# Other useful targets are "localdoc", "book.pdf", "stamp-html", "viewports". | ||
|
||
# Whereas "all" is made during normal FriCAS build, "doc" must be | ||
# invoked separately. | ||
|
@@ -46,7 +47,7 @@ | |
# | ||
# "make book.pdf" does the following: | ||
# - Copy pictures from the ps/ directory for (documentation of HyperDoc). | ||
# - Copy pictures from tmp/*.VIEW/image.ps (target stamp-pics). | ||
# - Copy pictures from tmp/*.VIEW/image.ps (target stamp-book-viewports). | ||
# - Generate tmo/ug09.tex with the list of examples. | ||
# - Create tmp/*.input from htex/*.htex (target ${HTEX_FILES_INPUT}). | ||
# The .input files contain the commands that should be executed. | ||
|
@@ -56,6 +57,10 @@ | |
# tmp/*.spool files (target ${HTEX_FILES_SPOOL}). | ||
# - Turn the tmp/*.spool files into tmp/*.tex files (target ${HTEX_FILES_TEX}). | ||
# - Create tmp/info.tex with version information. | ||
# - Create tmp/vp-*.input files by prepending ")assert CreateGraphics" | ||
# to tmp/*.input files for .htex files that contain \spadgraph commands. | ||
# - Run the tmp/vp-input files through fricas (target ${HTEX_VIEWPORTS_STAMP}) | ||
# in order to produce the postscript pictures for the book. | ||
# - LaTeX book.tex, call makeindex, and re-latex to get references right. | ||
# - Convert book.dvi to book.ps. | ||
# - Convert book.ps to book.pdf. | ||
|
@@ -252,11 +257,16 @@ GEN_HTFILES = xmpexp coverex gloss | |
# The reason for this delayed execution is that generation of the .xpm | ||
# files in *.VIEW/ without the xvfb-run program will pop up image | ||
# windows in X and will make working during compilation impossible. | ||
VIEWPORTFILES = coverex \ | ||
$(shell grep -lRe 'graphpaste{\|spadgraph{' ${srcdir}/ht/* ${srcdir}/htex/* \ | ||
HT_VIEWPORTFILES = coverex \ | ||
$(shell grep -lRe '^\\graphpaste{' ${srcdir}/ht/* \ | ||
| sed 's,.*/,,;s,\..*,,' \ | ||
| grep -v util \ | ||
| sort) | ||
| sort -u) | ||
# HTEX_VIEWPORTFILES is also used in stamp-book-viewports. | ||
HTEX_VIEWPORTFILES = \ | ||
$(shell grep -lRe '^\\spadgraph{' ${srcdir}/htex/* \ | ||
| sed 's,.*/,,;s,\..*,,' \ | ||
| sort -u) | ||
VIEWPORTFILES = ${HT_VIEWPORTFILES} ${HTEX_VIEWPORTFILES} | ||
# This should give | ||
# VIEWPORTFILES = coverex explot2d explot3d graphics SEGBIND \ | ||
# ug00 ug01 ug07 ug08 ug10 ug11 | ||
|
@@ -267,11 +277,8 @@ VIEWPORTFILES = coverex \ | |
# that do contain "paste" commands, i.e., for which .pht files must be | ||
# generated. | ||
HT_PASTEFILES = \ | ||
$(shell grep -R '\\\(graph\|spad\)paste{' ${srcdir}/ht/*.ht \ | ||
| sed 's/%.*//' \ | ||
| grep 'paste{' \ | ||
| sed 's,.*/ht/,,;s,\.ht:.*,,' \ | ||
| grep -v util \ | ||
$(shell grep -lRe '^\\\(graph\|spad\)paste{' ${srcdir}/ht/*.ht \ | ||
| sed 's,.*/,,;s,\..*,,' \ | ||
| sort -u) | ||
# This should give | ||
# HT_PASTEFILES = exdiff exint exlap exlimit exmatrix explot2d explot3d \ | ||
|
@@ -282,10 +289,8 @@ HT_PASTEFILES = \ | |
# and \graphpaste, respectively, in the .ht file during generation via | ||
# ht.awk. | ||
HTEX_PASTEFILES = \ | ||
$(shell grep -R '\\spad\(command\|graph\){' ${srcdir}/htex/*.htex \ | ||
| sed 's/%.*//' \ | ||
| grep '\\spad\(command\|graph\){' \ | ||
| sed 's,.*/htex/,,;s,\.htex:.*,,' \ | ||
$(shell grep -lRe '^\\spad\(command\|graph\){' ${srcdir}/htex/*.htex \ | ||
| sed 's,.*/,,;s,\..*,,' \ | ||
| sort -u) | ||
|
||
################################################################### | ||
|
@@ -294,8 +299,12 @@ HTEX_PASTEFILES = \ | |
# HyperDoc and book.pdf. | ||
# The list can be generated by the following command. | ||
# grep -R '\\spadcommand{)read' *| sed 's/[^ ]* //;s/[ \].*//'|sort -u | ||
# Additionally there are ntube, tknot, images1, and knot3 that | ||
# generate more .ps files for their use in the book. | ||
# All these files are going to be generated from the sources in the | ||
# .htex files in a future release of FriCAS. | ||
INPUT_EXTRA = arrows bouquet newton ribbon vectors \ | ||
ntube tknot images1 ug-pics | ||
ntube tknot images1 knot3 | ||
|
||
################################################################### | ||
# For these files .ht files will be generated. | ||
|
@@ -507,7 +516,7 @@ mobius.VIEW: ${inputsrcdir}/mobius.input | |
# is set. This is supposed to be done through configure.ac. | ||
# The copy command should actually appear during the "copy-to-target" | ||
# below, but it would needlessly complicate this Makefile. | ||
viewports: ${GEN_VIEWPORTFILES_PHT} mobius.VIEW | ||
viewports: ${GEN_VIEWPORTFILES_PHT} mobius.VIEW stamp-book-viewports | ||
${MKDIR_P} ${viewportstargetdir} | ||
cp -r *.VIEW ${viewportstargetdir} | ||
${STAMP} $@ | ||
|
@@ -627,7 +636,7 @@ HTEX_FILES = $(HTEX_UGCHAPTERS) $(HTEX_EXAMPLES) | |
HTEX_FILES_INPUT = $(patsubst %, tmp/%.input, ${HTEX_FILES}) | ||
${HTEX_FILES_INPUT}: tmp/%.input: ${htexsrcdir}/%.htex | ||
${MKDIR_P} tmp | ||
${HTEX2INPUT} $< | ${AWK} -f ${srcdir}/skip-graphics.awk > $@ | ||
${HTEX2INPUT} $< > $@ | ||
|
||
HTEX_FILES_SPOOL = ${patsubst %, tmp/%.spool, ${HTEX_FILES}} | ||
${HTEX_FILES_SPOOL}: tmp/%.spool: tmp/%.input | ||
|
@@ -657,21 +666,28 @@ PS_FILES_PS = ${patsubst %, %.ps, ${PS_FILES}} | |
${PS_FILES_PS}: %.ps: ${pssrcdir}/%.ps | ||
cp $< $@ | ||
|
||
HTEX_PICS = SEGBIND ug00 ug01 ug07 ug08 ug10 ug11 | ||
HTEX_PICS_INPUT = ${patsubst %, tmp/pics-%.input, ${HTEX_PICS}} | ||
${HTEX_PICS_INPUT}: tmp/pics-%.input: ${htexsrcdir}/%.htex | ||
# Note that one tmp/vp-*.input file may produces several postscript | ||
# files. | ||
HTEX_VIEWPORTS_INPUT = ${patsubst %, tmp/vp-%.input, ${HTEX_VIEWPORTFILES}} | ||
HTEX_VIEWPORTS_STAMP = ${patsubst %, tmp/stamp-%, ${HTEX_VIEWPORTFILES}} \ | ||
tmp/stamp-knot3 | ||
|
||
${HTEX_VIEWPORTS_INPUT}: tmp/vp-%.input: tmp/%.input | ||
${MKDIR_P} tmp | ||
${HTEX2INPUT} $< > $@ | ||
(echo ")assert CreateGraphics"; cat $<) > $@ | ||
|
||
tmp/vp-knot3.input: knot3.input ${INPUT_EXTRA_INPUT} | ||
cp $< $@ | ||
|
||
${HTEX_VIEWPORTS_STAMP}: tmp/stamp-%: tmp/vp-%.input | ||
unset DAASE; FRICAS=${FRICAS}; export FRICAS; \ | ||
echo ")read $@" | FRICAS_INITFILE='' ${XVFB} \ | ||
echo ")read $<" | FRICAS_INITFILE='' ${XVFB} \ | ||
${FRICAS}/bin/fricas -noht -noclef > /dev/null | ||
${STAMP} $@ | ||
|
||
stamp-pics: ${INPUT_EXTRA_INPUT} ${HTEX_PICS_INPUT} ${PS_FILES_PS} | ||
(unset DAASE; FRICAS=${FRICAS}; export FRICAS; \ | ||
echo ')read ug-pics' | FRICAS_INITFILE='' ${XVFB} \ | ||
${FRICAS}/bin/fricas -noht -noclef) | ||
stamp-book-viewports: ${HTEX_VIEWPORTS_STAMP} ${PS_FILES_PS} | ||
for f in tmp/*.VIEW/image.ps; do \ | ||
cp $$f `echo $$f | cut -d / -f 2 | cut -d . -f 1`.ps; \ | ||
cp $$f `echo $$f | sed 's,tmp/\(.*\)\.VIEW/image,\1,'`; \ | ||
done | ||
${STAMP} $@ | ||
|
||
|
@@ -704,7 +720,7 @@ tmp/info.tex: | |
# Convince latex to abort on error. | ||
LATEX=latex -halt-on-error -file-line-error -interaction=nonstopmode | ||
|
||
book.dvi: stamp-pics tmp/ug09.tex tmp/info.tex ${HTEX_FILES_TEX} | ||
book.dvi: stamp-book-viewports tmp/ug09.tex tmp/info.tex ${HTEX_FILES_TEX} | ||
TEXINPUTS=$$TEXINPUTS:${srcdir}:tmp:. ${LATEX} book.tex \ | ||
|| (echo "==> Detected problem while running LaTeX."; \ | ||
echo "==> LaTeX must be installed."; \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.