[racket] Setting LaTeX Prefix, style and extra files from within file in DrR

From: Stephen De Gabrielle (spdegabrielle at gmail.com)
Date: Thu Oct 9 19:23:06 EDT 2014

Hi,

Is is possible to use "(part (style #f (list (make-latex-defaults ..." to
set the LaTeX prefix (and style and extra files) from within a scribble
file.

My example below gets a contract violation because I've not specified a
style or any extra files.

I can see the examples of it being done as a language for JFP and Book, but
I can't work out how to just do it in the preamble if my scribble file. (I
don't really want to create a new #lang)

kind regards,
Stephen

----

#lang scribble/base
@(require scribble/core
   scribble/latex-properties
          scribble/latex-prefix)


@(define setup-tma
   (part
    (style #f (list (make-latex-defaults
  (string->bytes/utf-8 (string-append
"\\documentclass[a4paper,12pt]{article}\n\\usepackage{cancel}\n\\usepackage{tma}\n"
                                      unicode-encoding-packages))
  ""
  null)
                    ))
    '()))

@(require "pr-slides.rkt" scribble/latex-properties)
@setup-math
@setup-tma
@title{Math Assignment 1}
@author{Prabhakar Ragde}
@section{First Test}
This @emph{should} be a formula: @math-in{x^2 + y^2}.
@section{Second Test}

struct
(struct latex-defaults (prefix style extra-files)

    #:extra-constructor-name make-latex-defaults)  prefix : (or/c bytes?
path-string?      (cons/c 'collects (listof bytes?)))  style : (or/c bytes?
path-string?      (cons/c 'collects (listof bytes?)))  extra-files : (listof
 (or/c path-string?              (cons/c 'collects (listof bytes?))))

Used as a style property on the main part of a document to set a default
prefix file, style file, and extra files (see Configuring Output). The
defaults are used by the scribblecommand-line tool for and --latex or
--pdf mode
if none are supplied via --prefix and --style (where extra-files are used
only when prefix is used). A byte-string value is used directly like file
content, and a path can be a result of path->main-collects-relative.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141010/d3ac3b75/attachment-0001.html>

Posted on the users mailing list.