retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.3k stars 284 forks source link

Relative path in file field? #1764

Closed notuntoward closed 3 years ago

notuntoward commented 3 years ago

How can I use the combination of BetterBibTex and ZotFile to get an exported .bib with a relative path in the file field?

Settings

In addition, when I first created the collection ExportToBib, I set its path to: C:\Users\scott\OneDrive - Clean Power Research\ref\zotero\papers_added (so that the .bib file would be exported to the directory above the pdfs)

Result

The file fields in C:\Users\scott\OneDrive - Clean Power Research\ref\zotero\papers_added\ExportToBib.bib are still absolute, for example:

@incollection{Beaudin17hmEnergyMgmtModelCmplx,
  title = {Home {{Energy Management Systems}}: {{A Review}} of {{Modelling}} and {{Complexity}}},
  shorttitle = {Home {{Energy Management Systems}}},
  booktitle = {Energy {{Solutions}} to {{Combat Global Warming}}},
  author = {Beaudin, Marc and Zareipour, Hamidreza},
  editor = {Zhang, XinRong and Dincer, Ibrahim},
  year = {2017},
  pages = {753--793},
  publisher = {{Springer International Publishing}},
  address = {{Cham}},
  doi = {10.1007/978-3-319-26950-4_35},
  abstract = {Innovations in the residential sector are required to reduce environmental impacts, as the sector is a contributor to greenhouse gas emissions. The increasing demand for electricity and the emergence of smart grids have presented new opportunities for home energy management systems (HEMS) in demand response markets. HEMS are demand response tools that shift and curtail demand to improve the energy consumption and production profile of a dwelling on behalf of a consumer. HEMS usually create optimal consumption and productions schedules by considering multiple objectives such as energy costs, environmental concerns, load profiles and consumer comfort. The existing literature has presented several methods, such as mathematical optimization, model predictive control and heuristic control, for creating efficient operation schedules and for making good consumption and production decisions. However, the effectiveness of the methods in the existing literature can be difficult to compare due to diversity in modelling parameters, such as appliance models, timing parameters and objectives. The present chapter provides a comparative analysis of the literature on HEMS, with a focus on modelling approaches and their impact on HEMS operations and outcomes. In particular, we discuss a set of HEMS challenges such as forecast uncertainty, modelling device heterogeneity, multi-objective scheduling, computational limitations, timing considerations and modelling consumer well-being. The presented work is organized to allow a reader to understand and compare the important considerations, approaches, nomenclature and results in prominent and new literary works without delving deeply into each one.},
  file = {C\:\\Users\\scott\\OneDrive - Clean Power Research\\ref\\zotero\\papers_added\\papers\\Beaudin17hmEnrgyMgmtModelCmplx.pdf},
  isbn = {978-3-319-26950-4},
  keywords = {Appliance models,Home energy management system,Home energy scheduling,Household device models,Net-zerohomes,Optimal residential energy management,Smart grid,Smart home},
  language = {en},
  series = {Lecture {{Notes}} in {{Energy}}}
}

Result I was hoping for

file fields like this:

file = {papers\\Beaudin17hmEnrgyMgmtModelCmplx.pdf},

Can this be done?

label-gun[bot] commented 3 years ago

It looks like you did not upload an debug report. The debug report is important; it gives @retorquere your current BBT settings and a copy of the problematic reference as a test case so he can best replicate your problem. Without it, @retorquere is effectively blind. Debug reports are useful for both bug analysis and enhancement requests; in the case of export enhancements, I need the copy of the references you have in mind.

If you did try to submit a debug report, but the ID looked like D<number>, that is a Zotero debug report, which I cannot access. Please re-submit a BBT debug log by one of the methods below.

This request is much more likely than not to apply to you, too, even if you think it unlikely, and even if it does not, there's no harm in sending a debug log that turns out to be unnecessary. @retorquere will more often than not just end up saying "please send a debug log first". Let's just skip over the unnecesary delay this entails. Sending a debug log is very easy:

  1. If your issue relates to how BBT behaves around a specific reference(s), such as citekey generation or export, select at least one of the problematic reference(s), right-click it, and submit an BBT debug report from that popup menu. If the problem is with export, please do include a sample of what you see exported, and what you expected to see exported for these references.

  2. If the issue does not relate to references and is of a more general nature, generate an debug report by restarting Zotero with debugging enabled (Help -> Debug Output Logging -> Restart with logging enabled), reproducing your problem, and selecting "Send Better BibTeX debug report..." from the help menu.

Once done, you will see a debug ID in red. Please post that debug id in the issue here.

Thank you!

notuntoward commented 3 years ago

I submitted a bug report: LTMWYT82-euc

github-actions[bot] commented 3 years ago

:robot: this is your friendly neighborhood build bot announcing test build 5.2.127.537 ("basepath exports = relative")

Install in Zotero by downloading test build 5.2.127.537, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

retorquere commented 3 years ago

Can you try build 537?

notuntoward commented 3 years ago

It works. Thanks.

retorquere commented 3 years ago

Thanks for the confirmation