Add tags Information and discussion about fonts and character sets (e.g. how to use language specific characters)
3 posts • Page 1 of 1
Hello LaTex experts,
I am new at LaTeX community and at LaTeX in general too, so please do not be hard when judging my post. I hope, the part of the forum I am pasting this question to is proper.
I am currently struggling with underscores in my generated pdf file. I have a lot of underscores in my text and I use the backslash "\" to avoid errors, which is the genral recomendation in all tutorial on how to work with underscores and other special characters. The underscores appear correctly in the generated PDF, however, the problem is that when I want to copy/paste the text with the underscores, I get spaces instead of underscores. For example, if I have the following text:
it appears OK in the PDF, but when I copy and paste it to a different file, I get the text as "This is a text with underscores", but not as "This_is_a_text_with_underscores" which is what I need.
I also noticed that if I search the PDF for the text "This_is_", I find no results, however if I search for "This is ", I find my text with underscores. It seems to me that the PDF file that is generated just displays the underscores, however, has spaces in the core of the document.
Can someone please tell me if this behaviour is expected? Or is this specific to the PDF generator? I am using TeXnicCenter tool.
I tried to use \textunderscore instead of \_ or even tried the behaviour when using package "underscore.sty", but I still have the same problem! Does anyone have an idea? I've already search the whole internet and the LaTeX community, but did not find anything with this problem.
Any help will be highly appreciated!
Thank you in advance.
Last edited by kulakov on Sat May 22nd, 2010, edited 1 time in total.
The code below works for me as expected. Copying and pasting parts of text yields the desired result as well as searching the PDF file. Perhaps a matter of the viewer.
Best regards and welcome to the board
Thorsten! You are the man! Thanks for your quick help!
This line made a difference:
If I change T1 to OT1 the old problem occurs, even with your simple example. I guess there is something wrong with the encoding OT1.
After I entered this line in my document it now works as expected! I got some issue with the text getting thinner and duller, but I was able to quickly solve it with the package "lmodern" as suggested in this post: http://mrunix.de/forums/showthread.php?t=57130.
Danke viel Mals!
Schöne Grüße aus Wien!
3 posts • Page 1 of 1
Users browsing this forum: No registered users and 5 guests