After using a custom command in the title, the table of contents is not generated properly
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
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
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
participants (3)
-
ai2472206007@yeah.net
-
Henning Hraban Ramm
-
Wolfgang Schuster