This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
PDF doc patch
- From: Iztok Zupet <iz at vsr dot si>
- To: ecos-patches at sources dot redhat dot com
- Cc: Jonathan Larmour <jifl at eCosCentric dot com>
- Date: Tue, 15 Apr 2003 17:30:26 +0200
- Subject: PDF doc patch
- Organization: VSR d.o.o.
- Reply-to: iz at vsr dot si
Hello:
This patch is just a good starting point if anybody else would play around
with PDF-s, or just a temporary solution, so don't commit.
Although the patch solves the problem of incorporating vector graphics (.fig)
into PDF and HTML target it has three flaws:
1.) It uses the hack "format="eps" for pdf or png files, which by the way
seems to be very common around for PDF targets.
2.) It uses "scale=XX" instead of "Width=X Scalefit=1" to resize the figures,
simply because pdfjadetex doesn't seem to do anything with the later.
3.) the copyfigures in the rules.doc doesn't update dependencies for copied
figures after copying, so the "make pdf" has to be run twice in the doc/sgml
directory
The still required manually converted png screenshots accompanying this patch
are on <http://www.ecos2.vsr.si/download/png20b1/>
Jifl,
I promised to You that I'll make a consistent patch a fourthnight ago. This
patch is consistent with the current doc layout and build, but has the three
flaws. Sorry, it's hard for me to find more time now then I did for playing
around with jade/pdfjadetex combo.
Regards
iz
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/doc/sgml/makemakefile ./doc/sgml/makemakefile
*** /ecoscvs/orig/ecos/doc/sgml/makemakefile 2003-04-12 18:37:19.000000000 +0200
--- ./doc/sgml/makemakefile 2003-04-12 21:35:59.000000000 +0200
***************
*** 93,104 ****
--- 93,126 ----
fi
done
+ # Go through again but find PNGs to copy
+ for i in `for j in \`cat ${doclist}\` ; do dirname $j ; done | sort | uniq` ; do
+ diri=`echo ${toplvl}/packages/$i | sed "s@/current/@/${PACKAGEVER}/@g"`
+ diripngs=`ls $diri/*.png 2>/dev/null | tr '\n' ' '`
+ if [ x"$diripngs" != x ]; then
+ copypngs="$copypngs $diripngs"
+ fi
+ done
+
+ # Go through again but find FIGs to copy
+ for i in `for j in \`cat ${doclist}\` ; do dirname $j ; done | sort | uniq` ; do
+ diri=`echo ${toplvl}/packages/$i | sed "s@/current/@/${PACKAGEVER}/@g"`
+ dirifigs=`ls $diri/*.fig 2>/dev/null | tr '\n' ' '`
+ if [ x"$dirifigs" != x ]; then
+ copyfigs="$copyfigs $dirifigs"
+ fi
+ done
+
+
cat >> makefile <<EOF
MAIN_HTML := ecos-ref.html
MAIN_PDF := ecos-ref.pdf
PICTURES :=
+ FIGURES := layout overview simple synth-io-overview tcpip
COPYFILES := $copyfiles
+ COPYPNGS := $copypngs
+ COPYFIGS := $copyfigs
include \$(TOPLEVEL)/pkgconf/rules.doc
EOF
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/doc/sgml/README-PDF ./doc/sgml/README-PDF
*** /ecoscvs/orig/ecos/doc/sgml/README-PDF 2002-10-18 03:45:34.000000000 +0200
--- ./doc/sgml/README-PDF 2003-04-12 19:30:42.000000000 +0200
***************
*** 6,11 ****
--- 6,16 ----
then define
save_size.pdfjadetex=10000 (at least) in
/usr/share/texmf/web2c/texmf.cnf instead of 5000.
+ Else if it complains with
+ >! TeX capacity exceeded, sorry [number of strings=40558].
+ then define
+ max_strings.pdfjadetex = 155000 in
+ /usr/share/texmf/web2c/texmf.cnf instead of 55000.
If You don't get coloured links in Your output, or if You
wish to modify the pdfjadetex default behaviour then add
***************
*** 15,21 ****
\hypersetup{pdfpagemode=None, pdfauthor=eCos (pdfjadetex) , colorlinks=true,
linkcolor=blue, pdfstartview=FitH}
! Regaqrds
Iztok
<iz at vsr dot si>
--- 20,26 ----
\hypersetup{pdfpagemode=None, pdfauthor=eCos (pdfjadetex) , colorlinks=true,
linkcolor=blue, pdfstartview=FitH}
! Regards
Iztok
<iz at vsr dot si>
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/host/libcdl/doc/makefile ./host/libcdl/doc/makefile
*** /ecoscvs/orig/ecos/host/libcdl/doc/makefile 2002-05-24 00:59:51.000000000 +0200
--- ./host/libcdl/doc/makefile 2003-04-12 19:03:45.000000000 +0200
***************
*** 38,45 ****
TOPLEVEL := ../../../packages
MAIN_SGML := main.sgml
MAIN_HTML := cdl-guide.html
! MAIN_PDF := main.pdf
OTHER_SGML := concepts.sgml package.sgml language.sgml reference.sgml build.sgml advanced.sgml
! PICTURES := repo version package
include $(TOPLEVEL)/pkgconf/rules.doc
--- 38,45 ----
TOPLEVEL := ../../../packages
MAIN_SGML := main.sgml
MAIN_HTML := cdl-guide.html
! MAIN_PDF := cdl-guide.pdf
OTHER_SGML := concepts.sgml package.sgml language.sgml reference.sgml build.sgml advanced.sgml
! FIGURES := repo version package
include $(TOPLEVEL)/pkgconf/rules.doc
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/host/libcdl/doc/package.sgml ./host/libcdl/doc/package.sgml
*** /ecoscvs/orig/ecos/host/libcdl/doc/package.sgml 2002-09-16 00:09:08.000000000 +0200
--- ./host/libcdl/doc/package.sgml 2003-04-15 15:32:43.000000000 +0200
***************
*** 78,84 ****
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="repo.eps" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="repo.gif" format="gif" Align="Center">
--- 78,84 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="repo.pdf" format="eps" scale=90 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="repo.gif" format="gif" Align="Center">
***************
*** 175,181 ****
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="version.eps" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="version.gif" format="gif" Align="Center">
--- 175,181 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="version.pdf" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="version.gif" format="gif" Align="Center">
***************
*** 394,400 ****
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="package.eps" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="package.gif" format="gif" Align="Center">
--- 394,400 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="package.pdf" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="package.gif" format="gif" Align="Center">
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/devs/eth/synth/ecosynth/current/doc/makefile ./packages/devs/eth/synth/ecosynth/current/doc/makefile
*** /ecoscvs/orig/ecos/packages/devs/eth/synth/ecosynth/current/doc/makefile 2002-09-15 19:48:57.000000000 +0200
--- ./packages/devs/eth/synth/ecosynth/current/doc/makefile 2003-04-12 19:45:04.000000000 +0200
***************
*** 30,34 ****
--- 30,35 ----
MAIN_PDF := devs-eth-synth.pdf
OTHER_SGML :=
PICTURES :=
+ FIGURES := overview
include $(TOPLEVEL)/pkgconf/rules.doc
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml ./packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml
*** /ecoscvs/orig/ecos/packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml 2003-02-25 17:46:23.000000000 +0100
--- ./packages/devs/eth/synth/ecosynth/current/doc/syntheth.sgml 2003-04-15 16:04:32.000000000 +0200
***************
*** 74,79 ****
--- 74,82 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="overview.pdf" format="eps" scale=75 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="overview.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
Binary files /ecoscvs/orig/ecos/packages/devs/watchdog/synth/current/doc/asleep.png and ./packages/devs/watchdog/synth/current/doc/asleep.png differ
Binary files /ecoscvs/orig/ecos/packages/devs/watchdog/synth/current/doc/awake.png and ./packages/devs/watchdog/synth/current/doc/awake.png differ
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml ./packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml
*** /ecoscvs/orig/ecos/packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml 2003-02-25 17:46:07.000000000 +0100
--- ./packages/devs/watchdog/synth/current/doc/synth_watchdog.sgml 2003-04-12 20:54:12.000000000 +0200
***************
*** 240,245 ****
--- 240,248 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="asleep.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="asleep.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 251,256 ****
--- 254,262 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="awake.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="awake.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
Binary files /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/filters.png and ./packages/hal/synth/arch/current/doc/filters.png differ
Binary files /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/menu_edit.png and ./packages/hal/synth/arch/current/doc/menu_edit.png differ
Binary files /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/menu_file.png and ./packages/hal/synth/arch/current/doc/menu_file.png differ
Binary files /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/menu_help.png and ./packages/hal/synth/arch/current/doc/menu_help.png differ
Binary files /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/menu_view.png and ./packages/hal/synth/arch/current/doc/menu_view.png differ
Binary files /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/preferences.png and ./packages/hal/synth/arch/current/doc/preferences.png differ
Binary files /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/screen_main.png and ./packages/hal/synth/arch/current/doc/screen_main.png differ
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/synth.sgml ./packages/hal/synth/arch/current/doc/synth.sgml
*** /ecoscvs/orig/ecos/packages/hal/synth/arch/current/doc/synth.sgml 2003-02-24 15:23:04.000000000 +0100
--- ./packages/hal/synth/arch/current/doc/synth.sgml 2003-04-15 16:00:34.000000000 +0200
***************
*** 135,140 ****
--- 135,143 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="synth-io-overview.pdf" format="eps" scale=80 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="synth-io-overview.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 850,855 ****
--- 853,861 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="screen_main.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="screen_main.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 883,888 ****
--- 889,897 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="menu_file.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="menu_file.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 936,941 ****
--- 945,953 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="menu_edit.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="menu_edit.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 964,969 ****
--- 976,984 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="preferences.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="preferences.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 976,981 ****
--- 991,999 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="menu_view.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="menu_view.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 989,994 ****
--- 1007,1015 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="menu_help.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="menu_help.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 1045,1050 ****
--- 1066,1074 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="filters.png" format="eps" Scalefit=1 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="filters.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 1080,1085 ****
--- 1104,1112 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="layout.pdf" format="eps" scale=78 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="layout.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
***************
*** 2501,2506 ****
--- 2528,2536 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
+ <imagedata fileref="layout.pdf" format="eps" scale=78 Align="Center">
+ </imageobject>
+ <imageobject>
<imagedata fileref="layout.gif" format="gif" Scalefit=1 Align="Center">
</imageobject>
</mediaobject>
Binary files /ecoscvs/orig/ecos/packages/io/usb/eth/slave/current/doc/simple.pdf and ./packages/io/usb/eth/slave/current/doc/simple.pdf differ
Binary files /ecoscvs/orig/ecos/packages/io/usb/eth/slave/current/doc/tcpip.pdf and ./packages/io/usb/eth/slave/current/doc/tcpip.pdf differ
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/io/usb/eth/slave/current/doc/usbseth.sgml ./packages/io/usb/eth/slave/current/doc/usbseth.sgml
*** /ecoscvs/orig/ecos/packages/io/usb/eth/slave/current/doc/usbseth.sgml 2003-02-25 17:47:38.000000000 +0100
--- ./packages/io/usb/eth/slave/current/doc/usbseth.sgml 2003-04-12 21:17:33.000000000 +0200
***************
*** 106,112 ****
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="simple.eps" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="simple.gif" format="gif" Align="Center">
--- 106,112 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="simple.pdf" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="simple.gif" format="gif" Align="Center">
***************
*** 134,140 ****
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="tcpip.eps" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="tcpip.gif" format="gif" Align="Center">
--- 134,140 ----
<informalfigure PgWide=1>
<mediaobject>
<imageobject>
! <imagedata fileref="tcpip.pdf" format="eps" Scalefit=1 Align="Center">
</imageobject>
<imageobject>
<imagedata fileref="tcpip.gif" format="gif" Align="Center">
diff -C3 -N -P -r -x '.*' /ecoscvs/orig/ecos/packages/pkgconf/rules.doc ./packages/pkgconf/rules.doc
*** /ecoscvs/orig/ecos/packages/pkgconf/rules.doc 2003-02-24 15:05:02.000000000 +0100
--- ./packages/pkgconf/rules.doc 2003-04-15 14:57:42.000000000 +0200
***************
*** 53,59 ****
#####DESCRIPTIONEND####
#=============================================================================
! .PHONY: default check html pdf clean copyfiles
# Locations of the stylesheets and other SGML support files. These
# have moved around in various releases of the tools.
--- 53,59 ----
#####DESCRIPTIONEND####
#=============================================================================
! .PHONY: default check html pdf clean copyfiles copyfigures
# Locations of the stylesheets and other SGML support files. These
# have moved around in various releases of the tools.
***************
*** 88,104 ****
MAIN_PDF := $(subst .sgml,.pdf,$(MAIN_SGML))
endif
# Rules for generating pictures
GIFS := $(foreach x,$(PICTURES),$(x).gif)
EPS := $(foreach x,$(PICTURES),$(x).eps)
! PNGS :=$(foreach x,$(PICTURES),$(x).png)
%.gif: %.fig
! convert -crop 0x0 $< $@
%.eps: %.fig
convert -crop 0x0 $< $@
# This is a little grotty. In some cases we want to just copy files from
# their source location to the destination's current dir and nothing
# more.
--- 88,112 ----
MAIN_PDF := $(subst .sgml,.pdf,$(MAIN_SGML))
endif
+
# Rules for generating pictures
GIFS := $(foreach x,$(PICTURES),$(x).gif)
+ FGIFS:= $(foreach x,$(FIGURES),$(x).gif)
EPS := $(foreach x,$(PICTURES),$(x).eps)
! PNGS := $(foreach x,$(PICTURES),$(x).png)
! PDFS := $(foreach x,$(FIGURES),$(x).pdf)
!
%.gif: %.fig
! fig2dev -L gif $< >$@
%.eps: %.fig
convert -crop 0x0 $< $@
+ %.pdf: %.fig
+ fig2dev -L pdf $< >$@
+
+
# This is a little grotty. In some cases we want to just copy files from
# their source location to the destination's current dir and nothing
# more.
***************
*** 107,112 ****
--- 115,132 ----
cp $(COPYFILES) .
endif
+ copyfigs:
+ ifneq (,$(COPYFIGS))
+ cp $(COPYFIGS) .
+ endif
+
+ copypngs:
+ ifneq (,$(COPYPNGS))
+ cp $(COPYPNGS) .
+ endif
+
+ copyfigures: copyfigs copypngs
+
default: check
# Validating an sgml document can be achieved with
***************
*** 118,131 ****
# can be ignored.
html: copyfiles $(MAIN_HTML)
! $(MAIN_HTML): $(MAIN_SGML) $(OTHER_SGML) $(GIFS) $(ECOS_STYLESHEET) $(FIXHTML)
jade -t sgml -i html -c $(DSSSL_CATALOG) -d $(ECOS_STYLESHEET)#html $<
tclsh $(FIXHTML)
# PDF files can be generated in a similar fashion.
! pdf: $(MAIN_PDF)
! $(MAIN_PDF): $(MAIN_SGML) $(OTHER_SGML) $(PNGS) $(ECOS_STYLESHEET)
jade -o $(subst .pdf,.tex,$(MAIN_PDF)) -t tex -V tex-backend -c $(DSSSL_CATALOG) -d $(ECOS_STYLESHEET)#print $<
pdfjadetex $(subst .pdf,.tex,$(MAIN_PDF))
pdfjadetex $(subst .pdf,.tex,$(MAIN_PDF))
--- 138,151 ----
# can be ignored.
html: copyfiles $(MAIN_HTML)
! $(MAIN_HTML): $(MAIN_SGML) $(OTHER_SGML) $(GIFS) $(FGIFS) $(ECOS_STYLESHEET) $(FIXHTML)
jade -t sgml -i html -c $(DSSSL_CATALOG) -d $(ECOS_STYLESHEET)#html $<
tclsh $(FIXHTML)
# PDF files can be generated in a similar fashion.
! pdf: copyfigures $(MAIN_PDF)
! $(MAIN_PDF): $(MAIN_SGML) $(OTHER_SGML) $(PNGS) $(PDFS) $(ECOS_STYLESHEET)
jade -o $(subst .pdf,.tex,$(MAIN_PDF)) -t tex -V tex-backend -c $(DSSSL_CATALOG) -d $(ECOS_STYLESHEET)#print $<
pdfjadetex $(subst .pdf,.tex,$(MAIN_PDF))
pdfjadetex $(subst .pdf,.tex,$(MAIN_PDF))
***************
*** 141,145 ****
# Clean. For now assume that all .html, .gif etc files are generated
clean:
! rm -rf *.html *.tex *.dvi *.aux *.log *.out *.ps *.pdf *.gif *.eps
--- 161,165 ----
# Clean. For now assume that all .html, .gif etc files are generated
clean:
! rm -rf *.html *.tex *.dvi *.aux *.log *.out *.ps *.pdf *.gif *.eps *.png