Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No epub file produced #76

Open
WvA1979 opened this issue Sep 25, 2020 · 9 comments
Open

No epub file produced #76

WvA1979 opened this issue Sep 25, 2020 · 9 comments

Comments

@WvA1979
Copy link

WvA1979 commented Sep 25, 2020

I am using the following command (on Windows) :

tex4ebook -f epub -c sample --jobname myjob --output-dir .build --tidy main.tex

sample is the file containing (not really sure what this file is for):
\Preamble{xhtml}
\CutAt{section}
\begin{document}
\EndPreamble

The whole process runs for quite some time, produces a bunch of files (all at the location where the command is executed and not in the .build folder as I would expect) and copies them to a folder myjob-epub ;

tidy seems to not find a file or path

HTML Tidy for Windows version 5.7.17
Le chemin d’accès spécifié est introuvable.
Le chemin d’accès spécifié est introuvable.
Le chemin d’accès spécifié est introuvable.
Le fichier spécifié est introuvable.
[STATUS] tex4ebook: Conversion finished

However in the end, I do not get a myjob.epub file at all ;

Any help is appreciated !

@michal-h21
Copy link
Owner

Try to add also the -a debug option, it should tell us more. I will also need to see a minimal working example of your TeX file. Especially used packages are important. You don't need to use the sample.cfg file, I don't think this particular file you have does anything useful.

@WvA1979
Copy link
Author

WvA1979 commented Sep 26, 2020

Thanks for your return; I am trying to make a minimal example, but now I get even less than before...

Screen output :
tex4ebook -a -f epub -c sample --jobname poly_ao101 --output-dir .build --tidy main.tex
[WARNING] mkparams: Cannot find input file: epub
[INFO] mkparams: Output dir: .build
[INFO] mkparams: Compiler: latex
[INFO] mkparams: Latex options: -jobname=poly_ao101
[INFO] mkparams: tex4ht.sty: sample,main.tex,charset=utf-8
[INFO] mkparams: tex4ht: -cmozhtf -utf8
[INFO] mkparams: build_file: poly_ao101.mk4
[INFO] mkparams: Output format: epub
[STATUS] tex4ebook: Conversion started
[STATUS] tex4ebook: Input file: epub
[INFO] tex4ebook: No conffile
[INFO] mkutils: Cannot open config file poly_ao101.mk4
[INFO] exec_epub: dir poly_ao101-epub/META-INF
[INFO] exec_epub: remove file poly_ao101-epub/META-INF/container.xml
[INFO] exec_epub: remove dir poly_ao101-epub/META-INF
[INFO] exec_epub: remove file poly_ao101-epub/mimetype
[INFO] exec_epub: dir poly_ao101-epub/OEBPS
[INFO] exec_epub: remove dir poly_ao101-epub/OEBPS
[INFO] exec_epub: remove dir poly_ao101-epub
[INFO] make4ht-lib: setting param correct_exit
[INFO] make4ht-lib: setting param correct_exit
[INFO] make4ht-lib: setting param correct_exit
[INFO] make4ht-lib: setting param ext
[INFO] exec_epub: Output file: poly_ao101.epub
[INFO] htlatex: LaTeX call: latex --interaction=batchmode -jobname=poly_ao101 \makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro@documentclasshook{\RequirePackage[#1,html]{tex4ht}\RequirePackage{tex4ebook}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode sample,main.tex,charset=utf-8,charset=utf-8,epub,uni-html4.a.b.c.\input "\detokenize{epub}" > nul 2>&1
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.7)
entering extended mode
[ERROR] htlatex: Compilation errors in the htlatex run
[ERROR] htlatex: Filename Line Message
[ERROR] htlatex: ? ? Emergency stop.
[FATAL] make4ht-lib: Fatal error. Command htlatex returned exit code 1

Minimal code:

\documentclass[twoside,12pt]{book}

% Style et Dimensions
%--------------------
\pagestyle{myheadings}\markboth{zzz}{Optimisation
quadratique}
    \textheight=22cm
    \textwidth=15.5cm
    \topmargin=-1.0cm
    \oddsidemargin=0.4cm
    \evensidemargin=0.4cm

% Extensions
%-----------
%\input option_keys
%\usepackage{showkeys}
\usepackage[french]{babel}
\usepackage[latin1]{inputenc}
%\usepackage{amssymb,equations,subeqn}
\usepackage{makeidx}
\usepackage{latexsym}     % Pour certains symboles (\Box, ...)
\usepackage{amsmath}      % Environnement AMS
\usepackage{amsthm}       % avec theoremes
\usepackage{amsfonts}     % et fonts associees
\usepackage{amssymb}
\usepackage{euscript}

\usepackage{epsf,eepic,graphicx,epsf,epsfig,psfrag}
%\usepackage[notref,notcite]{showkeys}
\usepackage{fancybox,hyperref}
%\usepackage[dvips,colorlinks=true,linkcolor=blue]{hyperref}

\usepackage{cite}
\usepackage{tex4ebook}

\makeindex

\begin{document}
\baselineskip = 7mm
\thispagestyle{empty}
\LARGE
\vglue 50mm
\centerline{\bf Cours AO101 }
\bigskip
\centerline{\bf Optimisation quadratique}
\bigskip\bigskip\bigskip \large \centerline{ zzz}
 \normalsize
 \vskip 10mm
% \centerline{version 1.0 (\today)}
 \centerline{(\today)}
 \newpage
 \tableofcontents
\baselineskip = 6mm
%\input avertissement.tex

    \include{contents/toy}

% BIBLIOGRAPHIE
%--------------
\bibliographystyle{plain}
\bibliography{./biblio_AO101}

% INDEX
%------
\printindex % Attention : il faut classer les lettres accentuees "a la main"
        %dans .ind

\end{document}

The file toy just contains an image:

\chapter{Existence, Unicité d'un minimum}\label{Existence_Unicite}
%-----------------------------------------------------------------

\section{~Cadre du probl\`eme}
%------------------------------

 \begin{figure}[h]
  \vspace*{-0cm}
  \centerline{\includegraphics[width=95mm, height=4.0cm]{img/convexe.pdf}}
  \vspace*{-0.5cm}
 \caption{Convexe ou non convexe}
 \label{min:def-convexe}
 \end{figure}

(nous renvoyons le lecteur \`a \cite{Gilb00}).

@michal-h21
Copy link
Owner

This error is caused by missing debug text for the -a option, so command line parsing then fails. The correct command would be:

tex4ebook -a debug -f epub -c sample --jobname poly_ao101 --output-dir .build --tidy sample.tex

Your sample file compiles without errors for me (I just don't include the picture you use in contents/toy.tex), so I guess that the problem happens somewhere later in the compilation of your full TeX sources.

@WvA1979
Copy link
Author

WvA1979 commented Sep 27, 2020

I get these sort of errors for the figures:

! LaTeX Error: File `"img/convexe1.xbb"' not found.

See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.

The file compiles just fine with pdflatex (images are available in both eps and pdf) ;

The now full debug command gives the following messages at the end:

[INFO] mkutils: Copy: copy "content.opf" "poly_ao101-epub\OEBPS"
1 fichier(s) copié(s).
HTML Tidy for Windows version 5.7.17
[INFO] exec_epub: Tidy ncx 0
[INFO] exec_epub: Tidy opf 0
Le chemin d’accès spécifié est introuvable.
[INFO] exec_epub: Pack mimetype 1
Le chemin d’accès spécifié est introuvable.
[INFO] exec_epub: Pack metadir 1
Le chemin d’accès spécifié est introuvable.
[INFO] exec_epub: Pack outputdir 1
[INFO] exec_epub: Copy generated epub
[INFO] mkutils: Copy: copy "poly_ao101-epub\poly_ao101.epub" ".build\poly_ao101.epub"
Le fichier spécifié est introuvable.
[STATUS] tex4ebook: Conversion finished

@michal-h21
Copy link
Owner

It is really strange that you get errors for missing .xbb files. You can generate them using:

 ebb -x img/*.pdf

But you should get at most warning when they are missing.

Anyway, you get real errors here:

Le chemin d’accès spécifié est introuvable.
[INFO] exec_epub: Pack mimetype 1
Le chemin d’accès spécifié est introuvable.
[INFO] exec_epub: Pack metadir 1
Le chemin d’accès spécifié est introuvable.
[INFO] exec_epub: Pack outputdir 1
[INFO] exec_epub: Copy generated epub
[INFO] mkutils: Copy: copy "poly_ao101-epub\poly_ao101.epub" ".build\poly_ao101.epub"
Le fichier spécifié est introuvable.

It seems that it fails to call chained commands. Could you try to execute the following code?

 cd poly_ao101-epub && zip -q0X poly_ao101.epub mimetype
 zip -qXr9D poly_ao101.epub META-INF
 zip -qXr9D poly_ao101.epub OEBPS

Do you get the same error for the first line? It is basically the same as tex4ebook is running on the lines where you get error. If it works, you will get poly_ao101.epub file in poly_ao101-epub dir.

@WvA1979
Copy link
Author

WvA1979 commented Sep 28, 2020

Thank you ; With those zip commands it actually works and creates the .epub file ;

I have some further observations/questions

  • Is there a way to get a better typography of the equations? The look and feel isn't quite as "usual" ?
  • Is there any reason the bibliography (bibtex) isn't picked up -- or any commands to make it be picked up by tex4ebook ?

As a last question, how can I add a fourth cover page (backpage) to the book ? Would that be through the configuration file?

@michal-h21
Copy link
Owner

  • Equations are bit hard to support properly in Epub. On web, they are pretty nicely handled using MathJax and MathML, but in Epub you must use images, which is generally quite poor. You can use SVG instead of PNG, this should result in cleaner look. Take a look here for an example.

  • I don't know why bibliography isn't picked up, could you please send me the bibliography file?

  • I don't think that Epub supports backpage, but you always can include stuff that should be used only with TeX4ht using something like:

    \ifdefined\HCode
    \includegraphics{backpage.png}
    \fi
    

@WvA1979
Copy link
Author

WvA1979 commented Sep 29, 2020

Thank you. Indeed, with svg the images have improved -- it is even slightly better in epub3, but that requires a special reader ;

As for the bibliography, attached is a sample file (in fact I include two files, the one here being "disposable") -- I guess I can ofcourse simply pick up the .bbl file and use the HCode flag, but that seems like a work around.

@book{Bjor90,
AUTHOR={A. Björck},
TITLE={Solutions of equations in $\R^n$ (Part I): Least
squares methods},
VOLUME={},
NUMBER={},
SERIES={Handbook of numerical analysis, Volume I},
PAGES={},
PUBLISHER={North Holland, Amsterdam},
EDITION={},
YEAR={1990},
KEY={},
ADDRESS={}
}
%editeurs P. G. Ciarlet et J.--L. Lions

@booklet{BoLe02,
AUTHOR={A.-S. Bonnet Ben Dhia and M. Lenoir},
TITLE={Outils \'el\'ementaires d'analyse
pour les \'equations aux d\'eriv\'ees partielles},
VOLUME={},
HOWPUBLISHED={Cours MA 102 ENSTA},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={},
EDITION={},
YEAR={},
KEY={},
ADDRESS={}
}

@booklet{CiJo03,
AUTHOR={P. Ciarlet and P. Joly},
TITLE={Introduction au calcul scientifique},
VOLUME={},
HOWPUBLISHED={Cours MA 103 ENSTA},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={},
EDITION={},
YEAR={},
KEY={},
ADDRESS={}
}

@book{Ciar82,
AUTHOR={P. G. Ciarlet},
TITLE={Introduction \`a l'analyse num\'erique matricielle et \`a l'optimisation},
VOLUME={},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={Masson, Paris},
EDITION={},
YEAR={1982},
KEY={},
ADDRESS={}
}

@article{FaMa84,
AUTHOR={V. Faber and T. Manteuffel},
TITLE={Necessary and sufficient conditions for the existence of a conjugate gradient method},
JOURNAL={SIAM Journal on Numerical Analysis},
NUMBER={1},
SERIES={},
PAGES={352-362},
INSTITUTION={},
VOLUME={21},
MONTH = {},
YEAR={1984},
ADDRESS={}
}

@booklet{Gilb00,
AUTHOR={J.-C. Gilbert},
TITLE={Optimisation diff\'erentiable. Th\'eorie et algorithmes},
VOLUME={},
HOWPUBLISHED={Cours AO 201 ENSTA},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={},
EDITION={},
YEAR={},
KEY={},
ADDRESS={}
}

@book{GoMe83,
AUTHOR={G. H. Golub and G. Meurant},
TITLE={R\'esolution num\'erique des grands syst\`emes lin\'eaires},
VOLUME={},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={Eyrolles, Paris},
EDITION={},
YEAR={1983},
KEY={},
ADDRESS={}
}

@booklet{Krik00,
AUTHOR={F. Jean},
TITLE={Lin\'earisation et stabilit\'e des \'equations
diff\'erentielles},
VOLUME={},
HOWPUBLISHED={Cours AO 102 ENSTA},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={},
EDITION={},
YEAR={},
KEY={},
ADDRESS={}
}

@book{Meur99,
AUTHOR={G. Meurant},
TITLE={Computer solution of large linear systems},
VOLUME={28},
NUMBER={},
SERIES={Studies in
Mathematics and its Applications},
PAGES={},
PUBLISHER={North Holland Amsterdam},
EDITION={},
YEAR={1999},
KEY={},
ADDRESS={}
}

@booklet{Pere00,
AUTHOR={J. P\'erez},
TITLE={Gravitation classique. Enseignement th\'ematique
d'Astrophysique},
VOLUME={},
HOWPUBLISHED={MAT 40 ENSTA},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={},
EDITION={},
YEAR={},
KEY={},
ADDRESS={}
}

@article{PoRi69,
AUTHOR={E. Polak and G. Ribi\`ere},
TITLE={Sur la convergence de la m\'ethode des
gradients conjugu\'es},
JOURNAL={Revue Fran\c caise d'Informatique et
de Recherche Op\'erationnelle},
NUMBER={R1},
SERIES={},
PAGES={},
INSTITUTION={},
VOLUME={16},
MONTH = {},
YEAR={1969},
ADDRESS={}
}

@article{SaSc86,
AUTHOR={Y. Saad and M. H. Schultz},
TITLE={GMRES: a generalized minimum residual algorithm for
solving nonsymmetric linear systems},
JOURNAL={SIAM Journal on
Scientific and Statistical Computing},
NUMBER={1},
SERIES={},
PAGES={856-869},
INSTITUTION={},
VOLUME={7},
MONTH = {},
YEAR={1986},
ADDRESS={}
}

@book{QuVa99,
AUTHOR={A. Quarteroni and A. Valli},
TITLE={Domain decomposition methods for partial differential equations},
VOLUME={},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={Oxford Science Publications},
EDITION={},
YEAR={1999},
KEY={},
ADDRESS={}
}

@book{SmBG96,
AUTHOR={B. F. Smith and P. E. Bj\o rstad and W. D. Gropp},
TITLE={Domain decomposition. Parallel multilevel methods for elliptic partial differential equations},
VOLUME={},
NUMBER={},
SERIES={},
PAGES={},
PUBLISHER={Cambridge University Press, New York},
EDITION={},
YEAR={1996},
KEY={},
ADDRESS={}
}

@michal-h21
Copy link
Owner

OK, so it seems that the issue is really something in how Miktex invokes tex4ebook. I will need to investigate it more once I have access to a Windows computer.

I can get the bibliography, using the following build file:


if mode == "draft" then
   Make:htlatex {}
else
   Make:htlatex {}
   Make:bibtex {}
   Make:htlatex {}
   Make:htlatex {}
end

Save it as mybuild.lua and add -e mybuild.lua to your tex4ebook call. You can use the draft mode for a quick compilation:

  tex4ebook -a debug -f epub -c sample --jobname poly_ao101 --output-dir .build --tidy -m draft -e mybuild.lua  sample.tex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants