You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在ShareLaTeX代码中插入图片时遇keyval包错误求助

Fixing "Package keyval Error: heigth undefined" in LaTeX (ShareLaTeX)

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 H for 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:05:25