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/
_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context