GithubHelp home page GithubHelp logo

Comments (16)

reitzig avatar reitzig commented on August 16, 2024 4

Too bad. As it is, the feature is pretty much useless as soon as you have more than one file in your document. :/

from latexer.

briandk avatar briandk commented on August 16, 2024 1

@reitzig It may actually be even simpler!

It looks like @Focus built in support for using TEX root. So, all you should need to do is step 2; no YAML should be necessary. (The YAML becomes important if you write in Markdown).

Can you try the following?

  1. open a supplementary file
  2. Set TEX root to your main file
  3. Make sure a valid bibliography resource is defined in your main file
  4. With your supplementary file open, check whether autocomplete works
  5. Report back here with your results :-)

from latexer.

hendrikbl avatar hendrikbl commented on August 16, 2024 1

Any plans on fixing this? This still remains with latexer 0.3.0 and atom 1.24.1.

from latexer.

reitzig avatar reitzig commented on August 16, 2024

I note that the second use case is addressed by adding %!TEX root = ... to every non-main file. That's a fair solution, if not a very convenient one.

Alternative ideas to (trying to) find out which BibTeX files are referenced:

  • Use information from opened BibTeX files.
  • Use information from all BibTeX files in current project folders.
  • Allow users to mark relevant BibTeX files for the current project (in the tree view, or with a project config file).

from latexer.

Focus avatar Focus commented on August 16, 2024

I am confused as to why you would have the bibtex file under chapter1.tex. Would it not make sense just to have it under mythesis.tex?

from latexer.

reitzig avatar reitzig commented on August 16, 2024

@Focus My usecase is to have \addbibresource in preamble.tex.

What you write (which corresponds to my second paragraph) happens all the time, of course, but the plugin does not resolve this case either. That said, you may want to have one BibTeX file when writing books with chapter bibliographies.

The abstract issue is: the way LaTeX works, you can specify BibTeX sources almost anywhere in the project, and reference the data everywhere. Latexer currently only looks for linked files in the current file.

from latexer.

Focus avatar Focus commented on August 16, 2024

Hm. I might implement this at some point but to be honest it is pretty low on the priority list.

from latexer.

lordlabakdas avatar lordlabakdas commented on August 16, 2024

latexer is excellent....thank @Focus
also thanks @reitzig, the %!TEX root = ... hack for the multifile support is awesome, good enough for me

from latexer.

briandk avatar briandk commented on August 16, 2024

@reitzig We just merged #49, which may solve your issue?

It allows you to specify bibliographic info in a YAML-formatted metadata block at the top of your document.

Please let me know if this helps you.

From the Updated README:

Latexer finds your bibfiles

Latexer will automatically scan your document to find your bibfiles. For example, if your document contains the command \bibliography{mybib1.bib, mybib2}, latexer will find and then scan through the files named mybib1.bib and mymbib2.bib to get the citations. Additionally, Latexer will look for BibTeX files given in the current file of the form \addbibresource and \addglobalbib.

You can also specify bibfiles using a YAML metadata block at the top of your document. If you choose to write in Markdown on RMarkdown, Latexer will automatically look for the bibliography key in your YAML and scan any files specified for citations.

from latexer.

reitzig avatar reitzig commented on August 16, 2024

Looks good! So the workflow would be:

  1. Add .bib files to YAML meta block in the main file.
  2. Add %!TEX root = ... in all supplementary TeX files.

Right?

from latexer.

reitzig avatar reitzig commented on August 16, 2024
  1. is what I didn't have, defining the bib files in a preamble file. Hence, the ticket. ;)

from latexer.

briandk avatar briandk commented on August 16, 2024

@reitzig - ah. Just trying to help.

So, is there anything else you need to solve your problem? If not, we can probably close the issue :-)

from latexer.

johschmitz avatar johschmitz commented on August 16, 2024

There should be an optional configuration file .latexer or .latexer.json where the %!TEX root = mainfile.tex can be defined, it is not very nice to put it in each and every .tex file.

from latexer.

hendrikbl avatar hendrikbl commented on August 16, 2024

I have a similar problem. I have my root file root.tex with an \input{header} and an \include{chapters/chapter1} line in it. The header.tex file has the \bibliography line in it and in chapter1.tex I'm using \cite{}. %!TEX root = ... is defined in both of them. But nothing shows up.

It seems that latexer doesn't check more 'layers' than the the file you're in and the root file.

from latexer.

briandk avatar briandk commented on August 16, 2024

@hendrikbl hmm. Would you be able to create a simple reproducible example?

Also, a few questions:

  1. What version of the package are you using?
  2. Which version of atom are you using?
  3. Can you confirm on your system that latexer does work in the simple case of a single .tex and bibliography file in the same parent directory?

from latexer.

hendrikbl avatar hendrikbl commented on August 16, 2024

Here is an example.
Autocompletion works fine from within header.tex but shows nothing from within root.tex or chapters/chapter1.tex.

To answer your questions:

  1. Latexer 0.3.0
  2. Atom 1.21.2
  3. Yes, it works fine in that case.

from latexer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.