1

Actually my question is-- just like in microsoft word suppose I am writing a word "horse" and I want "ho se", in this I do not need any space, here "r" is hide now. The simplest solution is make the "r" as white letter. Similar thing I need in latex---which command does this?

1 Answers1

2

\phantom{...} inserts a blank space that has the dimensions of the content inserted in the command. The character is not there anymore, so if you search your pdf for the word "horse" it will not find anything.

\documentclass{article}
\begin{document}   
ho\phantom{r}se
\end{document}

Now we just type the character in white. So it is still there and if you search your pdf for the word "horse" it will pop up.

\documentclass{article}
\usepackage{xcolor}
\begin{document}
ho\textcolor{white}{r}se 
\end{document}

Both solutions look like this:

enter image description here

Or you could define it like the following. So if you search your pdf for the word "horse" it will pop up but in the printed output you only see "hose" without any spacing in between. \makebox[0pt]{r} gives the character a width of 0 and {\transparent{0}r} makes it completely transparent.

\documentclass{article}
\usepackage{transparent}
\begin{document}
ho\makebox[0pt]{{\transparent{0}r}}se
\end{document}

enter image description here

Georg
  • 1,566