diff options
author | Norbert Preining <norbert@preining.info> | 2024-01-04 03:02:56 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-01-04 03:02:56 +0000 |
commit | c45a0e15a3f74b963e3c2be142de33c8c8f12588 (patch) | |
tree | a7ec0f84bd371896fde6eecb620dfd3d771918ad /info/symbols/comprehensive/source/Makefile | |
parent | 92effab22b73c432933e7eb8e12c1cefda221df9 (diff) |
CTAN sync 202401040302
Diffstat (limited to 'info/symbols/comprehensive/source/Makefile')
-rw-r--r-- | info/symbols/comprehensive/source/Makefile | 350 |
1 files changed, 264 insertions, 86 deletions
diff --git a/info/symbols/comprehensive/source/Makefile b/info/symbols/comprehensive/source/Makefile index c77a1b0892..96fe655735 100644 --- a/info/symbols/comprehensive/source/Makefile +++ b/info/symbols/comprehensive/source/Makefile @@ -4,26 +4,50 @@ ############################################# # Define TARGETS as a list of all of the files we intend to generate. -# TARGETS is categorized into TARGETS_SOURCE and TARGETS_DIST. -# TARGETS_DIST comprise the prebuilt distribution of the Comprehensive -# LaTeX Symbol List. TARGETS_SOURCE are needed primarily to build -# TARGETS_DIST, although they are also distributed (in a "source" -# subdirectory). -TARGETS = $(TARGETS_SOURCE) $(TARGETS_DIST) -TARGETS_DIST = symbols-letter.pdf symbols-a4.pdf \ - rawtables-letter.pdf rawtables-a4.pdf \ - SYMLIST README -TARGETS_SOURCE = lightbulb.eps lightbulb10.pfb lightbulb.map +TARGETS = symbols-letter.pdf symbols-a4.pdf \ + rawtables-letter.pdf rawtables-a4.pdf \ + SYMLIST README # There are a few files that we didn't generate but that need to be -# distributed. +# included in a source distribution. +PRUNETOML = \ + prune-idx-delete.toml \ + prune-idx-accents.toml \ + prune-idx-arrows.toml \ + prune-idx-brands.toml \ + prune-idx-circles.toml \ + prune-idx-cup-cap.toml \ + prune-idx-equals.toml \ + prune-idx-flags.toml \ + prune-idx-hands.toml \ + prune-idx-harpoons.toml \ + prune-idx-ineqs.toml \ + prune-idx-integrals.toml \ + prune-idx-letters.toml \ + prune-idx-math-maps.toml \ + prune-idx-music.toml \ + prune-idx-prec-succ.toml \ + prune-idx-rhombuses.toml \ + prune-idx-sets.toml \ + prune-idx-similar.toml \ + prune-idx-squares.toml \ + prune-idx-stars.toml \ + prune-idx-triangles.toml \ + prune-idx-turnstiles.toml \ + prune-idx-wedges-vees.toml \ + prune-idx-rewrite.toml \ + prune-idx-merge.toml \ + prune-idx-see.toml EXTRADIST = symbols.tex lightbulb10.mf lightbulb.mf \ symbols.ist fakego.sty unicode2eps.pe fakeold-arrows.sty \ makefakeMnSymbol teubner-subset.sty fakemusixtex.sty \ fakearevmath.sty fakedozenal.sty fakelatexsym.sty \ makefakefdsymbol makefakeboisik fakearcs.sty fakeallrunes.sty \ - makefakestix makefakestarfont makerawtables makefakecmupint \ - makefakeworldflags Makefile + renamed-overarrows.sty makefakestix makefakestarfont \ + makerawtables makefakecmupint makefakeworldflags \ + makefakelualatex makefakeasapsym makefakefigchild \ + patch-idx prune-idx $(PRUNETOML) \ + makefakeutfsym maketitlepage makeREADME unicode.txt Makefile # All formats of the symbol list depend upon the following files. COMMONDEPS = symbols.tex symbols.ist fakeMnSymbol.sty teubner-subset.sty \ @@ -32,7 +56,11 @@ COMMONDEPS = symbols.tex symbols.ist fakeMnSymbol.sty teubner-subset.sty \ fakearevmath.sty fakedozenal.sty fakelatexsym.sty \ fakestarfont.sty nonlatex versatim.tex junicode lilyglyphs \ fakeallrunes.sty fakecmupint.sty fakeworldflags.sty \ - $(TARGETS_SOURCE) + fakeacademicons.sty faketypicons.sty renamed-overarrows.sty \ + fakeasapsym.sty fakefontmfizz.sty fakehamnosys.sty \ + fakefigchild.sty fakeutfsym.sty fakelogix.sty \ + lightbulb.pdf lightbulb.eps lightbulb10.pfb lightbulb.map \ + patch-idx prune-idx $(PRUNETOML) # The following non-LaTeX files will be copied to the current # directory if they exist so LaTeX can find them. @@ -40,63 +68,76 @@ NONLATEX = hands.mf greenpoint.mf nkarta.mf astrosym.mf WebOMintsGD.pfb \ moonphase.mf dancers.mf smfpr10.mf umranda.mf umrandb.mf \ cryst.mf dice3d.mf magic.mf fselch10.mf Junicode.ttf msym10.tfm \ knot1.mf knot2.mf knot3.mf knot4.mf knot5.mf knot6.mf knot7.mf \ - endofproofwd.pdf + endofproofwd.pdf cmrj.tfm # We need FontForge (or the older PfaEdit) to generate lightbulb10.pfb. FONTFORGE = fontforge # Specify how much process parallelism we should employ in xargs invocations. -PARXARGS = 8 +PARXARGS = $(shell lscpu --parse=CPU | grep -Evc '^#') # The following should be overwritten in a recursive call to Make. SIZE = letter +# The document builds properly only with pdflatex. +LATEX = pdflatex + # I've had some trouble using sh as the shell. bash seems to work, though. SHELL = /bin/bash ########################################################################### # Build all specified formats in all specified paper sizes. -all: check_version $(TARGETS_DIST) - -.PHONY: all symbols check_version nonlatex dist clean mostlyclean +all: check_version $(TARGETS) ########################################################################### -# Define generic rules for building pdf/dvi/ps in letter/a4 size. -symbols: $(COMMONDEPS) +# Define a generic rule for building the document for either U.S. Letter +# or A4 paper. +symbols symbols-$(SIZE)-full.ind &: $(COMMONDEPS) + # Remove old index files to speed up the first two passes. + # (Technically, only the .ind file needs to be removed.) + $(RM) symbols-$(SIZE).ind symbols-$(SIZE).idx symbols-$(SIZE).ilg symbols-$(SIZE)-full.ind symbols-$(SIZE)-full.idx # Pass 1: Produce an initial build of the document. $(LATEX) -jobname symbols-$(SIZE) '\PassOptionsToClass{$(SIZE)paper}{article}\input symbols' - # Pass 2a: Build a second time to produce a final page layout (one hopes). + # Pass 2: Perform multiple partial and one full build to generate + # a title page. + ./patch-idx symbols-$(SIZE).idx + ./maketitlepage symbols-$(SIZE).idx $(SIZE) + # Pass 3: Build again to produce a final page layout. $(LATEX) -jobname symbols-$(SIZE) '\PassOptionsToClass{$(SIZE)paper}{article}\input symbols' - # Pass 2b: Create an index based on the current layout. We do some - # preprocessing of the .idx file to improve the sorting order. - perl -ne 's/\{(\d+)\}=/sprintf " {%03d}=", $$1/ge; s/\(\\(\S+)\s*\)/\(\\$$1\)/; print' < symbols-$(SIZE).idx > symbols-$(SIZE).tmp - mv symbols-$(SIZE).tmp symbols-$(SIZE).idx + # Create an index based on the current layout. We do some + # postprocessing of the .idx file to improve usability. However, + # we back up the pre-pruned list so we later can get an accurate + # symbol count. + ./patch-idx symbols-$(SIZE).idx + makeindex -s symbols.ist symbols-$(SIZE) + cp symbols-$(SIZE).ind symbols-$(SIZE)-full.ind + ./prune-idx symbols-$(SIZE).idx $(PRUNETOML) makeindex -s symbols.ist symbols-$(SIZE) - # Pass 3a: Build the document with the newly generated index. + # Pass 4: Build the document with the newly generated index. + # Afterward, the table of contents and PDF bookmarks files should + # point to the correct index pages, but these are not yet + # incorporated into the document. $(LATEX) -jobname symbols-$(SIZE) '\PassOptionsToClass{$(SIZE)paper}{article}\input symbols' - # Pass 3b: Get a final symbol count, and put it in the .aux file. - # Also, patch the hyperlink bookmarks since we can't do that from - # within the document. - totalsymbols=`fgrep -c '\item \verb' symbols-$(SIZE).ind` ; \ + # Get a final symbol count, and put it in the .aux file. + totalsymbols=`grep -E -c '\\\\item \\\\(sp)?verb' symbols-$(SIZE)-full.ind` ; \ ( fgrep -v prevtotalsymbols symbols-$(SIZE).aux > symbols-$(SIZE).pts ; \ echo "\\gdef\\prevtotalsymbols{$$totalsymbols}" ; \ echo "\\gdef\\approxcount{}" ) >> symbols-$(SIZE).pts ; \ mv symbols-$(SIZE).pts symbols-$(SIZE).aux - if [ -e symbols-$(SIZE).out ] ; then \ - cat symbols-$(SIZE).out | \ - perl -ne 's/\[[^\]]*\](?=\w)//g; print' > symbols-$(SIZE).tmp ; \ - mv symbols-$(SIZE).tmp symbols-$(SIZE).out ; \ - fi - # Pass 4: Build the final document using the final symbol count + # Pass 5: Build the final document using the final symbol count # and with the table of contents and PDF bookmarks correctly - # reflecting the index pages. We don't use our custom latex - # format here because it interferes with cmap.sty. - $(LATEX) -jobname symbols-$(SIZE) '\PassOptionsToClass{$(SIZE)paper}{article}\input symbols' + # reflecting the index pages. + $(LATEX) -jobname symbols-$(SIZE) '\PassOptionsToClass{$(SIZE)paper}{article}\def\titlefile{title-$(SIZE)}\input symbols' -@(grep --color -E "^.*multiply.defined.*" symbols-$(SIZE).log ; true) -@(grep --color -E "^.*undefined.*" symbols-$(SIZE).log | grep -v U/stmry/b/n ; true) +# Define a single-pass version of the above to reduce build time during +# development work. +fast-symbols: $(COMMONDEPS) + $(LATEX) -jobname symbols-$(SIZE) '\PassOptionsToClass{$(SIZE)paper}{article}\input symbols' + check_version: symbols.tex comment_ver=$$(perl -ne '/^\%\%\%\s+version\s+=\s+\"(\S+)\"/ && print "$$1\n"' symbols.tex) \ pdf_ver=$$(perl -ne '/pdfversionid\s*=\s*\{(\S+)\}/ && print "$$1\n"' symbols.tex) ; \ @@ -105,32 +146,38 @@ check_version: symbols.tex ########################################################################### # Define specific rules for building with different pages sizes. -symbols-a4.pdf symbols-a4.log symbols-a4.ind: $(COMMONDEPS) - $(MAKE) $(MAKEFLAGS) SIZE=a4 LATEX=pdflatex symbols - -symbols-letter.pdf symbols-letter.log symbols-letter.ind: $(COMMONDEPS) - $(MAKE) $(MAKEFLAGS) SIZE=letter LATEX=pdflatex symbols +symbols-a4.pdf symbols-a4.log &: $(COMMONDEPS) + if [ -z "$(FAST)" ] ; then \ + $(MAKE) $(MAKEFLAGS) SIZE=a4 symbols ; \ + else \ + $(MAKE) $(MAKEFLAGS) SIZE=a4 fast-symbols ; \ + fi +symbols-letter.pdf symbols-letter.log &: $(COMMONDEPS) + if [ -z "$(FAST)" ] ; then \ + $(MAKE) $(MAKEFLAGS) SIZE=letter symbols ; \ + else \ + $(MAKE) $(MAKEFLAGS) SIZE=letter fast-symbols ; \ + fi -rawtables-letter.tex rawtables.list testfont.pdf testfont.log: makerawtables $(COMMONDEPS) - perl makerawtables --paper=letter +rawtables-letter.tex rawtables-letter.list testfont-letter.pdf testfont-letter.log &: makerawtables $(COMMONDEPS) + ./makerawtables --paper=letter rawtables-letter.pdf: rawtables-letter.tex pdftex rawtables-letter.tex -rawtables-a4.tex rawtables.list testfont.pdf testfont.log: makerawtables $(COMMONDEPS) - perl makerawtables --paper=a4 +rawtables-a4.tex rawtables-a4.list testfont-a4.pdf testfont-a4.log &: makerawtables $(COMMONDEPS) + ./makerawtables --paper=a4 rawtables-a4.pdf: rawtables-a4.tex pdftex rawtables-a4.tex ########################################################################### -# Define rules to produce a lightbulb proof figure. -mfplain.mem: - mpost -ini '\input mfplain; dump' +lightbulb.pdf: lightbulb.eps + ps2pdf -dEPSCrop lightbulb.eps -lightbulb.eps: lightbulb10.mf lightbulb.mf mfplain.mem +lightbulb.eps: lightbulb10.mf lightbulb.mf mpost -mem=mfplain '\mode:=proof; prologues:=2; labelfont cmr17; input lightbulb10' mv lightbulb10.65 lightbulb.eps @@ -184,13 +231,17 @@ fakeboisik.sty: makefakeboisik # characters as graphical images. This enables the font to work in # any TeX engine and without any helper .tfm or .enc files. junicode: unicode2eps.pe - test -e junicode || mkdir junicode - if [ "`kpsewhich Junicode.ttf`" ] ; then \ - cd junicode ; \ - $(FONTFORGE) -script ../unicode2eps.pe `kpsewhich Junicode.ttf` 0x2123 0x211F ; \ - ls *.eps | xargs -P$(PARXARGS) -t -i epstopdf '{}' ; \ - true ; \ - fi + for jfont in Junicode-Regular.otf Junicode-Regular.ttf Junicode.otf Junicode.ttf JunicodeTwoBeta-Regular.otf ; do \ + if [ "`kpsewhich $$jfont`" ] ; then \ + jfont_full=$$(readlink -f $$(kpsewhich $$jfont)) ; \ + test -e junicode || mkdir junicode ; \ + cd junicode ; \ + $(FONTFORGE) -script ../unicode2eps.pe `kpsewhich $$jfont_full` 0x2123 0x211F ; \ + ls *.eps | xargs -P$(PARXARGS) -t -i epstopdf '{}' ; \ + true ; \ + break ; \ + fi ; \ + done # If we have knitting.sty, generate a truncated version that excludes # some catcode trickery which breaks mylatex.ltx. @@ -252,12 +303,121 @@ lilyglyphs: extract-by-name.pe fi # If we have worldflags.sty, generate a faked version that does not -# declare any new math alphabets. +# declare any short-named global symbols and that renders much faster. fakeworldflags.sty: makefakeworldflags if [ "`kpsewhich worldflags.sty`" ] ; then \ ./makefakeworldflags ; \ else \ - touch fakeworldflags.sty worldflag_GY.tex ; \ + touch fakeworldflags.sty ; \ + fi + +# If we have academicons.sty, generate a faked version that works +# with pdfLaTeX. +FAKEACADEMICONS_GEN = \ + fakeacademicons.sty \ + fakeacademicons.enc \ + fakeacademicons.tfm +$(FAKEACADEMICONS_GEN) &: makefakelualatex + if [ "`kpsewhich academicons.sty`" ] ; then \ + ./makefakelualatex academicons academicons.ttf ; \ + else \ + touch fakeacademicons.sty ; \ + fi + +# If we have typicons.sty, generate a faked version that works +# with pdfLaTeX. +FAKETYPICONS_GEN = \ + faketypicons.sty \ + faketypiconsA.enc \ + faketypiconsA.tfm \ + faketypiconsB.enc \ + faketypiconsB.tfm +$(FAKETYPICONS_GEN) &: makefakelualatex + if [ "`kpsewhich typicons.sty`" ] ; then \ + ./makefakelualatex typicons typicons.ttf ; \ + else \ + touch faketypicons.sty ; \ + fi + +# If we have asapsym.sty, generate a faked version that works with +# pdfLaTeX. +FAKEASAPSYM_GEN = \ + Asap-Symbol.pfb \ + fakeasapsym.sty \ + fakeasapsym.enc \ + fakeasapsym.tfm +$(FAKEASAPSYM_GEN) &: makefakeasapsym + if [ "`kpsewhich asapsym.sty`" ] ; then \ + ./makefakeasapsym ; \ + else \ + touch fakeasapsym.sty ; \ + fi + +# If we have fontmfizz.sty, generate a faked version that works +# with pdfLaTeX. +FAKEFONTMFIZZ_GEN = \ + fakefontmfizz.sty \ + fakefontmfizz.enc \ + fakefontmfizz.tfm +$(FAKEFONTMFIZZ_GEN) &: makefakelualatex + if [ "`kpsewhich fontmfizz.sty`" ] ; then \ + ./makefakelualatex fontmfizz font-mfizz.ttf ; \ + else \ + touch fakefontmfizz.sty ; \ + fi + +# If we have hamnosys.sty, generate a faked version that works +# with pdfLaTeX. +FAKEHAMNOSYS_GEN = \ + fakehamnosys.sty \ + fakehamnosys.enc \ + fakehamnosys.tfm +$(FAKEHAMNOSYS_GEN) &: makefakelualatex + if [ "`kpsewhich hamnosys.sty`" ] ; then \ + ./makefakelualatex --regexp='\\DeclareTextCommand\{\\(?P<sym>ham\w+)\}.*?\\char\s*\"(?P<hex>[0-9A-F]+)' hamnosys HamNoSysUnicode.ttf ; \ + else \ + touch fakehamnosys.sty ; \ + fi + +# If we have figchild.sty, generate a faked version that requires fewer TeX +# resources. +fakefigchild.sty: makefakefigchild + if [ "`kpsewhich figchild.sty`" ] ; then \ + ./makefakefigchild ; \ + else \ + touch fakefigchild.sty ; \ + fi + +# If we have utfsym.sty, generate a faked version that renders faster. +fakeutfsym.sty: makefakeutfsym + if [ "`kpsewhich utfsym.sty`" ] ; then \ + ./makefakeutfsym ; \ + else \ + touch fakeutfsym.sty ; \ + fi + +# If we have logix.sty, generate a faked version that works with pdfLaTeX. +FAKELOGIX_GEN = \ + Logix.pfb \ + fakelogix.sty \ + fakelogixA.enc \ + fakelogixA.tfm \ + fakelogixB.enc \ + fakelogixB.tfm \ + fakelogixC.enc \ + fakelogixC.tfm \ + fakelogixD.enc \ + fakelogixD.tfm \ + fakelogixE.enc \ + fakelogixE.tfm +$(FAKELOGIX_GEN) &: makefakelualatex + if [ "`kpsewhich logix.sty`" ] ; then \ + ./makefakelualatex \ + --regexp='\\newcommand\s*\\(?P<sym>[A-Z]\w+)\s*\{\\lg[lrmx]\{(?P<hex>[0-9A-F]+)\}' \ + --regexp='\\defineDelimiter\s*\{(?P<sym>[A-Z]\w+)\}\s*\{(?P<hex>[0-9A-F]+)\} ; Big ; 0x2' \ + logix logix.otf ; \ + else \ + touch fakelogix.sty ; \ fi # Generate a FontForge script that extracts all symbols from a font @@ -285,18 +445,17 @@ nonlatex: ########################################################################### -# The index is needed to produce a list of symbols. We arbitrarily -# use the symbols-letter.ind version of the index. -symbols.ind: symbols-letter.ind - cp symbols-letter.ind symbols.ind +# Create a list of all symbols. We arbitrarily choose the index from the +# U.S. Letter-sized document to count symbols. +SYMLIST: symbols-letter-full.ind + cat symbols-letter-full.ind | \ + perl -ne 's/.*\\(?:sp)?verb\+([^+]+)\+.*/$$1/g && print' | \ + sort -u > SYMLIST -# Create a list of all symbols. -SYMLIST: symbols.ind - cat symbols.ind | perl -ne 's/.*\\verb\+([^+]+)\+.*/$$1/g && print' | sort -u > SYMLIST - -# Create a README file. -README: makeREADME symbols-letter.log symbols.ind - ./makeREADME symbols-letter.log symbols.ind > README +# Create a README file. We arbitrarily choose the index from the +# U.S. Letter-sized document to count symbols. +README: makeREADME symbols-letter.log symbols-letter-full.ind + ./makeREADME symbols-letter.log symbols-letter-full.ind > README # Prepare to timestamp the distributed symbols.tex file. TODAY = $(shell date +'%d %B %Y') @@ -307,16 +466,17 @@ comprehensive.tar.gz: check_version $(TARGETS) $(EXTRADIST) $(RM) -r comprehensive mkdir comprehensive mkdir comprehensive/source - install -m 664 $(TARGETS_DIST) comprehensive - install -m 664 $(TARGETS_SOURCE) $(EXTRADIST) comprehensive/source + install -m 664 $(TARGETS) comprehensive + install -m 664 $(EXTRADIST) comprehensive/source cat symbols.tex | \ perl -ne 's/(date\s*=\s*)\"[^\"]*\"/$$1\"$(TODAY)\"/; print' | \ perl -ne 's/(time\s*=\s*)\"[^\"]*\"/$$1\"$(NOW)\"/; print' | \ checksum > comprehensive/source/symbols.tex - for fakes in MnSymbol fdsymbol boisik stix starfont cmupint ; do \ - chmod 755 comprehensive/source/makefake$$fakes ; \ + for script in comprehensive/source/make* ; do \ + chmod 755 "$$script" ; \ done - chmod 755 comprehensive/source/makerawtables + chmod 755 comprehensive/source/patch-idx + chmod 755 comprehensive/source/prune-idx chmod 664 comprehensive/source/symbols.tex tar -czf comprehensive.tar.gz comprehensive $(RM) -r comprehensive @@ -324,22 +484,40 @@ comprehensive.tar.gz: check_version $(TARGETS) $(EXTRADIST) dist: comprehensive.tar.gz # Clean up our mess. -clean: +clean: mostlyclean $(RM) -r comprehensive $(RM) $(TARGETS) - $(RM) symbols*.{aux,dep,dvi,fmt,idx,ilg,inc,ind,log,out,pdf,pts,toc} $(RM) $(NONLATEX) for fname in $(NONLATEX) ; do \ $(RM) `basename $$fname .mf`.*pk ; \ $(RM) `basename $$fname .mf`.tfm ; \ done $(RM) comprehensive.tar.gz - $(RM) -r junicode lilyglyphs + $(RM) -r junicode lilyglyphs figchild utfsym $(RM) fakeMnSymbol.sty fakefdsymbol.sty fakeknitting.sty $(RM) fakeboisik.sty fakestix.sty fakestarfont.sty fakecmupint.sty - $(RM) fakeworldflags.sty worldflag_GY.tex + $(RM) fakeworldflags.sty fakefigchild.sty fakeutfsym.sty + $(RM) $(FAKEACADEMICONS_GEN) + $(RM) $(FAKETYPICONS_GEN) + $(RM) $(FAKEASAPSYM_GEN) + $(RM) $(FAKEFONTMFIZZ_GEN) + $(RM) $(FAKEHAMNOSYS_GEN) + $(RM) $(FAKELOGIX_GEN) $(RM) versatim.tex extract-by-name.pe - $(RM) mfplain.{log,mem} - $(RM) lightbulb10*pk lightbulb10.{tfm,log,pe,afm} - $(RM) lightbulb-eps-converted-to.pdf - $(RM) rawtables-*.{log,tex,pdf} rawtables.list testfont.{log,pdf} + $(RM) mfplain.log + $(RM) lightbulb10.*pk lightbulb10.{afm,log,pe,pfb,tfm} + $(RM) lightbulb.{eps,map,pdf} + $(RM) title-letter.tex title-a4.tex + +# Remove just the document itself and intermediate files used in the +# creation of faked packages. +mostlyclean: + $(RM) symbols-letter-full.ind symbols-a4-full.ind + $(RM) symbols*.{aux,dep,dvi,fmt,idx,ilg,inc,ind,log,out,pdf,pts,toc} + $(RM) rawtables-*.{log,tex,pdf} rawtables-letter.list rawtables-a4.list + $(RM) testfont-letter.{log,pdf} testfont-a4.{log,pdf} + for dir in worldflags utfsym figchild ; do \ + $(RM) $$dir/*.log $$dir/*.aux $$dir/*.tex $$dir/mylatex.fmt ; \ + done + +.PHONY: all symbols fast-symbols check_version nonlatex dist clean mostlyclean |