最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

fonts - How to create invisible, but copiable, text with LaTeX? - Stack Overflow

programmeradmin3浏览0评论

I want to produce a .pdf document using LaTeX that has text that would look like:

Here is some example text.

But when that text is highlighted and copied and pasted the result is:

Here is some secret message example text.

I've seen this done using HTML and other means, but wondering if it's possible in LaTeX. The closest I've got is

Here is some\makebox[0pt]{\textcolor{white}{ secret message}} example text.

But this leaves the text looking weird (I think the white text is overlayed on top of the black text).

Thanks!

I want to produce a .pdf document using LaTeX that has text that would look like:

Here is some example text.

But when that text is highlighted and copied and pasted the result is:

Here is some secret message example text.

I've seen this done using HTML and other means, but wondering if it's possible in LaTeX. The closest I've got is

Here is some\makebox[0pt]{\textcolor{white}{ secret message}} example text.

But this leaves the text looking weird (I think the white text is overlayed on top of the black text).

Thanks!

Share Improve this question asked Mar 20 at 11:46 HmmmBeeeHmmmBeee 132 bronze badges 1
  • Please add a compilable minimal reproducible example – samcarter_is_at_topanswers.xyz Commented Mar 20 at 11:58
Add a comment  | 

1 Answer 1

Reset to default 0

Instead of a centred makebox, which will overlap half of the text on top of the previous text, you could left align the box.

Alternatively, you could also change the transparency of the text.

\documentclass{article}

\usepackage{xcolor}
\usepackage{transparent}

\begin{document}

Here is some\makebox[0pt][l]{\textcolor{white}{ secret message}} example text.

Here is some\makebox[0pt]{\texttransparent{0}{ secret message}} example text.

\end{document}
发布评论

评论列表(0)

  1. 暂无评论