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

Code blocks are shuffled in the PDF export of a tutorial #466

Open
entwanne opened this issue Jul 5, 2022 · 5 comments
Open

Code blocks are shuffled in the PDF export of a tutorial #466

entwanne opened this issue Jul 5, 2022 · 5 comments
Labels
semver/bugfix This is a minor backward-compatible fix status/verified This has been checked by a maintainer type/bug This is a problem

Comments

@entwanne
Copy link
Member

entwanne commented Jul 5, 2022

Hi,

zgorg2004 noticed on Zeste de Savoir that some blocks of code didn't contain the correct content in the PDF export of Un zeste de Python.

For example at page 269 we can see:
2022-07-05-171150_687x374_scrot

The name of the listing is correct (attaques.csv) but the content is the one of an earlier extract (new.ini page 268).

Everything is good in the HTML version of the tutorial: https://zestedesavoir.com/tutoriels/2514/un-zeste-de-python/6-entrees-sorties/7-formatage/#4-4-csv

@LikaKavkasidze LikaKavkasidze added type/bug This is a problem semver/bugfix This is a minor backward-compatible fix status/verified This has been checked by a maintainer labels Jul 8, 2022
@LikaKavkasidze LikaKavkasidze added this to the zmarkdown@11.1.0 milestone Jul 8, 2022
@LikaKavkasidze LikaKavkasidze removed this from the zmarkdown@11.2.0 milestone Nov 12, 2022
@LikaKavkasidze
Copy link
Member

Hi, and sorry for the delay,

I checked this bug, and first thought it was due to ZMarkdown, but the LaTeX seems to be correctly generated on the website (line 13774 and following). I do not understand how it could be due to the template... Can you confirm if the LaTeX is indeed correct, or if I am mistaking? I will open an issue on the LaTeX side if the error is not due to the generation of the LaTeX file.

@entwanne
Copy link
Member Author

entwanne commented Dec 5, 2022

Hi,

Sorry for the delay but yes I confirm that the LaTex file is good.

Voici un exemple de document CSV :



\begin{CodeBlock}{csv}
nom,type,degats
charge,normal,20
tonnerre,foudre,50
jet-de-flotte,aquatique,40
brûlure,flamme,40
\end{CodeBlock}
\captionof{listing}{attaques.csv}



Une première ligne (l’en-tête) identifie les noms des colonnes, elle est facultative, mais il faudra en tenir compte lors de l’analyse du fichier.

@LikaKavkasidze
Copy link
Member

LikaKavkasidze commented Dec 14, 2022

Thanks, I transferred on the LaTeX template repository, I am tagging the issue here while waiting for the answer.

@LikaKavkasidze LikaKavkasidze added the blocked/latex Awaiting for a change in the template label Dec 14, 2022
@LikaKavkasidze
Copy link
Member

Karnaj says that the issue is due to the LaTeX package used for code blocks not supporting the csv language. We could add support for the language in our template, but I do not think it would be very useful, since CSV doesn't require that much syntax highlighting; it is not even highlighted in the HTML content anyway. I think the best way to solve the issue would be to transform the code block in your tutorial's Markdown to text (not specifying the language should also work), considering that CSV is not a valid language in ZMarkdown. What do you think? Would you prefer the language to be discarded if invalid?

@entwanne
Copy link
Member Author

Ok thanks for the details.
I'll update my tutorial to fix the block, but yes I think it would be great to discard at zmd level unsupported languages.

@LikaKavkasidze LikaKavkasidze removed the blocked/latex Awaiting for a change in the template label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/bugfix This is a minor backward-compatible fix status/verified This has been checked by a maintainer type/bug This is a problem
Projects
None yet
Development

No branches or pull requests

2 participants