Difference between revisions of "Image Database"

From Wiki
Jump to navigation Jump to search
m (< -> <)
m
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
< [[Graphics]]
+
ConTeXt's direct XML processing allows a rather mighty management of pictures with an XML database.
 +
You can not only store images in this way, officially this technique is now named "Resource Libraries".
  
ConTeXt's direct XML processing allows a rather mighty management of pictures with an XML database.
+
[http://www.ntg.nl:8061/makeres.pdf Here] you can make such files online. (PDF interface!)
  
'''XML database file'''
+
'''XML database file: MKII'''
  
<pre>
+
<xmlcode>
 
<figurelibrary language="en">
 
<figurelibrary language="en">
 
<description>
 
<description>
Line 11: Line 12:
 
<project>ConTeXt Wiki</project>
 
<project>ConTeXt Wiki</project>
 
<product>prd_pictures</product>
 
<product>prd_pictures</product>
<comment>pictures for \ConTeXt Wiki</comment>
+
<comment>pictures for ConTeXt Wiki</comment>
 
</description>
 
</description>
 
<figure>
 
<figure>
Line 24: Line 25:
 
...
 
...
 
</figurelibrary>
 
</figurelibrary>
 +
</xmlcode>
 +
 +
'''XML database file: MKIV'''
 +
 +
<xmlcode>
 +
<rl:library language="en">
 +
 +
  <rl:description>
 +
      <rl:organization>Organisation</rl:organization>
 +
      <rl:project>ConTeXt Wiki</rl:project>
 +
      <rl:product>product pictures</rl:product>
 +
      <rl:comment>pictures for ConTeXt Wiki</rl:comment>
 +
  </rl:description>
 +
 +
  <rl:resource>
 +
      <rl:file>filename</rl:file>
 +
      <rl:label>reference</rl:label>
 +
      <rl:copyright>owner</rl:copyright>
 +
      <rl:comment>comment</rl:comment>
 +
  </rl:resource>
 +
</rl:library
 +
</xmlcode>
 +
 +
'''Making a PDF list MKII'''
 +
 +
<pre>
 +
texexec --pdf --use=fig-make --mode=compact myfile
 
</pre>
 
</pre>
  
'''Making a PDF list'''
+
'''Making a PDF list MKIV'''
  
 
<pre>
 
<pre>
texexec --pdf --use=fig-make --mode=compact myfile
+
context --input=figure-lib.xml auto:x-res-01.mkiv --result=figure-lib
 
</pre>
 
</pre>
  
Line 41: Line 69:
 
</texcode>
 
</texcode>
  
(is there a dtd or a relax ng schema somewhere out there? --[[User:Patrick Gundlach|pg]])
+
 
 +
 
 +
[[Category:Graphics]]
 +
[[Category:XML]]

Latest revision as of 22:21, 6 June 2020

ConTeXt's direct XML processing allows a rather mighty management of pictures with an XML database. You can not only store images in this way, officially this technique is now named "Resource Libraries".

Here you can make such files online. (PDF interface!)

XML database file: MKII

<figurelibrary language="en">
<description>
	<organization>Pragma ADE</organization>
	<project>ConTeXt Wiki</project>
	<product>prd_pictures</product>
	<comment>pictures for ConTeXt Wiki</comment>
</description>
<figure>
	<file>filename</file>
	<label>reference</label>
	<copyright>owner</copyright>
	<comment>comment</comment>
</figure>
<figure>
...
</figure>
...
</figurelibrary>

XML database file: MKIV

<rl:library language="en">

   <rl:description>
       <rl:organization>Organisation</rl:organization>
       <rl:project>ConTeXt Wiki</rl:project>
       <rl:product>product pictures</rl:product>
       <rl:comment>pictures for ConTeXt Wiki</rl:comment>
   </rl:description>

   <rl:resource>
      <rl:file>filename</rl:file>
      <rl:label>reference</rl:label>
      <rl:copyright>owner</rl:copyright>
      <rl:comment>comment</rl:comment>
   </rl:resource>
</rl:library

Making a PDF list MKII

texexec --pdf --use=fig-make --mode=compact myfile

Making a PDF list MKIV

context --input=figure-lib.xml auto:x-res-01.mkiv --result=figure-lib

Use pictures from database

\usemodule	[fig-base]
\usefigurebase	[myfile]

\externalfigure	[reference] % like in <label>