racket / scribble

Other
197 stars 90 forks source link

recent versions of newtxmath define widebar, breaking scribble output #324

Closed bremner closed 2 years ago

bremner commented 2 years ago

The following LaTeX document is reduced from what scribble generates from a hello world document. With newtxmath.sty 1.7 (2021/12/18), it generates an error because \widebar is already defined. Uncomenting the let for widebar seems to "fix" it, no idea if that's the best approach.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathabx}
\let\widering=\relax
%\let\widebar=\relax
\usepackage{newtxmath}
\begin{document}
hello world
\end{document}

Here's the scribble document.

#lang scribble/base
@(require scribble/core
          scribble/manual)

hello world
soegaard commented 2 years ago

I don't know of a way to remove commands in the latex prefix.

The best work around I can think of: copy the math-prefix.tex file and delete the offending line. Then use:

 scribble --prefix math-prefix.tex   file.tex
mfelleisen commented 2 years ago

A while back @rfindler posted the following:

#lang scribble/base
@(require (only-in scribble/core make-style)
          (only-in scribble/latex-properties latex-defaults+replacements))

@(define my-style
   (make-style
    #f
    (list (latex-defaults+replacements
           (list 'collects #"scribble" #"scribble-prefix.tex")
           (list 'collects #"scribble" #"scribble-style.tex")
           '()
           (hash "scribble-load-replace.tex" #"\\renewcommand{\\packageMathabx}{\\relax}\n")))))

@title[#:style my-style]{Discourse}

@author{Racket}

(dialogue)

It should help.

rfindler commented 2 years ago

Yeah, we should really go clean up that part of the docs and maybe make some changes to scribble itself to make this sort of thing easier to find and to accomplish!

soegaard commented 2 years ago

Here is the thread in question:

https://racket.discourse.group/t/what-system-configuration-is-needed-for-the-scribble-pdf-button-in-drracket-for-a-scribble-file-in-order-to-work-properly/528/14?u=soegaard

bremner commented 2 years ago

Jens Axel Søgaard @.***> writes:

I don't know of a way to remove commands in the latex prefix.

The best work around I can think of: copy the math-prefix.tex file and delete the offending line. Then use:

 scribble --prefix math-prefix.tex   file.tex

Maybe I misunderstand, but the existing prelude is full of workarounds for problems of this type.

    \newcommand{\packageWasysym}{
      \let\leftmoon\relax \let\rightmoon\relax \let\fullmoon\relax \let\newmoon\relax \let\diameter\relax
      \usepackage[nointegrals]{wasysym}}

    \newcommand{\packageTxfonts}{
      \let\widering\relax
      % insert "\let\widebar\relax" here
      \usepackage{newtxmath}}

It seems like we just need one more?

soegaard commented 2 years ago

Jens Axel Søgaard @.***> writes: I don't know of a way to remove commands in the latex prefix.

The best work around I can think of: copy the math-prefix.tex file and delete the offending line. Then use:

  scribble --prefix math-prefix.tex   file.tex

Maybe I misunderstand, but the existing prelude is full of workarounds for problems of this type.

I wasn't clear. I was thinking of a here-and-now solution that works without changing the default prelude.

racket-discourse-github-bot commented 2 years ago

This issue has been mentioned on Racket Discussions. There might be relevant details there:

https://racket.discourse.group/t/problems-generating-pdf-latex-from-scribble/1010/2

racket-discourse-github-bot commented 2 years ago

This issue has been mentioned on Racket Discussions. There might be relevant details there:

https://racket.discourse.group/t/scribble-to-pdf-pain/1076/8

capfredf commented 2 years ago

closed via https://github.com/racket/scribble/commit/1a106b9603a5a04d51eaf9075ad22d5171e27d5f