隐藏信息

隐藏信息

早上好,我试图避免简历中的信息。特别是,我希望有一种方法可以用与文本大小相同的黑框替换我的个人地址。我目前正在使用\phantom,我想知道是否有办法用黑色空间代替空白空间。

答案1

这是一个更好的方法:

结果

这是从 pdf 复制并粘贴后得到的内容:

To censor it .
To blackout it, .

有关更多替代方案,请security参阅卡坦,其中仅luacensor可能引起兴趣。

\documentclass[10pt, a4paper]{article}
\usepackage{censor}

\begin{document}

To censor it \censor{censor it}.\\

To blackout it, \blackout{black it out}.

\end{document}

答案2

类似的东西

\newlength{\myboxw}
\newlength{\myboxh}
\newcommand{\blackphantom}[1]%
{\settowidth{\myboxw}{#1}%
\settoheight{\myboxh}{#1}%
\rule{\myboxw}{\myboxh}}

\blackphantom{Hidden Text}

可以工作,但仅限于水平方向(即不支持多行内容或带换行/连字符的文本)。(\phantom不过我认为有相同的行为......)

答案3

以下是一种方法:

  • 使用包xcolorsoul通过突出显示文本\hl{}
  • 它在视觉上覆盖了它

但是,如果你标记、复制并粘贴黑色部分到编辑器中,你仍然可以读到它:strike-out.

结果

\documentclass[10pt, a4paper]{article}
\usepackage{xcolor, soul}

\begin{document}

1: Whatever you want to \hl{highlight}.\\

\sethlcolor{black}
2: Whatever you want to strike-\hl{out}.\\

3: Whatever you want to \hl{highlight}.\\% uses current color

\sethlcolor{yellow}% switch "back"
4: Whatever you want to \hl{highlight}.

\end{document}

附言:这可能仍然是一个选择,因为并非所有 pdf 文件用户都知道,更不用说尝试了,他们可以标记和复制文本选择......

答案4

使用 Lua 代码的基于排版的解决方案可用于定义自定义的 Open Type 字体功能,当为字体打开该功能时,允许字体用另一个字形(集合)替换一个字形(集合),包括连字。

审查者1

和:

审查者2

比较传统的“墨块”:

审查者3

需要 LuaLaTeX。

平均能量损失

\documentclass{article}
\usepackage{fontspec}
\usepackage{lipsum}

\newcommand\anycxchar{uniEBA3}
\newcommand\anycxcharb{uni2580}
\newcommand\anycxcharc{circlecopyrt}

\directlua {
luaotfload.add_colorscheme("cxscheme",
{
["FF200080"] = {"\anycxchar"},
})
}

\directlua {
luaotfload.add_colorscheme("cyscheme",
{
["FF20A090"] = {"\anycxcharb"},
})
}



\directlua {
luaotfload.add_colorscheme("czscheme",
{
["FF0000"] = {"T_h"},
})
}

\directlua{
fonts.handlers.otf.addfeature {
    name = "anycx",
    type = "substitution",
    data = {
        ["a"] = "\anycxchar",
        ["b"] = "\anycxchar",
        ["c"] = "\anycxchar",
        ["d"] = "\anycxchar",
        ["e"] = "\anycxchar",
        ["f"] = "\anycxchar",
        ["g"] = "\anycxchar",
        ["h"] = "\anycxchar",
        ["i"] = "\anycxchar",
        ["j"] = "\anycxchar",
        ["k"] = "\anycxchar",
        ["l"] = "\anycxchar",
        ["m"] = "\anycxchar",
        ["n"] = "\anycxchar",
        ["o"] = "\anycxchar",
        ["p"] = "\anycxchar",
        ["q"] = "\anycxchar",
        ["r"] = "\anycxchar",
        ["s"] = "\anycxchar",
        ["t"] = "\anycxchar",
        ["u"] = "\anycxchar",
        ["v"] = "\anycxchar",
        ["w"] = "\anycxchar",
        ["x"] = "\anycxchar",
        ["y"] = "\anycxchar",
        ["z"] = "\anycxchar",
        ["0"] = "\anycxchar",
        ["1"] = "\anycxchar",
        ["2"] = "\anycxchar",
        ["3"] = "\anycxchar",
        ["4"] = "\anycxchar",
        ["5"] = "\anycxchar",
        ["6"] = "\anycxchar",
        ["7"] = "\anycxchar",
        ["8"] = "\anycxchar",
        ["9"] = "\anycxchar",
        ["r"] = "\anycxchar",
        [","] = "\anycxchar",
        ["."] = "\anycxchar",
        ["/"] = "\anycxchar",
        ["<"] = "\anycxchar",
        [">"] = "\anycxchar",
        ["?"] = "\anycxchar",
        }
    }
}


\directlua{
fonts.handlers.otf.addfeature {
    name = "anycy",
    type = "substitution",
    data = {
        ["hyphen"] = "\anycxcharb",
        ["a"] = "\anycxcharb",
        ["b"] = "\anycxcharb",
        ["c"] = "\anycxcharb",
        ["d"] = "\anycxcharb",
        ["e"] = "\anycxcharb",
        ["f"] = "\anycxcharb",
        ["g"] = "\anycxcharb",
        ["h"] = "\anycxcharb",
        ["i"] = "\anycxcharb",
        ["j"] = "\anycxcharb",
        ["k"] = "\anycxcharb",
        ["l"] = "\anycxcharb",
        ["m"] = "\anycxcharb",
        ["n"] = "\anycxcharb",
        ["o"] = "\anycxcharb",
        ["p"] = "\anycxcharb",
        ["q"] = "\anycxcharb",
        ["r"] = "\anycxcharb",
        ["s"] = "\anycxcharb",
        ["t"] = "\anycxcharb",
        ["u"] = "\anycxcharb",
        ["v"] = "\anycxcharb",
        ["w"] = "\anycxcharb",
        ["x"] = "\anycxcharb",
        ["y"] = "\anycxcharb",
        ["z"] = "\anycxcharb",
        ["0"] = "\anycxcharb",
        ["1"] = "\anycxcharb",
        ["2"] = "\anycxcharb",
        ["3"] = "\anycxcharb",
        ["4"] = "\anycxcharb",
        ["5"] = "\anycxcharb",
        ["6"] = "\anycxcharb",
        ["7"] = "\anycxcharb",
        ["8"] = "\anycxcharb",
        ["9"] = "\anycxcharb",
        [32] = "\anycxcharb",
        ["r"] = "\anycxcharb",
        [","] = "\anycxcharb",
        ["."] = "\anycxcharb",
        ["/"] = "\anycxcharb",
        ["<"] = "\anycxcharb",
        [">"] = "\anycxcharb",
        ["?"] = "\anycxcharb",
        }
    }
}




\directlua{
fonts.handlers.otf.addfeature {
    name = "anycz2",
    type = "substitution",
    data = {
        ["T_h"] = "\anycxcharc",
        }
}}



\directlua{
fonts.handlers.otf.addfeature {
    name = "anycz",
    type = "substitution",
    data = {
        ["hyphen"] = "\anycxcharc",
        ["a"] = "\anycxcharc",
        ["b"] = "\anycxcharc",
        ["c"] = "\anycxcharc",
        ["d"] = "\anycxcharc",
        ["e"] = "\anycxcharc",
        ["f"] = "\anycxcharc",
        ["g"] = "\anycxcharc",
        ["h"] = "\anycxcharc",
        ["i"] = "\anycxcharc",
        ["j"] = "\anycxcharc",
        ["k"] = "\anycxcharc",
        ["l"] = "\anycxcharc",
        ["m"] = "\anycxcharc",
        ["n"] = "\anycxcharc",
        ["o"] = "\anycxcharc",
        ["p"] = "\anycxcharc",
        ["q"] = "\anycxcharc",
        ["r"] = "\anycxcharc",
        ["s"] = "\anycxcharc",
        ["t"] = "\anycxcharc",
        ["u"] = "\anycxcharc",
        ["v"] = "\anycxcharc",
        ["w"] = "\anycxcharc",
        ["x"] = "\anycxcharc",
        ["y"] = "\anycxcharc",
        ["z"] = "\anycxcharc",
        ["0"] = "\anycxcharc",
        ["1"] = "\anycxcharc",
        ["2"] = "\anycxcharc",
        ["3"] = "\anycxcharc",
        ["4"] = "\anycxcharc",
        ["5"] = "\anycxcharc",
        ["6"] = "\anycxcharc",
        ["7"] = "\anycxcharc",
        ["8"] = "\anycxcharc",
        ["9"] = "\anycxcharc",
        [32] = "\anycxcharc",
        ["r"] = "\anycxcharc",
        [","] = "\anycxcharc",
        ["."] = "\anycxcharc",
        ["/"] = "\anycxcharc",
        ["<"] = "\anycxcharc",
        [">"] = "\anycxcharc",
        ["?"] = "\anycxcharc",
        }
    }
}

\newfontfamily\fany{Clara}[
RawFeature=+anycx,
Colour=cxscheme,
]

\newfontfamily\fancy{FiraMath}[
RawFeature=+anycy,
Colour=cyscheme,
]


\newfontfamily\fancz{AntykwaTorunska}[
RawFeature=+anycz,
]


\newfontfamily\fancza{AntykwaTorunska}[
Ligatures=TeX,
Colour=czscheme,
]

\newfontfamily\fanczb{AntykwaTorunska}[
RawFeature=+anycz;+anycz2,
]


\begin{document}

abcde fghij klmnop qrstu wxyz 1234567890 ,./<>?

\fany


abcde fghij klmnop qrstu wxyz 1234567890 ,./<>?

\lipsum

\newpage
\fancy


abcde fghij klmnop qrstu wxyz 1234567890 ,./<>?

\lipsum



\newpage
\normalfont
Q: What is the question to $1+1=1$?


A: {\fancz The cat sat on the mat.}


\fancza ``Th'' is a ligature: \fanczb The cat sat on the mat.

\end{document}

相关内容