[Agda] agda --latex inline code

Altenkirch Thorsten psztxa at exmail.nottingham.ac.uk
Sat May 10 15:29:03 CEST 2014



On 09/05/2014 15:10, "Stevan Andjelkovic"
<stevan.andjelkovic at strath.ac.uk> wrote:

>On Fri, May 09, 2014 at 01:57:56PM +0100, Altenkirch Thorsten wrote:
>> However, is there a way to write inline Agda code as |..| in lhs?
>
>The backend only typesets code inside code blocks, inline code you
>have to typeset manually, e.g.:
>
>  Below we postulate a set called \AgdaDatatype{apa}.
>
>  \begin{code}
>  postulate apa : Set
>  \end{code}

Would it be possible to fix that? I mean it would be nice to have the
inline functionality of lhs2tex.

>
>You can find all the commands used by the backend (and which you can use
>manually) in the latex/agda.sty file. If you are doing a lot of manual
>typesetting, then you might want to introduce shorter command names,
>e.g.:
>
>  \newcommand{\D}{\AgdaDatatype}
>  \newcommand{\F}{\AgdaFunction}
>
>etc, I chose long names to avoid name clashes.
>
>> Also sometimes (especially when explaining Agda syntax), I don't
>> actually want to type check my code but just produce latex. Is this
>> possible?
>
>Typechecking is essential to the typesetting (otherwise we don't
>know what colours etc to use).

Yes, I realize that. Maybe it would be possible only to use the parser for
inline code and spec-blocks? For monochrome output?

> 
>
>However, since lhs2tex and the latex backend are interchangeable (or
>should be at least), I suppose you could have a "fast" and a "slow"
>make target, e.g. a Makefile with:
>
>  COMPILER=latexmk -pdf -use-make -e '$$pdflatex=q/xelatex %O %S/'
>
>  fast:
>        lhs2tex --agda <file>.lagda > latex/<file>.tex
>        cd latex && \
>        $(COMPILER) <file>.tex && \
>        mv <file>.pdf ..
>
>  slow:
>        agda --latex <file>.lagda
>        cd latex && \
>        $(COMPILER) <file>.tex && \
>        mv <file>.pdf ..

Yes, but the problem remains that lhs2tex processes the inline code and
agda doesn't.

Thorsten

>        
>Then you can compile using "make fast" to avoid typechecking (at the cost
>of not having colours etc).
>
>I don't use this setup myself, so I don't know how well it works in
>practice... 
>
>
>Cheers,
>SA.

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.






More information about the Agda mailing list