ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] After using a custom command in the title, the table of contents is not generated properly
@ 2024-06-05 14:03 ai2472206007
  2024-06-05 14:11 ` [NTG-context] " Henning Hraban Ramm
  2024-06-05 14:33 ` Wolfgang Schuster
  0 siblings, 2 replies; 4+ messages in thread
From: ai2472206007 @ 2024-06-05 14:03 UTC (permalink / raw)
  To: ntg-context

As described, here is example:

%%%%%
\def\cmd#1{{\tt\textslash #1}}
\def\cmdii#1{\tt #1}
\def\cmdiii#1{\rm #1}

\starttext

\placecontent% if i dont place toc command , ConText can render it.

\chapter{anything else}
\section{\cmdi{with command} section}
\section{\cmdii{with command} section}
\section{\cmdiii{with command} section}
\section{{\rm with command} section} % only this one work well

\stoptext
%%%%

Am I missing something important? If so, please tell me what to do. Thank you so much.

Muyik
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: After using a custom command in the title, the table of contents is not generated properly
  2024-06-05 14:03 [NTG-context] After using a custom command in the title, the table of contents is not generated properly ai2472206007
@ 2024-06-05 14:11 ` Henning Hraban Ramm
  2024-06-05 14:19   ` ai2472206007
  2024-06-05 14:33 ` Wolfgang Schuster
  1 sibling, 1 reply; 4+ messages in thread
From: Henning Hraban Ramm @ 2024-06-05 14:11 UTC (permalink / raw)
  To: ntg-context

Am 05.06.24 um 16:03 schrieb ai2472206007@yeah.net:
> As described, here is example:
> 
> %%%%%
> \def\cmd#1{{\tt\textslash #1}}
> \def\cmdii#1{\tt #1}
> \def\cmdiii#1{\rm #1}
> 
> \starttext
> 
> \placecontent% if i dont place toc command , ConText can render it.
> 
> \chapter{anything else}
> \section{\cmdi{with command} section}
> \section{\cmdii{with command} section}
> \section{\cmdiii{with command} section}
> \section{{\rm with command} section} % only this one work well
> 
> \stoptext
> %%%%
> 
> Am I missing something important? If so, please tell me what to do. Thank you so much.

What do you mean with “not properly”?

\cmdi is not defined
Only \cmd has the necessary additional braces to contain the style switch.
But I don’t know if that’s your problem.

Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: After using a custom command in the title, the table of contents is not generated properly
  2024-06-05 14:11 ` [NTG-context] " Henning Hraban Ramm
@ 2024-06-05 14:19   ` ai2472206007
  0 siblings, 0 replies; 4+ messages in thread
From: ai2472206007 @ 2024-06-05 14:19 UTC (permalink / raw)
  To: ntg-context

I was careless. thank you
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: After using a custom command in the title, the table of contents is not generated properly
  2024-06-05 14:03 [NTG-context] After using a custom command in the title, the table of contents is not generated properly ai2472206007
  2024-06-05 14:11 ` [NTG-context] " Henning Hraban Ramm
@ 2024-06-05 14:33 ` Wolfgang Schuster
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2024-06-05 14:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users, ai2472206007

ai2472206007@yeah.net schrieb am 05.06.2024 um 16:03:
> As described, here is example:
> 
> %%%%%
> \def\cmd#1{{\tt\textslash #1}}
> \def\cmdii#1{\tt #1}
> \def\cmdiii#1{\rm #1}

You can use \definehighlight to create a custom command for a style.

The case where you want a slash before the text you have to use 
\definestartstop which allows you to set something before and after

\definestartstop [cmdi]   [style=\tt,left=\textslash]
\definehighlight [cmdii]  [style=\tt]
\definehighlight [cmdiii] [style=\rm]

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2024-06-05 14:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-05 14:03 [NTG-context] After using a custom command in the title, the table of contents is not generated properly ai2472206007
2024-06-05 14:11 ` [NTG-context] " Henning Hraban Ramm
2024-06-05 14:19   ` ai2472206007
2024-06-05 14:33 ` 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).