删除草稿中的图片,但保留超链接

删除草稿中的图片,但保留超链接

我想删除文档中的数字,以便更快地编译,并将其编译为draft所示在这个问题中。但是我想删除图片,但保留超链接(章节部分等),这样导航会更容易。以下是示例:

\documentclass[draft]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,      
    urlcolor=cyan,
    pdftitle={Sharelatex Example},
    bookmarks=true,
    pdfpagemode=FullScreen,
}
\urlstyle{same}
\begin{document}
\tableofcontents
\chapter{First Chapter}
This will be an empty chapter and I will put some text here
\begin{equation}
\label{eq:1}
\sum_{i=0}^{\infty} a_i x^i
\end{equation}
The equation \ref{eq:1} shows a sum that is divergent. This formula 
will later be used in the page \pageref{second}.
For further references see \href{http://www.sharelatex.com}{Something 
Linky} or go to the next url: \url{http://www.sharelatex.com} or open 
the next file \href{run:./file.txt}{File.txt}
It's also possible to link directly any word or 
\hyperlink{thesentence}{any sentence} in your document.
\begin{figure}
  \includegraphics{somefig.png}
\end{figure}
\end{document}

答案1

根据此篇文章来自 egreg或者hyperref 文档第 6 页您可以使用该选项final

因此,我建议:

\documentclass[draft]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,      
    urlcolor=cyan,
    pdftitle={Sharelatex Example},
    bookmarks=true,
    pdfpagemode=FullScreen,
    final
}
\urlstyle{same}
\begin{document}
\tableofcontents
\chapter{First Chapter}
This will be an empty chapter and I will put some text here
\begin{equation}
\label{eq:1}
\sum_{i=0}^{\infty} a_i x^i
\end{equation}
The equation \ref{eq:1} shows a sum that is divergent. This formula 
will later be used in the page \pageref{second}.
For further references see \href{http://www.sharelatex.com}{Something 
Linky} or go to the next url: \url{http://www.sharelatex.com} or open 
the next file \href{run:./file.txt}{File.txt}
It's also possible to link directly any word or 
\hyperlink{thesentence}{any sentence} in your document.
\begin{figure}
  \includegraphics{somefig.png}
\end{figure}
\end{document}

相关内容