ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Peter Münster" <pmlists@free.fr>
Subject: \hyphenatedfile
Date: Sat, 19 Jun 2004 17:21:36 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.58.0406191608020.19642@gaston.free.fr> (raw)

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/

             reply	other threads:[~2004-06-19 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-19 15:21 Peter Münster [this message]
2004-06-21 14:06 ` \hyphenatedfile Hans Hagen
2004-06-21 15:05   ` \hyphenatedfile Peter Münster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0406191608020.19642@gaston.free.fr \
    --to=pmlists@free.fr \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).