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

Knitr problem with latex-workshop.latex.autoBuild.run #2050

Closed
nducphuong opened this issue Apr 26, 2020 · 3 comments
Closed

Knitr problem with latex-workshop.latex.autoBuild.run #2050

nducphuong opened this issue Apr 26, 2020 · 3 comments
Labels
bug Issue identified by LW maintainers as bug

Comments

@nducphuong
Copy link

Preliminary questions [Required]

Knitr problem with latex-workshop.latex.autoBuild.run, manual Recipe work well!

Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]

You still see this issue?: Yes

Make sure to visit the wiki FAQ before filling an issue.

You visited the wiki?: Yes

If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.

You can compile a TeX document manually?: Yes

Describe the bug [Required]

My configure as following
latex-workshop.latex.recipes
{ "name": "Knitr", "tools": [ "knitr","latexmk" ] }

and

latex-workshop.latex.tools
`{
"name": "knitr",
"command": "Rscript",
"args": [
"-e",
"knitr::knit('%DOCFILE_EXT%')"
],
"env": {}
}

{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOC%.tex"
],
"env": {}
}`

Manual Recipe -> it works well!! However, I used the option
**"latex-workshop.latex.autoBuild.run":"onFileChange",
"latex-workshop.latex.recipe.default":"lastUsed"
**
then it comes with error "Failed to resolve build recipe: undefined"

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. See error

Expected behavior

A clear and concise description of what you expected to happen.

Logs [Required]

Please paste the whole log messages here, not parts of ones. It is very important to identify problems.

LaTeX Workshop Output [Required]

To access the log, click the 'TeX' icon on the Activity Bar on the left side, select 'View Log Messages', then select 'View LaTeX Workshop extension log'.

[10:47:23] Initializing LaTeX Workshop.
[10:47:23] Creating file watcher for .pdf files.
[10:47:23] Creating LaTeX Workshop http and websocket server.
[10:47:23] LaTeX Workshop initialized.
[10:47:23] Found root file from active editor: /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw
[10:47:23] Root file changed from: undefined to /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw. Find all dependencies.
[10:47:24] Instantiating a new file watcher for /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw
[10:47:24] Creating file watcher for .bib files.
[10:47:24] Parsing /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw
[10:47:24] Parse fls file.
[10:47:24] Cannot find fls file.
[10:47:24] Server created on 127.0.0.1:55071
[10:47:24] Adding /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw to file watcher.
[10:47:24] Snippet data loaded.
[10:47:24] LaTeX Workshop version: 8.9.0
[10:47:24] Cannot parse /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw: Fall back to regex-based completion.
[10:47:25] File watcher: responding to change in /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw
[10:47:25] Parsing /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw
[10:47:25] Parse fls file.
[10:47:25] Cannot find fls file.
[10:47:25] /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw changed. Auto build project.
[10:47:25] BUILD command invoked.
[10:47:25] Building root file: /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw
[10:47:25] Build root file /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw
[10:47:25] Cannot parse /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw: Fall back to regex-based completion.
[10:47:33] LOG command invoked.
[10:47:33] Found root file from active editor: /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw
[10:47:33] Root file remains unchanged from: /Volumes/Data/nducphuong/Desktop/project/Untitled-1.Rnw.

Developer Tools Console [Required]

To access the log, click 'help' -> 'Toggle Developer Tools. Paste anything suspicious.

Failed to resolve build recipe: undefined

Screenshots

Manual recipe, it works well!
image

**save file -> auto recipe **
image

Desktop [Required]

  • OS: MacOS 10.13
  • VS Code version: 1.44.2
  • Extension version: 8.9.0
  • TeX distribution version: TeX Live 2020

Additional questions

Are you using LaTeX Workshop with VS Code Remote?

No

Additional context

Add any other context about the problem here.

@jlelong jlelong added the bug Issue identified by LW maintainers as bug label Apr 26, 2020
@jlelong
Copy link
Collaborator

jlelong commented Apr 26, 2020

Thanks for your report as it makes me realise that I forgot to write the corresponding documentation in the wiki! It seems that your logs are truncated as there is no reference to Failed to resolve build recipe: undefined in them. Could you post the full content?

Currently, autobuild for .rnw files looks for the first recipe whose names (converted to lowercase) contains rnw or rsweave. I can extend the regex to match knitr too. Could you try to rename your recipe and let me knnow? However, with latex-workshop.latex.recipe.default: lastUsed everything should be working fine once you manually build the file once.

I will investigate all this.

@nducphuong
Copy link
Author

Thanks for your report as it makes me realise that I forgot to write the corresponding documentation in the wiki! It seems that your logs are truncated as there is no reference to Failed to resolve build recipe: undefined in them. Could you post the full content?

Currently, autobuild for .rnw files looks for the first recipe whose names (converted to lowercase) contains rnw or rsweave. I can extend the regex to match knitr too. Could you try to rename your recipe and let me knnow? However, with latex-workshop.latex.recipe.default: lastUsed everything should be working fine once you manually build the file once.

I will investigate all this.

  • I'm so silly! now this Plugin can work perfectly with .Rnw without any additional configuration. Looks like this happened recently? Thank you for telling the tip. It provides exactly what I need.

  • By the way, I could not find the log file because it seems that the compilation process take place forever.

@jlelong
Copy link
Collaborator

jlelong commented Apr 26, 2020

This is now explained in the wiki https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#building-a-rnw-file

This new mechanism was introduced in 8.9.0. See the discussion in #2013.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by LW maintainers as bug
Projects
None yet
Development

No branches or pull requests

2 participants