Generalxtring not taking function arguments

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Zelos
Posts: 4
Joined: Tue Nov 19, 2013 12:32 pm

xtring not taking function arguments

Post by Zelos »

\documentclass[11pt,a4paper]{book}
\usepackage{pgfkeys}
\usepackage{xstring}
\newcommand{\setIPA}[1]{\pgfkeyssetvalue{/IPA}{#1}}
\newcommand{\getIPA}{\pgfkeysvalueof{/IPA}}

\newcommand{\ScriptIPA}[1]{
\StrSubstitute{#1}{a}{A}
\setIPA{#1}
\setIPA{\StrSubstitute{\getIPA}{a}{A}}
\setIPA{\StrSubstitute{\getIPA}{e}{3}}
\setIPA{\StrSubstitute{\getIPA}{o}{8}}
\getIPA
}
\begin{document}
\ScriptIPA{ae}
\end{document}


This is a small macro I am working on, what I am trying to do is create somethign that can turn a string I have in normal text into textipa friendly symbols so it cna show IPA text, but when I try this it doesn't work out, I figure strsubstitute doesn't like functions within it's first arguement but how would I go about it?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply