The ... unavailable in encoding OT1
error means, as Herbert said, that your problem is related to your font encoding and can be solved by loading the appropriate font encoding.
As you said you are new to LaTeX, maybe you want to also read What packages do people load by default, where you can learn that if you load T1 font encoding, you should usually also load a vector font, for example lmodern
, and probably the babel
package (the order does not matter).
Also you could consider to use utf8
as input encoding instead of cp1252
, because today most editors do support utf8 and maybe at some point your input will have characters that are not available in cp1252. But you can as well switch any time later.
Maybe some time later you want references, then you should take a look at biblatex
and biber
.
Putting all these hints together, you get a MWE that looks like this (as an answer to your question the 4 lines fontenc...lmodern are sufficient):
\documentclass[
a4paper,
final
]{scrartcl}
\usepackage[T1]{fontenc} % font encoding
\usepackage[utf8]{inputenc} % input encoding
\usepackage[french]{babel} % keyword translation and hyphenation
\usepackage{lmodern} % lmodern looks better than cm-super
\usepackage[
babel=true,
verbose=true
]{microtype}
\usepackage[]{graphicx} % if you want figures
\usepackage[autostyle]{csquotes} % quotes
\usepackage[
backend=biber,
style=authoryear-icomp,
sortlocale=fr_FR,
natbib=true,
url=false,
doi=true,
eprint=false
]{biblatex}
\addbibresource{biblatex-examples.bib} % just an example
%\addbibresource{\jobname.bib} % include your own bib file
\usepackage[]{hyperref}
\hypersetup{
colorlinks=true,
}
%% ===========================
\begin{document}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.
At vero eos et accusam et justo \citet{kastenholz} et ea rebum.
Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr,
sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.
At vero eos et accusam et justo duo dolores et ea rebum.
Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet~\citep{sigfridsson}.
\printbibliography
\end{document}
You should use the modern replacement for bibtex: biblatex with its biber backend.
It is fully unicode capable.
If you want to take it one more step further, you might also want to switch to a native unicode-enginge: xelatex or lualatex. You just have to change a few packages in the preamble. The combination of \usepackage[utf8]{inputenc}
and \usepackage[T1]{fontenc}
has to be replaced by \usepackage{fontspec}
.
This package takes care of font and input encoding. All you need are utf8 encoded source files. You can also use every truetype or opentype font.
For language support polyglossia
should be preferred to babel
.
Here is an example that works both with lualatex and xelatex:
\documentclass{scrartcl}
\begin{filecontents}{references.bib}
@ARTICLE{test,
TITLE = {à è ê á é},
JOURNAL = {des accents},
YEAR = {2015},
}
\end{filecontents}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{french}
\usepackage[backend=biber]{biblatex}
\addbibresource{build/references.bib}
\begin{document}
\cite{test}
\printbibliography
\end{document}
Compile e.g. with lualatex test.tex, biber test.bcf, lualatex test.tex, lualatex test.tex.
If you want to still use pdflatex, it would look like this:
\documentclass{scrartcl}
\begin{filecontents}{references.bib}
@ARTICLE{test,
TITLE = {à è ê á é},
JOURNAL = {des accents},
YEAR = {2015},
}
\end{filecontents}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage[backend=biber]{biblatex}
\addbibresource{build/references.bib}
\begin{document}
\cite{test}
\printbibliography
\end{document}
Compile with pdflatex test.tex, biber test.bcf, pdflatex test.tex, pdflatex test.tex
Best Answer
Very likely your file ended up not being saved as UTF-8.
If you didn't change the default settings in the preferences, TeXShop saves files as Latin-1 (older versions use MacRoman).
Remember to add
at the start of your files. Do it and save the file; close and reopen it, then try running LaTeX on it.
In any case, it's better if you also go to the preferences and change the default encoding to UTF-8.