Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)

Home Page:https://brew.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

latex2html configuration is missing

cinsk opened this issue · comments

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
  • have a problem with brew install (or upgrade, reinstall) a single, official formula (not cask)? If it's a general brew problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new. If it's a brew cask problem please file this issue at https://github.com/caskroom/homebrew-cask/issues/new. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

Problems

After installing latex2html by brew install latex2html. The configuration file /usr/local/Cellar/latex2html/2018/l2hconf.pm does not contain required pathname:

$LATEX = '';   # LaTeX
$DVIPS = '';   # dvips
$DVIPNG = ''; # dvipng
$TEX = "";                       # TeX
$INILATEX = " \"&latex\"";    # initex+latex

Note that LaTeX (MacTeX) was already installed on my system, LaTeX binaries are available in the PATH:

$ which latex
/Library/TeX/texbin/latex
  1. It would be nice that homebrew actually update l2hconf.pm accordingly. For example:
$LATEX = '/Library/TeX/texbin/latex';   # LaTeX
$DVIPS = '/Library/TeX/texbin/dvips';   # dvips
$DVIPNG = '/Library/TeX/texbin/dvipng'; # dvipng
$TEX = "/Library/TeX/texbin/TeX";                       # TeX
$INILATEX = "/Library/TeX/texbin/initex \"&latex\"";    # initex+latex
  1. or, print what to do on brew info latex2html something like:
Note that you must update some of the variable in 
`/usr/local/Cellar/latex2html/2018/l2hconf.pm` at least for
$LATEX, $DVIPS, $DVIPNG, $TEX and $INILATEX.

outputs

output of brew gist-logs latex2html

    Error: No logs.

output of brew config

HOMEBREW_VERSION: 1.5.8
ORIGIN: https://github.com/Homebrew/brew
HEAD: 08f7e8c5887d1c654a1a5d5bc851a9c9d5a00371
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c340723a0a851423a451ad1fd959636afdf2ec10
Core tap last commit: 23 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_RUBY_WARNINGS: -W0
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
Clang: 9.0 build 900
Git: 2.14.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/bin/python3.6
Ruby: /Users/seong-kookshin/.rbenv/shims/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Java: 1.8.0_144
macOS: 10.13.3-x86_64
Xcode: 9.2
CLT: 9.2.0.0.1.1510905681
X11: 2.7.11 => /opt/X11

output of brew doctor

There are some warnings, but none of them are relevant for this issue:

with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Putting non-prefixed coreutils in your path can cause gmp builds to fail.

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
  echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile

Warning: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/bin/gambcomp-C.bat
  /usr/local/bin/gambdoc.bat

This seems pretty reasonable to me.

There are configure switches in latex2html to point it at the LaTeX installation, so it probably wouldn't require much hacking in the formula.

  ...
  --enable-texlive        build LaTeX2HTML for TeXlive cdrom
  ...
  --with-dvips=PATH       path/name of the dvips executable
  --with-dvipng=PATH      path/name of the dvipng executable
  --with-latex=PATH       path/name of the LaTeX executable
  ...

I think we should look in to how the upstream latex2html does its LaTeX detection before throwing anything in to the formula. It's a tad surprising that latex2html doesn't detect this automatically, and maybe that's something we should try to push upstream. And maybe this is just a matter of getting stuff on the path so latex2html can detect/use it at run time.

But it seems reasonable to me to point it at the MacTeX installation, if present - MacTeX is a well-known and quasi-official distribution of LaTeX (and the only big one I know of on Mac), so we probably ought to play nice with it.

Could we get an example of a couple latex2html commands that error out or have other problems under the current configuration regime? It would be nice to have concrete examples of the issues that this lack of configuration causes.

$ latex2html --init_file latex2html.conf cfaqs-ko
Note: Initialising with file: ./latex2html.conf
This is LaTeX2HTML Version 2018 (Released Feb 1, 2018)
by Nikos Drakos, Computer Based Learning Unit, University of Leeds.

Revised and extended by:
 Marcus Hennecke, Ross Moore, Herb Swan and others
...producing markup for HTML version 4.0  



Extension: loading /usr/local/Cellar/latex2html/2018/versions/latin1.pl
HTML version: loading /usr/local/Cellar/latex2html/2018/versions/html4_0.pl

...

Doing footnotes ...
Writing image file ...

Fatal (syswait): exec " ./images.tex" failed: Permission denied
 at /usr/local/bin/latex2html line 3796.

Cannot read logfile './images.log': No such file or directory```

Around line 3796 of latex2html:

3791: sub make_latex_images{
3792:     &close_dbm_database if $DJGPP;
3793:     local($dd) = $dd; $dd = '/' if ($dd eq "\\"); 
3794:     local($latex_call) = "$LATEX .$dd${PREFIX}images.tex";
3795:     print "$latex_call\n" if (($DEBUG)||($VERBOSITY > 1));
3796:     L2hos->syswait($latex_call);
3797:     &open_dbm_database if $DJGPP;
3798: }

Since $LATEX is empty in l2hconf.pm. I guess $latex_call is expanded to " images.tex", and latex2html tries to run the command line in the string which does not have any executable, so it failed with "permission denied".

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.