General! Use of doesn't match its definition. l.10 Error

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
shray_sharan
Posts: 2
Joined: Wed Jul 01, 2015 6:44 pm

! Use of doesn't match its definition. l.10 Error

Post by shray_sharan »

I was working on this thesis template which was compiling fine until I used a \verb command in my code. From then code is showing countless errors like the one given below:-

! Use of doesn't match its definition.
l.10 ...sageBreak This may be a bug in a package f
ile you are using\par } {\...
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.

I commented all the code that I wrote on that day before error popped up, but still same errors.I don't even know which part of the code is the problem so don't know what to paste here.
Attachments
Snapshot of the error window
Snapshot of the error window
Error.PNG (49.4 KiB) Viewed 19369 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

! Use of doesn't match its definition. l.10 Error

Post by cgnieder »

Without a Infominimal working example with which we can reproduce the error the following is random guessing:

You cannot use \verb inside of the argument of another macro (a \footnote, say, or a \caption, a \section or whatever…)

Regards
site moderator & package author
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Re: ! Use of doesn't match its definition. l.10 Error

Post by cgnieder »

site moderator & package author
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

! Use of doesn't match its definition. l.10 Error

Post by Stefan Kottwitz »

You cannot use \verb within \caption, as Clemens said. \verb is very specific, as it doesn't interpret LaTeX commands in its argument. So you cannot use it within macros.

It's even more unusable in a moving argument, that means it's written into a file. Captions are written into a file, to be loaded and interpreted in the next LaTeX compiler run.

It can already be fixed by simply using typewriter font with a backslash in front. The output will be as desired.

Note, you should delete the external file where it was written to. In this case, it can be the .lof file which contains the captions for the list of figures, so also the illegal \verb command, so remove it. It will be re-generated in the next run, re-read to be interpreted one run later.

Stefan
LaTeX.org admin
Post Reply