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

Unable to render equations in exported pdf #170

Closed
windxrz opened this issue Sep 17, 2020 · 3 comments
Closed

Unable to render equations in exported pdf #170

windxrz opened this issue Sep 17, 2020 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@windxrz
Copy link

windxrz commented Sep 17, 2020

Hi.

When I used the latest extension to export pdf, I found that it can not render mathematical equations in the pdf file. I could render equations last week (September 8, 2020) but now I failed.

The markdown source is as follows:

---
_class: lead
paginate: true
marp: true
---

---

$E = mc^2$
@yhatt
Copy link
Member

yhatt commented Sep 17, 2020

Probably it's same trouble as #150. I tried to reproduce in the latest version but could not, and equations are getting work as usual. What is showing in developer console after exporting? (Ctrl/Cmd+Shift+P ➡️ Developer: Toggle Developer Tools)

@windxrz
Copy link
Author

windxrz commented Sep 17, 2020

[Extension Host] Execute Marp CLI: -c /var/folders/3q/f5l0p30j0958ns9xllbbgt4w0000gn/T/.marp-vscode-cli-conf-ssiHobJgWPvVqIza7gk_U.json /Users/wind/Library/Mobile Documents/com~apple~CloudDocs/PhD/research/group meeting/my/2020-09-16-fairness/main.md -o /Users/wind/Library/Mobile Documents/com~apple~CloudDocs/PhD/research/group meeting/my/2020-09-16-fairness/main.pdf
console.ts:137 [Extension Host] [  INFO ] Converting 1 markdown...
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
console.ts:137 [Extension Host] [  WARN ] Insecure local file accessing is enabled for conversion from          Users/wind/Library/Mobile          Documents/com~apple~CloudDocs/PhD/research/group          meeting/my/2020-09-16-fairness/main.md.
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
console.ts:137 [Extension Host] [  WARN ] The local file is missing and will be ignored. Make sure the file path          is correct.
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
console.ts:137 [Extension Host] [  INFO ] Users/wind/Library/Mobile Documents/com~apple~CloudDocs/PhD/research/group meeting/my/2020-09-16-fairness/main.md => Users/wind/Library/Mobile Documents/com~apple~CloudDocs/PhD/research/group meeting/my/2020-09-16-fairness/main.pdf
t.log @ console.ts:70
$logExtensionHostMessage @ extHostTunnelService.ts:43
_doInvokeHandler @ rpcProtocol.ts:372
_invokeHandler @ rpcProtocol.ts:372
_receiveRequest @ rpcProtocol.ts:253
_receiveOneMessage @ rpcProtocol.ts:185
(anonymous) @ rpcProtocol.ts:51
fire @ event.ts:584
fire @ ipc.net.ts:459
_receiveMessage @ ipc.net.ts:792
(anonymous) @ ipc.net.ts:647
fire @ event.ts:584
acceptChunk @ ipc.net.ts:216
(anonymous) @ ipc.net.ts:137
t @ ipc.net.ts:859
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181

I think there is nothing special. In addition, I found that I could not always reproduce the error. The equations are sometimes shown successfully but sometimes the bug occurs.

@yhatt
Copy link
Member

yhatt commented Sep 17, 2020

It leads exactly same conclusion as #150.

KaTeX, the default math typesetting library, requires to load Web fonts from jsDelivr CDN when rendering math in Marp. If you're in offline or connecting to unstable network, math equations may not render correctly by failing to load Web fonts.

Changing math typesetting library from KaTeX to MathJax in the extension setting might help you. While converting Markdown, all of equations will be rendered within your PC and no network connections are required. So MathJax rendering should not get unstable result.

See also: #150 (comment)

@yhatt yhatt closed this as completed Sep 17, 2020
@yhatt yhatt added the duplicate This issue or pull request already exists label Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants