\newcommand*{\name}[1][C]{%
I have come very familiar with \newcommand however, I came across this line of code and i do not know what the [C] is for.
\newcommand*{\name}[1][C]{%
I have come very familiar with \newcommand however, I came across this line of code and i do not know what the [C] is for.
LaTeX's \newcommand has the following syntax:
\newcommand *{<\FOO>}[<i>]{<TEXT>}User command to define
\FOOto be a macro withiarguments (i= 0 if missing) having the definition<TEXT>. Produces an error if\FOOalready defined. Normally the command is defined to be\long(i.e. it may take multiple paragraphs in its argument). In the star-form, the command is not defined as\longand a blank line in any argument to the command would generate an error.
If you define a command with at least one argument (i > 0), you can specify an additional (optional) argument before the definition <TEXT>. This optional argument will be used as the "default" value for a first optional argument to \FOO.
So, as an example, consider
\newcommand{\FOO}[2]{<TEXT>}
This command has two mandatory arguments and is therefore used as \FOO{<one>}{<two>}. However,
\newcommand{\FOO}[2][X]{<TEXT>}
takes two (2) arguments, the first of which is optional and has a default of X (if not supplied). You can use it as \FOO{<one>} (which is equivalent to \FOO[X]{<one>}) or \FOO[<one>]{<two>}. Similarly,
\newcommand{\FOO}[1][X]{<TEXT>}
takes a single (1) optional argument that has a default value of X (if not supplied) and can be used as \FOO (which is equivalent to \FOO[X]) or \FOO[<one>].
In your particular case,
\newcommand*{\name}[1][C]{<TEXT>}
defines \name to (be non-\long; that is, <TEXT> cannot have blank lines and) take a single (1) optional argument that defaults to C if not supplied. You can use it as \name (which is equivalent to \name[C]) or \name[<one>].
Reference:
\namehas one optional argument whose default value isC. – Jan 21 '19 at 03:30\itdo not get advertized? – Jan 21 '19 at 03:54\itetc. are commands provided by the standard LaTeX classes, so naturally they would be listed in a reference manual. However, you can contribute and remove them https://latexref.xyz/dev/writing.html – Henri Menke Jan 21 '19 at 04:08\itand so on. Therefore I am really wondering if there are sources of the same information which a free of such relics. – Jan 21 '19 at 04:13