ashthespy / Atom-LaTeX

The only LaTeX package you need for typesetting with Atom.
https://atom.io/packages/atom-latex
MIT License
22 stars 9 forks source link

.latexcfg does not register #268

Closed dkalaxdk closed 3 years ago

dkalaxdk commented 3 years ago

I have defined my .latexcfg as:

{
  "root" : "\master.tex",

  "toolchain" : "pdflatex -synctex=1 -interaction=nonstopmode -file-line-error -pdf %DOC" ,

  "latex_ext": [".tikz", ".Rnw"]
}

And put it in the root folder. File structure:

LatexTest
 - Bib
 - setup
 -- Preamble
- .latexcfg
- master.tex

But none of the configs from the .latexcfg seems to be used, nor does atom-latex seem to find it when compiling, and it keeps compiling from master.tex

ashthespy commented 3 years ago

Can you open up the dev console and check if you have any errors there? IIRC it should log errors if it fails to parse the file.

dkalaxdk commented 3 years ago

It just builds the master (As that is the one I am in) (Does not build from the toolchain I've shown.)

` C:\Users\Alexander N\AppData\Local\atom\app-1.54.0\resources\app.asar\src\text-editor-element.js:357 [Deprecation] document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.

(anonymous) @ C:\Users\Alexander N\AppData\Local\atom\app-1.54.0\resources\app.asar\src\text-editor-element.js:357

:14 TrustedTypes policy dompurify could not be created. _createTrustedTypesPolicy @ :14 C:\Users\Alexander N\.atom\packages\atom-latex\lib\manager.coffee:72 SyntaxError: Unexpected token m in JSON at position 16 at JSON.parse () at Manager.module.exports.Manager.loadLocalCfg (/C:/Users/Alexander N/.atom/packages/atom-latex/lib/manager.coffee:38) at Manager.module.exports.Manager.findMainConfig (/C:/Users/Alexander N/.atom/packages/atom-latex/lib/manager.coffee:138) at Manager.module.exports.Manager.findMainSequence (/C:/Users/Alexander N/.atom/packages/atom-latex/lib/manager.coffee:101) at Manager.module.exports.Manager.findMain (/C:/Users/Alexander N/.atom/packages/atom-latex/lib/manager.coffee:67) at Builder.module.exports.Builder.build (/C:/Users/Alexander N/.atom/packages/atom-latex/lib/builder.coffee:12) at HTMLElement.click (/C:/Users/Alexander N/.atom/packages/atom-latex/lib/view/panel.js:111) :14 TrustedTypes policy dompurify could not be created. _createTrustedTypesPolicy @ :14 createDOMPurify @ :14 DOMPurify @ :14 NotificationElement.render @ :11 NotificationElement @ :11 (anonymous) @ :11 createView @ :11 getView @ :11 addNotificationView @ :11 (anonymous) @ :11 simpleDispatch @ :11 emit @ :11 addNotification @ :11 addInfo @ :11 module.exports.Logger.setMain @ C:\Users\Alexander N\.atom\packages\atom-latex\lib\logger.coffee:59 module.exports.Manager.findMainSelf @ C:\Users\Alexander N\.atom\packages\atom-latex\lib\manager.coffee:179 module.exports.Manager.findMainSequence @ C:\Users\Alexander N\.atom\packages\atom-latex\lib\manager.coffee:160 module.exports.Manager.findMain @ C:\Users\Alexander N\.atom\packages\atom-latex\lib\manager.coffee:108 module.exports.Builder.build @ C:\Users\Alexander N\.atom\packages\atom-latex\lib\builder.coffee:24 click @ C:\Users\Alexander N\.atom\packages\atom-latex\lib\view\panel.js:171 manager.coffee:43 SyntaxError: Unexpected token m in JSON at position 16 at JSON.parse () at Manager.module.exports.Manager.loadLocalCfg (manager.coffee:38) at Manager.module.exports.Manager.getDocandExt (manager.coffee:57) at Manager.module.exports.Manager.findMain (manager.coffee:80) at Builder.module.exports.Builder.build (builder.coffee:12) at HTMLElement.click (panel.js:111) `
ashthespy commented 3 years ago

There you go -- your JSON has errors..

manager.coffee:43 SyntaxError: Unexpected token m in JSON at position 16
at JSON.parse ()
at Manager.module.exports.Manager.loadLocalCfg (manager.coffee:38)
at Manager.module.exports.Manager.getDocandExt (manager.coffee:57)
at Manager.module.exports.Manager.findMain (manager.coffee:80)
at Builder.module.exports.Builder.build (builder.coffee:12)
at HTMLElement.click (panel.js:111)

Are you sure you want your file as \master.tex?
-- If you really need the \ in your json, you will have to escape it. -- In your case, you should just set root to "master.tex"

Try copy pasting this

{
  "root" : "master.tex",
   "toolchain" : "pdflatex -synctex=1 -interaction=nonstopmode -file-line-error -pdf %DOC",
   "latex_ext": [".tikz", ".Rnw"]
}