• Tidak ada hasil yang ditemukan

PDF SchemeTEX - kebo.pens.ac.id

N/A
N/A
Protected

Academic year: 2023

Membagikan "PDF SchemeTEX - kebo.pens.ac.id"

Copied!
1
0
0

Teks penuh

(1)

SchemeTEX

John D. Ramsdell

SchemeTEX provides simple support for literate programming in any dialect of Lisp. Originally cre- ated for use with Scheme, it defines a new source file format which may be used to produce LATEX input or Lisp code.

SchemeTEX source lines are divided into text and code. Lines of code start with a line beginning with

“(”, and continue until the line containing the match- ing “)”. The remaining lines are text lines, and they are treated as comments.

When producing a LATEX document, both the text lines and the code lines are copied into the document source file, but the code lines are surrounded by a pair of formatting commands (\begin{astyped}and

\end{astyped}). This LATEX environment formats the code as written, in typewriter font. A Lisp com- ment within a code line is formatted in an\mboxin Roman font. A SchemeTEX style command should in- clude theastyped style option, so that theastyped environment is available. An example:

\documentstyle[astyped]{article}

SchemeTEX was designed under the constraint that code lines must be unmodified Lisp code, and text lines must be unmodified LATEX code. Text editors with support for Lisp and LATEX, such as Emacs, may be used for SchemeTEX code much as they are used for Lisp code and LATEX code.

Some users prefer not modifying theLOADfunction in their Lisp system. To support those users, the rule that text lines must be unmodified LATEX code has been relaxed. Text lines that begin with “;” are copied without the initial “;”.

.SUFFIXES: .dvi .tex .st .st.dvi:

make $*.tex && make $*.dvi .st.tex:

st $*

.tex.dvi:

latex $*

Figure 1: A SchemeTEX Makefile

Usage under Unix

The extension for SchemeTEX files is “.st”. For T, the file st.t contains two programs used to obtain code from an “.st” file. The T expression

(LOAD-STfilespec environment)

loads a SchemeTEX file by creating a T source file if no T source file exists which is younger than the SchemeTEX file. The T source file is then loaded us- ing the usual LOAD procedure. COMPILE-ST is like LOAD-STexcept it compiles the file instead of loading it.

A LATEX file is produced from a file with the “.st”

extension using the Unix shell command stfile-name

It will produce a file with the “.tex” extension. The obvious make file is in Figure 1.

Page 1

Referensi

Dokumen terkait

TheLATEXdocument preparation system Dr Engelbert Buxbaum Introduction Structure of a LATEX document Basic commands Structuring text Sectioning Fonts Lists Tables and stuff Graphics

This is a process whereby magnetic field lines are cut and reconnect to other field lines, changing the magnetic topology and releasing vast amounts of energy Interpretation of