使用 \newcommand 而不添加文本样式

Use \newcommand without the text styles added to it

这是一个奇怪的问题,我不知道我是否能够很好地表述它。

所以,我像这样在某处声明了一个新命令:

\newcommand{\examplecommand}{\textbf{\textit{exampletext}}}

这样会用到很多次

我也试图在文档的一个地方使用它,想以不同的方式格式化它(使用 \textsc{},以及 none 的粗体和斜体)

我试过

\textsc{\examplecommand}

但这不起作用,它仍然以某种方式优先考虑命令声明中的格式。

如何在不更改声明但使用不同格式的情况下使用命令?

编辑(MWE):

document.tex
--------------------
\documentclass{book}

\usepackage{fancyhdr}
\usepackage{blindtext}

\newcommand{\booktitle}{} % create it empty at first, so that the files can change it

\newcommand{\textbfit}[1]{\textbf{\textit{#1}}} % combine bold and italic in one

\fancypagestyle{plain}{
 \fancyhf{}
 \fancyhead[RO,RE]{\textsc{\booktitle}}
 \renewcommand{\headrulewidth}{2pt}
}

\begin{document}
\pagestyle{plain}

\chapter{example1}
\input{doc1}

\chapter{example2}
\input{doc2}

\chapter{example3}
\input{doc3}

\end{document}
doc1.tex
--------------------
\renewcommand{\booktitle}{\textbfit{``Title 1''}}
\booktitle\ is a very nice book, it's really great, buy it etcetcetc

\blindtext
doc2.tex
--------------------
\renewcommand{\booktitle}{\textbfit{``Title 2''}}
\booktitle\ is a very nice book, it's really great, buy it etcetcetc

\blindtext
doc3.tex
--------------------
\renewcommand{\booktitle}{\textbfit{``Title 3''}}
\booktitle\ is a very nice book, it's really great, buy it etcetcetc

\blindtext

我希望能够做到这一点的原因:

我有 12 个以单文档形式编写的文档,现在我希望它们都以单文档形式工作(它们都有一个单独的 .tex 文件,将它们编译为一个文件文档),以及将它们全部放入一个大文件的表格。

我对所有这些都使用了 \booktitle 命令,因为它们在一般结构上都很相似。现在,当我还想将它们转换成书籍形式时,我发现我可以使用它来更改页眉中右上角的文本(请参阅普通 fancypagestyle 的定义在其 fancyhead 中使用该命令),但是,在那里, 我想将它与 \textsc

一起使用

我不想更改我的命令的原因是因为它意味着在所有文档中更改它,我只是想我可以做 \textsc{\booktitle} 并完成它

您可以暂时关闭您的 \textbfit 命令:

\documentclass{book}

\usepackage{fancyhdr}
\usepackage{blindtext}

\newcommand{\booktitle}{} % create it empty at first, so that the files can change it

\newcommand{\textbfit}[1]{\textbf{\textit{#1}}} % combine bold and italic in one

\fancypagestyle{plain}{
 \fancyhf{}
 \fancyhead[RO,RE]{
  \begingroup
    \let\textbfit\relax
    \textsc{\booktitle}
  \endgroup
 }
 \renewcommand{\headrulewidth}{2pt}
}

\begin{document}
\pagestyle{plain}

\chapter{example1}

\renewcommand{\booktitle}{\textbfit{``Title 1''}}
\booktitle\ is a very nice book, it's really great, buy it etcetcetc

\blindtext


\end{document}