ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* disabling onum in url
@ 2011-10-02 10:58 Pablo Rodríguez
  2011-10-02 11:34 ` Philipp Gesang
  0 siblings, 1 reply; 9+ messages in thread
From: Pablo Rodríguez @ 2011-10-02 10:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: disabling onum in url
  2011-10-02 10:58 disabling onum in url Pablo Rodríguez
@ 2011-10-02 11:34 ` Philipp Gesang
  2011-10-02 15:40   ` Pablo Rodríguez
  0 siblings, 1 reply; 9+ messages in thread
From: Philipp Gesang @ 2011-10-02 11:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2362 bytes --]

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

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- 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] 9+ messages in thread

* Re: disabling onum in url
  2011-10-02 11:34 ` Philipp Gesang
@ 2011-10-02 15:40   ` Pablo Rodríguez
  2011-10-02 16:40     ` Philipp Gesang
  0 siblings, 1 reply; 9+ messages in thread
From: Pablo Rodríguez @ 2011-10-02 15:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: disabling onum in url
  2011-10-02 15:40   ` Pablo Rodríguez
@ 2011-10-02 16:40     ` Philipp Gesang
  2011-10-02 17:53       ` Pablo Rodríguez
  0 siblings, 1 reply; 9+ messages in thread
From: Philipp Gesang @ 2011-10-02 16:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2354 bytes --]

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

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- 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] 9+ messages in thread

* Re: disabling onum in url
  2011-10-02 16:40     ` Philipp Gesang
@ 2011-10-02 17:53       ` Pablo Rodríguez
  2011-10-02 18:00         ` Wolfgang Schuster
  2011-10-02 18:20         ` Philipp Gesang
  0 siblings, 2 replies; 9+ messages in thread
From: Pablo Rodríguez @ 2011-10-02 17:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: disabling onum in url
  2011-10-02 17:53       ` Pablo Rodríguez
@ 2011-10-02 18:00         ` Wolfgang Schuster
  2011-10-02 18:41           ` Pablo Rodríguez
  2011-10-02 18:20         ` Philipp Gesang
  1 sibling, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2011-10-02 18:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: disabling onum in url
  2011-10-02 17:53       ` Pablo Rodríguez
  2011-10-02 18:00         ` Wolfgang Schuster
@ 2011-10-02 18:20         ` Philipp Gesang
  2011-10-02 18:54           ` Pablo Rodríguez
  1 sibling, 1 reply; 9+ messages in thread
From: Philipp Gesang @ 2011-10-02 18:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1890 bytes --]

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

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- 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] 9+ messages in thread

* Re: disabling onum in url
  2011-10-02 18:00         ` Wolfgang Schuster
@ 2011-10-02 18:41           ` Pablo Rodríguez
  0 siblings, 0 replies; 9+ messages in thread
From: Pablo Rodríguez @ 2011-10-02 18:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: disabling onum in url
  2011-10-02 18:20         ` Philipp Gesang
@ 2011-10-02 18:54           ` Pablo Rodríguez
  0 siblings, 0 replies; 9+ messages in thread
From: Pablo Rodríguez @ 2011-10-02 18:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

end of thread, other threads:[~2011-10-02 18:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-02 10:58 disabling onum in url Pablo Rodríguez
2011-10-02 11:34 ` Philipp Gesang
2011-10-02 15:40   ` Pablo Rodríguez
2011-10-02 16:40     ` Philipp Gesang
2011-10-02 17:53       ` Pablo Rodríguez
2011-10-02 18:00         ` Wolfgang Schuster
2011-10-02 18:41           ` Pablo Rodríguez
2011-10-02 18:20         ` Philipp Gesang
2011-10-02 18:54           ` Pablo Rodríguez

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