[OS X TeX] macro with xstring.sty doesn't work

RA Friedrich Vosberg fv at meinrechtsanwalt.com
Tue Dec 10 04:06:22 EST 2013


Morning.

Why does this macro not work?

Thanks in advance for your support!

Kind regards, Friedrich

%!TEX TS-program = fvfull
\documentclass{scrartcl}
\usepackage{xspace,xstring}
\begingroup 
  \let\\\relax
  \immediate\write18{%
    pwd | sed -e 's/&/\\&/g' | iconv -f UTF-8-MAC -t MacRoman | awk
-F'\\n' '{%
      print"
        \\begingroup 
          \\catcode\string^\string^60\\\string^\string^24=11\\relax
          \\catcode\string^\string^60\\\string^\string^26=11\\relax
          \\newcommand\\fvpath{" $1 "\\xspace}\\relax
          \\expandafter
        \\endgroup
        \\expandafter\\newcommand
        \\expandafter\\fvpath
        \\expandafter{\\fvpath}\\relax
        \\endinput"
      }'
    > tmppath.tex%
  }
  \immediate\write18{%
    echo "\jobname" | sed -e 's/&/\\&/g' | iconv -f UTF-8-MAC -t
MacRoman | awk -F'\\n' '{%
      print"
        \\begingroup 
          \\catcode\string^\string^60\\\string^\string^24=11\\relax 
          \\catcode\string^\string^60\\\string^\string^26=11\\relax 
          \\newcommand\\fvfile{" $1 "\\xspace}\\relax 
          \\expandafter
        \\endgroup 
        \\expandafter\\newcommand 
        \\expandafter\\fvfile 
        \\expandafter{\\fvfile}\\relax 
        \\endinput"
      }'
    > tmpfile.tex%
  }% 
\endgroup
\input{tmppath.tex} 
\input{tmpfile.tex}
\newcommand*{\pathfile}[1][pdf]{%
  \frenchspacing\fvpath/\fvfile{}.#1%
}
\begin{document}
\pathfile
%\StrSubstitute{\pathfile}{Users}{$\sim$}[\shortstring]
\end{document}

--
Für sichere E-Mails an mich verwenden Sie bitte S/MIME oder nutzen meinen öffentlichen PGP-Schlüssel:
http://www.meinrechtsanwalt.com/download/pgpfvmrac.asc

Friedrich Vosberg, Rechtsanwalt (German Lawyer)
D-04275 Leipzig, August-Bebel-Straße 59, Germany
Ruf: (+49) 0341 234600 20   Fax: (+49) 0341 234600 22
http://www.meinrechtsanwalt.com

Der Inhalt dieses E-Mails einschließlich ggf. beigefügter Dateien ist vertraulich und nur für den Empfänger bestimmt. Sollten Sie nicht der bestimmungsgemäße Empfänger sein, ist jegliche Offenlegung, Vervielfältigung, Weitergabe oder Nutzung des Inhalts nicht zulässig. Bitte informieren Sie mich in diesem Fall unverzüglich und löschen Sie das E-Mail einschließlich ggf. beigefügter Dateien in Ihrem System. Vielen Dank für Ihre freundliche Unterstützung, und bitte entschuldigen Sie jegliche Unannehmlichkeiten.

The contents of this e-mail including any attachments are confidential and may be legally privileged. If you are not the intended recipient of this e-mail, any disclosure, copying, distribution or use of its contents is prohibited. Please notify me immediately and delete this email including any attachments from your system. Thank you for your kind co-operation, and please accept my apologies for any inconvenience.













-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20131210/5cbc7cac/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2212 bytes
Desc: not available
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20131210/5cbc7cac/attachment.p7s>


More information about the MacOSX-TeX mailing list