Rich text formatting in bibtex exports
Hi,
I have an extensive list of publications with biological and chemical names in the titles requiring rich text formatting (italics, subscript etc), and I have manually formatted all the titles with html tags.
While this works for Word, my primary means of bibliography management is by exporting to a bibtex file (for use with latex), and the formatting does not work in this case (the tags just appear as text).
What do I need to do to get the proper formatting? Please help!
I have an extensive list of publications with biological and chemical names in the titles requiring rich text formatting (italics, subscript etc), and I have manually formatted all the titles with html tags.
While this works for Word, my primary means of bibliography management is by exporting to a bibtex file (for use with latex), and the formatting does not work in this case (the tags just appear as text).
What do I need to do to get the proper formatting? Please help!
Italics can be either presentational or semantic in both HTML and LaTeX:$_{\textrm{SUBSCRIPTED}}$
\textit{presentational, italicized text}
\emph{semantic, emphasized text}
(formerly, we suggested users use <sc/> for small-caps)
http://www.zotero.org/support/kb/rich_text_bibliography
<i> <b> <sub> <sup> and <span style="small-caps"> (ugh).
Since we use the presentational <i> it html we should probably use \textit in TeX
$^{\textrm{SUPERSCRIPTED}}$
\textbf{BOLD}
\textsc{SMALL-CAPS}
Although I want to use my bibliography with latex, I still have to use Word once in a while. So ideally the solution must work in all scenarios.
If I understand correctly, the bibtex exporter (in zotero) will eventually be able to correctly translate the html tags?
Edit:
Is there any way to edit the library entries in bulk? For example:
Find: <i>
Replace with: \textit{
You mentioned making a custom translator earlier (I missed it between all the comments). That would certainly be of great help, as my current plan involves manually editing the html tags of a few hundred references (which I manually put in, in the firs place!) :-p
You may have already remembered/realized the relevant tags:
Italics-
html: <i>" "</i> to latex: \textit{" "}
Subscript-
html: <sub>" "</sub> to latex: $_{" "}$
Superscipt-
html: <sup>" "</sup> to latex: $^{" "}$
There's more- bold and underlined, but I don't think these are ever used.
I am however already using the custom bibtex exporter plugin for automatic updating, AutoZotBib.
$^{\textrm{SUPERSCRIPTED}}$
$_{\textrm{SUBSCRIPTED}}$
\textit{presentational, italicized text}
\textbf{BOLD}
\textsc{SMALL-CAPS}
It'd be very helpful if you could test this in the meantime, though.
The file is here
https://github.com/adam3smith/translators/raw/bibtex2/BibTeX.js
download it and place it in the translator folder of your Zotero data directory:
http://www.zotero.org/support/zotero_data
replacing the old translator. You may have to restart Firefox/Zotero.
Anything weird let us know. Testing this is risk-free, you can always restore the original translator by reseting translators from the advanced tab of the Zotero preferences.
@noksagt - obviously, if you'd take a look as well that'd be greatly appreciated. I'm always on somewhat shaky feet with bibtex.
Any problems, of course, still let us know.
Sorry about the late response (I had given up after learning that it might take a while, and did not see your later updates).
Thank you for the updated translator. I only just got around to updating firefox and zotero after a long time, and the italics, superscripts etc. appear as expected.
I do have a new problem now :(
I am using biber/biblatex in pdflatex to typeset my references, and it seems biber is stumbling over the accented characters and symbols when using the new .bib, while it seems to have no problems with the .bib generated by the old translator. Will have to sort that one out for now.
Thank you once again for the update! I really wanted to see this issue solved, but I had not expected it to be resolved and updated so fast!
Edit: The issue was solved by adding \usepackage[utf8]{inputenc} to the preamble. I wonder why this problem occurred in the first place!
On the other hand, like I said, I did not see this problem with pdflatex/biblatex/biber and the older .bib produced by zotero (3.0.8). So I am not sure what exactly might be going on here. Using the older .bib file (which was also utf-8 encoded) still produces the accents just fine (but without the new rich text formatting). So clearly something is different with the new .bib file that isn't sitting well with either pdflatex or biber (unless the inputenc package is used).
I have no clue how to narrow down the problem, but if anyone one has any suggestions, I will try them to find the source of this odd behavior.
*(it seems β is still a problem- weird!)
Here is the error message for β:
Package inputenc Error: Unicode char \u8:β not set up for use with LaTeX
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
Here are the MWEs:
The old .bib output: The .tex MWE: Partial log file, for comparison with later log files (no error messages here): The output (correcly appearing accented characters and symbols noted in green): I am not sure if this is the best way to post this information. I am breaking the MWEs to avoid making a humongous post. Please let me know if there is better way to do this.
L\'{o}pez (old output) vs López (new output)
and $\beta$ vs β
which is causing the problem.
Using the quick start guide item that Zotero comes with as an example, if I give the title as
Zotero Quick Start <i>Guide</i>
I get the following output for bibtex
@misc{center_for_history_and_new_media_zotero_????,
title = {Zotero Quick Start \{\textless\}i\{\textgreater\}Guide\{\textless\}/i\{\textgreater\}},
url = {http://zotero.org/support/quick_start_guide},
author = {\{Center for History and New Media\}},
howpublished = {http://zotero.org/support/quick\_start\_guide},
annote = {Welcome to Zotero!
View the Quick Start Guide to learn how to begin collecting, managing, citing, and sharing your research sources.
Thanks for installing Zotero.}
},
Any help will be greatly appreciated as I need to be able to apply italics to items for my work.
Thanks in advance
for completeness:
it currently exports as β with utf8, but used to export as $\beta$ before the update (with utf8).