1

This question already has an answer here:

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?

marked as duplicate by Werner spacing May 16 '17 at 18:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Try "ho\phantom{r}se". – Hood Chatham May 16 '17 at 18:47
  • Than you very much. My last question is that-- While the output is "ho se"., in this blank region is the letter is hidden in that place or it has just generated the blank space in the place of "r" by using phantom command? – Diptiranjan Pattanaik May 16 '17 at 19:04
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

  • Thank you very much. Now my question is that--- is the letter "r" hidden now? or there is a blank space in the place of "r"? Actually I do not need a blank space. – Diptiranjan Pattanaik May 16 '17 at 18:54
  • I just need a hidden character in the place of "r" – Diptiranjan Pattanaik May 16 '17 at 18:55
  • now there is a blank space in the size of an "r". – Georg May 16 '17 at 19:06
  • Then how can I get the hidden letter format? – Diptiranjan Pattanaik May 16 '17 at 19:09
  • just like "ho'hidden r'se" not like "ho'blank space'se" – Diptiranjan Pattanaik May 16 '17 at 19:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.