I've some questions about the Image Database. I found no answers in the xfigure.pdf. Can I generate the xml file automaticly? I can use xmltools --dir --pattern=/home/tralal/*.jpg --output=tralala.xml but then in the xml file doesn't stad figure, there is file. so this doesn't work I think. Must everything be in the same folder? the xmlfile, the images and my document I'm writing? Or can I specify a directory in the xmlfile? So that the images can be on an other folder than the xmlfile? Must the xmlfile be in the same directory than my document?
Jessica Holle wrote:
I've some questions about the Image Database. I found no answers in the xfigure.pdf.
Can I generate the xml file automaticly? I can use xmltools --dir --pattern=/home/tralal/*.jpg --output=tralala.xml but then in the xml file doesn't stad figure, there is file. so this doesn't work I think.
Must everything be in the same folder? the xmlfile, the images and my document I'm writing? Or can I specify a directory in the xmlfile? So that the images can be on an other folder than the xmlfile? Normally I prepare a directory with the figures. The xml-file is then generated and compiled. The resulting figure-databse I transfer then to
Humble, I do not know what xmltools all can do. I use a perl-sript to generate the xml-file. - Please have a look into the attached file make-xml.pl the directory where the tex files reside.
Must the xmlfile be in the same directory than my document?
I hope this will help you. Kind regards Willi
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
#!/usr/bin/perl
## Prepare an XML-file for the preparation of a figure-database with TeX
## XML-file header information:
$Librarylanguage = "en";
$Organization = "Willi";
$Project = "Restauratie";
$Product = "Restauratie-cursus ";
$Comment = "Figure database";
$CopyRight = "WE" ;
## Variables
$Filename = "";
$FileextensionA = "pdf";
$FileextensionB = "png";
#~ $FileextensionC = "1";
$Filedate = "";
$Filetimestamp ;
$Filesize= "";
$Globstring = "*." . $FileextensionA;
$Outfile = ">Figure-lib.xml";
## Date
($Second, $Minute, $Hour, $DayOfMonth, $Month, $Year, $WeekDay, $DayOfYear, $IsDST) = localtime(time);
$RealMonth = $Month +1 ;
$RealYear = $Year + 1900 ;
printf ('%02d.%02d.%04d', $DayOfMonth,$RealMonth,$RealYear);
print "\n";
## Open the XML-file for writing:
open(OUTFILE, $Outfile);
## Print XML-file header:
Header();
## Collect Figure files into an list:
@Files = glob($Globstring);
$Globstring = "*." . $FileextensionB;
@MoreFiles = glob($Globstring);
push(@Files, @MoreFiles);
#~ $Globstring = "*." . $FileextensionC;
#~ @MoreFiles = glob($Globstring);
#~ push(@Files, @MoreFiles);
## Work on each filename:
foreach $Filename (@Files) {
#~ $exifinfo = `identify -verbose -format "%[EXIF:*]" $Filename`;
#~ chomp($exifinfo);
#~ if(length($exifinfo) < 2){
#~ $Filetimestamp = (-C $Filename) ;
#~ $Filedatestamp = time - $Filetimestamp ;
#~ ($Second, $Minute, $Hour, $DayOfMonth, $Month, $Year, $WeekDay, $DayOfYear, $IsDST) = localtime($Filedatestamp);
#~ $RealMonth = $Month +1 ;
#~ $RealYear = $Year + 1900 ;
#~ $FileDate = $DayOfMonth . "." . $RealMonth . "." . $RealYear ;
#~ }
#~ else {
#~ @exiflines = split(/\n/,$exifinfo);
#~ foreach $exifline (@exiflines){
#~ ($exifHeader,$exifData) = split(/=/,$exifline,2);
#~ if($exifHeader eq "DateTimeOriginal"){
#~ $FileDate = substr($exifData,8,2) . "." . substr($exifData,5,2) . "." . substr($exifData,0,4);
#~ }
#~ }
#~ }
$Filesize = (-s $Filename) ;
if ($Filesize > 1024){
$Filesize = int($Filesize / 1024) . "k";
}
## Determine first part of filename -> label in figure library
($Label,$Suffix) = split (/\./,$Filename) ;
## Print the XMLblock for the actual figurefile:
Printfigureblock();
}
print OUTFILE "</figurelibrary>";
close(OUTFILE);
## End of main programme.
sub Header{
print OUTFILE "<!-- Figurelibrary: $Outfile -->\n" ;
print OUTFILE "<!-- Date of generation:" ;
printf OUTFILE ('%02d.%02d.%04d', $DayOfMonth,$RealMonth,$RealYear) ;
print OUTFILE "-->\n" ;
print OUTFILE "<!-- Figurelibrary generated automatically by PERL -->\n" ;
print OUTFILE "<!-- Script by W. Egger, 27.04.2003 -->\n" ;
print OUTFILE "\n" ;
print OUTFILE "\n" ;
print OUTFILE "\n" ;
print OUTFILE "
Willi Egger wrote:
Jessica Holle wrote:
I've some questions about the Image Database. I found no answers in the xfigure.pdf.
Can I generate the xml file automaticly? I can use xmltools --dir --pattern=/home/tralal/*.jpg --output=tralala.xml but then in the xml file doesn't stad figure, there is file. so this doesn't work I think.
Humble, I do not know what xmltools all can do. I use a perl-sript to generate the xml-file. - Please have a look into the attached file make-xml.pl
if you install cont-exa.zip, you can say: rslibtool --add *.pdf (other options are --delete --sort etc; undocumented)
Must everything be in the same folder? the xmlfile, the images and my document I'm writing? Or can I specify a directory in the xmlfile? So that the images can be on an other folder than the xmlfile?
Normally I prepare a directory with the figures. The xml-file is then generated and compiled. The resulting figure-databse I transfer then to the directory where the tex files reside.
should be possible
Must the xmlfile be in the same directory than my document?
no, you can define paths with \usepath[...] \useeubpath[...] \setupexternalfigures[directory=...] support for figure databases will move to rlxtools; although not yet documented, context supports on the fly conversions with caching (so that it only happens when needed) based on resource logs more about that later Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Jessica Holle
-
Willi Egger