1

I'm using \newcommand for create some custom functions in my text. Some of these functions have 2 or 3 arguments and many times I confuse the input order.

The default commands of LaTeX in my TeXstudio editor shows suggestions like

enter image description here

enter image description here

But the new commands does not do it, only shows arg1 and arg2

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\newcommand{\test}[2]{#2 and then #1}

\begin{document}

\test{second}{first}

\test{arg1}{arg2}

\textbf{text}

\end{document}

enter image description here

enter image description here

There is a way to change the words arg1 and arg2 for second and first for example?

\test{second}{first} instead \test{arg1}{arg2}

David Carlisle
  • 757,742
  • I added texstudio as a tag, as well. – Steven B. Segletes Apr 11 '18 at 20:01
  • 1
    Why not redefining the command so that first be in place of arg1 and second to be in place of arg2? Also custom is not a good tag... Everything in TeX can be consider as custom... – koleygr Apr 11 '18 at 20:02
  • 1
    @koleygr I guess the MWE is over simplified. Something like \newcommand{\mypic}[3][]{\begin{figure}\centering\includegraphics[#1]{#2}\caption{#3}\end{figure}} and then the syntax explanation options, file, caption instead of arg1, arg2, arg3, respectively, would be useful. – Skillmon Apr 11 '18 at 20:08
  • May be your example (with first and second) is just an example and you want something like \test{color}{distance}{shape}... Or similar... Please make it clear – koleygr Apr 11 '18 at 20:08
  • @Skillmon... Thanks... Thought about it just some minutes after commented... – koleygr Apr 11 '18 at 20:11

0 Answers0