BystroTeX
1 Introduction
This manual is only partially useful, because many functions are auto-generated by macros. The beginner user should find the instructions in the form of a slide presentation here, and also study the sample file slides-manual.scrbl, which is in the samples directory. That sample file can be used as a template for creating new presentations.
As a general rule, those functions whose name starts with bystro-, are either for internal use or for use in the header. They are not meant to be used in slides by themselves, or at least not to be used frequently. (But this rule is not very strict.)
2 Some general tricks
To load a stylesheet from a file filename.css:
@(element (make-style #f (list (make-css-addition (string->path "filename.css")))) '()) |
Example of nesting things:
@nested[ #:style @(make-style "comment" '()) @verb|{ |
This is some text which I want to be show verbatim |
}| |
] |
3 Functions for manipulating slides
(require bystroTeX/slides) | package: bystroTeX |
struct
(struct bystro ( formula-processor formula-database-name formula-dir-name formula-size formula-bg-color formula-fg-color autoalign-adjust manual-base-alignment) #:extra-constructor-name make-bystro) formula-processor : path? formula-database-name : string? formula-dir-name : string? formula-size : integer? formula-bg-color : (listof integer?) formula-fg-color : (listof integer?) autoalign-adjust : integer? manual-base-alignment : integer?
procedure
procedure
x : content? tg : (or/c symbol? string? #f) = #f sttl : boolean? = #f xs : (listof pre-flow?)
procedure
(after-pause [#:tag tg] #:rest xs) → part?
tg : (or/c symbol? string? #f) = #f xs : (listof pre-flow?)
procedure
(remove-slide) → void?
procedure
procedure
(use-LaTeX-preamble #:rest xs) → void?
xs : string?
procedure
x : string?
procedure
(ref-formula x) → delayed-element?
x : string?
procedure
r : exact-nonnegative-integer? g : exact-nonnegative-integer? b : exact-nonnegative-integer?
procedure
r : exact-nonnegative-integer? g : exact-nonnegative-integer? b : exact-nonnegative-integer?
procedure
(bystro-formula #:database x #:formulas-in-dir y [ #:shell-command z] #:size n #:bg-color bg-color #:fg-color fg-color #:align m #:use-depth ud #:aa-adjust aa-adj #:rest tex) → element? x : db? y : string? z : path? = #f n : natural-number/c bg-color : (listof natural-number/c) fg-color : (listof natural-number/c) m : (or/c (integer-in (- 99) 99) #f) ud : boolean? aa-adj : (integer-in (- 99) 99) tex : (listof string?)
procedure
(bystro-equation tex #:size n [ #:label l #:bg-color bg-color #:fg-color fg-color]) → nested-flow? tex : (listof string?) n : natural-number/c l : (or/c string? #f) = #f
bg-color : (listof natural-number/c) = (bystro-formula-bg-color configuration)
fg-color : (listof natural-number/c) = (bystro-formula-fg-color configuration)
procedure
4 Miscellaneous functions
(require bystroTeX/common) | package: bystroTeX |
procedure
procedure
(bystro-inject-style #:rest xs) → element?
xs : (listof string?)
syntax
(spn someword content)
@span[attn]{remember to pay the phone bill!}.
.attn { |
color: red; |
font-weight: bold; |
} |
syntax
(div someword content)
<div class="someword">content</div>
The difference is that div can extend over several paragraphs.
syntax
(tg someword content)
@tg[ol]{ |
@tg[li]{The union of open sets is an open set.} |
@tg[li]{The finite intersection of open sets is an open set.} |
@tg[li]{@f{X} and the empty set @f{\emptyset} are open sets.} |
} |
@tg[span #:attrs ([style "color:blue;text-decoration:underline;"] [title "not clickable! Example only!"])]{pseudo-link!!!} |
syntax
(init-counter name)
@(require racket/dict) |
@(init-counter exercise) |
@(define (ex-num label) |
(elemtag label (exercise-next label))) |
@(define (ex-ref label) |
(elemref label (list "Exercise " (exercise-number label)))) |
@bold{Exercise @ex-num{ProvePositivityOfE}:} Show that the energy is always greater thatn zero |
As you should have proven in @ex-ref{ProvePositivityOfE}, ... |
procedure
rows : bystro-rectangular-table? dirn : (or/c 'hor 'vert #f)
syntax
(align alignment-scheme content ...)
@align[r.l |
@list[ |
@f{{2\over 1 - x^2} = } @f{1+x+x^2 + \ldots +} |
]@list[ |
"" @f{1-x+x^2- \ldots} |
] |
] |
@align[r.l |
@list[ |
@f{{2\over 1 - x^2} = } @v+[2 @f{1+x+x^2 + \ldots +}] |
]@list[ |
"" @f{1-x+x^2- \ldots} |
] |
] |
@align[r.l.n |
@list[ |
@f{{2\over 1 - x^2} = } @v+[2 @f{1+x+x^2 + \ldots +}] "" |
]@list[ |
"" @f{1-x+x^2- \ldots} @label{SumOfGeometricProgressions} |
] |
] |
procedure
n : exact-nonnegative-integer? xs : (listof pre-content?)
procedure
n : exact-nonnegative-integer? xs : (listof pre-content?)
procedure
n : exact-nonnegative-integer? xs : (listof pre-content?)
procedure
n : exact-nonnegative-integer? xs : (listof pre-content?)
procedure
x : string? i : exact-nonnegative-integer? xs : (listof string?)
procedure
colorname : string? xs : (listof pre-content?)
procedure
(longtbl bss #:styless stylepropsss #:width w) → nested-flow? bss : (listof (listof block?)) stylepropsss : (listof (listof (listof (or/c 'left 'right 'center 'top 'baseline 'bottom 'vcenter)))) w : (integer-in 1 100)
procedure
x : (listof pre-content?)
procedure
(bystro-js x) → traverse-element?
x : string?
procedure
(bystro-js-url url) → traverse-element?
url : string?
procedure
(bystro-elemstyle x #:rest otherprops) → style?
x : (or/c #f string?) otherprops : (listof any/c)
(element (bystro-elemstyle "vertical-align:middle") (image "flowers-on-the-wall.png"))
The otherprops are as described in the manual of element
procedure
l : any
procedure
(bystro-path-to-link x) → string?
x : string?
procedure
p : path?
procedure
(bystro-list-scrbls p [ #:exclude-same-name x]) → (listof path?) p : path? x : boolean? = #t
procedure
(bystro-list-scrbls-in-dir p [ #:background-color clr]) → element? p : path? clr : (listof integer?) = '(251 206 177)
procedure
(bystro-ribbon) → table?
procedure
(bystro-ribbon-for-location p [ #:exclude-same-name esn]) → block? p : path? esn : boolean? = #f
procedure
(bystro-shell-dump command [ #:stdin stdin #:style style #:indent indent] #:rest arguments) → block? command : string? stdin : (or/c (and/c input-port? file-stream-port?) #f) = #f style : (or/c style? #f) = #f indent : exact-nonnegative-integer? = 0 arguments : (listof string?)
@bystro-shell-dump|{sqlite3 -line base.sqlite |
select capital,population from countries where continent like '%asia%'}| |
Note how we use the at-syntax instead of quotation marks in the SQL query |
procedure
(bystro-get-cl-argument key) → string?
key : string?
scribble ++arg --person ++arg Andrei filename.scrbl |
5 Functions for reading the configuration file
(require bystroTeX/xmlconf) | package: bystroTeX |
The configuration file is usually called bystrotex.xml
procedure
xf : path-string?
value
bystroconf-xexpr : (or/c xexpr? #f)
syntax
(with-bystroconf bc (name dest name.html name.scrbl formulas/ .sqlite arglist multipage?) body ...)
6 Auxiliary functions
(require bystroTeX/utils) | package: bystroTeX |
nick-stdout is the input-port from the stdout of the process
nick-stdin is the output-port to the stdin of the process
nick-pid is the PID
nick-stderr is the input-port from the stderr of the process
nick-ctl is the control procedure, see the manual for process*
nick-process is the resulting subprocess
nick-stdout is the input-port from the stdout of the process
nick-stdin is the output-port to the stdin of the process
nick-stderr is the input-port from the stderr of the process
7 Legal
Copyright 2012,2013,2014 Andrei Mikhailov
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.