Does LaTeX handle situation when a .bib file has different encoding than .tex file? For instance, .tex is in ISO-8859-2 and .bib in UTF-8. Can the encoding be converted on the fly by LaTeX? Or the only way is to do is manually?
相关问题
- Library to convert latex to png in Java
- Error: missing \begin{document} in LaTeX [closed]
- MATLAB figures don't have the same size when i
- How to output several variables in the same row us
- Isabelle's document preparation
相关文章
- Markdown: How to reference an item in a numbered l
- how to align kable and ggplot in one row (side by
- How can the backticks (`) printed around these tab
- Is it possible to write own “packages” for LaTeX?
- Which is the best import / export LaTeX tool?
- Increment section numbers in PDF output
- positions of page numbers, position of chapter hea
- Convert HTML and inline Mathjax math to LaTeX with
Bibtex has random support for any non-standard character encodings -- essentially sometimes it works, most of the time it doesn't and officially it is not supported (More details ).
Personally, in .bib, I stick to the basic ASCII and LaTeX magic like \"o. For .tex, if I don't write in English, I keep .tex in UTF-8 with \usepackage[utf8]{inputenc} .
First of all, according to the LyX wiki BibTeX can't use UTF-8:
Usually, whatever is inside a BibTeX file gets copied verbatim to the LaTeX source code (with some formatting maybe and case changings, &c.), such as book titles, authors, &c.
So your BibTeX file encoding has to match the one used by your LaTeX file, otherwise things get funny. You also can't use babel-provided commands in BibTeX (such as
"a
forä
, provided by n?german) unless your document includes the right packages.The canonical way is to make BibTeX files agnostic of any encoding or package issues by always specifying special characters with their appropriate commands.
This basically means that instead of writing
ä
you would have to use{\" a}
if you want to be absolutely sure that it works. Seems to be fairly standard practice.The BibTeX manual BibTeXing by Oren Patashnik also details this:
BibTeX has huge problems with non-ASCII characters, even in the newest version. If you prefer a modern system, I'd like to recommend the combination of biblatex and biber. Both are still in beta stage, but they work quite well even in production environments. With this combination, most problems related to LaTeX bibliographies will vanish. As a side note, the biblatex documentation also contains a section about encoding issues with traditional BibTeX (§ 2.4.3).
You can change the input encoding on the fly:
The
\inputencoding
command is provided by theinputenc
package.