In Anschluss an die Frage http://texwelt.de/wissen/fragen/3715/wie-kann-ich-worter-im-text-automatisch-formatieren-lassen habe ich xesearch ausprobiert, um typische bibliographische Angaben automatisch richtig spationieren zu lassen.
xesearch scheint laut Fehlermeldung keine Punkte zu akzeptieren (im Handbuch nichts dazu gefunden), nur damit würde aber ein "normaler" Text automatisch formatiert. Weiß jemand eine Lösung?
Hier mein Beispiel:
Open in Online-Editor
\documentclass[11pt]{article}\usepackage[ngerman]{babel}\usepackage{xltxtra,libertine,xesearch,xspace}\newcommand{\spat}{\kern .12em}\newcommand{\bd}{Bd.\spat}\newcommand{\ff}{\spat{}ff.\xspace}\newcommand{\pag}{S.\spat}\SearchList{bd}{\bd}{Bd.}\SearchList{ff}{\ff}{ff.}\SearchList{S}{\pag}{S.}\begin{document} Text (vgl. Werke \bd 1, \pag 12\ff) %Formatierung: Spationierung über \newcommand Text (vgl. Werke Bd. 1, S. 12 ff.) %Autoformatierung über xesearch\end{document}
Nach der Beantwortung von Clemens hier ein vervollständigtes, funktionsfähiges Beispiel:
Open in Online-Editor
% arara: xelatex\documentclass[11pt]{article}\usepackage[ngerman]{babel}\usepackage[osf]{libertine}\usepackage{xltxtra,xesearch,xspace}\newcommand*{\spat}{\kern.10em\relax}\UndoBoundary{.}\begin{document}\quad\textsf{Ohne Spationierung} Text (vgl. Werke Bd. 1, a. a. O., S. 12 ff.) V. 12, S. 45 f., pp. 45 sqq., H. 23, vol. 19, no. 3 \medskip\quad\textsf{Mit automatischer Spationierung}% Autoformatierung über xesearch -- \SearchList*!{all}{\spat\ignorespaces}{Bd.,p.,pp.,Kap.,V.,S.,cap.,chap.,vol.,Nr.,no.,H.,cf.}\SearchList*{ff}{\unskip\spat#1}{ff.,f.,sq.,sqq.}\SearchList*{aao}{a.\spat a.\spat O.}{a.a.O.,a. a. O.}\SearchList*{Aao}{A.\spat a.\spat O.}{A.a.O.,A. a. O.}\SearchList*{oc}{op.\spat cit.}{op.cit,op. cit.}\SearchList*{Oc}{Op.\spat cit.}{Op.cit.,Op. cit.}\SearchList*{zb}{z.\spat B.}{z.B.,z. B.} Text (vgl. Werke Bd. 1, a. a. O., S. 12 ff.) V. 12, S. 45 f., pp. 45 sqq., H. 23, vol. 19, no. 3 \end{document}