ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Line break in verbatim
@ 2011-05-02 16:19 Aditya Mahajan
  2011-05-02 20:35 ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Aditya Mahajan @ 2011-05-02 16:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

Why does verbatim text not line break properly.

\setuppapersize[A5]
\showframe

\starttext
% hyphenate is not the right word here; but illustrates the problem

\type{a very very long line to see if it hyphenates or not, that can 
require a lot oftyping phew}.
\stoptext

Also, it is possible to completely prevent line breaks for \type.

Aditya
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Line break in verbatim
  2011-05-02 16:19 Line break in verbatim Aditya Mahajan
@ 2011-05-02 20:35 ` Wolfgang Schuster
  2011-05-02 23:26   ` Aditya Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2011-05-02 20:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 02.05.2011 um 18:19 schrieb Aditya Mahajan:

> Hi,
> 
> Why does verbatim text not line break properly.
> 
> \setuppapersize[A5]
> \showframe
> 
> \starttext
> % hyphenate is not the right word here; but illustrates the problem
> 
> \type{a very very long line to see if it hyphenates or not, that can require a lot oftyping phew}.
> \stoptext

You can get a better result with “\setuptype[space=stretch]” but only the “stretch”
keyword for \setupalign/\setuptolerance prevents a overfull line in your example.

> Also, it is possible to completely prevent line breaks for \type.

\setuptype[space=fixed]

You can also put the text in a \hbox with “\setuptype[command=\hbox]”.
The command key from \setuptype is special because it accepts only
box commands (\hbox, \vbox, \framed …).

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Line break in verbatim
  2011-05-02 20:35 ` Wolfgang Schuster
@ 2011-05-02 23:26   ` Aditya Mahajan
  2011-05-03  7:19     ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Aditya Mahajan @ 2011-05-02 23:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1185 bytes --]

On Mon, 2 May 2011, Wolfgang Schuster wrote:

>
> Am 02.05.2011 um 18:19 schrieb Aditya Mahajan:
>
>> Hi,
>>
>> Why does verbatim text not line break properly.
>>
>> \setuppapersize[A5]
>> \showframe
>>
>> \starttext
>> % hyphenate is not the right word here; but illustrates the problem
>>
>> \type{a very very long line to see if it hyphenates or not, that can require a lot oftyping phew}.
>> \stoptext
>
> You can get a better result with “\setuptype[space=stretch]” but only the “stretch”
> keyword for \setupalign/\setuptolerance prevents a overfull line in your example.

Thanks. I was looking for space=stretch (I did not want to change the 
global tolerance)

>> Also, it is possible to completely prevent line breaks for \type.
>
> \setuptype[space=fixed]
>
> You can also put the text in a \hbox with “\setuptype[command=\hbox]”.
> The command key from \setuptype is special because it accepts only
> box commands (\hbox, \vbox, \framed …).

I don't see why that is the case. Looking at the code, it appears that any 
option for command should work (that is not reset by \tf\tt). For example, 
command=\underbar works as expected.

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Line break in verbatim
  2011-05-02 23:26   ` Aditya Mahajan
@ 2011-05-03  7:19     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2011-05-03  7:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 03.05.2011 um 01:26 schrieb Aditya Mahajan:

>> You can also put the text in a \hbox with “\setuptype[command=\hbox]”.
>> The command key from \setuptype is special because it accepts only
>> box commands (\hbox, \vbox, \framed …).
> 
> I don't see why that is the case. Looking at the code, it appears that any option for command should work (that is not reset by \tf\tt). For example, command=\underbar works as expected.


\underbar is defined as \groupedcommand and doesn’t take a argument, here is a example which fails.

\define[1]\TypeCommand{}

\setuptype[command=\TypeCommand]

\starttext
\type{type}
\stoptext

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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-03  7:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-02 16:19 Line break in verbatim Aditya Mahajan
2011-05-02 20:35 ` Wolfgang Schuster
2011-05-02 23:26   ` Aditya Mahajan
2011-05-03  7:19     ` Wolfgang Schuster

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).