Assume I need to sandwich English words in chapter titles which are mainly in Burmese. I want those sandwiched English words in red color. However I want to have all the headers text only in gray keeping the same font in the original chapter titles. How can I achieve that? Here is my MWE:
\documentclass[twoside, openright]{book}
\XeTeXlinebreaklocale "my_MM" %Myanmar line and character breaks
\XeTeXinterwordspaceshaping = 2
\usepackage{fontspec}
\usepackage[dvipsnames]{xcolor}
\usepackage{titlesec}
\newfontfamily{\ubuntumono}{Fira Mono}[Script=Latin]% replace Fira with Ubuntu
\DeclareTextFontCommand{\textubuntumono}{\ubuntumono}
\newcommand{\class}{\myCodePar{class}}
\newcommand{\turnLeft}{\myCodePar{turnLeft}}
\NewDocumentCommand{\myCodePar}{om}{%
% #1 = optional color, #2 = text
\textubuntumono{\IfValueT{#1}{\addfontfeatures{Color=#1}}#2}%
}
\definecolor{myParColor}{HTML}{4E4D4D}
\definecolor{myParColor1}{rgb}{1,0,0}
\titleformat{\chapter}[display]
{\Huge}{\color{blue}\thechapter}{10pt}{\color{blue}}
{\filcenter}
\renewcommand{\chaptermark}[1]{%
% header မှာ အခန်း ၁ ကို boldfont နဲ့ မစောင်းပဲပေါ်အောင်
\markboth{{\color{gray}\bfseries{\chaptername\ \thechapter~~~}}%
% chapter title ကို italic နဲ့ ပေါ်အောင်
{\color{gray}\bfseries{#1}}}{}}
\begin{document}
\chapter{Burmese Txt \myCodePar[red]{Some Eng Txt} Burmese Txt}
\newpage
sometext
\newpage
sometext
\end{document}
\chapter[Burmese Txt Some Eng Txt Burmese Txt]{Burmese Txt \myCodePar[red]{Some Eng Txt} Burmese Txt}
. Put into[]
what goes to the header.