Hello, I want to insert "hotkeys", surrounded by a round frame, into a paragraph text. I almost have achieve it, except of proper vertical alignment. Now it is the frame that is aligned with the text bottom line. But, I want the text inside a frame to be aligned with the rest of line. (I found that \vcenter solves the problem but I don't know how to merge it with \defineframed. Or, maybe there is better solution?) \defineframed [hotkey][height=\lineheight,offset=4pt,corner=00] \starttext Another way to start or stop the device is to use hotkey. If the application is active (that is, sits on the foreground of your desktop), the hotkey is {\hotkey{Space}}. If it is not active, then use global hotkey -- \hotkey{Alt}+\hotkey{Space}. \stoptext -- Best regards, Vyatcheslav Yatskovsky
On Tue, 17 Apr 2007 16:27:03 +0300
Vyatcheslav Yatskovsky
\defineframed [hotkey][height=\lineheight,offset=4pt,corner=00]
Hi, \defineframed [hotkey][offset=4pt,corner=00,location=low] Wolfgang
\starttext Another way to start or stop the device is to use hotkey. If the application is active (that is, sits on the foreground of your desktop), the hotkey is {\hotkey{Space}}. If it is not active, then use global hotkey -- \hotkey{Alt}+\hotkey{Space}. \stoptext
Hello, Thank you Wolfgang, but \defineframed [hotkey][offset=4pt,corner=00,location=low] produces too big frames, while \defineframed [hotkey][height=\lineheight,offset=4pt,corner=00,location=low] produces nice tight frames but places the text very BELOW the line text. (Previously the text was too much ABOVE). If I remove offset then it looks good (on center), except I really want more right/left spacing (from the inner text to the frame) but less spacing top/below, so that It resembles a keyboard key. How to get just center position while keeping the frame tight and more X-stretched?
On Tue, 17 Apr 2007 16:27:03 +0300 Vyatcheslav Yatskovsky
wrote:
\defineframed [hotkey][height=\lineheight,offset=4pt,corner=00]
Hi,
\defineframed [hotkey][offset=4pt,corner=00,location=low]
Wolfgang
\starttext Another way to start or stop the device is to use hotkey. If the application is active (that is, sits on the foreground of your desktop), the hotkey is {\hotkey{Space}}. If it is not active, then use global hotkey -- \hotkey{Alt}+\hotkey{Space}. \stoptext
-- Best regards, Vyatcheslav Yatskovsky
Hi Vyatcheslav, Vyatcheslav Yatskovsky wrote:
Hello,
Thank you Wolfgang, but
\defineframed
[hotkey][offset=4pt,corner=00,location=low]
produces too big frames, while
\defineframed
[hotkey][height=\lineheight,offset=4pt,corner=00,location=low]
produces nice tight frames but places the text very BELOW the line text. (Previously the text was too much ABOVE).
If I remove offset then it looks good (on center), except I really want more right/left spacing (from the inner text to the frame) but less spacing top/below, so that It resembles a keyboard key.
How to get just center position while keeping the frame tight and more X-stretched?
the best way is to define your own macro, as \framed alone can't handle this special case. if you insert an \offset macro inside \framed (with offset=overlay to avoid additional offsets), you can use different offset values for all directions. you still have to lower the result, so you also need \dontleavehmode\lower??ex\hbox{<Hotkey>} in your final macro. something like (untested!) \def\Hotkey#1% {\dontleavehmode\lower??ex\hbox {\framed[offset=overlay,corner=00,...] {\offset[leftoffset=??em, rightoffset=??em, topoffset=??ex, bottomoffset=??ex] {#1\strut}}}} try to use em for horizontal offsets and ex for vertical ones (instead of fixed values). also metapost generated backgrounds (overlay) look much better here. happy fiddling with all the ?? ;) peter
On Tue, 17 Apr 2007 16:27:03 +0300
Vyatcheslav Yatskovsky
mailto:yatskovsky@gmail.com> wrote: \defineframed
[hotkey][height=\lineheight,offset=4pt,corner=00]
Hi,
\defineframed
[hotkey][offset=4pt,corner=00,location=low]
Wolfgang
\starttext
Another way to start or stop the device is to use hotkey. If the application is active (that is, sits on the foreground of your desktop), the hotkey is {\hotkey{Space}}. If it is not active, then use global hotkey -- \hotkey{Alt}+\hotkey{Space}.
\stoptext
--
Best regards,
Vyatcheslav Yatskovsky
------------------------------------------------------------------------
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
On 4/17/07, Vyatcheslav Yatskovsky wrote:
Hello,
I want to insert "hotkeys", surrounded by a round frame, into a paragraph text. I almost have achieve it, except of proper vertical alignment.
Now it is the frame that is aligned with the text bottom line. But, I want the text inside a frame to be aligned with the rest of line.
(I found that \vcenter solves the problem but I don't know how to merge it with \defineframed. Or, maybe there is better solution?)
\defineframed [hotkey][height=\lineheight,offset=4pt,corner=00]
\starttext Another way to start or stop the device is to use hotkey. If the application is active (that is, sits on the foreground of your desktop), the hotkey is {\hotkey{Space}}. If it is not active, then use global hotkey -- \hotkey{Alt}+\hotkey{Space}. \stoptext
Perhaps \inframed could solve your problem? It takes case for proper baseline placement. There is no \defineinframed equivalent (perhaps there should be some?), but you can still define it in the old TeX-ish way: \def\hotkey#1{\inframed[corner=00]{\ #1\ }} Offset is a bit tricky: \framed only supports a single set of offset parameters (you cannot set left/right/top/bottom offset separately). Wolfgang (Schuster) has written a patch for leftoffset/rightoffset, but if it's not (until it's not) part of the core, you can still add fake space before or after the text if you're using framed with a \def-ined command. \inframed[height=\lineheight] doesn't work properly. (It might be a bug, an oversight or simply something that you're not supposed to use anyway ;) Mojca
participants (4)
-
Mojca Miklavec
-
Peter Rolf
-
Vyatcheslav Yatskovsky
-
Wolfgang Schuster