[texworks] New Command question from beginner

Reinhard Kotucha reinhard.kotucha at web.de
Mon Nov 26 22:11:08 CET 2012


On 2012-11-26 at 09:00:37 +0100, Jean-Claude Raoult wrote:

 > 
 > Le 25 nov. 2012 ˆ 19:31, Schor, Robert H a Žcrit :
 > 
 > > IÕve just installed MiKTeX and have started writing a document
 > > about Getting Started with LabVIEW.  In this document, I talk
 > > about a Virtual Instrument, commonly abbreviated as VI.  To make
 > > the plural, I didnÕt want to use either VIs or VIÕs, but instead
 > > wanted to use VI\hspace{1pt}s, putting a little space between the
 > > VI and the ÒsÓ.
 > > 
 > > Not wanting to type this string over and over again, I defined a
 > > New Command as follows:
 > > 
 > > \newcommand{VIs}{VI\hspace{1pt}s}
 > > 
 > > However, when I use it in my document, it ÒeatsÓ white space that
 > > follows the command, causing a line such as ÒThese \VIs will beÓ
 > > to be rendered as ÒThese VIswill beÓ (with a 1 pt space between
 > > VI and s, but no space between s and ÒwillÓ).  On the other hand,
 > > if I build the space into the command itself, then Ònormal \VIs.Ó
 > > is rendered as Ònormal VIs .Ó  (with the extra space before the
 > > period).
 > > 
 > > Is there a way to define the command so that the characters being
 > > output will ÒrespectÓ subsequent white space?  [IÕve done a quick
 > > Google search, but am new enough to TeX and LaTeX to not know
 > > what search terms to use].
 > > 
 > > Bob Schor
 > [...]
 > 
 > Personally, I use Plain TeX or rather XeTeX (simpler is better),
 > but I think that the following def would work equally well with
 > LaTeX:
 > 
 >  \def\vi{VI'\kern1pts\ }

No, it doesn't even work with Plain TeX.  This is what Bob already
tried. It _always_ inserts a space, which is not desired.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha                                      Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                              mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------



More information about the texworks mailing list