Re: [off-topic] LaTex for [[ ... ]]

2001-06-01 Thread Fergus Henderson

Sorry for the off-topic post, but I figured someone here would know...
can anyone please tell me how to do the double-square-bracket symbols
that are often used in denotational semantics in LaTex?  It's like
[[ but a single symbol without the space between the two brackets.
(I checked the Latex companion, but it's not listed there AFAICT.)

-- 
Fergus Henderson [EMAIL PROTECTED]  |  I have always known that the pursuit
|  of excellence is a lethal habit
WWW: http://www.cs.mu.oz.au/~fjh  | -- the last words of T. S. Garp.

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Re: [off-topic] LaTex for [[ ... ]]

2001-06-01 Thread Keith Wansbrough

 Sorry for the off-topic post, but I figured someone here would know...
 can anyone please tell me how to do the double-square-bracket symbols
 that are often used in denotational semantics in LaTex?  It's like
 [[ but a single symbol without the space between the two brackets.
 (I checked the Latex companion, but it's not listed there AFAICT.)

\newcommand{\lsem}{[\![}
\newcommand{\rsem}{]\!]}

is what I use; there are some real ones in \usepackage{stmaryrd} if you really want 
them.

--KW 8-)

-- 
Keith Wansbrough [EMAIL PROTECTED]
http://www.cl.cam.ac.uk/users/kw217/
Cambridge University Computer Laboratory.


___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Re: [off-topic] LaTex for [[ ... ]]

2001-06-01 Thread Andrew Moran

Joe English wrote:

 Fergus Henderson wrote:
 
  Sorry for the off-topic post, but I figured someone here would know...
  can anyone please tell me how to do the double-square-bracket symbols
  that are often used in denotational semantics in LaTex?  It's like
  [[ but a single symbol without the space between the two brackets.
 
 It's often done by squishing together two ordinary square brackets
 with a negative thin space (\!):
 
 \newcommand{\sembrack}[1]{[\![#1]\!}
 
 This looks good with Computer Modern; with other fonts YMMV.

There's also \llbracket and \rrbracket, from stmaryrd.  They look better than
the negative space hack, IMHO (now all I need is for Alan Jeffrey to write in
and say that \{ll,rr}bracket are implemented with the negative space hack :-)

Cheers,

Andy

-- 
Andy Moran  Ph.  (503) 526 3472
Galois Connections, Inc.Fax. (503) 350 0833
3875 SW Hall Blvd.   http://www.galconn.com
Beaverton, OR 97005   [EMAIL PROTECTED]

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe



Re: [off-topic] LaTex for [[ ... ]]

2001-06-01 Thread Ross Paterson

On Fri, Jun 01, 2001 at 12:41:05PM -0400, Ken Shan wrote:
 On 2001-06-01T08:41:34-0700, Andrew Moran wrote:
  There's also \llbracket and \rrbracket, from stmaryrd.  They look better than
  the negative space hack, IMHO (now all I need is for Alan Jeffrey to write in
  and say that \{ll,rr}bracket are implemented with the negative space hack :-)
 
 Heh.  Actually they're not (and cannot, because they are extensible
 delimiters -- useful for typesetting the denotation of multiple-line
 programs!).

Here's a negative space hack that gives extensible brackets: write
\Sem{expr} to wrap an expression.  (Doubtless someone who knows TeX
could do better.)

\newsavebox{\sembox}
\newlength{\semwidth}
\newlength{\boxwidth}

\newcommand{\Sem}[1]{%
\sbox{\sembox}{\ensuremath{#1}}%
\settowidth{\semwidth}{\usebox{\sembox}}%
\sbox{\sembox}{\ensuremath{\left[\usebox{\sembox}\right]}}%
\settowidth{\boxwidth}{\usebox{\sembox}}%
\addtolength{\boxwidth}{-\semwidth}%
\left[\hspace{-0.3\boxwidth}%
\usebox{\sembox}%
\hspace{-0.3\boxwidth}\right]%
}

___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe