How using \myfunction{"TEST"} to \mysuperfunction{T}{E}{S}{T}
I alvays have this same number of parameter
2 Answers
Here is a possibility (if I understood the need correctly...):
\documentclass{article}
\def\mysuperfunction#1#2#3#4{{\it#1\tt#2\bf#3\it#4}}
\newcommand\myfunction[1]{\mysuperfunction#1}
\begin{document}
\myfunction{TESTwithlontext}
\end{document}
And a solution without deprecated commands:
\documentclass{article}
\def\mysuperfunction#1#2#3#4{{\textit{#1}\texttt{#2}\textbf{#3}\textit{#4}}}
\newcommand\myfunction[1]{\mysuperfunction#1}
\begin{document}
\myfunction{TESTwithlontext}
\end{document}
- 70,770
- 10
- 176
- 283
-
4Usual warning: the commands
\it\tt\bfhave been deprecated for 30 years – egreg Jan 25 '22 at 08:48
Please always provide an example document as here, this answers the question as asked in the comments, the version in your question has " in the input which would complicate the answer slightly
\documentclass{article}
\newcommand\cmdA[4]{\textit{#1} \texttt{#2} \textbf{#3} \textit{#4}}
\newcommand\cmdB[1]{\cmdA#1}
\begin{document}
TEST
\cmdA{T}{E}{S}{T}
\cmdB{TEST}
\end{document}
- 757,742

"-delimited argument with 4 letters (so 6 in total) going to a 4 parameter command. which do you want, the answers would be completely different. – David Carlisle Jan 24 '22 at 21:52\documentclassand the appropriate packages so that those trying to help don't have to recreate it. Or at least provide as complete as possible test case. – Peter Grill Jan 25 '22 at 07:51"which is a completely different form Note also that\it,\bfhaven't been defined by default in LaTex since 1993, I assume you want\textit{#1} \texttt{#2}... – David Carlisle Jan 25 '22 at 08:59