Hi,
what is the best method to add labels to a figure; I want them not only on the figure but their position should be relative to the figure size.
I tried start/stopfigure (mentioned as outdated in the source) but the label is not shown.
\setupexternalfigures[location={local,global,default}]
\starttext
\startfigure[kuh][cow] \referring(1,1)(1,1)[r:horn] \stopfigure
\externalfigure[kuh]
\stoptext
After this I tried collector and got with a little extra and a box and to dimens what I wanted but it's not very elegant.
\setupexternalfigures[location={local,global,default}]
\starttext
\newbox\labelbox \setbox\labelbox\hbox{\externalfigure[cow]}
\newdimen\labelwidth \labelwidth \wd\labelbox \newdimen\labelheight \labelheight\ht\labelbox
\definecollector[label][state=repeat]
\setcollector[label]{\box\labelbox}
\setcollector[label][x=.65\labelwidth,y=.75\labelheight]{udder}
\placefigure {A labelled cow} {\flushcollector[label]}
\stoptext
Figurelabel as described in the label manual [1] seem to be the perfect solution but the module was finished :-(
Is there not better way to achieve what I want and do I have to live with my second method or could I hope for the future.
[1] http://pragma-ade.nl/general/manuals/mlabels.pdf
Greetings Wolfgang
Hi all,
any new news about my question below.
Wolfgang
On Fri, Jun 6, 2008 at 9:51 AM, Wolfgang Schuster schuster.wolfgang@googlemail.com wrote:
Hi,
what is the best method to add labels to a figure; I want them not only on the figure but their position should be relative to the figure size.
I tried start/stopfigure (mentioned as outdated in the source) but the label is not shown.
\setupexternalfigures[location={local,global,default}]
\starttext
\startfigure[kuh][cow] \referring(1,1)(1,1)[r:horn] \stopfigure
\externalfigure[kuh]
\stoptext
After this I tried collector and got with a little extra and a box and to dimens what I wanted but it's not very elegant.
\setupexternalfigures[location={local,global,default}]
\starttext
\newbox\labelbox \setbox\labelbox\hbox{\externalfigure[cow]}
\newdimen\labelwidth \labelwidth \wd\labelbox \newdimen\labelheight \labelheight\ht\labelbox
\definecollector[label][state=repeat]
\setcollector[label]{\box\labelbox}
\setcollector[label][x=.65\labelwidth,y=.75\labelheight]{udder}
\placefigure {A labelled cow} {\flushcollector[label]}
\stoptext
Figurelabel as described in the label manual [1] seem to be the perfect solution but the module isn't finished :-(
Is there not better way to achieve what I want and do I have to live with my second method or could I hope for the future.
[1] http://pragma-ade.nl/general/manuals/mlabels.pdf
Greetings Wolfgang
Wolfgang Schuster wrote:
Hi all,
any new news about my question below.
Wolfgang
On Fri, Jun 6, 2008 at 9:51 AM, Wolfgang Schuster schuster.wolfgang@googlemail.com wrote:
Hi,
what is the best method to add labels to a figure; I want them not only on the figure but their position should be relative to the figure size.
how about just using a layer ...
I tried start/stopfigure (mentioned as outdated in the source) but the label is not shown.
\setupexternalfigures[location={local,global,default}]
\starttext
\startfigure[kuh][cow] \referring(1,1)(1,1)[r:horn] \stopfigure
\externalfigure[kuh]
\stoptext
After this I tried collector and got with a little extra and a box and to dimens what I wanted but it's not very elegant.
\setupexternalfigures[location={local,global,default}]
\starttext
\newbox\labelbox \setbox\labelbox\hbox{\externalfigure[cow]}
\newdimen\labelwidth \labelwidth \wd\labelbox \newdimen\labelheight \labelheight\ht\labelbox
\definecollector[label][state=repeat]
\setcollector[label]{\box\labelbox}
\setcollector[label][x=.65\labelwidth,y=.75\labelheight]{udder}
\placefigure {A labelled cow} {\flushcollector[label]}
\stoptext
Figurelabel as described in the label manual [1] seem to be the perfect solution but the module isn't finished :-(
Is there not better way to achieve what I want and do I have to live with my second method or could I hope for the future.
[1] http://pragma-ade.nl/general/manuals/mlabels.pdf
Greetings Wolfgang
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
On Tuesday 16 September 2008 16:28:45 Hans Hagen wrote:
what is the best method to add labels to a figure; I want them not only on the figure but their position should be relative to the figure size.
how about just using a layer ...
You might also try pgf/tikz, according to your taste:
\usemodule[tikz] \starttikzpicture[scale=xxxx] \pgftext{\externalfigure[kuh][width=1cm]}; \draw (x,y) node {label}; \stoptikzpicture
On Tue, Sep 16, 2008 at 5:44 PM, Alan BRASLAU alan.braslau@cea.fr wrote:
On Tuesday 16 September 2008 16:28:45 Hans Hagen wrote:
what is the best method to add labels to a figure; I want them not only on the figure but their position should be relative to the figure size.
how about just using a layer ...
You might also try pgf/tikz, according to your taste:
\usemodule[tikz] \starttikzpicture[scale=xxxx] \pgftext{\externalfigure[kuh][width=1cm]}; \draw (x,y) node {label}; \stoptikzpicture
Thanks for the tip but I won't rely on external packages, before this will happen I write my own macros.
Wolfgang
On Tue, Sep 16, 2008 at 4:28 PM, Hans Hagen pragma@wxs.nl wrote:
Wolfgang Schuster wrote:
Hi all,
any new news about my question below.
Wolfgang
On Fri, Jun 6, 2008 at 9:51 AM, Wolfgang Schuster schuster.wolfgang@googlemail.com wrote:
Hi,
what is the best method to add labels to a figure; I want them not only on the figure but their position should be relative to the figure size.
how about just using a layer ...
And how could they help me, I want to pisition the label relative to the figure size with fraction of the figure width and heigth.
I could write my own macros to do this but I hoped you have already something available to do this.
Wolfgang
Wolfgang Schuster wrote:
On Tue, Sep 16, 2008 at 4:28 PM, Hans Hagen pragma@wxs.nl wrote:
Wolfgang Schuster wrote:
Hi all,
any new news about my question below.
Wolfgang
On Fri, Jun 6, 2008 at 9:51 AM, Wolfgang Schuster schuster.wolfgang@googlemail.com wrote:
Hi,
what is the best method to add labels to a figure; I want them not only on the figure but their position should be relative to the figure size.
how about just using a layer ...
And how could they help me, I want to pisition the label relative to the figure size with fraction of the figure width and heigth.
I could write my own macros to do this but I hoped you have already something available to do this.
hm, i thought that you knew all those things -)
wikifyable ...
\definelayer[figure][width=\overlaywidth,height=\overlayheight] \defineoverlay[figure][{\directsetup{figure}\tightlayer[figure]}]
\setupcolors[state=start]
\starttext
\startsetups figure
\setlayerframed[figure][preset=rightbottom,x=.25\layerwidth,y=.25\layerheight]{HERE} \setlayerframed[figure][preset=leftbottom, x=.15\layerwidth,y=.35\layerheight]{THERE} \stopsetups
\externalfigure[cow][background={foreground,figure},width=4cm,height=8cm]
\startsetups figure
\setlayerframed[figure][preset=righttop,x=.25\layerwidth,y=.25\layerheight]{MORE}
\setlayerframed[figure][preset=middle,foregroundcolor=green]{EVEN MORE} \stopsetups
\externalfigure[cow][background={foreground,figure},width=14cm,height=2cm]
\defineexternalfigure[whatever][background={foreground,figure}]
\startsetups figure
\setlayerframed[figure][preset=righttop,x=.25\layerwidth,y=.25\layerheight]{\red MORE}
\setlayerframed[figure][preset=middle,foregroundcolor=green]{EVEN MORE} \stopsetups
\externalfigure[cow][whatever][width=14cm,height=4cm]
\stoptext
----------------------------------------------------------------- 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 -----------------------------------------------------------------
Missing from lang-ita.tex: \setuplabeltext[\s!fr][\v!see=voir ]
(indeed, this label needs to be set for all of the variants fr es ca it la pt ro)
Thanks, Alan
With $ export TEXINPUTS=".:/home/local/tex//:" mtxrun fails $ mtxrun --script fonts --list cannot open : No such file or directory as it looks to open /home/local/tex/font-syn.lua rather than /usr/share/texmf/tex/context/base/font-syn.lua (after succeeding to find /usr/share/texmf/scripts/context/lua/mtx-fonts.lua).
Must be a simple script error, but I have not found the bug....
- using Debian/unstable : MtxRun | current version : 2008.05.21 15:21 LuaTools | version 1.2.0 - 2006+ - PRAGMA ADE / CONTEXT This is LuaTeX, Version snapshot-0.28.0-2008070709
Wolfgang Schuster wrote:
I could write my own macros to do this but I hoped you have already something available to do this.
Hi Wolfgang, I don't remember where I get this, I'm only sure it's coming from a Hans's example somewhere...
\definefont[AuteurFont][Sans sa .40] \defineornament [Auteur] [rotation=90,corner={right,bottom},location={right,top}, hoffset=.9ex,voffset=.9ex,alternative=b] [style=AuteurFont,offset=0pt]
% This affiliation is used as: % \placefigure % {Affiliations normally are typeset pretty small.} % {\Auteur {\copyright myself} {\externalfigure[hacker]}}
HTH