1

My tags are follows:

\documentclass{book}
  \usepackage[T1]{fontenc}
  \usepackage{tipa}

\begin{document}

\textschwa

\end{document}

And the output came as:

enter image description here

If I copy this characters from PDF and paste it in MS-Word file, it shows they key as @, but I need to show this character as same as output as in PDF file, please suggest... Note that I'm using PDFLaTeX to generate the output....

MadyYuvi
  • 13,693
  • Did you try alt+447 in Word? – SebGlav Aug 22 '21 at 13:28
  • 2
    You could consider switching to Unicode, see https://tex.stackexchange.com/questions/224164/typesetting-phonetic-symbols-unicode-or-tipa for an extensive discussion. If you want to keep using the \textxxx style commands then then answer by yannis is relevant. – Marijn Aug 22 '21 at 13:31
  • 2
    well the problem is that the glyph has the name at in the font, so if you would simply redirect the name to U+0259 all @ in your document would suddenly copy&paste as schwa. This means you need to write a manual cmap, that is not so easy and takes some time. If you want to do it: There are a few examples in the cmap you can use as starting point. But using an unicode engine is easier. – Ulrike Fischer Aug 22 '21 at 13:46
  • You can also declare a command in hypertef that sets the Unicode string which gets copied from the document. – Davislor Aug 22 '21 at 22:16
  • @Davislor Sorry, can you please get back with more details? Please... – MadyYuvi Aug 23 '21 at 03:45
  • @MadyYuvi In my tests, it didn’t actually work. – Davislor Aug 23 '21 at 06:12
  • @UlrikeFischer Could also use the mmap format, I think? – Davislor Aug 23 '21 at 06:13
  • 1

2 Answers2

2

If possible, you should load a font that supports IPA symbols in LuaTeX or XeTeX. In this example, I use New Computer Modern Book. Others include Libertinus, dejaVu and Charis SIL. The text copies and pastes as əə.

\documentclass{book}
\usepackage{newcomputermodern}

\DeclareTextSymbol{\textschwa}{TU}{"0259} % Only needed if you are mixing in 8-bit fonts: %\DeclareTextSymbolDefault{\textschwa}{TU}

\begin{document}

ə{\textschwa}

\end{document}

You can also use tipauni, which should be simpler. (Not to be confused with unitipa.)

If you save that standalone PDF consisting of only a schwa, you can include this PDF file in a PDFTeX document to get a Unicode schwa that you can copy and search for. You might additionally want to make the Unicode character ə run this command, with newunicodechar.

If you really, truly need to extend PDFLaTeX to support tipa and make the result copy as valid Unicode, what you want to do is extend mmap to support the 8-bit T3 encoding that tipa uses.

Davislor
  • 44,045
1

The font you use does have misleading glyph names and therefore there are no good automated solutions for this, but you can explicitly overwrite the mapping on a character by character basis using \pdfglyphtounicode. In your case you only want the font generated by the tfm file tipa10.tfm and want to map the glyph named "at" to Unicode codepoint U+0259, so this translates to

\pdfglyphtounicode{tfm:tipa10/at}{0259}

This can be added anywhere in the preamble of your document, so you get

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{tipa}

\pdfglyphtounicode{tfm:tipa10/at}{0259}

\begin{document}

\textschwa

\end{document}

  • Thanks for your suggestion, but still I copy the reverse e character from the generated PDF and copy into a Word file, I got the character @ only...Anything wrong I did? Please suggest...I used PDFLaTeX to run your code.... – MadyYuvi Aug 23 '21 at 15:35
  • @MadyYuvi Your system might be too old. At the beginning of the log file, which version of LaTeX is listed? – Marcel Krüger Aug 23 '21 at 15:37
  • Here it is This is pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.3) (preloaded format=pdflatex 2021.8.23) – MadyYuvi Aug 23 '21 at 15:40
  • @MadyYuvi A bit further down there should be a line starting with LaTeX2e and a date. That is the version of the format, could you send that? (The first line only lists the version of the engine.) – Marcel Krüger Aug 23 '21 at 15:44
  • Sorry, hope you expect this LaTeX2e <2020-10-01> patch level 4 L3 programming layer <2021-02-18> – MadyYuvi Aug 23 '21 at 15:47
  • @MadyYuvi You can either update your LaTeX version or add \pdfgentounicode=1 in your preamble. – Marcel Krüger Aug 23 '21 at 15:50
  • Sir, it's working like a champ...Hats off to you... – MadyYuvi Aug 23 '21 at 15:56