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

Curly brackets always used from \chapter even if square brackets present #51

Closed
DavidGriffith opened this issue Dec 24, 2018 · 4 comments

Comments

@DavidGriffith
Copy link

The \chapter takes two parameters: in curly brackets (more common) and square brackets (less common). If just curly brackets are used, that text is used for both the TOC and chapter header. If curly and square are used, then the text in square brackets are used by LaTeX for the TOC and the text in curly brackets are used for the chapter header. Tex4ebook appears to ignore the square brackets and use whatever's in the curly brackets for both TOC and chapter headers. This is a problem for my current project because I have newlines in the chapter names where they appear at chapter headers, but this is ugly in the TOC.

In the context of this bug report, if only square brackets are used, it is legal for demons to fly out of the author's nose.

\documentclass{memoir}
\begin{document}
\tableofcontents*
\chapter[First Chapter]{First\\
Chapter}
\chapter[Second Chapter]{Second\\
Chapter}
\chapter[Third Chapter]{Third\\
Chapter}
\end{document}
@michal-h21
Copy link
Owner

This seems to be caused by Memoir, it works with the Book class. Anyway, it can be fixed using the following configuration:

\Preamble{xhtml}
\Configure{writetoc}{\let\\\space}
\begin{document}
\EndPreamble

It is possible to redefine all macros that may cause issues in the TOC in the \Configure{writetoc} definition.

@DavidGriffith
Copy link
Author

Can this be fixed in tex4ebook to avoid surprising other authors down the line?

@michal-h21
Copy link
Owner

Sure, I've reported this issue on tex4ht issue tracker. I was not able to identify the source of the bug yet.

DavidGriffith added a commit to DavidGriffith/tex4ebook-demo that referenced this issue Dec 29, 2018
This brings up a bug, possibly in tex4ebook.  "\tableofcontents*" works
like expected, but a trailing star is emitted into the resulting epub.
@michal-h21
Copy link
Owner

The fix for this issue has been just pushed to TL.

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