caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] can I use camlp4 to output latex ?
@ 2004-04-02  0:45 Pietro Abate
  2004-04-02  4:51 ` Basile STARYNKEVITCH
  0 siblings, 1 reply; 3+ messages in thread
From: Pietro Abate @ 2004-04-02  0:45 UTC (permalink / raw)
  To: ocaml ml

Hi all,
I'd like to use camlp4 to pretty print my files (pseudo-ocaml) in latex.
At the same times I'd like to recycle the same syntax that I use to
produce valid ocaml. The problem is that when I use something like
EXTEND
        str_item: [
		....

the type of this expansion should be str_item, but I actually want to
output a string (containing the latex source). This way I can replace
all <<str_item< ... expansion with sprintf "something" and spit latex
instead of ocaml... a solution would be to add printf before the
str_item expansion and output both ocaml (first) and latex, but this
looks like to me a bad hack... how can I do it ? I basically don't want
to parse my files but use the calmp4 parser to do the job and only add
few hooks for the pretty printing...

:-)
tnx,
p

-- 
++ If you have an apple and I have an apple and we  exchange apples 
   then you and I will still each have one apple. But if you have 
   an idea and I have an idea and we exchange these ideas, then each 
   of us will have two ideas. -- George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.
   See http://www.fsf.org/philosophy/no-word-attachments.html

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] can I use camlp4 to output latex ?
  2004-04-02  0:45 [Caml-list] can I use camlp4 to output latex ? Pietro Abate
@ 2004-04-02  4:51 ` Basile STARYNKEVITCH
  2004-04-02  6:31   ` Pietro Abate
  0 siblings, 1 reply; 3+ messages in thread
From: Basile STARYNKEVITCH @ 2004-04-02  4:51 UTC (permalink / raw)
  To: Pietro Abate, caml-list

On Fri, Apr 02, 2004 at 10:45:18AM +1000, Pietro Abate wrote:

> I'd like to use camlp4 to pretty print my files (pseudo-ocaml) in latex.

This is the job of ocamldoc (which already knows how to output
LaTeX). Why don't you use ocamldoc?


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/ 
email: basile<at>starynkevitch<dot>net 
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la Faïencerie, 92340 Bourg La Reine, France

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] can I use camlp4 to output latex ?
  2004-04-02  4:51 ` Basile STARYNKEVITCH
@ 2004-04-02  6:31   ` Pietro Abate
  0 siblings, 0 replies; 3+ messages in thread
From: Pietro Abate @ 2004-04-02  6:31 UTC (permalink / raw)
  To: caml-list

On Fri, Apr 02, 2004 at 06:51:13AM +0200, Basile STARYNKEVITCH wrote:
> On Fri, Apr 02, 2004 at 10:45:18AM +1000, Pietro Abate wrote:
> > I'd like to use camlp4 to pretty print my files (pseudo-ocaml) in latex.
> This is the job of ocamldoc (which already knows how to output
> LaTeX). Why don't you use ocamldoc?

because ocamldoc doesn't know about my camlp4-sh syntax ... do you
propose to hack ocamldoc to understand my syntax and then write ad-hoc
output functions ? I hope there's a better solution :-((

actually, my pretty print is not going to be just ocaml code + color in
latex, but a total rewrite of my rules/code in a human readable
format...

something like:

let or =
	let a = prem { A ; B ; X }
	and b = concl { A v B ; X }
in rule (a,b)

to

\frac{or}{A ; B ; X}{A v B ; X} 

... don't know if it's legitmate latex code ...

tnx for the feedback :-)

p

-- 
++ "All great truths begin as blasphemies." -George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.
   See http://www.fsf.org/philosophy/no-word-attachments.html

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-02  6:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-02  0:45 [Caml-list] can I use camlp4 to output latex ? Pietro Abate
2004-04-02  4:51 ` Basile STARYNKEVITCH
2004-04-02  6:31   ` Pietro Abate

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).