* Typing in natural width box
@ 2016-11-08 14:10 Henri Menke
2016-11-08 20:02 ` Henri Menke
2016-11-09 20:30 ` Hans Hagen
0 siblings, 2 replies; 3+ messages in thread
From: Henri Menke @ 2016-11-08 14:10 UTC (permalink / raw)
To: mailing list for ConTeXt users
Dear list,
To answer this question on TeX.SX https://tex.stackexchange.com/questions/338135/ I was trying to put a typing environment into a natural width box. It first seemed that framedtext is doing what I was after but it turned out that only the frame is adjusted to natural width, the underlying box is still full width. Therefore I tried framed but there I obtain spurious vertical space out of nowhere. How can I place typing into a natural sized box?
Cheers, Henri
---
\starttext
\ruledhbox{%
\startframedtext[width=fit,offset=0pt]
\starttyping
print("Hello World!")
\stoptyping
\stopframedtext
}
\ruledhbox{%
\startframed[width=fit,align=right,offset=0pt]
\starttyping
print("Hello World!")
\stoptyping
\stopframed
}
\stoptext
___________________________________________________________________________________
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Typing in natural width box
2016-11-08 14:10 Typing in natural width box Henri Menke
@ 2016-11-08 20:02 ` Henri Menke
2016-11-09 20:30 ` Hans Hagen
1 sibling, 0 replies; 3+ messages in thread
From: Henri Menke @ 2016-11-08 20:02 UTC (permalink / raw)
To: mailing list for ConTeXt users
The solution is to use strut=no in the framed and clear the before and after keys of the typing environment. I found it by accident on the wiki: http://wiki.contextgarden.net/Verbatim_text#Making_a_tight_vertical_fit
---
\starttext
\ruledhbox{%
\startframed[width=fit,align=right,strut=no,offset=0pt]
\setuptyping[before=,after=]
\starttyping
print("Hello World!")
\stoptyping
\stopframed
}
\stoptext
On 11/08/2016 03:10 PM, Henri Menke wrote:
> Dear list,
>
> To answer this question on TeX.SX https://tex.stackexchange.com/questions/338135/ I was trying to put a typing environment into a natural width box. It first seemed that framedtext is doing what I was after but it turned out that only the frame is adjusted to natural width, the underlying box is still full width. Therefore I tried framed but there I obtain spurious vertical space out of nowhere. How can I place typing into a natural sized box?
>
> Cheers, Henri
>
> ---
>
> \starttext
>
> \ruledhbox{%
> \startframedtext[width=fit,offset=0pt]
> \starttyping
> print("Hello World!")
> \stoptyping
> \stopframedtext
> }
>
> \ruledhbox{%
> \startframed[width=fit,align=right,offset=0pt]
> \starttyping
> print("Hello World!")
> \stoptyping
> \stopframed
> }
>
> \stoptext
>
___________________________________________________________________________________
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Typing in natural width box
2016-11-08 14:10 Typing in natural width box Henri Menke
2016-11-08 20:02 ` Henri Menke
@ 2016-11-09 20:30 ` Hans Hagen
1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2016-11-09 20:30 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 11/8/2016 3:10 PM, Henri Menke wrote:
> Dear list,
>
> To answer this question on TeX.SX https://tex.stackexchange.com/questions/338135/ I was trying to put a typing environment into a natural width box. It first seemed that framedtext is doing what I was after but it turned out that only the frame is adjusted to natural width, the underlying box is still full width. Therefore I tried framed but there I obtain spurious vertical space out of nowhere. How can I place typing into a natural sized box?
>
> Cheers, Henri
>
> ---
>
> \starttext
>
> \ruledhbox{%
> \startframedtext[width=fit,offset=0pt]
location=none
> \starttyping
> print("Hello World!")
> \stoptyping
> \stopframedtext
> }
>
> \ruledhbox{%
> \startframed[width=fit,align=right,offset=0pt]
> \starttyping
> print("Hello World!")
> \stoptyping
> \stopframed
> }
>
> \stoptext
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
>
--
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-09 20:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-08 14:10 Typing in natural width box Henri Menke
2016-11-08 20:02 ` Henri Menke
2016-11-09 20:30 ` Hans Hagen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).