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

Add a flowchart environnement and its listof #188

Merged
merged 11 commits into from
Aug 24, 2023

Conversation

cedounet
Copy link
Collaborator

So we can more easily access those flowcharts from pdf and website, rather than looking in the crowded list of figures.

So we can more easily access those flowcharts from pdf and website,
rather than looking in the crowded list of figures.
@hendricius
Copy link
Owner

hendricius commented Aug 20, 2023

For some reason they are not shown in the websiten editioimage

I could remove the list for now on the website?

@cedounet
Copy link
Collaborator Author

cedounet commented Aug 20, 2023

That is the easy "fix"...

  • Do they show up in ebook?
  • Do they show up in html?

Is the file book.loc (list of charts...) created?

@hendricius
Copy link
Owner

Good point. The CI doesn't run trying to make the ebook version. This seems to be broken too. Got this error when running make bake

[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=15766]

[WARNING] domfilter: DOM parsing of listtablename.html failed:
[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=15766]

[WARNING] domfilter: DOM parsing of listfigurename.html failed:
[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=22667]

[WARNING] domfilter: DOM parsing of listfigurename.html failed:
[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=22667]

[WARNING] exec_epub: Missing opf file
...023/texmf-dist/scripts/tex4ebook/tex4ebook-exec_epub.lua:341: attempt to index a nil value (local 'f')

@cedounet
Copy link
Collaborator Author

:/ Let me have a look.

@cedounet
Copy link
Collaborator Author

Yeah that is something wrong with make4ht/tex4ebook

the-sourdough-framework/book ➤ 9611b25|list_of_flowchart⚡
3814 ± : head book_serif/book.loc [-28208758m] ✹ ✭
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\contentsline {flowchart}{\numberline {1}{\ignorespaces Process for starter from scratch}}{19}{flowchart.caption.14}%
\contentsline {flowchart}{\numberline {2}{\ignorespaces Sourdough readiness flow chart}}{22}{flowchart.caption.16}%
\contentsline {flowchart}{\numberline {3}{\ignorespaces Sourdough starter maintenance flowchart}}{24}{flowchart.caption.17}%
\addvspace {10\p@ }

it is all empty with maek4ht
book ➤ 9611b25|list_of_flowchart⚡
3815 ± : head book.loc [-28208758m] ✹ ✭
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }
\addvspace {10\p@ }

@cedounet
Copy link
Collaborator Author

Good point. The CI doesn't run trying to make the ebook version. This seems to be broken too. Got this error when running make bake

[WARNING] domfilter: ...ive/2023/texmf-dist/tex/luatex/luaxml/luaxml-mod-xml.lua:175: Unbalanced Tag (/body) [char=15766]
[...]
[WARNING] exec_epub: Missing opf file
...023/texmf-dist/scripts/tex4ebook/tex4ebook-exec_epub.lua:341: attempt to index a nil value (local 'f')

FWIW local builds work on my debian machine.

Our website issue is related to the .loc file being empty.

@cedounet
Copy link
Collaborator Author

Some more debug info
the file book.4ct has loc, lof and lot infos..

My google-fu is failing me right now.

grep loc book.4ct | head
\doTocEntry\tocloc{1}{\csname a:TocLink\endcsname{7}{x7-14002r1}{}{\ignorespaces Process for starter from scratch}}{flowchart}\relax
\doTocEntry\tocloc{2}{\csname a:TocLink\endcsname{7}{x7-15001r2}{}{\ignorespaces Sourdough readiness flow chart}}{flowchart}\relax
\doTocEntry\tocloc{3}{\csname a:TocLink\endcsname{7}{x7-16001r3}{}{\ignorespaces Sourdough starter maintenance flowchart}}{flowchart}\relax
\doTocEntry\tocloc{4}{\csname a:TocLink\endcsname{10}{x10-27001r4}{}{\ignorespaces Flat bread process}}{flowchart}\relax
\doTocEntry\tocloc{5}{\csname a:TocLink\endcsname{11}{x11-29001r5}{}{\ignorespaces The typical process of making a wheat-based sourdough bread.\relax }}{flowchart}\relax
\doTocEntry\tocloc{6}{\csname a:TocLink\endcsname{11}{x11-30001r6}{}{\ignorespaces Process to prepare your starter before baking}}{flowchart}\relax
\doTocEntry\tocloc{7}{\csname a:TocLink\endcsname{11}{x11-36001r7}{}{\ignorespaces The gluten development process for a wheat-based dough.\relax }}{flowchart}\relax
\doTocEntry\tocloc{8}{\csname a:TocLink\endcsname{11}{x11-37002r8}{}{\ignorespaces Process to check the bulk fermentation}}{flowchart}\relax
\doTocEntry\tocloc{9}{\csname a:TocLink\endcsname{11}{x11-39001r9}{}{\ignorespaces Dividing decision tree}}{flowchart}\relax
\doTocEntry\tocloc{10}{\csname a:TocLink\endcsname{11}{x11-40001r10}{}{\ignorespaces Shaping process}}{flowchart}\relax

@hendricius
Copy link
Owner

hendricius commented Aug 20, 2023 via email

@cedounet
Copy link
Collaborator Author

Was planning to Google some more and if not do a MWE before reaching out.

cedounet and others added 3 commits August 21, 2023 14:59
No functional change, but less warnings will help to read the logs.
Good idea anyway to use the key/value scheme

Co-authored-by: Cedric <ced@awase.ostal>
As it is manually placed, is prone to break on evry change of the page
geometry...  This one looks good though in today's conditions.

Co-authored-by: Cedric <ced@awase.ostal>
Few people will notice but this actually brings loads of improvements to
line breaking, handing punctuations etc.
@cedounet
Copy link
Collaborator Author

OK here my MWE if you could confirm it "works" (i.e. fails) for you too:
`\documentclass{scrbook}
\DeclareNewTOC[
type=flowchart,%
types=flowcharts,% ,
float,
name=Flowchart,%
listname = {List of Flowcharts}
]{loc}
\setuptoc{loc}{chapteratlist}

\begin{document}
\begin{flowchart}[!htb]
\caption{A flowchart}
\end{flowchart}

\begin{figure}[!htb]
\caption{A figure}
\end{figure}
\listofflowcharts
\listoffigures

\end{document}`

If i do lualatex mwe.tex then cat mwe.loc I get:
\contentsline {flowchart}{\numberline {1}{\ignorespaces A flowchart}}{1}{}% \providecommand \tocbasic@end@toc@file {}\tocbasic@end@toc@file
and the pdf is as expected

If I do make4ht --lua -a debug mwe.tex then cat mwe.loc I get an empty file:
\providecommand \tocbasic@end@toc@file {}\tocbasic@end@toc@file

@hendricius
Copy link
Owner

@cedounet great test. Can confirm - I get the same error.

@cedounet
Copy link
Collaborator Author

raised michal-h21/tex4ebook#114

@cedounet
Copy link
Collaborator Author

Updated with michal's comments. @hendricius please have a look if that works (reverted your workaround). My ruby install is flaky right now.

@hendricius
Copy link
Owner

@cedounet thank you!!!

For some reason after trying - I still don't see the list of tables in the navigation bar on the right. However - the file is generated. I will add a workaround for this for now. I will merge the PR and create a followup PR. Side note - could you maybe directly create your branches on this repo? Then I can push to your PRs and/or you can push to mine. Thank you!

@hendricius hendricius merged commit 35916c1 into hendricius:main Aug 24, 2023
1 check passed
@cedounet
Copy link
Collaborator Author

Side note - could you maybe directly create your branches on this repo?
Then I can push to your PRs and/or you can push to mine. Thank you!

I will try yes

@cedounet cedounet deleted the list_of_flowchart branch September 13, 2023 12:35
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

Successfully merging this pull request may close these issues.

2 participants