ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* String single quote in \tt
@ 2006-09-11  6:47 Aditya Mahajan
  2006-09-11 16:38 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2006-09-11  6:47 UTC (permalink / raw)


Hi,

  I just noticed that in the preprocessing manual, the single quotes 
are wrong. Look at the output of

\starttext
\starttyping
   let a = 'string' ;
\stoptyping
\mono{ let a = 'string' ;}

{\tt let a = 'string' ;}
\stoptext

The singlequote character is converted into rightquote. This "feature" 
is also present in plain tex and Latex.

rightquote string rightquote does not look good in program listings. 
Isn't there some way to turn off these intelligent quotes in \tt?

Aditya

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

* Re: String single quote in \tt
  2006-09-11  6:47 String single quote in \tt Aditya Mahajan
@ 2006-09-11 16:38 ` Hans Hagen
  2006-09-11 23:47   ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2006-09-11 16:38 UTC (permalink / raw)


Aditya Mahajan wrote:
> Hi,
>
>   I just noticed that in the preprocessing manual, the single quotes 
> are wrong. Look at the output of
>
> \starttext
> \starttyping
>    let a = 'string' ;
> \stoptyping
> \mono{ let a = 'string' ;}
>
> {\tt let a = 'string' ;}
> \stoptext
>
> The singlequote character is converted into rightquote. This "feature" 
> is also present in plain tex and Latex.
>   
maybe \noligatures 

Hans 

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

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

* Re: String single quote in \tt
  2006-09-11 16:38 ` Hans Hagen
@ 2006-09-11 23:47   ` Aditya Mahajan
  2006-09-12 16:43     ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2006-09-11 23:47 UTC (permalink / raw)


On Mon, 11 Sep 2006, Hans Hagen wrote:

> Aditya Mahajan wrote:
>> Hi,
>>
>>   I just noticed that in the preprocessing manual, the single quotes
>> are wrong. Look at the output of
>>
>> \starttext
>> \starttyping
>>    let a = 'string' ;
>> \stoptyping
>> \mono{ let a = 'string' ;}
>>
>> {\tt let a = 'string' ;}
>> \stoptext
>>
>> The singlequote character is converted into rightquote. This "feature"
>> is also present in plain tex and Latex.
>>
> maybe \noligatures

Unless I misunderstood noligature, this does not work.

\pdfnoligatures\tentt
\tt a = 'string' ;
\bye

Still gives me rightquote.

Aditya

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

* Re: String single quote in \tt
  2006-09-11 23:47   ` Aditya Mahajan
@ 2006-09-12 16:43     ` Hans Hagen
  2006-09-12 16:56       ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2006-09-12 16:43 UTC (permalink / raw)


Aditya Mahajan wrote:
> Unless I misunderstood noligature, this does not work.
>
> \pdfnoligatures\tentt
> \tt a = 'string' ;
> \bye
>
> Still gives me rightquote.
>   
we need to ask taco ... he has to run your snippet in his mind/memory 

Hans 


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

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

* Re: String single quote in \tt
  2006-09-12 16:43     ` Hans Hagen
@ 2006-09-12 16:56       ` Taco Hoekwater
  2006-09-13  2:04         ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2006-09-12 16:56 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users

Hans Hagen wrote:
> Aditya Mahajan wrote:
> 
>> Unless I misunderstood noligature, this does not work.
>>
>> \pdfnoligatures\tentt
>> \tt a = 'string' ;
>> \bye
>>
>> Still gives me rightquote.
>>   
> we need to ask taco ... he has to run your snippet in his mind/memory

The single straight quote in 'Typewriter Text' encoding is \char 13,
the directional one is in the ' slot (no, i do not know why)

Something rude like

   \catcode`'=\active \def'{\char13 }
   \tt a = 'string' ;

works in this example, but may not be usable in practise.

Cheers, Taco

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

* Re: String single quote in \tt
  2006-09-12 16:56       ` Taco Hoekwater
@ 2006-09-13  2:04         ` Aditya Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2006-09-13  2:04 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users, Hans Hagen

On Tue, 12 Sep 2006, Taco Hoekwater wrote:

> Hans Hagen wrote:
>> Aditya Mahajan wrote:
>>
>>> Unless I misunderstood noligature, this does not work.
>>>
>>> \pdfnoligatures\tentt
>>> \tt a = 'string' ;
>>> \bye
>>>
>>> Still gives me rightquote.
>>>
>> we need to ask taco ... he has to run your snippet in his mind/memory
>
> The single straight quote in 'Typewriter Text' encoding is \char 13,
> the directional one is in the ' slot (no, i do not know why)
>
> Something rude like
>
>   \catcode`'=\active \def'{\char13 }
>   \tt a = 'string' ;
>
> works in this example, but may not be usable in practise.

Thanks. I tried to modify this example to work with context, and the 
simplest solution is

\catcode`'=\active
\def'{\raise.6em\hbox{\char13}}

\starttext
\tt a = 'string' ;
\stoptext


One probably also needs

\catcode``=\active  \def`{\char0}

I will experiment and see if this definition can be activated on every 
teletype font switch.

Aditya

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

end of thread, other threads:[~2006-09-13  2:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-11  6:47 String single quote in \tt Aditya Mahajan
2006-09-11 16:38 ` Hans Hagen
2006-09-11 23:47   ` Aditya Mahajan
2006-09-12 16:43     ` Hans Hagen
2006-09-12 16:56       ` Taco Hoekwater
2006-09-13  2:04         ` Aditya Mahajan

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