pt 和像素之间的转换
我的上网本有一个10.1英寸长度和1024*600分辨率的显示器。我认为 1pt 大约是 1/72inch - 以下计算正确吗?
由于分辨率为1024*600, 对角线大约有 1186.83 个像素, 因此 1 英寸约为 1186.83/10.1 = 117.51 像素,因此 1pt 约为 117.51/72 = 1.63 像素,即 1 像素约为 0.6127 pt。
利用这种关系,我将图像插入到 LaTeX 文档中,将像素转换为 pt,并将结果作为 includegraphics
的参数,但生成的文档中的图形相当模糊。
- 计算是否正确?如果 不、如何或 我哪里错了?
- 如何将图像插入 LaTeX 文档中 与尺寸完全相同 原来的?
更新:
我使用pdflatex来编译文档,图像是一个png文件,我之所以进行如此愚蠢的计算,是因为在没有设置宽度参数的情况下,文档中显示的图像比实际尺寸大,我不明白为什么。
My netbook has a monitor with 10.1 inch length and 1024*600 solution. I think 1pt is about 1/72inch - is the following computation right?
Since the resolution is 1024*600, the
diagonal has about 1186.83 pixels,
thus 1 inch is about 1186.83/10.1 =
117.51 pixels, and thus 1pt is about 117.51/72 = 1.63 pixels, or 1 pixel is about 0.6127 pt.
Using this relationship, I've inserted an image into a LaTeX document, converting pixels to pt, and take the result as a parameter to includegraphics
, but the figure in the resulting document is rather blurred.
- Is the computation correct? if
not, how or
where am I wrong? - How can I insert an image into a LaTeX document
with precisely the same dimensions as the
original?
Updated:
I'm using pdflatex to compile the document and the image is a png file, and the reason why I do such a stupid computation is that with no width parameter set, the image shown in the document is larger than the actual size, and I can't work out why.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LaTeX 用于创建纸质文档。它使用的单位是指纸张输出上的距离,而不是屏幕上的距离。因此,如果您在 LaTeX 中要求 72pts 的距离,您将在打印输出上得到 1 英寸,但您在屏幕上获得的距离取决于 pdf 或 ps 阅读器的缩放级别,这可能不知道如何你的屏幕很大。
如果您只是想让图像的光栅网格适合屏幕网格,我想说最好的办法就是尽可能获得更高质量的图形。
(PS 有一个 TeX 堆栈交换站点,您也可以在其中提出您的问题...)
LaTeX is for creating paper documents. The units it uses refer to distance on the paper output, not on the screen. So if you ask for a distance of 72pts in LaTeX, you'll get 1 inch on your printout, but the distance you get on your screen depends on the zoom-level of your pdf or ps reader, which probably doesn't know how big your screen is.
If you simply want to get the raster grid of your image to fit to the screen grid, I'd say the best thing to do is get a higher-quality graphic if you can.
(PS there's a TeX stack exchange site where you could ask your question too...)
我不知道这是否会产生任何影响,但 TeX 实际上使用 72.27 点为英寸(因为它早于 PostScript,后者将标准 72 点设置为英寸)。
I don't know if it will make any difference, but TeX actually uses 72.27 points to the inch (as it predates PostScript, which set the standard 72 points to the inch).