我正在尝试使用编译的模板在此处输入链接描述网站(下载zip
文件请点击这里) 并且我在使用德语变音符号(例如 ä、ö、ü 以及 ß)时遇到了麻烦。
在序言中确实说过
\usepackage[utf8]{inputenc}
因此我希望它能够起作用,但是却没有。
相反,编译在变音符号处停止并希望我用诸如写入(我想避免)之\"u
类的变通方法替换它们。ü
我的系统设置使用 TexShop,在 10.11.6 Macbook 上使用 LaTeX 进行编译。
我将非常感激任何想法。
这是一个完整的例子:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{oldstyle}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[scale=0.75]{geometry}
\name{Hans}{im Glueck}
\address{Gluecksstr. 13}{55444 City}{Deutschland \medskip}
\phone[mobile]{+49~(176)~111~2222}
\email{[email protected]}
\begin{document}
\recipient{Max Mustermann AG}{Personalwesen \\ Hans-Beispiel-Strasse 2 \\ 55555 Beispielhausen}
\date{\today}
\opening{Sehr geehrter Damen und Herren,}
\closing{Mit freundlichen Gruessen,}
\makelettertitle
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus.
Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante.
Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu.
\bigskip
\makeletterclosing
\end{document}
答案1
好吧,我想这里面有点误解。也许这也是 TeXshop 造成的,我不知道这个编辑器是如何对 TeX 文件进行编码的(特殊 MAC 代码,,,,utf-8
... )。ansi
latin9
使用 TeXnicCenter 编辑器,我可以看到所使用的编码(参见下图中的红色箭头)。如果文档需要utf-8
,但存储了ansi
编码,也会收到图中显示的消息。此消息非常清楚:字符编码ß
错误。
以下 MWE 使用编码存储后编译时不会出现错误utf-8
。
梅威瑟:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{oldstyle}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} % <=========================================
\usepackage[ngerman]{babel}
\usepackage[scale=0.75]{geometry}
\usepackage{blindtext} % >================================= to generate german dummy text
\name{Hans}{im Glück}
\address{Glücksstraße 13}{55444 City}{Deutschland \medskip}
\phone[mobile]{+49~(176)~111~2222}
\email{[email protected]}
\begin{document}
\recipient{Max Mustermann AG}{Personalwesen \\ Hans-Beispiel-Straße 2 \\ 55555 Beispielhausen}
\date{\today}
\opening{Sehr geehrter Damen und Herren,}
\closing{Mit freundlichen Grüßen,}
\makelettertitle
\blindtext
\bigskip
\makeletterclosing
\end{document}
编码utf-8
结果为: