🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #1835

need help with a LaTeX macro

#1835
From: Scott Barker
Date: Fri, 28 Aug 1992 21:45
38 lines
1399 bytes
Sorry if this shows up more than once - it didn't seem to work the first time
------------------------------------------------------------------------------

Hi, I'm having problems with a macro, and I was wondering if anyone could
help. I started with a command:

\verb"some text"\\

Which I wanted to change into a macro:

\type{some text}

So I defined the macro as:

\newcommand{\type}[1]{\verb"#1"\\}

Which works fine, except when {some text} contains special characters such as
#$_ etc. Now, when I do:

\verb"# comment line for some programming language"\\

There is no problem, but when I use my macro:

\type{# comment line for some programming language}

LaTeX complains (actually, I think it is TeX complaining) about improper use
of the # character.

Any ideas why the command works, but the macro doesn't?

Thanks for any help you can give.

--
Scott Barker
barker@enel.ucalgary.ca

"Logic is the beginning of wisdom, not the end."
   - Spock, Star Trek VI: The Undiscovered Country
Technical Details
Message-ID: <9208282143.AA24890@acs1.acs.ucalgary.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!gateway

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!gateway
From: iwsbarke@acs.ucalgary.ca (Scott Barker)
Newsgroups: comp.text.tex
Subject: need help with a LaTeX macro
Date: 28 Aug 1992 16:45:44 -0500
Organization: UTexas Mail-to-News Gateway
Lines: 38
Sender: daemon@cs.utexas.edu
Message-ID: <9208282143.AA24890@acs1.acs.ucalgary.ca>
NNTP-Posting-Host: cs.utexas.edu