首先:我使用 Overleaf 作为我的 LaTeX 编译器。
作为法国人,我想使用
\documentclass[letterpaper,11pt,french]{article}
\usepackage{babel}
在我的声明中,而不是
\documentclass[letterpaper,11pt]{article}
但是,除了预期的更改(例如,日期 (april 变成了 avril))之外,一些线条现在纠缠在一起了!请参阅屏幕截图。
知道为什么吗?令人惊讶的是,我尝试使用德语 Babel,没有问题……
这是我的完整文档(当然带有 lorem ipsum):
\documentclass[letterpaper,11pt]{article}%,french] OR \documentclass[letterpaper,11pt,french]{article}
%\usepackage{babel}
\newlength{\outerbordwidth}
\pagestyle{empty}
\raggedbottom
\raggedright
%\usepackage[english]{babel}
\usepackage[svgnames]{xcolor}
\usepackage{framed,tabularx,array}
\usepackage{tocloft}
\usepackage{color,hyperref}
\usepackage{xspace}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%-----------------------------------------------------------
%Edit these values as you see fit
\setlength{\outerbordwidth}{3pt} % Width of border outside of title bars
\definecolor{shadecolor}{gray}{0.75} % Outer background color of title bars (0 = black, 1 = white)
\definecolor{shadecolorB}{gray}{0.93} % Inner background color of title bars
%-----------------------------------------------------------
%Margin setup
\setlength{\evensidemargin}{-0.25in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\paperheight}{11in}
\setlength{\paperwidth}{8.5in}
\setlength{\tabcolsep}{0in}
\setlength{\textheight}{9.5in}
\setlength{\textwidth}{7in}
\setlength{\topmargin}{-0.3in}
\setlength{\topskip}{0in}
\setlength{\voffset}{0.1in}
%-----------------------------------------------------------
%Custom commands
%\newcommand{\Cpp}{C\raisebox{0.5ex}{\tiny\textbf{++ }}}
\newcommand{\Cpp}{C\texttt{++\thinspace}}
\newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
\newcommand{\resheading}[1]{\vspace{8pt}
\parbox{\textwidth}{\setlength{\FrameSep}{\outerbordwidth}
\begin{shaded}
\setlength{\fboxsep}{0pt}\framebox[\textwidth][l]{\setlength{\fboxsep}{4pt}\fcolorbox{shadecolorB}{shadecolorB}{\textbf{\sffamily{\mbox{~}\makebox[6.762in][l]{\large #1} \vphantom{p\^{E}}}}}}
\end{shaded}
}\vspace{-5pt}
}
\newcommand{\ressubheading}[4]{
\begin{tabularx}{6.5in}{X<{\cftdotfill{\cftsecdotsep}}@{}r}
\textbf{#1} & #2 \\
\textit{#3} & \textit{#4} \\
\end{tabularx}\vspace{-6pt}}
%-----------------------------------------------------------
\begin{document}
\begin{tabularx}{7in}{Xr}
\textbf{\Large Lorem Ipsum} & \textbf{\today}
\\
Dolorem & \href{mailto:[email protected]}{\nolinkurl{mailto:[email protected]}} \\
42 My place & 01 23 45 67 89 \\
\end{tabularx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\resheading{Lorem ipsum dolor sit amet}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{itemize}
\item \ressubheading{consectetur adipiscing elit. }{Sed non risus tortor}{dignissim sit amet}{}
\begin{itemize}
\resitem{ Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat.}
\resitem{Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue.}
\end{itemize}
\end{itemize}
\end{document}[![Difference between the two versions][1]][1]
答案1
法语不仅改变了名称,还改变了布局相关的东西,比如列表布局。
您必须调整您的定义,例如删除\vspace{-6pt}
的定义中的\ressubheading
。
答案2
babel-french
提供了许多选项来自定义布局,查看文档、文件frenchb.pdf
(英文)或frenchb-doc.pdf
(法文)。
如果您根本不想babel-french
干扰布局,只需添加\frenchsetup{StandardLayout}
。