# [racket] Latex Symbols

There isn't built-in support for that, I'm sorry to say. You can use
unicode characters that have hats on them, which should be
straightforward, or you can implement a function that accepts and
returns picts and then draws a hat on top of the given pict to produce
the result pict. Below is a start on such a function. You'll need to
use the redex pict adjustment combinators to actually use this
function, tho, and how you do that depends on how your model is set
up.
hth,
Robby
#lang racket
(require pict)
(define (wide-hat p)
(define hat-h (* (pict-height p) .2))
(define hat-w (pict-width p))
(define (draw-hat dc dx y)
(send dc draw-line
dx (+ dy hat-h)
(+ dx (/ hat-w 2)) dy)
(send dc draw-line
(+ dx (/ hat-w 2)) dy
(+ dx hat-w) (+ dy hat-h)))
(inset (refocus
(vl-append
(dc draw-hat hat-w hat-h)
p)
p)
0 hat-h 0 0))
(wide-hat (text "a"))
(wide-hat (text "a+b+c+d"))
On Sun, Aug 24, 2014 at 6:03 PM, Maria Jenkins <mkjxocai at gmail.com> wrote:
>*
*>* Hello all,
*>*
*>* I am writing a paper and the implementation was done in redex.
*>*
*>* My question is when I render the semantics and state space is there a way to get a wide hat symbol to print out over some of the characters like in latex?
*>*
*>* Thank you!
*>*
*>* Maria
*>* ____________________
*>* Racket Users list:
*>* http://lists.racket-lang.org/users
*