Hello, I try to build a macro, that prints special characters as \type and hyphenates as \hyphenatedfile. I can use now : and ;, but the characters ?, !, # and \ are still not working, and spaces are lost. Could someone help please? Here are my tries: file env.tex: \startenvironment env \useencoding[ffr] \mainlanguage[fr] \unprotect \def\reactivateLostActivations{\catcode`:=\@@active\catcode`;=\@@active} \appendtoks\reactivateLostActivations\to\everystarttext \bgroup \catcode`;=12 \catcode`?=12 \catcode`!=12 \gdef\cleanedupSemicolon{;} \gdef\cleanedupQuestmark{?} \gdef\cleanedupExclamark{!} \catcode`\;=\@@active \catcode`?=\@@active \catcode`!=\@@active \gdef\protectChars{\let;\cleanedupSemicolon % \let?\cleanedupQuestmark \let!\cleanedupExclamark % does not work \protectlabels} \egroup \protect \def\File#1{{\tt\protectChars\hyphenatedfile{#1}}} %\let\File\typ % does not work %\let\File\type % does not work \stopenvironment file test.tex: \environment env \starttext bla: bla? bla! bla; bla, this works now. \hskip10cm \File{lost space/file with;strange:charac?ters~/ < and > /end!} % And it would be nice, if I could use the following characters too: % ?, !, # and \ \stoptext In fact, I'm looking for something like this: \documentclass[frenchb]{article} \usepackage[latin1]{inputenc} \usepackage{listings,babel} \lstset{breaklines=true,basicstyle=\ttfamily} \begin{document} \hsize8cm\noindent \lstinline{hööah:aloh/aa?lha llol!loh%lloh#allhal\lohhll;ohohal~loll ohalölo} \end{document} Perhaps, it could be possbible to port listings.sty to ConTeXt? Greetings, Peter -- http://pmrb.free.fr/contact/ _____________________________________ FilmSearch engine: http://f-s.sf.net/
On Mon, 21 Jun 2004, Hans Hagen wrote:
I try to build a macro, that prints special characters as \type and hyphenates as \hyphenatedfile.
you mean something like \typ{whatever} (i.e. \type without e)
Yes, but I don't see any difference between \starttext \hskip10cm \typ{lost space/file with;strange:charac?ters~/ < and > /end!} \stoptext and \starttext \hskip10cm \type{lost space/file with;strange:charac?ters~/ < and > /end!} \stoptext Peter -- http://pmrb.free.fr/contact/ _____________________________________ FilmSearch engine: http://f-s.sf.net/
participants (2)
-
Hans Hagen
-
Peter Münster