좁은 열에 대한 더 스마트한 하이픈 연결?

좁은 열에 대한 더 스마트한 하이픈 연결?

다음을 통해 하이픈 넣기를 해제하는 방법을 알고 있습니다 \nohyphens{.....}.하이픈). 하지만 제가 정말로 원하는 것은 스마트하게 하이픈을 넣는 것입니다. 이것이 의미하는 바는 다음 예를 통해 명확해지기를 바랍니다.

왼쪽에는 명령을 사용하여 렌더링된 테이블 열의 텍스트 조각이 있습니다 \nohyphens{...}. 이로 인해 열린 공백이 많이 남습니다. 오른쪽에는 바닐라 XeLaTeX에서 조판한 동일한 텍스트가 있습니다. 보시다시피, 그것은아직텍스트 중간에 큰 공백을 남겨두고 예를 들어 더 자연스러운 "교정" 대신 다소 이상한 하이픈 연결인 "or-phaning"을 도입합니다.
하이픈이 전혀 없습니다. 기본 동작

다음은 소스 코드에 "수정"을 도입하여 만든 더 스마트한 버전입니다.

일부는 손으로 조정

적어도 내 눈에는 위의 두 버전보다 훨씬 좋아 보입니다.

따라서 기본적인 질문은 다음과 같습니다. 예를 들어 허용 가능한 가장 긴 단어 간 공백을 지정하여 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}|}}

여기에 이미지 설명을 입력하세요

관련 정보