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

Finding Same File Multiple Times #2533

Closed
Sam-OT opened this issue Aug 16, 2022 · 8 comments
Closed

Finding Same File Multiple Times #2533

Sam-OT opened this issue Aug 16, 2022 · 8 comments

Comments

@Sam-OT
Copy link

Sam-OT commented Aug 16, 2022

I am writing some lecture notes with a base file and using \input to input the other files.

The find functionality seems to have bugged out somewhat. When I search across the full project, it finds the same file multiple times. The following imagine shows this.

image

This in of itself, but a consequence is that loads of my labels are marked as 'multiply defined'.

I haven't been able to reproduce this with other files. However, even making new base and individual tex files, the issue still arises. It seems that TeXstudio fails to forget the closed files. You can see this in the following image. The file 02-markov.tex is not included anywhere in the current document. It was before, but it has been replaced with 02-markov.tex. It seems that it is not being forgotten.

The issue is still present even if I include just one file, eg 02-markov.tex mentioned above, and remove all information from it except for one section heading and its label. I then removed all the preamble and everything else from the base file. It still said "multiply defined" and the search brought up the inputted file multiple times. So, it isn't an issue with the specific files, some package or something like that. Something is causing TeXstudio to just find the same file multiple times.

Incidentally, the issue is removed if I untick "automatically load include files" in the options. This isn't great, though, as then the references to other files say "label missing". Update. Ok, so the above was true yesterday and the first time I ran TeXstudio this morning, but then when I closed and re-opened it now has gone back to the original "label defined multiple times" error even with the "automatically load include files" option unticked. Hmm...

Update. Restarting the entire computer temporarily fixes it. I open the inputted files once and there is no issue (currently!). Closing it and reopening causes the issue to arise, though. It certainly appears to me that it is just not removing the label-data from its memory when it closes the file.

image


  • TeXstudio: 4.2.3
  • Qt: 6.3.0
  • OS: Windows 10
  • TeX distribution: miktex

I appreciate that this is not the most recent version. I use the portable version, since I don't have admin rights, so it's not so easy to update without resetting things. Hence, I have not tried to update

@sunderme
Copy link
Member

I need text files in order to reproduce the issue without hustle.
(you can send the files also directly to me sunderme@gmx.de)

@Sam-OT
Copy link
Author

Sam-OT commented Aug 17, 2022

I need text files in order to reproduce the issue without hustle. (you can send the files also directly to me sunderme@gmx.de)

Ah, I see now that my comment regarding lack of reproducibility was ambiguous. I have updated it now. I run the portable version, so would it make sense for me to zip up and send you my entire program files?

@sunderme
Copy link
Member

I rather need the latex source files. And maybe the texstudio.ini, if it is caused by some changed settings.

@Sam-OT
Copy link
Author

Sam-OT commented Aug 17, 2022

I rather need the latex source files. And maybe the texstudio.ini, if it is caused by some changed settings.

Ah, as I said, the source files are nothing unfortunately. Here's an equivalent version anyway, but I'm sure it doesn't help at all.

% save this as base.tex
\documentclass{article}
\begin{document}
\section{A}
\label{A}
\input{other.tex}
\end{document}
% save this as other.tex
\section{B}
\label{B}

It's not identical, as they have the other names shown in the snippets. But, as I said, I removed it down to basically that and the issue still arose. Remember, though, I said that I couldn't reproduce it—but it still persists with these files.

Perhaps try setting one as an explicit root document. I did that at some point, I just thought.

@sunderme
Copy link
Member

sunderme commented Aug 17, 2022

and now, what do I search for ? and how exactly ?

Screencast might help.

@Sam-OT
Copy link
Author

Sam-OT commented Aug 17, 2022

Yeah, I can do screencast. Here's a video of it, too; and another. I had it in split-preview mode, so when I compile at the end you don't actually see the compilation. But, it's what you would expect. If I close and reopen TeXstudio, then it still has the same "defined multiple times" warning.

and now, what do I search for ? and how exactly ?

I feel that I need to repeat this again: I haven't been able to reproduce this. Given that, it's clear that I can't answer your last two questions. I'll email you my TeXstudio configuration.

I can't imagine there'll be a super easy fix for this, given its lack of reproducibility. Just wanted to bring it to the dev's attention for future releases! 🙂

@sunderme
Copy link
Member

when you see the issue again, can you report what view/show open documents and view/show hidden documents shows ?
I suspect that it relates to your closing some documents.
Another point is that the sub-documents use relative path on windows. Does it occur if all documents are in the same directory?

@Sam-OT
Copy link
Author

Sam-OT commented Aug 18, 2022

Ah, I didn't know about this "open/hidden documents" option! Indeed, it shows many in the "hidden". I show two screenshot below: first is "open"; second is "hidden".

image

image

Big-brain move suggesting the relative paths. Indeed, that appears to fix it!

image

Very impressive, @sunderme, to be able to find a work-around when I couldn't even reproduce the issue myself! I guess the lack of reproducibility was stemming from the fact that I was putting in the same directory.

Of course, ideally it should just work with paths. But, still, I'm very grateful for the work-around!

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

2 participants