单词没有换行

单词没有换行

在以下文档的第一段中,单词mathematical没有跨行换行,这会导致文本对齐错误。我知道我可以-\-在我决定的任意位置强制换行,但有没有自动的方法可以做到这一点?

\documentclass[letterpaper,11pt]{article}
\newlength{\outerbordwidth}
\pagestyle{empty}
\raggedbottom
\raggedright
\usepackage[svgnames]{xcolor}
\usepackage{framed}
\usepackage{tocloft}
\usepackage{makecell, tabularx}
\usepackage{multicol}
\usepackage[hidelinks]{hyperref}
\usepackage[explicit]{titlesec}
\usepackage{natbib}
\usepackage{bibentry}

\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

\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}



\newcommand{\ressubheading}[4]{
\begin{tabularx}{6in}{l@{\cftdotfill{\cftsecdotsep}\extracolsep{\fill}}r}
        \textbf{#1} & #2 \\
        \textit{#3} & \textit{#4} \\
\end{tabularx}\vspace{2pt}}

\newcommand{\ressubheadingNew}[5]{
\begin{tabularx}{6in}{l@{\cftdotfill{\cftsecdotsep}\extracolsep{\fill}}r}
        \textbf{#1} & #2 \\
        \textit{#3} & \textit{#4} \\
        \multicolumn{2}{{p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth}}}{\setlength{\parindent}{4ex}\indent \textbf{Thesis}: {#5}}\\
\end{tabularx}\vspace{2pt}}

\begin{document}


\begin{tabularx}{7in}{l@{\extracolsep{\fill}}r}
\textbf{\Huge MyName} \\
[email protected] & Mobile: 018923123890123890123890 \\
 & \\
\end{tabularx}
\\
\vspace{-2mm}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut mathematical labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 

\vspace{-4mm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%SECTION%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Education}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \ressubheadingNew{University of Neverland}{Neverland}{Bachelor studies in Flight}{September 2020 - October 2020}{Development of flight}
    \ressubheadingNew{University of Neverland}{Neverland}{Master studies in Flight}{October 2020 - November 2020}{Development of swimming skills}
        \ressubheadingNew{University of Neverland}{Neverland}{Postgraduate studies in Flight}{October 2020 - November 2020}{Example of a very long sentence in another section where, unexpectedly, the word mathematical got broken}


\end{document}

答案1

只需添加包并使用以下ragged2e环境即可justify

\begin{justify}
 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut mathematical labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
\end{justify}

是

答案2

问题就\raggedright在你的序言里。

然而,我担心,特别是你在滥用这些工具tabularx

有一种更简单的方法来设置你的简历。

\documentclass[letterpaper,11pt]{article}
\usepackage{geometry}
\usepackage[hidelinks]{hyperref}

\geometry{
  headheight=0in,
  headsep=0in,
  textheight=9.5in,
  textwidth=7in,
}

\setlength{\tabcolsep}{0in}
\setlength{\topskip}{0in}% ???
\setlength{\parindent}{0pt}
\pagestyle{empty}

\newcommand{\ressubheadingNew}[5]{%
  \textbf{#1}\dotfill #2\\*
  \textit{#3}\dotfill \textit{#4}\\*
  \hspace*{2em}\begin{minipage}[t]{\dimexpr\textwidth-2em}
     \textbf{Thesis}: #5
  \end{minipage}%
  \par\addvspace{\medskipamount}%
}
\iffalse % keep for the record
\newcommand{\ressubheadingNew}[5]{%
  \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
    \textbf{#1} & #2 \\
    \textit{#3} & \textit{#4} \\
    \multicolumn{2}{p{\textwidth}}{%
      \setlength{\parindent}{4ex}\indent \textbf{Thesis}: {#5}%
    }
  \end{tabular*}%
  \par\vspace{2pt}%
}
\fi

\begin{document}

\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
\textbf{\Huge MyName} \\[1ex]
[email protected] & Mobile: 018923123890123890123890 \\
 & \\
\end{tabular*}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor 
incididunt ut mathematical labore et dolore magna aliqua. Ut enim ad minim veniam, 
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%SECTION%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Education}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ressubheadingNew
  {University of Neverland}
  {Neverland}
  {Bachelor studies in Flight}
  {September 2020 - October 2020}
  {Development of flight}

\ressubheadingNew
  {University of Neverland}
  {Neverland}
  {Master studies in Flight}
  {October 2020 - November 2020}
  {Development of swimming skills}

\ressubheadingNew
  {University of Neverland}
  {Neverland}
  {Postgraduate studies in Flight}
  {October 2020 - November 2020}
  {Example of a very long sentence in another section where, unexpectedly,
   the word mathematical got broken}

\end{document}

添加您真正需要的其他包。如果您不需要领导者,请更改\dotfill为。\hfill

tabular*我为基于而不是tabularx(需要一X列才能正常工作)的主要宏保留了更好的定义。

在此处输入图片描述

相关内容