【问题标题】:Is it possible to insert a gif in latex (Overleaf)?是否可以在乳胶(背页)中插入 gif?
【发布时间】:2021-10-29 12:58:36
【问题描述】:

我正在 Overleaf 上写一个乳胶文件,我会插入一个 gif 图像。
可能吗?因为我没有找到任何解决方案。

【问题讨论】:

  • 不,不是@samcarter_is_at_topanswers.xyz
  • 请添加更多信息,说明为什么所描述的解决方法不适合您。您不能直接包含 .gif,这样的解决方法是我们可以提供的最佳解决方法
  • 我尝试使用您上面提到的问题的解决方案,但它不起作用,即使文档类是投影仪。那么还有其他选择吗?
  • “不起作用”不是一个真正有用的错误描述。您是否以演示模式在 adobe reader 中查看了 pdf?

标签: latex gif pdflatex


【解决方案1】:

我遇到了同样的问题,我通过将gif 转换为一组pngs 然后使用animate 包来解决它。

对于第一个任务,您可以利用here 建议的解决方案之一。

一旦你有一系列以共享前缀命名的图像文件(例如fig-)和一个不断增加的索引来跟踪它们必须出现的顺序,那么`animate} 的使用就很简单了:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx, animate}


\title{animate SO}
\date{January 2022}

\begin{document}

This is how to insert gif in main document:

% use the usual figure environment and substitute \includegraphics with \animategraphics
\begin{figure}
    \centering
    % \includegraphics{}
     \animategraphics[width=\textwidth, loop, autoplay]{1}%frame rate
    {figures/fig-}%path to figures
    {1}%start index
    {4}%end index
    \caption{Local gif}
    \label{fig:my_label}
\end{figure}

\end{document}

请注意,我需要将图形位置的路径表示为./figures/<fig-prefix>,以防\animategraphics 被包含在主文件中的外部tex 文件调用。 我创建了一个示例背页 project 来展示用法。

最后,我建议查看StackExchange LaTeX 以了解与乳胶相关的问题:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-05-17
    • 2022-11-11
    • 1970-01-01
    • 2022-11-19
    • 1970-01-01
    • 1970-01-01
    • 2015-01-23
    相关资源
    最近更新 更多