1

I've defined a new command in the document's preamble. For the sake of this question the following (tested!) example:

\newcommand{\multipleargs}[3]{{#1}-{#2}-{#3}}

Using [cmd]-M on MacOS I want to be able to enter:

\multipleargs{A}{B}{C}

But when I try this, LyX only provides me with a "hole" for the first argument. Adding braces myself only results in "text" rather than passing the enclosed text as arguments.

And, yes, I know I can use the TeX-mode ([cmd]-L on MacOS) and type

$\multipleargs{A}{B}{C}$

But this question is about using commands with multiple arguments in the formula editor.

I don't want to use the LyX macro system because I want to collect these command later in my own style.

Please don't provide an alternative to \multipleargs, it is just a silly example to illustrate the formula editing question ;-)

  • Typing \{ in the math mode works for me. Does that work for you? – scottkosty Apr 27 '18 at 19:23
  • 1
    Hi @scottkosty, Thanks! I had no clue it would be that simple. Please make it an answer instead of a comment, so I can give it a thumbs up and increase your reputation. – nanitous Apr 30 '18 at 23:31
1

In order to tell LyX that you want to enter a literal {, you must enter a backslash before. So you should enter the two-character sequence \{. An alternative is to paste the full string \multipleargs{A}{B}{C} (with all args) into a math inset all at once.

It is ironic that entering { leads to the LaTeX \{ and entering \{ leads to the LaTeX {.

  • Precisely that irony threw me off ;-) Thanks again! – nanitous May 1 '18 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.