2

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.

This is the code that I wrote after which errors appeared:

\begin{figure}[h]

\centering
\includegraphics[scale=0.75]{TAMUthesis_AddChapter.png}
\caption{Add More Chapters Into TAMUthesis\_Template.tex.
[For example, a new chapter named "myNewChapterName.tex" is created under the
folder of data. To put this new file for the compilation by adding the line \verb+\eqref{}+ char as shown in 281 (uncomment the  in front.)]}

Below is the link to access the files

https://www.mediafire.com/?7l9ieny56v8sp0e

18
  • 1
    Welcome to TeX.SX! You mention \verb: how are you using it?
    – egreg
    Commented Jul 15, 2015 at 21:32
  • I had to display Latex commands such that they are not compiled but displayed as text. So I used \verb+\eqref{}... And i used this is command at a couple of places.. But now all of that is commented.. but still errors are there Commented Jul 15, 2015 at 21:34
  • 1
    You can't use \verb in the argument to \caption.
    – egreg
    Commented Jul 15, 2015 at 21:47
  • 1
    Don't use \verb in the arguments of other commands, and delete the .lof-file to get rid of the errors. Commented Jul 15, 2015 at 21:49
  • 1
    The error message you show is not the format TeX uses. please show the exact error lines from the log file. Commented Jul 15, 2015 at 22:07

1 Answer 1

2

As already I wrote answering to the crosspost on LaTeX-Community.org:

You cannot use \verb within \caption, as egreg and Ulrike said in the comments her before. \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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .