joaomlourenco / novathesis

A LaTeX template for academic monographs (e.g., dissertations and thesis). This template serves both beginners and proficient LaTeX users.
http://joaomlourenco.github.io/novathesis/
LaTeX Project Public License v1.3c
759 stars 122 forks source link

\ref across files #163

Open Paul-Grey opened 3 years ago

Paul-Grey commented 3 years ago

Bom dia a todos, estou a usar a versão 5.3.1 e tenho uma pergunta relacionada com \ref{} de labels, figuras, equações e tabelas entre ficheiros. Por exemplo: No ficheiro chapter1.tex tenho uma label \label{A} Então consigo usar \ref{A} no mesmo ficheiro. E o texmaker até faz a sugestão dessa ref. Mas se eu quiser fazer a mesma \ref no ficheiro chapter2.tex o Texmaker não faz a sugestão da label definida no chapter1.tex. Na compilação final as \refs até aparecem bem se fizer a compilação dos vários capítulos em questão. No entanto, facilitava bastante o trabalho se fosse possível ter as sugestões durante a escrita. Isto também para o comando \gls{} para os símbolos do ficheiro symbols.tex. Não sei se já fizeram esta pergunta por aqui mas não encontrei nada. No grande Oraculo (Google) encontro algumas soluções relacionadas com um \package{xr} e \externaldocument{chapter1} que perimte ir buscar labels a outros ficheiros mas não consigo implemetar isso no template. Alguem tem ou teve o mesmo problema e consegue ajudar?

jmg-duarte commented 3 years ago

Note: The repository author prefers english to be used; using an english title and writing the issue in portuguese is also misleading.

While I use VSCode + LaTeX Workshop extension it also happens to me from time to time. The blame is both on the editor and the template (this or any other kind of), sometimes the editor is just not that powerful and unable to establish links between several files, in others, the template is too convoluted to get it working properly.

Given that upgrading your template version might be too much work, I recommend trying the VSCode + LaTeX Workshop extension combo

joaomlourenco commented 3 years ago

I agree this problem is annoying! :(

@jmg-duarte is probably right when he says that the fault is shared between the editor(s) and the template itself. But, as all the labels are declared in the template.aux file, it is unclear for me why the editors don't locate/define/use them for suggestions. I'll have to dig deeper into the editor/plugin source code to figure out why!

BTW, I think the problem remains in version v6.x.

Paul-Grey commented 3 years ago

Thank you for your input. I changed to Overleaf and there it is working quite well. So yes it is definitely connected to the editors (before i was using TexMaker). But now everything works fine since I pay for Overleaf as well....maybe the perks of not using freeware :)

joaomlourenco commented 3 years ago

Thanks for the feedback and for confirming that it works all right in Overleaf. I think I have to try a few editors and make a “white list” of recommended editors. :)