* Section format using /def
@ 2009-02-05 17:37 Michael Bynum
2009-02-05 17:55 ` Wolfgang Schuster
2009-02-05 17:59 ` Aditya Mahajan
0 siblings, 2 replies; 6+ messages in thread
From: Michael Bynum @ 2009-02-05 17:37 UTC (permalink / raw)
To: mailing list for ConTeXt users
I, apparently, do not understand the syntax and/or uses of /def. I am
trying to make section heads appear in all caps and underlined. I
originally tried to just use \setuphead, but found that I using the
"textcommand" option I could only either capitalize or underline and
not both. I then figured that using a macro was my next best option.
Below is what I tried and it does not work. Can someone tell me what
I am doing wrong?
\def\mysectionhead{\WORD\underbar}
\setuphead[section]
[number=no,
textcommand=\mysectionhead,
style={\tfa\bf}]
Thanks,
Mike
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Section format using /def
2009-02-05 17:37 Section format using /def Michael Bynum
@ 2009-02-05 17:55 ` Wolfgang Schuster
2009-02-05 18:45 ` Michael Bynum
2009-02-05 17:59 ` Aditya Mahajan
1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2009-02-05 17:55 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 05.02.2009 um 18:37 schrieb Michael Bynum:
> I, apparently, do not understand the syntax and/or uses of /def. I am
> trying to make section heads appear in all caps and underlined. I
> originally tried to just use \setuphead, but found that I using the
> "textcommand" option I could only either capitalize or underline and
> not both. I then figured that using a macro was my next best option.
> Below is what I tried and it does not work. Can someone tell me what
> I am doing wrong?
Both commands take parameter and in your example you pass \underbar
as argument to \WORD.
Two solution are possible for your problem.
1. You define a command with one argument and use both commands
nested, it is important to use deeptextcommand for the \WORD style.
\define[1]\mysectionhead{\underbar{\WORD{#1}}}
\setuphead
[section]
[number=no,
deeptextcommand=\mysectionhead,
style={\tfa\bf}]
2. You ca use both text commands and pass one with textcommand and
another one with deeptextcommand.
\setuphead
[section]
[number=no,
textcommand=\underbar,
deeptextcommand=\WORD,
style={\tfa\bf}]
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Section format using /def
2009-02-05 17:37 Section format using /def Michael Bynum
2009-02-05 17:55 ` Wolfgang Schuster
@ 2009-02-05 17:59 ` Aditya Mahajan
2009-02-05 18:48 ` Michael Bynum
1 sibling, 1 reply; 6+ messages in thread
From: Aditya Mahajan @ 2009-02-05 17:59 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Thu, 5 Feb 2009, Michael Bynum wrote:
> I, apparently, do not understand the syntax and/or uses of /def. I am
> trying to make section heads appear in all caps and underlined. I
> originally tried to just use \setuphead, but found that I using the
> "textcommand" option I could only either capitalize or underline and
> not both. I then figured that using a macro was my next best option.
> Below is what I tried and it does not work. Can someone tell me what
> I am doing wrong?
>
> \def\mysectionhead{\WORD\underbar}
>
> \setuphead[section]
> [number=no,
> textcommand=\mysectionhead,
> style={\tfa\bf}]
>
See
http://wiki.contextgarden.net/Titles#Formatting_Titles_with_.5Csetuphead
and try to use deeptextcommand instead.
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Section format using /def
2009-02-05 17:55 ` Wolfgang Schuster
@ 2009-02-05 18:45 ` Michael Bynum
2009-02-05 19:06 ` \define was: " Wolfgang Schuster
0 siblings, 1 reply; 6+ messages in thread
From: Michael Bynum @ 2009-02-05 18:45 UTC (permalink / raw)
To: mailing list for ConTeXt users
Ah, I think I see. So "\define[1]\mysectionhead{\bfa
\WORD{\underbar{#1}}}" would also be valid. Is \define a context
equivalent to the \def command for tex? I couldn't find much
documentation on it.
Mike
On Thu, Feb 5, 2009 at 12:55 PM, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
>
> Am 05.02.2009 um 18:37 schrieb Michael Bynum:
>
>> I, apparently, do not understand the syntax and/or uses of /def. I am
>> trying to make section heads appear in all caps and underlined. I
>> originally tried to just use \setuphead, but found that I using the
>> "textcommand" option I could only either capitalize or underline and
>> not both. I then figured that using a macro was my next best option.
>> Below is what I tried and it does not work. Can someone tell me what
>> I am doing wrong?
>
> Both commands take parameter and in your example you pass \underbar
> as argument to \WORD.
>
> Two solution are possible for your problem.
>
> 1. You define a command with one argument and use both commands
> nested, it is important to use deeptextcommand for the \WORD style.
>
> \define[1]\mysectionhead{\underbar{\WORD{#1}}}
>
> \setuphead
> [section]
> [number=no,
> deeptextcommand=\mysectionhead,
> style={\tfa\bf}]
>
> 2. You ca use both text commands and pass one with textcommand and
> another one with deeptextcommand.
>
> \setuphead
> [section]
> [number=no,
> textcommand=\underbar,
> deeptextcommand=\WORD,
> style={\tfa\bf}]
>
> 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 : https://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Section format using /def
2009-02-05 17:59 ` Aditya Mahajan
@ 2009-02-05 18:48 ` Michael Bynum
0 siblings, 0 replies; 6+ messages in thread
From: Michael Bynum @ 2009-02-05 18:48 UTC (permalink / raw)
To: mailing list for ConTeXt users
Yes, I think I may have an older version of context here at work. I
was able to use the deeptextcommand at home, but here at work it
wasn't working. It doesn't seem to be recognized. Was it a later
implementation perhaps that an older version wouldn't have?
Mike
On Thu, Feb 5, 2009 at 12:59 PM, Aditya Mahajan <adityam@umich.edu> wrote:
> On Thu, 5 Feb 2009, Michael Bynum wrote:
>
>> I, apparently, do not understand the syntax and/or uses of /def. I am
>> trying to make section heads appear in all caps and underlined. I
>> originally tried to just use \setuphead, but found that I using the
>> "textcommand" option I could only either capitalize or underline and
>> not both. I then figured that using a macro was my next best option.
>> Below is what I tried and it does not work. Can someone tell me what
>> I am doing wrong?
>>
>> \def\mysectionhead{\WORD\underbar}
>>
>> \setuphead[section]
>> [number=no,
>> textcommand=\mysectionhead,
>> style={\tfa\bf}]
>>
>
> See http://wiki.contextgarden.net/Titles#Formatting_Titles_with_.5Csetuphead
>
> and try to use deeptextcommand instead.
>
> 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 : https://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* \define was: Section format using /def
2009-02-05 18:45 ` Michael Bynum
@ 2009-02-05 19:06 ` Wolfgang Schuster
0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2009-02-05 19:06 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 05.02.2009 um 19:45 schrieb Michael Bynum:
> Ah, I think I see. So "\define[1]\mysectionhead{\bfa
> \WORD{\underbar{#1}}}" would also be valid. Is \define a context
> equivalent to the \def command for tex? I couldn't find much
> documentation on it.
\define is ConTeXt's equivalent to \newcommand in LaTeX, you can set
with the optional parameter the number of arguments. It makes a check
if the command you create is already defined and writes a message to
the terminal.
Usage:
\define\commanda {First Command}
\define[1]\commandb{Second command: #1}
\define[2]\commandc{Third command: #1 #2}
\starttext
\commanda
\commandb{text}
\commandc{text}{text}
\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 : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-02-05 19:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-05 17:37 Section format using /def Michael Bynum
2009-02-05 17:55 ` Wolfgang Schuster
2009-02-05 18:45 ` Michael Bynum
2009-02-05 19:06 ` \define was: " Wolfgang Schuster
2009-02-05 17:59 ` Aditya Mahajan
2009-02-05 18:48 ` Michael Bynum
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).