4

I am writing a project about phonetics using the tipa package. The problem is, I need to publish two separate versions of my project using different phonetic notation standards. When considering the fact that there is, fortunately, a one-to-one correlation between the symbols of these two standards, I would like to know if there is a way to convert from the one standard to the other without having to write everything twice?

Furthermore, since I am only using a small selection of the symbols available in tipa, I would like to use a custom syntax which eases typing.

What I need to create is a command phone in which I can type phonetic writing using my own custom syntax. The phone command is then supposed to convert this into the tipa syntax. If that is possible, all I have to do to convert between these two standards is to change this command.

An example: Since I'm using \textraiseglotstop and \textsubarch{5} a lot, I would phone to replace ? with \textraiseglotstop and R with \textsubarch{5}.

If somebody can provide me with a command that enables me to make lots of substring conversions without causing conflicts, I think that would suffice. Other suggestions are also very welcome, though.

2
  • Are the two transcriptions systems ever found in the same document? Or are they distinct in each version?
    – Alan Munn
    Dec 11, 2012 at 18:44
  • They are going to be distinct. However, if possible, I wouldn't mind having both at my disposal so that I could make a conversion table, but it's not strictly necessary. But maybe the best is to have two commands: \standard1 and \standard2. Then \phone can be set to either depending on which version of the document is to be produced. ;-)
    – Gaussler
    Dec 11, 2012 at 18:48

1 Answer 1

3

The simplest way to do this would be to use macros for the variant characters and use a conditional to switch between them. Here's a simple example:

\documentclass{article}
\usepackage{tipa}
\newif\ifregularIPA
\regularIPAtrue
\newcommand*{\GS}{\ifregularIPA\textglotstop\else\textsuperscript{?}\fi}
\begin{document}
\begin{IPA}
\GS aral

\regularIPAfalse
\GS aral
\end{IPA}
\end{document}

output of code

For the different versions of the document you would set the switch once in the preamble. For making a table of conversions you can set the switch inside a group.

6
  • Thanks :-) ... But is it not possible to create a command phone so that \phone{?aral} is equivalent to \textipa{\textraiseglotstop{}aral}?
    – Gaussler
    Dec 11, 2012 at 18:56
  • I don't see what you gain from doing that. You need some markup for IPA anyway, so I don't see the difference between \phone{?aral} and \textipa{\GS aral}. Or is your problem actually a different one, and you have things already in some orthographic form and you want to translate them to IPA. That's a different problem. But if you're entering the elements directly, this method is really the simplest.
    – Alan Munn
    Dec 11, 2012 at 18:59
  • Well, only the fact that it takes much less time to type when writing a long project ;-). What I want is to let the project rely entirely on my custom syntax, assigning a one-letter code to all the symbols I'm going to use :-). And I'm going to write the project from scratch using this system. ;-)
    – Gaussler
    Dec 11, 2012 at 19:03
  • While this is possible, (involves making characters 'active') it's likely to cause more problems than it's worth. You can just as easily configure your editor to enter the markup in a single keystroke if you want to save typing time.
    – Alan Munn
    Dec 11, 2012 at 19:09
  • 1
    I don't want to belabor the point, but I really think this is very much a case of the XY Problem.
    – Alan Munn
    Dec 12, 2012 at 2:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .