我使用 Beamer 如下:
\documentclass[10pt]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage{appendixnumberbeamer}
\usepackage[numbers,sort&compress]{natbib}
\bibliographystyle{plainnat}
\usepackage[utf8x]{inputenc}
\usepackage{graphicx}
\usepackage{caption}
\DeclareGraphicsExtensions{.png,.jpg,.pdf,.mps} % Para versão PDF
\usepackage[scale=2]{ccicons}
\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
\title{Curso de Javascript}
% \subtitle{Subtítulo}
%\date{\today}
\date{29/04/2019}
\author{Prof. Dr. Ricardo Ramos de Oliveira}
\institute{IFSULDEMINAS - Programação Web I - 1ª/2019}
% \titlegraphic{\hfill\includegraphics[height=1.5cm]{logo.pdf}}
\begin{document}
\maketitle
\begin{frame}{Table of contents}
\setbeamertemplate{section in toc}[sections numbered]
\tableofcontents[hideallsubsections]
\end{frame}
\section{Introdução}
\begin{frame}[fragile]{Javascript - Introdução}
História do Javascript
\end{frame}
\begin{frame}[fragile]{Javascript - Introdução}
\textbf{Javascript - JS}
\begin{itemize}
\item Linguagem de Programação do Navaegador (Javascript - Abreviação JS);
\item É uma linguagem interpretada e Orientada a Objetos (OO);
\item Interpretada pelo Navegador;
\item Utilizada tanto do lado cliente quanto do servidor (NodeJS);
\item Javascript $\neq$ Java;
\item Javascript para Sistemas Embarcados \footnote{\textbf{Biblioteca johnny-five: }http://johnny-five.io/}.
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Javascript - Introdução}
\textbf{Engine Javascript - Interpretador JS}
\begin{figure}[ht]
\centering
\includegraphics[scale=0.4]{JavascriptEngine.jpg}
\caption{Figure 1}
\end{figure}
\end{frame}
\begin{frame}[fragile]{Javascript - Introdução}
\begin{figure}[ht]
\centering
\includegraphics[scale=0.2]{firefox.png}
\caption{Figure 2}
\end{figure}
\end{frame}
\end{document}
但是,我的代码仅显示格式中的第二个图形.png
,我不知道为什么 Beamer 没有显示.jpg
格式中的图像。有人能告诉我我做错了什么吗?
此外,Overleaf 中还出现了以下消息:
Dimension too large.
<to be read again>
b
l.7 ...degraphics[scale=0.4]{JavascriptEngine.jpg}
I can't work with sizes bigger than about 19 feet.
Continue and I'll use the largest value I can.
我的身材JavascriptEngine.jpg
答案1
或者下载这个更高质量的 PNG 文件
或者从下面的图片中剪辑一个,因为大多数浏览器都会将其保存为 96dpi
不过,我会尝试找到您的源图形并保存为 png,因为这样会很清晰,而 jpg 肯定不适合图形图像(仅限照片)
您可以直接在 Latex 中构建,请参阅此处的表格部分,我将其与 PNG 和 JPG 进行了比较
\documentclass[a4paper,12pt]{article}
\usepackage[table]{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{graphicx}
% \RequirePackage{fontspec} uncomment for use with xelatex
% \setmainfont{Arial} uncomment for use with arial font on windows
\begin{document}
\noindent
\begin{table}
\begin{tabular}{|l|l|}
\hline
\cellcolor{green!75}Browser & \cellcolor{green!75}Engine Name \\ \hline
Chrome & V8 \\ \hline
Firefox & SpiderMonkey \\ \hline
Edge & Chakra \\ \hline
Safari & JavaScriptCore \\ \hline
\end{tabular}
Vector format (scalable by choice of fontsize)
\end{table}
\par\noindent
\includegraphics[scale=0.18]{browsers.png}\newline
32bit 1169x616 pixels @ 96dpi = (81,920 bytes) = SMALLER and Better
\newline\par\noindent
\includegraphics[scale=0.18]{browsers.jpg}\newline
24bit 1169x616 pixels @ 96dpi = (151,552 bytes)
\end{document}
答案2
- 只需使用相对于页面的尺寸(或像 20 毫米这样的绝对尺寸)。
- 在我看来,dpi 的分辨率并不重要(参考用户@KJO 的评论)——重要的是像素的绝对数量(全高清的宽度为 1920 像素)。
\includegraphics[width=0.8\textwidth]{JavascriptEngine.jpg}
答案3
最好的方法是将 jpg 转换为 eps,例如jpg2eps
,然后使用\usepackage{graphicx}
和
\begin{frame}
\begin{center}
\includegraphics[scale=.5]{com_2020_2.eps}
\end{center}
\end{frame}