[NTG-context] disabling onum in url

2011-10-02 Thread Pablo Rodríguez
Hi there,

I'm a ConTeXt newbie that I have the following options and a command for
URLs in the document preamble (what comes before \starttext [I don't
know if it is named so in ConTeXt]):

\definefontfeature[default][default][onum=yes]
\setupbodyfontenvironment[default][em=italic]
\setupinteraction[state=start,color=,style=
em,contrastcolor=,focus=standard]

\def\href#1{\goto{\hyphenatedurl{#1}}[url(#1)]}

My question is: how can I disable old style numbers for the \href command?

Thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] disabling onum in url

2011-10-02 Thread Philipp Gesang
Hi Pablo,

On 2011-10-02 12:58, Pablo Rodríguez wrote:
 Hi there,
 
 I'm a ConTeXt newbie that I have the following options and a command for
 URLs in the document preamble (what comes before \starttext [I don't
 know if it is named so in ConTeXt]):
 
   \definefontfeature[default][default][onum=yes]
   \setupbodyfontenvironment[default][em=italic]
   \setupinteraction[state=start,color=,style=
   em,contrastcolor=,focus=standard]
 
   \def\href#1{\goto{\hyphenatedurl{#1}}[url(#1)]}

·

\definefontfeature[default][default][onum=yes]
\setupbodyfontenvironment[default][em=italic]
\setupinteraction[state=start,color=,style=em,contrastcolor=,focus=standard]

%%% First, define the switch for text figures:
\definefontfeature[url][default][onum=no]

%%% Best use context’s default url commands:
\useURL[aurl][http://www.pragma-ade.com/download-1.htm]

%%% It comes with a proper setup for everything.
\setupurl[style={\tf\addff{url}}]

%%% If you must use the “href” macro, disable the font feature locally.
\define[1]\href{%
  \begingroup
\addff{url}%
\goto{\hyphenatedurl{#1}}[url(#1)]%
  \endgroup%
}

\starttext

42
%%% With the internal command:
\from[aurl]
42
%%% Your way:
\href{0123456789abcdef}
42

\stoptext

·

HTH, Philipp


 
 My question is: how can I disable old style numbers for the \href command?
 
 Thanks for your help,
 
 
 Pablo
 -- 
 http://www.ousia.tk
 ___
 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
 ___

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpCYM2U1Y0jr.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] disabling onum in url

2011-10-02 Thread Pablo Rodríguez
Hi  Philipp,

thanks for your reply.

I'm afraid it doesn't work. No matter which method I use. (Of course, I
copied and pasted your sample code, which doesn't work for me.)

On 10/02/2011 01:34 PM, Philipp Gesang wrote:
 \definefontfeature[default][default][onum=yes]
 \setupbodyfontenvironment[default][em=italic]
 \setupinteraction[state=start,color=,style=em,contrastcolor=,focus=standard]
 
 %%% First, define the switch for text figures:
 \definefontfeature[url][default][onum=no]

Here is the issue, if I rewrite:

\definefontfeature[url][default][onum=no,smcp=yes]

small caps will work, but they won't if I rewrite both:

\definefontfeature[default][default][onum=yes,smcp=yes]
\definefontfeature[url][default][onum=no,smcp=no]

 %%% Best use context’s default url commands:
 \useURL[aurl][http://www.pragma-ade.com/download-1.htm]

After having to write the second url, I began to think it was
unnecessarily complex.

Have I hit a bug or does it work for you?

Thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] disabling onum in url

2011-10-02 Thread Philipp Gesang
On 2011-10-02 17:40, Pablo Rodríguez wrote:
 Hi  Philipp,
 
 thanks for your reply.
 
 I'm afraid it doesn't work. No matter which method I use. (Of course, I
 copied and pasted your sample code, which doesn't work for me.)
 
 On 10/02/2011 01:34 PM, Philipp Gesang wrote:
  \definefontfeature[default][default][onum=yes]
  \setupbodyfontenvironment[default][em=italic]
  \setupinteraction[state=start,color=,style=em,contrastcolor=,focus=standard]
  
  %%% First, define the switch for text figures:
  \definefontfeature[url][default][onum=no]
 
 Here is the issue, if I rewrite:
 
   \definefontfeature[url][default][onum=no,smcp=yes]
 
 small caps will work, but they won't if I rewrite both:
 
   \definefontfeature[default][default][onum=yes,smcp=yes]
   \definefontfeature[url][default][onum=no,smcp=no]

Well, in my previous example, rather use:

  \definefontfeature[url][onum=no,smcp=yes]

and come back with a complete example if it doesn’t help.

(Btw, looks like you consider setting the default font style to
small caps. Is this really what you intended?)

 After having to write the second url, I began to think it was
 unnecessarily complex.

Fwiw I think that \useURL fits the context style best as it
separates the declaration of an element from its use in the
document.

Best regards
Philipp



 
  %%% Best use context’s default url commands:
  \useURL[aurl][http://www.pragma-ade.com/download-1.htm]
 
 After having to write the second url, I began to think it was
 unnecessarily complex.
 
 Have I hit a bug or does it work for you?
 
 Thanks for your help,
 
 
 Pablo
 -- 
 http://www.ousia.tk
 ___
 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
 ___

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgp7a6e1rlxXr.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] disabling onum in url

2011-10-02 Thread Pablo Rodríguez
On 10/02/2011 06:40 PM, Philipp Gesang wrote:
 Well, in my previous example, rather use:
 
   \definefontfeature[url][onum=no,smcp=yes]
 
 and come back with a complete example if it doesn’t help.

Philipp, I'm afraid it doesn't work. Sample file:

\definefontfeature[default][default][onum=yes]
\setupbodyfontenvironment[default][em=italic]
\setupinteraction[state=start,color=,style=em,contrastcolor=,focus=standard]

%%% First, define the switch for text figures:
\definefontfeature[url][onum=no,smcp=yes]

%%% Best use context’s default url commands:
\useURL[aurl][http://www.pragma-ade.com/download-1.htm]

%%% It comes with a proper setup for everything.
\setupurl[style={\tf\addff{url}}]

%%% If you must use the “href” macro, disable the font feature locally.
\define[1]\href{%
  \begingroup
\addff{url}%
\goto{\hyphenatedurl{#1}}[url(#1)]%
  \endgroup%
}

\starttext

42
%%% With the internal command:
\from[aurl]
42
%%% Your way:
\href{0123456789abcdef}
42

 (Btw, looks like you consider setting the default font style to
 small caps. Is this really what you intended?)

No, I was only checking the “feature”. It seems that if an OT feature is
enabled as default, you cannot disable it for urls (at least, this is
what I get).

 After having to write the second url, I began to think it was
 unnecessarily complex.
 
 Fwiw I think that \useURL fits the context style best as it
 separates the declaration of an element from its use in the
 document.

Sorry, but I'm afraid I don't see your point. Would you think the same
for titles or emphasized text?

Imagine a whole book in one document. If you have more than 100 urls, it
would be inconvenient to have to go to the document preamble and back to
the body text only to add an url.

But I guess it might be a question of habits.

Many thanks for your help again,


Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] disabling onum in url

2011-10-02 Thread Wolfgang Schuster

Am 02.10.2011 um 19:53 schrieb Pablo Rodríguez:

 On 10/02/2011 06:40 PM, Philipp Gesang wrote:
 Well, in my previous example, rather use:
 
  \definefontfeature[url][onum=no,smcp=yes]
 
 and come back with a complete example if it doesn’t help.
 
 Philipp, I'm afraid it doesn't work. Sample file:
 
 […]

Use \addfs{url} to disable the onus feature.

 After having to write the second url, I began to think it was
 unnecessarily complex.
 
 Fwiw I think that \useURL fits the context style best as it
 separates the declaration of an element from its use in the
 document.
 
 Sorry, but I'm afraid I don't see your point. Would you think the same
 for titles or emphasized text?
 
 Imagine a whole book in one document. If you have more than 100 urls, it
 would be inconvenient to have to go to the document preamble and back to
 the body text only to add an url.
 
 But I guess it might be a question of habits.

Move the preamble in a external environment file, you can then switch
between both without scrolling up and down.

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
___


Re: [NTG-context] disabling onum in url

2011-10-02 Thread Philipp Gesang
On 2011-10-02 19:53, Pablo Rodríguez wrote:
 On 10/02/2011 06:40 PM, Philipp Gesang wrote:
  Well, in my previous example, rather use:
  
\definefontfeature[url][onum=no,smcp=yes]
  
  and come back with a complete example if it doesn’t help.
 
 Philipp, I'm afraid it doesn't work. Sample file:

As I thought: the problem is rather with latin modern not having
small caps as font feature, so „\definefontfeature” will have
zero effect on the example. Your options are afaics: either pick
a font that has the smcp feature (\setupbodyfont[antykwa-poltawskiego]
for example) or rely on the “style” key of the interaction
setups:

·

\setupbodyfontenvironment[default][em=italic]
\setupinteraction[state=start,color=,style=\em,contrastcolor=,focus=standard]

\useURL[aurl][http://www.pragma-ade.com/download-1.htm]

\setupurl[style={\tf\sc}]
%%% ^^^ for the traditional method

\define[1]\href{%
  \begingroup
\setupinteraction[style=\sc]% locally override the interaction style
\goto{\hyphenatedurl{#1}}[url(#1)]%
  \endgroup%
}

\starttext

42 abcd
%%% With the internal command:
\from[aurl]
42 abcd
%%% Your way:
\href{0123456789abcdef}
42 abcd

\stoptext

·

 Imagine a whole book in one document. If you have more than 100 urls, it
 would be inconvenient to have to go to the document preamble and back to
 the body text only to add an url.

In this case, wouldn’t you prefer a bibliography?

Philipp

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpDazBje1xeD.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] disabling onum in url

2011-10-02 Thread Pablo Rodríguez
On 10/02/2011 08:20 PM, Philipp Gesang wrote:
 On 2011-10-02 19:53, Pablo Rodríguez wrote:

 Philipp, I'm afraid it doesn't work. Sample file:
 
 As I thought: the problem is rather with latin modern not having
 small caps as font feature, [...]

Sorry, my own example was misleading (or so it seems to have been).

Wolfgang has found the cause of the problem.

Disabling mall caps when having enabled them for the default didn't work
either with TeX Gyre Pagella, because of using \addff instead of \addfs.

 Imagine a whole book in one document. If you have more than 100 urls, it
 would be inconvenient to have to go to the document preamble and back to
 the body text only to add an url.
 
 In this case, wouldn’t you prefer a bibliography?

It depends on the kind of book you are working on. If the only items of
the bibliography would be urls (no printed stuff), I would avoid using a
bibliography.

One of the most annoying features I found in some academic books (I have
found some in humanities) is having to go back an forth because of the
endnotes using quotations with the author-year system, so you have to
stop reading, go to the endnote page and then to the bibliography page
referring to the cited work.

Because of that, I prefer to give all information on the same page.

Thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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
___


Re: [NTG-context] disabling onum in url

2011-10-02 Thread Pablo Rodríguez
On 10/02/2011 08:00 PM, Wolfgang Schuster wrote:
 
 Use \addfs{url} to disable the onus feature.

Many thanks, Wolfgang.

This fixed the problem.

 After having to write the second url, I began to think it was
 unnecessarily complex.
 [...]
 But I guess it might be a question of habits.
 
 Move the preamble in a external environment file, you can then switch
 between both without scrolling up and down.

I think that it is a question of personal preference and practice.

But I find it distracting (when not disturbing) to be forced to move
when writing a text because of a website location.

I tend to consider it as any other element such as a title, an
emphasized text, a quote in German or a Latin or ancient Greek expression.

One of the main capabilities of TeX is separating text from presentation
and enabling the focus on one of the elements. Having to define
segregated URLs in the document preamble seems to as the opposite to
this approach.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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
___