# [Tex/LaTex] How to create two commands with the same name but different number of parameters

macros

I want to define a command with the same name, but a different number of parameters.

I'm considering something like this:

\documentclass{article}

\usepackage{hyperref}

\newcommand{\quelle}[1]{\textit{(Quelle: \url{#1})})}
\newcommand{\quelle}[2]{\textit{(Quelle: \url{#1} Absatz: #2)})}

\begin{document}

Test: \quelle{www.wikipedia.de}
Test: \quelle{www.wikipedia.de, sometext}

\end{document}


If I try to compile this, I get the following result:

Command \quelle already defined. ...2]{\textit{(Quelle: \url{#1} Absatz: #2)})}


The only change from the requested syntax is to use a ! as the separator between the http reference and "sometext", as I figured a comma , was much more likely to appear as part of "sometext:.

\documentclass{article}
\usepackage{hyperref,listofitems}
\newcommand{\quelle}[1]{%
\setsepchar{!}%