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

bug when exporting pdf using Latex/pandoc templet #6195

Open
2 of 3 tasks
Hpeox opened this issue Dec 19, 2024 · 0 comments
Open
2 of 3 tasks

bug when exporting pdf using Latex/pandoc templet #6195

Hpeox opened this issue Dec 19, 2024 · 0 comments

Comments

@Hpeox
Copy link

Hpeox commented Dec 19, 2024

  • Searched existing issues to avoid creating duplicates.

  • Confirmed that it can be reproduced in built-in themes without customized css.

  • Searched http://support.typora.io/


Describe the bug
when using the pdf (Latex/pandoc) template to export pdf file with pandoc extension pagebreak typora just can't deal with a paragraph with only strong words
An error about lua filter occurred: attempt to index a nil value (local 'command')
Somewhere says that typora just transfer a non-markdown file to pandoc, i think this is where the problem happens
To Reproduce
this is a minimal sample:

---
pagebreak:
 break-on:
   form-feed: false
   plaintext-command: false
---

test code

\newpage

test code

**test code**

use Typora open the file then export it with Latex/pandoc templet with an extra argument --lua-filter pagebreak.lua
then you will get the error in typora's log file or just the pop up window:

[RenderProcess 4][Error] Error running filter C:\Users\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:
...sers\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:81: attempt to index a nil value (local 'command')
stack traceback:
	...sers\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:113: in function <...sers\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:112>
	(...tail calls...)
	[C]: in function 'pandoc.List.find_if'
	...sers\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:119: in upvalue 'is_pb'
	...sers\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:122: in function <...sers\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:121>
	[C]: in ?
	[C]: in method 'walk'
	...sers\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:142: in function 'Pandoc'
stack traceback:
	...sers\<user name>\AppData\Roaming\pandoc\filters\pagebreak.lua:142: in function 'Pandoc'

then if remove the test code in the last line, typora can export the file correctly

also, if just convert the file in cmd with command pandoc test.md -o test.pdf --lua-filter pagebreak.lua or use a custom template in typora, the file can be exported successfully, So i think it's typora's bug

Something else:
if remove the line plaintext-command: false, no error occurs regardless of whether form-feed is true or false, but \newpage is not processed correctly at the same time
also, if remove the whole metadata block, \newpage will remain in pdf

Expected behavior
I just need to insert some pagebreak in my pdf file, however the html label doesn't work when exporting to pdf with pandoc

Desktop:

  • OS: Win11

Typora Version

  • 1.9.5

Pandoc Version

  • 3.6
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

1 participant