NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
The code is correct. I guess the error message doesn't belong to this code but to your original code that is different. Did you try this example? Can you post the log file, as attachment here?
I remember such errors when using graphics instead of graphicx or when using \includegraphics with optional arguments within an optional argument, so nesting brackets that doesn't work.
Stefan
PS: to format code, use the "Code" button above the edit field. Or the [code]...[/code] syntax. I corrected it above. If you move the mouse cursor over a button, there's a small popup help information.
the driver pdftex.def does not support the manual specification of the bounding box, because it is not needed. If the user wants to have a portion of the image, there are options viewport and trim to specify this wish in a cleaner way. Option bb is treated as viewport with a warning.
So leave those options out and use the alternative options if you need them.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p