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

Markdown formatting is overly sensitive to layout #648

Open
nrnrnr opened this issue Aug 30, 2022 · 7 comments
Open

Markdown formatting is overly sensitive to layout #648

nrnrnr opened this issue Aug 30, 2022 · 7 comments

Comments

@nrnrnr
Copy link

nrnrnr commented Aug 30, 2022

My LaTeX markup allowed a space to creep in before a dash in a Markdown list. I expected pdfpc to recognize the markup, but it did not.

To reproduce the behavior,

  1. Run pdflatex on the attached test.tex file.
  2. Run pdf-presenter-console -f markdown on the resulting test.pdf. (My test.pdf is also attached.)

I would expect all four Markdown notes to render as lists. But only the first renders as a list.

(And since you're redefining \\, it is probably worth redefining \par as well.)

pdfpc version: v4.5.1pre

Used Distribution (GTK version, vala version): Debian stable (bullseye). No idea how to find other versions, but package dependency shows "libgtk-3-0 (>= 3.21.4)".

Display Server (X/Wayland): X

HiDPI Setting (yes/no): I don't know what this is, but if it helps, the display size is 3840x2160 pixels.

@fnevgeny
Copy link
Member

fnevgeny commented Sep 4, 2022

  1. Run pdflatex on the attached test.tex file.

I see no attachments.

@nrnrnr
Copy link
Author

nrnrnr commented Sep 5, 2022

My apologies. I must have botched the attachment process.

I'm trying again. In order to attach test.tex, I had to rename it test.tex.txt.

test.tex.txt
test.pdf

@fnevgeny
Copy link
Member

fnevgeny commented Sep 5, 2022

I see your point, but it's unrelated to pdfpc, which by itself doesn't "recognize" (i.e., render) markdown. It uses libmarkdown2 (aka discount). Furthermore, the text is passed by the \pdfpcnote macro, which is indeed rather picky. If you wish, submit this as a bug to latex-pdfpc.

@nrnrnr
Copy link
Author

nrnrnr commented Sep 5, 2022

If I get a chance I'll see if I can figure out whether the LaTeX or libmarkdown2 is more to blame.

@HermannDppes
Copy link

Extracting the notes from your PDF, I find these:

This is a markdown note
 
 - One
 - Two
 - Three
 
This is another markdown note 
- Four
 - Five
 - Six
 
This is a third markdown note par - Seven
 - Eight
 - Nine
And a fourth
 par - Ten
 - Eleven
 - Twelve

Running them through Markdown.pl, only the first one is a list. So, as the intention seems to be merely to implement Markdown, I see no evidence of any bug in pdfpc or discount. Though original Markdown is notoriously underspecified and if at some point more people complain about pdfpcs Markdown rendering, it may be a desirable enhancement of pdfpc to be less noticeably incompatible with the increasing majority of dialects in usage which, I think, do not require the (mostly) blank line before a list, for example.

@fnevgeny
Copy link
Member

This is another markdown note 
- Four
 - Five

BTW, can someone understand where the space before the last - comes from?

@HermannDppes
Copy link

This is another markdown note 
- Four
 - Five

BTW, can someone understand where the space before the last - comes from?

If I write ? for the line break byte (assuming Unix …), the input there is \\?- Five but since TeX tends to treat single line breaks the same as spaces, it might just as well be \\ - Five where there is clearly a space immediately after the \\, i.e. at the beginning of the line. Parsing and executing TeX in my head is kind of hard but I think this is precisely what I would have expected.

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

No branches or pull requests

3 participants