0

Sorry for my english it's not my native language. I begin to write paper with latex and I try to write with VS Code. But when I compil my project I have these errors:

[{
    "resource": "/Users/jules/Desktop/test_template/test vs code/main.tex",
    "owner": "BibTeX",
    "severity": 8,
    "message": "I found no \\citation commands",
    "source": "BibTeX",
    "startLineNumber": 1,
    "startColumn": 1,
    "endLineNumber": 1,
    "endColumn": 65536
},{
    "resource": "/Users/jules/Desktop/test_template/test vs code/main.tex",
    "owner": "BibTeX",
    "severity": 8,
    "message": "I found no \\bibstyle command",
    "source": "BibTeX",
    "startLineNumber": 1,
    "startColumn": 1,
    "endLineNumber": 1,
    "endColumn": 65536
}]

I don't understand how to fix it. This is a sample of my bib file

@article{saitoh_approximate_2006,
    title = {Approximate empirical relations for nonlinear photonic crystal fibers},
    volume = {14},
    issn = {1094-4087},
    url = {https://opg.optica.org/oe/abstract.cfm?uri=oe-14-14-6572},
    doi = {10.1364/OE.14.006572},
    abstract = {abstract},
    language = {en},
    number = {14},
    urldate = {2022-03-04},
    journal = {Optics Express},
    author = {Saitoh, Kunimasa and Fujisawa, Takeshi and Kirihara, Takahito and Koshiba, Masanori},
    year = {2006},
    pages = {6572},
    file = {Saitoh et al. - 2006 - Approximate empirical relations for nonlinear phot.pdf:/Users/Saitoh et al. - 2006 - Approximate empirical relations for nonlinear phot.pdf:application/pdf},
}

I use Latex Workshop extension. This sample is exported from zotero with bibtex and western encoding.

An example of latex code:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
\section*{First part}
bla bla bla bla \cite{saitoh_approximate_2006}
\bibliography{sample}  
\end{document}

Thank's for your attention

dexteritas
  • 9,161
  • Welcome to tex.sx. I'm not familiar with VS Code, but for those who can help directly, they will need more information. Since bibtex won't do anything unless latex has been run first on your main file, it's necessary to see what that looks like. A small compilable example, starting with \documentclass, ending with \end{document}, and including a call to the bibliography and a few \cites should be sufficient. – barbara beeton Jun 06 '22 at 15:06
  • Thanks to answer quickly, I uploaded my question :) – Jules Hx Jun 06 '22 at 15:16
  • 1
    Your code should also have a \bibliographystyle instruction. E.g. \bibliographystyle{plain}. This must be fixed, but I'm not sure if it helps, because your BibTeX complains about there being no citations, when your example document clearly has some. – moewe Jun 06 '22 at 15:22
  • 1
    It's fixed, I feel stupid ^^'. I don't know that I have to add the bibliography style before. Thank you very much. – Jules Hx Jun 06 '22 at 15:35
  • Welcome. // I suggest to get some book on introduction to Latex, which also deals with bibliography. Unless you have one, this may be useful, though quite overwhwlming: https://en.wikibooks.org/wiki/LaTeX/Bibliography_Management . // I suggest to restart small, i.e. make a more simplified version run, i.e. ignore your current problems. E.g. just „copy“ examples, and gradually add more of your citation data. I.e. let the URL be the last item you treat this way. You may want to use package hyperlink then. Just move from success to success. Now it‘s too much at once. – MS-SPO Feb 17 '23 at 00:35
  • Bibliography in Latex is powerful, hence it‘s hard to understand the few approaches to it for a beginner. Again, get a good introduction on this subject, i.e. a book you can „copy“ from. – MS-SPO Feb 17 '23 at 00:39

0 Answers0