Error: Argument of newcommand{…} has an extra }
I am trying to create a new command to help formatting the entries of the list of figures. Argument 1 should be optional and contain the date the source was accessed, argument 2 is simply the figure's caption I want to show up in the list of figures, and argument 3 is a hyperlink to the source of the image. I want the source and date to only show up in the list of figures and not underneath the actual image. I wrote this in the preamble:
newcommand{lof}[3]{
textbf{#2}
linebreak
{scriptsize #3 #1}
}
This is the caption of some figure:
caption[
lof[(Accessed on 02.01.2019)]
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
]
{Basic neural network with three layers}
Note that I want to be able to declare that the image is my own, in which case the hyperlink and the date should be omitted.
caption[
{Basic neural network with three layers}
{Made by the author.}
]
{Basic neural network with three layers}
This gives me the following error:
! Argument of \lof has an extra }.
However, the brackets should be balanced if I am not completely mistaken. I have read somewhere that there are 'fragile' commands, and using them leads to the same error message I got. Might url{} be a fragile command? Or have I messed up the command definition somehow?
Edit:
The following code shows everything that might be related to the problem. If I remove these parts from the code, the LaTeX documents compiles.
documentclass{article}
usepackage{wrapfig,graphicx,amsmath,hyperref}
newcommand{lof}[3]{textbf{#2}newline {scriptsize #3 #1}}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
caption[ {lof[(Accessed on 02.01.2019)]
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ]
{Basic neural network with three layers}
label{fig:nn}
end{wrapfigure}
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
caption[{lof{$boldsymbol{sigma (x)}$, the sigmoid function}
{Created by the author}}]
{$sigma (x)$, the sigmoid function}
label{fig:sigmoid}
end{wrapfigure}
end{document}
macros table-of-contents errors hyperref urls
New contributor
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 10 more comments
I am trying to create a new command to help formatting the entries of the list of figures. Argument 1 should be optional and contain the date the source was accessed, argument 2 is simply the figure's caption I want to show up in the list of figures, and argument 3 is a hyperlink to the source of the image. I want the source and date to only show up in the list of figures and not underneath the actual image. I wrote this in the preamble:
newcommand{lof}[3]{
textbf{#2}
linebreak
{scriptsize #3 #1}
}
This is the caption of some figure:
caption[
lof[(Accessed on 02.01.2019)]
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
]
{Basic neural network with three layers}
Note that I want to be able to declare that the image is my own, in which case the hyperlink and the date should be omitted.
caption[
{Basic neural network with three layers}
{Made by the author.}
]
{Basic neural network with three layers}
This gives me the following error:
! Argument of \lof has an extra }.
However, the brackets should be balanced if I am not completely mistaken. I have read somewhere that there are 'fragile' commands, and using them leads to the same error message I got. Might url{} be a fragile command? Or have I messed up the command definition somehow?
Edit:
The following code shows everything that might be related to the problem. If I remove these parts from the code, the LaTeX documents compiles.
documentclass{article}
usepackage{wrapfig,graphicx,amsmath,hyperref}
newcommand{lof}[3]{textbf{#2}newline {scriptsize #3 #1}}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
caption[ {lof[(Accessed on 02.01.2019)]
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ]
{Basic neural network with three layers}
label{fig:nn}
end{wrapfigure}
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
caption[{lof{$boldsymbol{sigma (x)}$, the sigmoid function}
{Created by the author}}]
{$sigma (x)$, the sigmoid function}
label{fig:sigmoid}
end{wrapfigure}
end{document}
macros table-of-contents errors hyperref urls
New contributor
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
caption[ {lof[(Accessed on 02.01.2019)] {Basic neural network with three layers} {url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ] {Basic neural network with three layers}-- you must enclose thelot[...]{}{}command with a{}pair, since it has an optional argument and occurs in the optional argument ofcaption
– Christian Hupfer
2 hours ago
1
You might want to have a look at thexparsepackage, which makes it considerably easier to define commands with multiple optonal arguments.
– GuM
2 hours ago
1
@Terrenay: Then add the complete code, not just fragments only
– Christian Hupfer
2 hours ago
1
As you are new, I extended your fragment with the missing definitions and replacing with generally available images, however it does not produce the error that you are asking about. Please edit the example so that it is an example of the error.
– David Carlisle
2 hours ago
1
also you should delete your .aux and .lof files which may be corrupted by previous errors.
– David Carlisle
2 hours ago
|
show 10 more comments
I am trying to create a new command to help formatting the entries of the list of figures. Argument 1 should be optional and contain the date the source was accessed, argument 2 is simply the figure's caption I want to show up in the list of figures, and argument 3 is a hyperlink to the source of the image. I want the source and date to only show up in the list of figures and not underneath the actual image. I wrote this in the preamble:
newcommand{lof}[3]{
textbf{#2}
linebreak
{scriptsize #3 #1}
}
This is the caption of some figure:
caption[
lof[(Accessed on 02.01.2019)]
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
]
{Basic neural network with three layers}
Note that I want to be able to declare that the image is my own, in which case the hyperlink and the date should be omitted.
caption[
{Basic neural network with three layers}
{Made by the author.}
]
{Basic neural network with three layers}
This gives me the following error:
! Argument of \lof has an extra }.
However, the brackets should be balanced if I am not completely mistaken. I have read somewhere that there are 'fragile' commands, and using them leads to the same error message I got. Might url{} be a fragile command? Or have I messed up the command definition somehow?
Edit:
The following code shows everything that might be related to the problem. If I remove these parts from the code, the LaTeX documents compiles.
documentclass{article}
usepackage{wrapfig,graphicx,amsmath,hyperref}
newcommand{lof}[3]{textbf{#2}newline {scriptsize #3 #1}}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
caption[ {lof[(Accessed on 02.01.2019)]
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ]
{Basic neural network with three layers}
label{fig:nn}
end{wrapfigure}
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
caption[{lof{$boldsymbol{sigma (x)}$, the sigmoid function}
{Created by the author}}]
{$sigma (x)$, the sigmoid function}
label{fig:sigmoid}
end{wrapfigure}
end{document}
macros table-of-contents errors hyperref urls
New contributor
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am trying to create a new command to help formatting the entries of the list of figures. Argument 1 should be optional and contain the date the source was accessed, argument 2 is simply the figure's caption I want to show up in the list of figures, and argument 3 is a hyperlink to the source of the image. I want the source and date to only show up in the list of figures and not underneath the actual image. I wrote this in the preamble:
newcommand{lof}[3]{
textbf{#2}
linebreak
{scriptsize #3 #1}
}
This is the caption of some figure:
caption[
lof[(Accessed on 02.01.2019)]
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
]
{Basic neural network with three layers}
Note that I want to be able to declare that the image is my own, in which case the hyperlink and the date should be omitted.
caption[
{Basic neural network with three layers}
{Made by the author.}
]
{Basic neural network with three layers}
This gives me the following error:
! Argument of \lof has an extra }.
However, the brackets should be balanced if I am not completely mistaken. I have read somewhere that there are 'fragile' commands, and using them leads to the same error message I got. Might url{} be a fragile command? Or have I messed up the command definition somehow?
Edit:
The following code shows everything that might be related to the problem. If I remove these parts from the code, the LaTeX documents compiles.
documentclass{article}
usepackage{wrapfig,graphicx,amsmath,hyperref}
newcommand{lof}[3]{textbf{#2}newline {scriptsize #3 #1}}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
caption[ {lof[(Accessed on 02.01.2019)]
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ]
{Basic neural network with three layers}
label{fig:nn}
end{wrapfigure}
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
caption[{lof{$boldsymbol{sigma (x)}$, the sigmoid function}
{Created by the author}}]
{$sigma (x)$, the sigmoid function}
label{fig:sigmoid}
end{wrapfigure}
end{document}
macros table-of-contents errors hyperref urls
macros table-of-contents errors hyperref urls
New contributor
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 2 hours ago
David Carlisle
482k4011151853
482k4011151853
New contributor
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 hours ago
Terrenay
62
62
New contributor
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Terrenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
caption[ {lof[(Accessed on 02.01.2019)] {Basic neural network with three layers} {url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ] {Basic neural network with three layers}-- you must enclose thelot[...]{}{}command with a{}pair, since it has an optional argument and occurs in the optional argument ofcaption
– Christian Hupfer
2 hours ago
1
You might want to have a look at thexparsepackage, which makes it considerably easier to define commands with multiple optonal arguments.
– GuM
2 hours ago
1
@Terrenay: Then add the complete code, not just fragments only
– Christian Hupfer
2 hours ago
1
As you are new, I extended your fragment with the missing definitions and replacing with generally available images, however it does not produce the error that you are asking about. Please edit the example so that it is an example of the error.
– David Carlisle
2 hours ago
1
also you should delete your .aux and .lof files which may be corrupted by previous errors.
– David Carlisle
2 hours ago
|
show 10 more comments
1
caption[ {lof[(Accessed on 02.01.2019)] {Basic neural network with three layers} {url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ] {Basic neural network with three layers}-- you must enclose thelot[...]{}{}command with a{}pair, since it has an optional argument and occurs in the optional argument ofcaption
– Christian Hupfer
2 hours ago
1
You might want to have a look at thexparsepackage, which makes it considerably easier to define commands with multiple optonal arguments.
– GuM
2 hours ago
1
@Terrenay: Then add the complete code, not just fragments only
– Christian Hupfer
2 hours ago
1
As you are new, I extended your fragment with the missing definitions and replacing with generally available images, however it does not produce the error that you are asking about. Please edit the example so that it is an example of the error.
– David Carlisle
2 hours ago
1
also you should delete your .aux and .lof files which may be corrupted by previous errors.
– David Carlisle
2 hours ago
1
1
caption[ {lof[(Accessed on 02.01.2019)] {Basic neural network with three layers} {url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ] {Basic neural network with three layers} -- you must enclose the lot[...]{}{} command with a {} pair, since it has an optional argument and occurs in the optional argument of caption– Christian Hupfer
2 hours ago
caption[ {lof[(Accessed on 02.01.2019)] {Basic neural network with three layers} {url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ] {Basic neural network with three layers} -- you must enclose the lot[...]{}{} command with a {} pair, since it has an optional argument and occurs in the optional argument of caption– Christian Hupfer
2 hours ago
1
1
You might want to have a look at the
xparse package, which makes it considerably easier to define commands with multiple optonal arguments.– GuM
2 hours ago
You might want to have a look at the
xparse package, which makes it considerably easier to define commands with multiple optonal arguments.– GuM
2 hours ago
1
1
@Terrenay: Then add the complete code, not just fragments only
– Christian Hupfer
2 hours ago
@Terrenay: Then add the complete code, not just fragments only
– Christian Hupfer
2 hours ago
1
1
As you are new, I extended your fragment with the missing definitions and replacing with generally available images, however it does not produce the error that you are asking about. Please edit the example so that it is an example of the error.
– David Carlisle
2 hours ago
As you are new, I extended your fragment with the missing definitions and replacing with generally available images, however it does not produce the error that you are asking about. Please edit the example so that it is an example of the error.
– David Carlisle
2 hours ago
1
1
also you should delete your .aux and .lof files which may be corrupted by previous errors.
– David Carlisle
2 hours ago
also you should delete your .aux and .lof files which may be corrupted by previous errors.
– David Carlisle
2 hours ago
|
show 10 more comments
1 Answer
1
active
oldest
votes
I get no error, but your input is very awkward and error prone.
I suggest to define a new xcaption command, so as to minimize the burden.
documentclass{article}
usepackage{xparse}
usepackage{amsmath}
usepackage{wrapfig}
usepackage{graphicx}
usepackage{hyperref}
usepackage{kantlipsum}
NewDocumentCommand{xcaption}{O{#2}mmo}{%
caption[lof{#1}{#3IfValueT{#4}{ #4}}]{#2}%
}
NewDocumentCommand{lof}{mm}{%
{boldmathtextbf{#1}}newline
{scriptsize #2}%
}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
xcaption
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
[(Accessed on 02.01.2019)]
label{fig:nn}
end{wrapfigure}
kant[1]
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
xcaption
[Short caption with $sigma(x)$]
{$sigma (x)$, the sigmoid function}
{Created by the author}
label{fig:sigmoid}
end{wrapfigure}
kant[1]
end{document}
The syntax is
xcaption
[<optional caption for the lof>]
{<main caption>}
{<attribution>}
[<optional info>]
I added an example of the optional caption, also showing how to get bold math without explicitly adding boldsymbol.
The lof command is only auxiliary and it shouldn't be really used in the document.

add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Terrenay is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468333%2ferror-argument-of-newcommand-has-an-extra%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I get no error, but your input is very awkward and error prone.
I suggest to define a new xcaption command, so as to minimize the burden.
documentclass{article}
usepackage{xparse}
usepackage{amsmath}
usepackage{wrapfig}
usepackage{graphicx}
usepackage{hyperref}
usepackage{kantlipsum}
NewDocumentCommand{xcaption}{O{#2}mmo}{%
caption[lof{#1}{#3IfValueT{#4}{ #4}}]{#2}%
}
NewDocumentCommand{lof}{mm}{%
{boldmathtextbf{#1}}newline
{scriptsize #2}%
}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
xcaption
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
[(Accessed on 02.01.2019)]
label{fig:nn}
end{wrapfigure}
kant[1]
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
xcaption
[Short caption with $sigma(x)$]
{$sigma (x)$, the sigmoid function}
{Created by the author}
label{fig:sigmoid}
end{wrapfigure}
kant[1]
end{document}
The syntax is
xcaption
[<optional caption for the lof>]
{<main caption>}
{<attribution>}
[<optional info>]
I added an example of the optional caption, also showing how to get bold math without explicitly adding boldsymbol.
The lof command is only auxiliary and it shouldn't be really used in the document.

add a comment |
I get no error, but your input is very awkward and error prone.
I suggest to define a new xcaption command, so as to minimize the burden.
documentclass{article}
usepackage{xparse}
usepackage{amsmath}
usepackage{wrapfig}
usepackage{graphicx}
usepackage{hyperref}
usepackage{kantlipsum}
NewDocumentCommand{xcaption}{O{#2}mmo}{%
caption[lof{#1}{#3IfValueT{#4}{ #4}}]{#2}%
}
NewDocumentCommand{lof}{mm}{%
{boldmathtextbf{#1}}newline
{scriptsize #2}%
}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
xcaption
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
[(Accessed on 02.01.2019)]
label{fig:nn}
end{wrapfigure}
kant[1]
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
xcaption
[Short caption with $sigma(x)$]
{$sigma (x)$, the sigmoid function}
{Created by the author}
label{fig:sigmoid}
end{wrapfigure}
kant[1]
end{document}
The syntax is
xcaption
[<optional caption for the lof>]
{<main caption>}
{<attribution>}
[<optional info>]
I added an example of the optional caption, also showing how to get bold math without explicitly adding boldsymbol.
The lof command is only auxiliary and it shouldn't be really used in the document.

add a comment |
I get no error, but your input is very awkward and error prone.
I suggest to define a new xcaption command, so as to minimize the burden.
documentclass{article}
usepackage{xparse}
usepackage{amsmath}
usepackage{wrapfig}
usepackage{graphicx}
usepackage{hyperref}
usepackage{kantlipsum}
NewDocumentCommand{xcaption}{O{#2}mmo}{%
caption[lof{#1}{#3IfValueT{#4}{ #4}}]{#2}%
}
NewDocumentCommand{lof}{mm}{%
{boldmathtextbf{#1}}newline
{scriptsize #2}%
}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
xcaption
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
[(Accessed on 02.01.2019)]
label{fig:nn}
end{wrapfigure}
kant[1]
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
xcaption
[Short caption with $sigma(x)$]
{$sigma (x)$, the sigmoid function}
{Created by the author}
label{fig:sigmoid}
end{wrapfigure}
kant[1]
end{document}
The syntax is
xcaption
[<optional caption for the lof>]
{<main caption>}
{<attribution>}
[<optional info>]
I added an example of the optional caption, also showing how to get bold math without explicitly adding boldsymbol.
The lof command is only auxiliary and it shouldn't be really used in the document.

I get no error, but your input is very awkward and error prone.
I suggest to define a new xcaption command, so as to minimize the burden.
documentclass{article}
usepackage{xparse}
usepackage{amsmath}
usepackage{wrapfig}
usepackage{graphicx}
usepackage{hyperref}
usepackage{kantlipsum}
NewDocumentCommand{xcaption}{O{#2}mmo}{%
caption[lof{#1}{#3IfValueT{#4}{ #4}}]{#2}%
}
NewDocumentCommand{lof}{mm}{%
{boldmathtextbf{#1}}newline
{scriptsize #2}%
}
begin{document}
listoffigures
begin{wrapfigure}{r}{0.25textwidth}
centering
includegraphics[width=0.25textwidth]{example-image}
xcaption
{Basic neural network with three layers}
{url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}
[(Accessed on 02.01.2019)]
label{fig:nn}
end{wrapfigure}
kant[1]
begin{wrapfigure}{h}{0.5textwidth}
centering
includegraphics[width=0.5textwidth]{example-image}
xcaption
[Short caption with $sigma(x)$]
{$sigma (x)$, the sigmoid function}
{Created by the author}
label{fig:sigmoid}
end{wrapfigure}
kant[1]
end{document}
The syntax is
xcaption
[<optional caption for the lof>]
{<main caption>}
{<attribution>}
[<optional info>]
I added an example of the optional caption, also showing how to get bold math without explicitly adding boldsymbol.
The lof command is only auxiliary and it shouldn't be really used in the document.

answered 2 hours ago
egreg
709k8618833167
709k8618833167
add a comment |
add a comment |
Terrenay is a new contributor. Be nice, and check out our Code of Conduct.
Terrenay is a new contributor. Be nice, and check out our Code of Conduct.
Terrenay is a new contributor. Be nice, and check out our Code of Conduct.
Terrenay is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468333%2ferror-argument-of-newcommand-has-an-extra%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
caption[ {lof[(Accessed on 02.01.2019)] {Basic neural network with three layers} {url{https://commons.wikimedia.org/wiki/File:Artificial_neural_network.svg}}} ] {Basic neural network with three layers}-- you must enclose thelot[...]{}{}command with a{}pair, since it has an optional argument and occurs in the optional argument ofcaption– Christian Hupfer
2 hours ago
1
You might want to have a look at the
xparsepackage, which makes it considerably easier to define commands with multiple optonal arguments.– GuM
2 hours ago
1
@Terrenay: Then add the complete code, not just fragments only
– Christian Hupfer
2 hours ago
1
As you are new, I extended your fragment with the missing definitions and replacing with generally available images, however it does not produce the error that you are asking about. Please edit the example so that it is an example of the error.
– David Carlisle
2 hours ago
1
also you should delete your .aux and .lof files which may be corrupted by previous errors.
– David Carlisle
2 hours ago