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?
Asked
Active
Viewed 606 times
1
-
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
1 Answers
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:
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}
Georg
- 1,566
-
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
-
-
-
-
-
-
Sorry to say that, little bit confusing about hidden and space – Diptiranjan Pattanaik May 16 '17 at 19:17
-
@Diptiranjan Pattanaik Ok that is great to hear. I edited a 3. option in just to cover every possibility to hide a character. If the answer solved you problem you could accept it by clicking on the check mark symbol on the left side. – Georg May 16 '17 at 19:25

