Difference between revisions of "Using Graphics"

From Wiki
Jump to navigation Jump to search
m (added Combinations link)
m (changed pre to texcode and tt to cmd)
Line 3: Line 3:
 
'''Direct use of <tt>mypic.pdf</tt>'''
 
'''Direct use of <tt>mypic.pdf</tt>'''
  
<pre>
+
<texcode>
 
\externalfigure[mypic]
 
\externalfigure[mypic]
</pre>
+
</texcode>
  
 
Additional parameters:
 
Additional parameters:
<pre>
+
<texcode>
 
\externalfigure[file or reference name][key=value, key=value, ...]
 
\externalfigure[file or reference name][key=value, key=value, ...]
</pre>
+
</texcode>
  
 
* scale            = ''scaling value''
 
* scale            = ''scaling value''
Line 28: Line 28:
  
 
You can define your own image directory with:
 
You can define your own image directory with:
<pre>
+
<texcode>
 
\setupexternalfigures[directory={../pictures}]
 
\setupexternalfigures[directory={../pictures}]
</pre>
+
</texcode>
 
You can define the path relative or absolute, but use always forward slashes!
 
You can define the path relative or absolute, but use always forward slashes!
  
Line 37: Line 37:
 
Declaration of all used pictures in your environment, project or header file is better than direct use of file names in your code.
 
Declaration of all used pictures in your environment, project or header file is better than direct use of file names in your code.
  
<pre>
+
<texcode>
 
\useexternalfigure[reference name][file name][options]
 
\useexternalfigure[reference name][file name][options]
</pre>
+
</texcode>
  
 
Same options as above. You can even inherit them like this:
 
Same options as above. You can even inherit them like this:
  
<pre>
+
<texcode>
 
\useexternalfigure[dummy][nofile][width=\textwidth]
 
\useexternalfigure[dummy][nofile][width=\textwidth]
 
\useexternalfigure[myone][my_pic_one][dummy]
 
\useexternalfigure[myone][my_pic_one][dummy]
Line 49: Line 49:
  
 
Somewhere in your text there's \externalfigure[myone].
 
Somewhere in your text there's \externalfigure[myone].
</pre>
+
</texcode>
  
 
'''Pictures as [[Floating Objects]]'''
 
'''Pictures as [[Floating Objects]]'''
Line 55: Line 55:
 
Floats are numbered and placed by ConTeXt, and they can get a caption.
 
Floats are numbered and placed by ConTeXt, and they can get a caption.
  
<pre>
+
<texcode>
 
\placeexternalfigure[place]{My Caption}{\externalfigure[myone]}
 
\placeexternalfigure[place]{My Caption}{\externalfigure[myone]}
</pre>
+
</texcode>
 
<tt>place</tt> is one of:
 
<tt>place</tt> is one of:
 
left, right, here, top, bottom, inleft, inright, inmargin, margin, page, opposite, always, force, tall
 
left, right, here, top, bottom, inleft, inright, inmargin, margin, page, opposite, always, force, tall
  
You get ''no'' caption with </tt>none</tt>.
+
You get ''no'' caption with <tt>none</tt>.
You get a table of figures with <tt>\showexternalfigures[alternative=a]</tt>. Alternatives (styles) a, b and c are predefined.
+
You get a table of figures with <cmd>showexternalfigures[alternative=a]</cmd>. Alternatives (styles) a, b and c are predefined.
  
The second brackets of <tt>\placeexternalfigure</tt> can keep any command, e.g. <tt>\getbuffer</tt>.
+
The second brackets of <cmd>placeexternalfigure</cmd> can keep any command, e.g. <cmd>getbuffer</cmd>.
  
 
You find more about floats ([[Floating Objects]]) in the manual.
 
You find more about floats ([[Floating Objects]]) in the manual.
Line 71: Line 71:
  
 
Movies aren't recognized automatically yet, you need a more verbose declaration:
 
Movies aren't recognized automatically yet, you need a more verbose declaration:
<pre>
+
<texcode>
 
\externalfigure[demo.mov][label=demo,width=4cm,height=4cm,preview=yes]
 
\externalfigure[demo.mov][label=demo,width=4cm,height=4cm,preview=yes]
</pre>
+
</texcode>
 
<tt>preview=yes</tt> shows the first image as preview.
 
<tt>preview=yes</tt> shows the first image as preview.
 
You find more about interactive Elements in [http://www.pragma-ade.com/general/manuals/mwidget-s.pdf mwidget-s.pdf]
 
You find more about interactive Elements in [http://www.pragma-ade.com/general/manuals/mwidget-s.pdf mwidget-s.pdf]

Revision as of 11:10, 2 September 2004

< Graphics | Combinations >

Direct use of mypic.pdf

\externalfigure[mypic]

Additional parameters:

\externalfigure[file or reference name][key=value, key=value, ...]
  • scale = scaling value
  • factor = max, fit, broad
  • wfactor, hfactor = max, fit, broad, value
  • width, height = dimension
  • frame = on, off
  • preset, preview, repeat, object = yes, no
  • display = file name
  • type, method = eps, mps, pdf, tif, png, jpg, mov, tex

If only one dimension is given, scaling is proportional.

Where ConTeXt finds your picture files

ConTeXt looks in the actual and parent directory plus those given in texmf.cnf.

You can define your own image directory with:

\setupexternalfigures[directory={../pictures}]

You can define the path relative or absolute, but use always forward slashes!

Referenced Pictures

Declaration of all used pictures in your environment, project or header file is better than direct use of file names in your code.

\useexternalfigure[reference name][file name][options]

Same options as above. You can even inherit them like this:

\useexternalfigure[dummy][nofile][width=\textwidth]
\useexternalfigure[myone][my_pic_one][dummy]
\useexternalfigure[mytwo][my_pic_two][dummy]

Somewhere in your text there's \externalfigure[myone].

Pictures as Floating Objects

Floats are numbered and placed by ConTeXt, and they can get a caption.

\placeexternalfigure[place]{My Caption}{\externalfigure[myone]}

place is one of: left, right, here, top, bottom, inleft, inright, inmargin, margin, page, opposite, always, force, tall

You get no caption with none. You get a table of figures with \showexternalfigures[alternative=a]. Alternatives (styles) a, b and c are predefined.

The second brackets of \placeexternalfigure can keep any command, e.g. \getbuffer.

You find more about floats (Floating Objects) in the manual.

Movies

Movies aren't recognized automatically yet, you need a more verbose declaration:

\externalfigure[demo.mov][label=demo,width=4cm,height=4cm,preview=yes]

preview=yes shows the first image as preview. You find more about interactive Elements in mwidget-s.pdf