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

Latex Workshop: Build with recipe - Add biber and more combinations of pdflatex #1931

Closed
AndreasLuckert opened this issue Feb 4, 2020 · 6 comments
Labels
feature request Feature request

Comments

@AndreasLuckert
Copy link

Is your feature request related to a problem? Please describe.
After each package-update, I need to include the lines mentioned below into the '.vscode/extensions/james-yu.latex-workshop-8.7.1/package.json' - file (approx. between line 600 and 800) in order to be able to build LaTeX-documents the way I need.
I want to compile LaTeX via pdflatex and biber, as I don't use bibtex (which I consider inferior to biber).

{
    "name": "pdflatex -> biber -> pdflatex TWICE",
    "tools": [
        "pdflatex",
        "biber",
        "pdflatex",
        "pdflatex"
    ]
},
{
    "name": "execute biber",
    "tools": [
        "biber"
    ]
},
{
    "name": "execute pdflatex TWICE",
    "tools": [
        "pdflatex",
        "pdflatex"
    ]
},
{
    "name": "execute pdflatex",
    "tools": [
        "pdflatex"
    ]
}

and below that adding biber

{
    "name": "biber",
    "command": "biber",
    "args": [
        "%DOCFILE%"
    ],
    "env": {}
}

Describe the solution you'd like
After each update, I have to insert these code lines manually. Please, just add them to your package-distribution by default, i.e. in your 'package.json' - file. It doesn't hurt, but rather broadens the opportunities for the grateful users. You would do me a big favor!
Thanks so far for your great extension and making it better every time!

Describe alternatives you've considered
Up to now fix that every time manually before building my LaTeX-documents.

@AndreasLuckert AndreasLuckert added the feature request Feature request label Feb 4, 2020
@jlelong
Copy link
Collaborator

jlelong commented Feb 4, 2020

Why not directly using the latexmk recipe, which handles all this transparently?

@AndreasLuckert
Copy link
Author

Ok, thanks for the tip.
I didn't have latexmk installed on my Lubuntu 18.04 OS,
but pdflatex and biber separatly.
I've just installed latexmk via the synaptic package manager and now it works just as well as calling my custom "pdflatex -> biber -> pdflatex TWICE".

The only thing I found a bit unfortunate, was, that when trying to execute latexmk before, it didn't tell me that it wasn't installed, but just didn't do anything (without e.g. returning a concise and telling error message why it couldn't be executed. Same thing with using biber behind the scenes, as far as I remember. Therefore it was quite complicated to tell, back in the days, when I had the problem, why latexmk wouldn't give me the desired result, which is why I ended up with the above-mentioned custom solution.)

In conclusion concerning latexmk:
This command calls pdflatex and the appropriate reference-compiler (bibtex or biber) automatically depending on the LaTeX-code employed? Because how should it otherwise know, whether to use bibtex or biber behind the scences?

@jlelong
Copy link
Collaborator

jlelong commented Feb 4, 2020

Yes, latexmk first runs a LaTeX compiler (the default is pdflatex) and then based on the content of the auxiliary files it decides how to handle the bibliography, index, ... Finally, the LaTeX compiler is called sufficiently many times to fix references.

I am very much surprised that you did not get any message saying that latexmk was not installed. Have you checked the LaTeX Workshop extension log. If you have latex-workshop.message.error.show set to true, you should even have had a popup error.

@AndreasLuckert
Copy link
Author

The line "latex-workshop.message.error.show": true was not yet part of my general settings.json - file.
I've corrected that now.
At least 1 hour ago, when I didn't have latexmk installed yet, a pop-up error didn't appear as usual on the bottom-right.

Thanks for all your tips!
If there is more to know or to implement, which is not yet done by default in your package, let me know, please.

jlelong added a commit that referenced this issue Feb 4, 2020
Here is the conversion table used between the exit status of spawn
and the popup severity

    fatal error  -> error
    error  -> warning
    anything else  -> info

Related to #1931.
@jlelong
Copy link
Collaborator

jlelong commented Feb 4, 2020

The default value for latex-workshop.message.error.show is true. So, need to put it in your settings.json, it is already provided by the extension. This lead to me to find a little bug with the popup severity. This is now fixed, so I am closing this issue.

@jlelong jlelong closed this as completed Feb 4, 2020
@AndreasLuckert
Copy link
Author

Alright, great! Thanks for your help, effort and commitment! Keep it up!

@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
feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants