более умный перенос слов для узких столбцов?

более умный перенос слов для узких столбцов?

Я знаю, как отключить расстановку переносов через \nohyphens{.....}(издефис). Но что мне действительно хотелось бы, так это разумно расставлять дефисы. Что я имею в виду, надеюсь, станет ясно из следующего примера.

Слева — фрагмент текста из столбца таблицы, отрисованный с помощью команды \nohyphens{...}. Это оставляет много открытого белого пространства. Справа — тот же текст, набранный vanilla XeLaTeX. Как видите, онвсе ещеоставляет большое белое пространство в середине текста, а также вводит довольно странную расстановку переносов, «сиротство», вместо, например, более естественных «исправлений».
Никаких переносов вообще Поведение по умолчанию

Вот более умная версия, созданная мной путем внесения «исправлений» в исходный код:

некоторые вручную подправляли

По крайней мере, на мой взгляд, это выглядит намного лучше, чем любая из вышеприведенных версий.

Итак, основной вопрос: могу ли я заставить LaTeX делать это автоматически, например, указав максимально допустимую длину пробела между словами?

ПС. Другим более сложным решением было бы указать "целевую ширину" для столбцов в моей таблице, например, .25\textwidthа затем оптимизировать систему для создания таблицы, которая максимально приближает меня к указанному мной показателю пробелов и ширине таблицы, при этом минимизируя количество переносимых слов... но я не знаю, может ли LaTeX выполнять такую ​​динамическую оптимизацию в нескольких переменных! Вот одно последнее изображение, где я полностью избавился от переносов, перейдя на .27\textwidthfor columns. Это, кажется, самая читаемая версия на данный момент.

введите описание изображения здесь

решение1

При попытке набрать текст в очень узких пределах иногда лучше (или хуже?) использовать директиву \sloppy, как это сделано в следующем примере.

В таких ситуациях также может быть полезно задать \righthyphenmin2. (Для англоязычных текстов значение этого параметра по умолчанию — 3.)

введите описание изображения здесь

\documentclass[12pt,letterpaper]{article}
\usepackage[showframe,margin=3.38in]{geometry} 
  % \textwidth = 8.5"-2*3.38" = 1.74"
\frenchspacing
\righthyphenmin2
\sloppy
\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{Linux Libertine O}
\begin{document}
\noindent
Quality control is handled with corrections and the ``orphaning'' mechanism in case 
of nonresponsive authors. Some articles are world-writeable, as in the wiki model.
\end{document}

решение2

Я не уверен, почему вы используете, \nohyphensя бы подумал, что вы хотите больше, а не меньше. Используя связанную таблицу, поскольку вы не предоставляете код для примера в вопросе, я получаю это, что не так уж и плохо, хотя, очевидно, можно было бы немного подправить.

введите описание изображения здесь

\documentclass[article,a4paper,12pt,twoside]{memoir}

\usepackage{hyphenat}

\setlrmarginsandblock{40mm}{20mm}{*}
\setulmarginsandblock{20mm}{20mm}{*}

\begin{document}

\renewcommand{\arraystretch}{1.5}
\begin{table}
\begin{center}
\raisebox{3in}{\small
\begin{tabular}{|*{3}{>{\hyphenpenalty0 }p{.25\textwidth}|}}
\hline
% \multicolumn{1}{p{.25\textwidth}}{\textbf{Relevance}}
\begin{center}(PM)
\end{center}

Ultimately relevance depends on peer review, and irrelevant content
may be deleted. Mechanisms to ensure that relevant content
\emph{will} be added could be improved. &
\begin{center}(WP)
\end{center}
People contribute articles about what
they're interested in; apart from this, rules like WP:WEIGHT come into
play.&
\begin{center}(DO)
\end{center}

Anyone can upload projects (for ``full projects'', one time approval
is needed), but getting changes into the core requires considerably
more vetting. \\
%\multicolumn{1}{p{.25\textwidth}}{\textbf{Quality}}
Quality control is handled with corrections and the ``orphaning'' mechanism
in case of nonresponsive authors. Some articles are world-writeable,
as in the wiki model. & Automated tools for spam and vandalism detection
combined with a system of editorial oversight, in which Jimmy Wales
has last say. & In addition to bug reports and feature requests handled
through the issue tracker, modules can make use of an automated patch
testing system.\\
%\multicolumn{1}{p{.25\textwidth}}{\textbf{Scalability}}
Peer review is distributed. Links are handled automatically. Caching
is deployed where relevant; in particular, interlinking features are
kept up to date. & The database and other infrastructure is massively
scaled. There are many bots that help with small tasks. & In theory,
anyone can join. Earl Miles, NYCCamp 2012 keynote: ``\emph{There are
no insiders, except Dries; there are no outsiders, only resumes.}''
\\
% \multicolumn{1}{p{.25\textwidth}}{\textbf{Consistency}}
Although automatic links and corrections can help with consistency,
mainly PM relies on standards for proof and expository quality.
&NPOV is the key rule, which works together with templates and other
process tools to maintain community standards about style and
content. & The project issue queues are the place to go when one
module's changes breaks another's. The core of the project has
considerable oversight in these
matters.\\
% \multicolumn{1}{p{.25\textwidth}}{\textbf{Motivation}}
People are solving some of their learning, exposition, and social
needs on the site by writing and reviewing articles and posting in the
forums.& As of 2006, over 50\% of the site had been written by less
than 1\% of the users; these days, paid editing is somewhat
notorious.& Miles continued: ``\emph{To build a resume, find someone
who needs help, and help them. Find something that needs doing, do
it.}'' \\ \hline
\end{tabular}
}
\end{center}
\caption{As typeset ``out of the box''}
\end{table}


\end{document}

Если вы допустите немного гибкости на правом поле и добавите микрошрифт, то получите:

\usepackage{microtype}

...

\begin{tabular}{|*{3}{
   >{\hyphenpenalty0 \rightskip0pt plus .3em \emergencystretch2em}%
   p{.25\textwidth}|}}

введите описание изображения здесь

Связанный контент