Changes

Jump to navigation Jump to search
1,643 bytes removed ,  21:57, 30 March 2013
m
Removing redundant old info
<pre>context --directives=schemes.threshold=120 <em>filename</em></pre>
The variable <tt>schemes.threshold</tt> is global, so changing its value affects all other macros like <tt>\input</tt>, <tt>\usemodule</tt>, <tt>\component</tt>, etc. that load remote files.
 
=== HTTP Proxy ===
 
To use an http proxy for fetching images, the http variable ([http://w3.impa.br/~diego/software/luasocket/http.html LuaSocket]) has to be set up as follows:
 
<texcode>
\ctxlua{http = require("socket.http"); http.PROXY = "http://proxy.example.com:3128"}
</texcode>
 
Replace "http://proxy.example.com:3128" with the proxy URL.
 
To disable the proxy again:
 
<texcode>
\ctxlua{http = require("socket.http"); http.PROXY = nil}
</texcode>
 
= Image transformations =
-------------------------------------------
 
== Direct use of an image ==
 
This way you can use your image <tt>mypic.pdf</tt> :
<texcode>
\externalfigure[mypic]
</texcode>
Additional parameters:<texcode>\externalfigure[file or reference name][key=value, key=value, ...]</texcode> * 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 current and parent directory plus those given in <tt>texmf.cnf</tt>. You can define your own image directory with:<texcode>\setupexternalfigures[directory={../pictures}]</texcode>or even for multiple directories:<texcode>\setupexternalfigures[directory={../drawings,../bitmaps}]</texcode>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. <texcode>\useexternalfigure[reference name][file name][options]</texcode> Same options as above. You can even inherit them like this: <texcode>\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].</texcode> == Place picture in the text ==
You can directly place a figure in a text using <tt>\externalfigure[cow]</tt>. If you want to align it not to the baseline, but lower you can try whether <tt>\bbox{\externalfigure[cow]}</tt> does the right thing, otherwise you have to tweek <tt>\smash{\lower24pt\hbox{\externalfigure[cow]}}</tt>
== Flow text around a picture ==
That's an undocumented feature Hans told us about in a [http://archive.contextgarden.net/message/20080624.074046.56e76622.en.html mail from 2008-06-24].
</texcode>
== Pictures as [[Floating Objects]] ==
Floats are numbered and placed by ConTeXt, and they can get a caption.
You find more about floats ([[Floating Objects]]) in the manual.
== Floating graphics with an enlarged, shaded background ==
To place a figure in, say, the right margin with a shaded background that is slightly larger than the figure (to give a bit of breathing room):
</texcode>
== Movies ==
Movies aren't recognized automatically yet, you need a more verbose declaration:
* See [[Simple Cover Page]]
== Picture with hyperlink ==
This is an example of how to make a picture interactive. When the user clicks it, it invokes the user's browser to a given URL.
</texcode>
=== HTTP Proxy ===
 
To use an http proxy for fetching images, the http variable ([http://w3.impa.br/~diego/software/luasocket/http.html LuaSocket]) has to be set up as follows:
 
<texcode>
\ctxlua{http = require("socket.http"); http.PROXY = "http://proxy.example.com:3128"}
</texcode>
 
Replace "http://proxy.example.com:3128" with the proxy URL.
 
 
To disable the proxy again:
 
<texcode>
\ctxlua{http = require("socket.http"); http.PROXY = nil}
</texcode>
== See also ==

Navigation menu