Export in amsrefs .ltb style?

I would like to be able to export bibliography items (either using the "Export" command, or with "Quick Copy") in a format compatible with the amsrefs package.


As explained in the documentation, the amsrefs use a .ltb file, analogous to the .bib file used with BibLaTeX.


The .ltb file is structured similarly to, but distinct from, a .bib file.

Is there an amsrefs style file (a CSL file, I guess?) available anywhere? I have looked in the Zotero Style Repository but didn't find anything.

  • It'd likely have to be an export translator that's significantly more work than a CSL file -- but I'm also not sure why you'd need it? It sounds like AMSrefs works just fine with a BibTeX file and actually notes a couple of advantages.
  • The amsrefs documentation gives some (not overwhelming) motivation for preferring the ltb format.
  • OK, the rest of the above stands: this almost certainly can't be done as CSL. It could be done based on bibtex or biblatex export but would remain a good amount of work. I don't see any regular contributor doing this, but export translators are completely modular (i.e. individual files which can simply be added/modified and don't require recompiling Zotero), so anyone motivated could take this on.
  • Got it, makes sense. Thanks very much for looking into it.
  • It should be possible to produce a .ltb database from a BibTeX file. Try using the 'amsxport' option of the 'amsrefs' package.

    See here:

    However, I think you might be better off using BibTeX/BibLaTeX, for which the Better BibTeX add-on provides excellent support.

    Here is some background on the amsrefs package:
  • Thanks qqbb.

    The chief advantage of using the .ltb amsrefs format is that all the bibliographic information is preserved with high fidelity. The encoding of the .bib BibTex format is "lossy". So it wouldn't help much to encode to .bib and then convert to .ltb. At that point you might as well just load the .bib file with amsrefs (which it is capable of).
  • The encoding of the .bib BibTex format is "lossy".
    I'm not sure what you mean by that. The translation from Zotero's metadata to BibTeX is obviously lossy, but it should give you everything you need. The BBT add-on provides many options for adjusting the output. Are you referring to missing fields, issues with TeX commands or capitalization? Or are you saying that data is lost when you create a .lts file from a .bib file?
  • From the amsrefs documentation:

    > In particular, [amsrefs] has been carefully designed to encourage the preservation of structured markup of the bibliography throughout the entire lifetime of a document from rough draft to final archival version. As we shall see, it does this by replacing LATEX’s unstructured .bbl file format by a new, fully structured format. The package is compatible with the showkeys, hyperref, and backrefs packages and implements the functionality of the popular cite package. Interoperability with BibTEX is supported via a special bibliography style file, but amsrefs can be used without BibTEX.

  • I'm not quite sure I understand enough to judge whether using BibTeX with AMSRef would also have this example (though the above para sounds like it would) but it's definitely the case that converting Zotero --> Bib(La)TeX --> .ltb would have the same benefits as going straight from Zotero --> .ltb
  • I've glanced through the amsref docs, but nothing jumps out at me as being a better format in either the sense that it can hold more information (bibtex can hold pretty much anything, it's just that most styles will not find it) or that it has a concept of items that's closer to Zotero's or CSL's than bib(la)tex (which might mean a less lossy transformation).

    Some things in the amsref manual actually seem to be misunderstandings of how bib(la)tex works (and why it works this way):
    Mandatory braces:BibTEX allows the braces around field values to be omitted in some contexts and allows double quotes to be substituted for braces.In amsrefs, every field value must be surrounded by braces.
    bibtex does not so much allow braces to be omitted as that it has a feature for @string macro expansion. If a macro is not declared it may well use the string reference verbatim, but that's a fallback mechanism, not the primary use-case for "unbraced text"
    Capitalization: Some BibTEX styles will adjust the capitalization of titles to achieve a uniform style. This means that authors have to be careful to put extra braces around any characters that should not be upper- or lower-cased. For example, if you were to write title={An $O(n \log n)$ Sorting Network} many BibTEX styles would change the title "toAno(nlogn) sorting network" possibly resulting in great confusion on the part of the reader. To prevent this, you must surround the mathematical expression with an extra set of braces:"title={An {$O(n \log n)$} Sorting Network}" As with name formats, experience suggests that authors are often confused by BibTEX’s rules and fail to properly protect their titles. The good news is that amsrefs will not change the capitalization of any of your titles.The bad news is that this means you are solely responsible for editing the titles of your bibliography items to match the style your publisher requires.
    and this just makes zero sense to me. Different citation styles demand that the title must be rendered in sentence case or title case. It looks to me like amsref expects the author to manually edit the items before rendering a bibliography to make sure it meeds the casing requirements. This seems to me to be an avenue for disastrous flaws in your bibliography, and seems to partially negate the benefit of using a reference manager at all.

    Maybe amsref assumes you'll only ever be writing for AMS? I genuinely do not understand this.
  • edited January 10, 2021
    The bbl file is simply the bibliography expanded into raw latex after applying the style (and in that sense unstructured) -- publishers will sometimes request the bbl so that the paper can be re-set without fiddling with bib(la)tex because the bbl file can just be put where \bibliography{} is.

    Apparently amsrefs retains the bib-ish structure in its intermediate format in some way, but I'm not really sure what the benefit of that would be. You don't ever deal with the intermediary format, it's an artefact of compilation. It looks to me like it is at this particular point that amsrefs is not "lossy", but I can't think of any way in which this helps. In any case, if the bib file can be converted into a ltb file, the exact same benefits would remain available.

    If this assessment is correct, my earlier comments about amsrefs working from a misunderstanding of bibtex would fall away, because you would compile the source (tlb?) to the intermediary format, applying things like case changes during that phase. But then the manual still makes no sense to me. bib(la)tex's intermediate bbl has neither case protection nor "braceless values" because it's just raw (la)tex at that point.

    No wait -- that can't be right, because if the benefit from amsrefs is it doesn't do any case fiddling, anywhere, that means it has no support for different-cased styling. Which would mean any benefit it has comes from the fact it only targets a single publisher. But if that's the case, you can get that with bib(la)tex too. Just disable the case handling (there's a macro to call, I forgot which TBH) and done. No, wait, no, the amsrefs manual says
    If some word is capitalized that should not be capitalized, putting braces around the word will preventthat. But I think it will be very seldom necessary in practice.
    so obviously it does do case-fiddling. I'm really confused here. I must be missing something. If someone could explain to me how amsrefs is better I'd really appreciate it.
  • Just to be clear, I have already decided for my personal situation that I won't be using .ltb files, so please don't count my interest as a reason for anyone to work on this. I was considering it, and I started this thread just to check how difficult it would be to add to my workflow.

    Thank you all for your very thoughtful comments!
Sign In or Register to comment.