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

Support for multi file documents #11

Closed
danbim opened this issue Jul 1, 2015 · 2 comments
Closed

Support for multi file documents #11

danbim opened this issue Jul 1, 2015 · 2 comments

Comments

@danbim
Copy link

danbim commented Jul 1, 2015

I'm editing a larger document that is spread throughout multiple .tex files, e.g.,

main.tex
part_a.tex
...
part_z.tex

and main.tex includes part_a.tex to part_z.tex via \input and also includes the .bib file. Latexer does not find any citations when I'm working inside one of part_a.tex to part_z.tex.

Spontaneous ideas to overcome this situation:

Also a good idea could be to separate the three different autocompletion features (reference, bibliography and environment) of latexer in individual plugins so people can choose freely between plugins that partially overlap in functionality (see last point in the list above).

@andrasbarany
Copy link

I had the same issue; as a very ugly hack I edited ~/.atom/packages/latexer/lib/cite-view.coffee and changed the following block:

  getCitations: ->
    cites = []
    bibRex = /\\bibliography{([^}]+)}/g
    while (match = bibRex.exec(@editor.getText()))
      if not /\.bib$/.test(match[1])
        match[1] += ".bib"
        path = FindLabels.getAbsolutePath(@editor.getPath(), match[1])
        cites = cites.concat(@getCitationsFromPath(path))
    cites

Removing the while-loop and replacing “match[1]” with the path to the .bib-file does the trick. The result looks as follows:

  getCitations: ->
    cites = []
    path = FindLabels.getAbsolutePath(@editor.getPath(), "[path-to-bibfile]")
    cites = cites.concat(@getCitationsFromPath(path))
    cites

It does seem to work, but this is obviously not a permanent solution.

@Focus
Copy link
Owner

Focus commented Jul 25, 2015

Hi. This issue is resolved with balu's fix. The program now will look for a %!TEX root = root.tex inside of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants