在ShareLaTeX代码中插入图片时遇keyval包错误求助
Hey there! Let's sort out this error popping up in your ShareLaTeX project—it's a super simple fix, promise.
First, let's recap the error you're seeing:
Package keyval Error: heigth undefined.
See the keyval package documentation for explanation.
Type Hfor immediate help.
... l.32 ...[heigth=6cm,width=5cm]{img/e-commerce.png}
The issue is just a tiny typo! You misspelled the height parameter as heigth (swapped the 'i' and 'g'). LaTeX's keyval package doesn't recognize this misspelled keyword, which is why it's throwing that error.
The Fix
Replace your problematic line of code with this corrected version:
Original (broken) code:
\includegraphics[heigth=6cm,width=5cm]{img/e-commerce.png}
Corrected code (fixed spelling):
\includegraphics[height=6cm,width=5cm]{img/e-commerce.png}
That's it! Once you fix the spelling of height, the error should disappear, and your image will render as expected.
A quick pro tip: If you use ShareLaTeX's autocomplete feature as you type, it'll suggest valid parameter names like height—this can help avoid silly typos like this in the future.
内容的提问来源于stack exchange,提问作者Lokman Koc

