Ошибка включая изображение в [закрытом] Латексе

Перечисления TypeScript позволяют выполнять обратное отображение :

enum RowStates {
    editing = 0,
    sentToApproval,
    approved
}

enum RowColors {
    editing = '#ffffff',
    sentToApproval = '#ffffcc',
    approved = '#ccffb3'
}

function convert(rowState) {
    return RowColors[RowStates[rowState] as keyof typeof RowColors];
}

console.log(convert(RowStates.sentToApproval)); // prints '#ffffcc'

34
задан Mr Lister 3 May 2012 в 13:05
поделиться

3 ответа

I've had the same problems including jpegs in LaTeX. The engine isn't really built to gather all the necessary size and scale information from JPGs. It is often better to take the JPEG and convert it into a PDF (on a mac) or EPS (on a PC). GraphicsConvertor on a mac will do that for you easily. Whereas a PDF includes DPI and size, a JPEG has only a size in terms of pixels.

( I know this is not the answer you wanted, but it's probably better to give them EPS/PDF that they can use than to worry about what happens when they try to scale your JPG).

21
ответ дан 27 November 2019 в 16:36
поделиться

I use MacTex, and my editor is TexShop. It probably has to do with what compiler you are using. When I use pdftex, the command:

\includegraphics[height=60mm, width=100mm]{number2.png}

works fine, but when I use "Tex and Ghostscript", I get the same error as you, about not being able to get the size information. Use pdftex.

Incidentally, you can change this in TexShop from the "Typeset" menu.

Hope this helps.

4
ответ дан 27 November 2019 в 16:36
поделиться

Если у вас есть GIMP, я видел, что экспорт изображения в формате .eps подойдет.

7
ответ дан 27 November 2019 в 16:36
поделиться
Другие вопросы по тегам:

Похожие вопросы: