using a different "scribble.tex"

78 views
Skip to first unread message

Spencer Florence

unread,
Jan 6, 2016, 3:44:56 PM1/6/16
to racket
Hey all,

I'm currently trying to use a custom tex style file with scribble. Unfortunately this style file conflicts with the line "\usepackage[usenames,dvipsnames]{color}" in the "scribble.tex" file include by the scribble to tex compiler.

Is there any way to tell scribble to use a different "scribble.tex"?

--spencer

Matthew Flatt

unread,
Jan 6, 2016, 3:53:51 PM1/6/16
to Spencer Florence, racket
There's not currently a simple way to replace "scribble.tex".

Probably you can hack anything by providing an alternate prefix file
(i.e., replacement for "scribble-prefix.tex"). For example, I bet it
would be possible to make the prefix file end with an unfinished
comment, have the comment swallow "scribble.tex" completely, and have a
style file (i.e., replacement for "scribble-style.tex") end the comment
and drop in your replacement for "scribble.tex".
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ben Lerner

unread,
Jan 6, 2016, 5:52:46 PM1/6/16
to Spencer Florence, racket

I’ve used the invocation scribble --prefix my-prefix.tex with a file my-prefix.tex that starts off

\documentclass{book}  %% You could use whatever class you need here
\PassOptionsToPackage{usenames,dvipsnames}{color}
...

I’m not sure whether you’re trying to actually use those two settings and there’s an inconsistent load, or whether you’re trying to actually not use those two settings and can’t avoid them. My solution fixes the former kind of problem.

Matthias Felleisen

unread,
Jan 7, 2016, 9:21:01 AM1/7/16
to Matthew Flatt, Spencer Florence, racket

Spencer, when you have a solution, please share. I am facing the exact same problem rendering 2e, but have deferred writing a script to rewrite the resulting tex prefix until I know everything I need to rewrite. -- Matthias

p.s. I think we may wish to discuss an alternative solution for the inclusion of tex packages.

Asumu Takikawa

unread,
Jan 7, 2016, 9:36:10 AM1/7/16
to Spencer Florence, racket
On 2016-01-06 20:44:40 +0000, Spencer Florence wrote:
> I'm currently trying to use a custom tex style file with scribble.
> Unfortunately this style file conflicts with the line
> "\usepackage[usenames,dvipsnames]{color}" in the "scribble.tex" file
> include by the scribble to tex compiler.

This isn't really a Racket-level solution, but when we faced the same kind of
conflict in the LIPIcs Scribble package we did the following before the
documentclass declaration:

\PassOptionsToPackage{usenames,dvipsnames}{color}
\documentclass[letterpaper,UKenglish]{lipics}

maybe that will work for you?

(for reference: https://github.com/takikawa/lipics-scribble/blob/master/main.rkt#L36)

Cheers,
Asumu

Spencer Florence

unread,
Jan 7, 2016, 9:50:13 AM1/7/16
to Matthias Felleisen, Matthew Flatt, racket
> writing a script to rewrite the resulting tex prefix

thats exactly the workaround I'm currently using. I just build with --latex and seding away the problematic line.

>  \PassOptionsToPackage{usenames,dvipsnames}{color}
That seems to also fix the issue. Graci!

But this is obviously these aren't great solutions.


>p.s. I think we may wish to discuss an alternative solution for the inclusion of tex packages.

 I have a proposed solution, but i'll move that over to the dev mailing list.

Matthias Felleisen

unread,
Jan 7, 2016, 10:08:30 AM1/7/16
to Spencer Florence, Matthew Flatt, racket

On Jan 7, 2016, at 9:49 AM, Spencer Florence <spe...@florence.io> wrote:

> > writing a script to rewrite the resulting tex prefix
>
> thats exactly the workaround I'm currently using. I just build with --latex and seding away the problematic line.
>
> > \PassOptionsToPackage{usenames,dvipsnames}{color}
> That seems to also fix the issue. Graci!


[Didn't fix it for me; I want to eliminate an option.]

Tim Jervis

unread,
Mar 31, 2016, 3:45:07 AM3/31/16
to Matthew Flatt, Spencer Florence, racket
Commenting out scribble.tex with an open comment in prefix.tex and closing comment in scribble.tex works, to a point. It hides scribble.tex, but it also hides any dynamic inclusions such as figure.tex.

I have been trying to use the longtable package in preference to the stabular-based  package that Scribble uses for long tables. Unfortunately scribble.tex creates some incompatible definitions, which I have been trying to work around. My current best option appears to be hacking scribble.tex in the Racket source to remove those definitions. It would be nice to avoid hacking the source.

Spencer Florence

unread,
Mar 31, 2016, 11:51:38 AM3/31/16
to Tim Jervis, Matthew Flatt, racket
Oops, guess I forgot to update this thread.

This commit (https://github.com/racket/scribble/commit/2881ef290ddfef6b645eaabc997c9bd6fddaa641) tries to address this problem.

Roughly, you can use `latex-defaults+replacements` to replace `scribble-load-replace.tex` and override the macros that generate the latex includes.

--spf

Tim Jervis

unread,
Apr 1, 2016, 4:21:04 AM4/1/16
to Spencer Florence, Matthew Flatt, racket
Many thanks for updating the thread and for the patch. To make it work for me, I had to make a small additional change. I need to replace “scribble.tex”, so I've tweaked my latex-render.rkt source at line 118 to wrap scribble-tex within a call to your maybe-replace function. With that done, it works just fine.

I don’t see a way for scribble-load-replace.tex to help me avoid loading scribble.tex or avoid loading the definitions within it, but I am no expert and might have misunderstood it. As I see it, scribble-load-replace is a way to redefine which graphicx, hyperref, etc. packages are loaded. The stabular macros are more deeply embedded in scribble.tex.

Tim
Reply all
Reply to author
Forward
0 new messages