
아래에 이와 같은 마크다운 테이블이 많이 있으며 pandoc
LaTeX PDF 템플릿을 사용하여 PDF로 변환되고 있습니다.
| Column1 | Column2 | Column3 | Column4 | Column5 | Column6 | Column7 | Column8 | Column9 | Column10 |
|-----------------------------------------------------------------------------------------------------------------------------------|----------------|---------|---------|---------------------|-------------------------------------------------------------------------------------------------------------|------------------|----------------------------------------------------------------------------------------|-------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|
| Lorem Ipsum verylongwordwithnospacehere simply dummy text of the printing and typesetting indust | Lor | Lor | L | Lor | Lorem Ipsum is simply dumm | Lorem Ipsum i | Lorem Ipsum is simply 9834JKEMKWJ4334DWEE44 the printing and typesetting industry. Lo | Lorem Ipsum is simply dummy text of the printin | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard |
| Lorem Ipsum is simply dummy text of the printing anotherverylongwordwithoutspace | Lor | Lor | L | Lor | Lorem Ipsum is simply dummy | Lorem Ipsum i | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsu | Lorem Ipsum is simply dummy text of the printin | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard |
| Lorem Ipsum is simply dummy Q034DJSKJ32492139DK | Lor | Lor | L | Lor | Lorem Ipsum is simply dummy t | Lorem Ipsum i | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsu | Lorem Ipsum is simply dummy text of the printin | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard |
따라서 표 셀에 긴 단어나 일종의 긴 코드가 있는 경우, 제가 얻는 결과는 아래 그림과 같습니다. 잘려지거나 다음 열로 넘치게 됩니다.
나에게 필요한 것은 모든 문자에서 단어를 줄 바꿈할 수 있는 방법입니다. 하이픈도 없어야하므로 \usepackage[none]{hyphenat}
그렇게 사용하고 있습니다.
그래서 결국 내가 원하는 것은 다음과 같습니다.
제가 말했듯이 마크다운 내용은 자동으로 라텍스 코드로 변환되기 때문에 \seqsplit{longword}
. 가능한지는 잘 모르겠지만 전체 문서에 대해 단어 분리를 활성화하거나 테이블만 대상으로 하는 것이 필요합니다...
답변1
아마도 현 단계에서 최종 답변은 아닐 것입니다. 그러나 코멘트를 하기에는 너무 깁니다. 나는 오늘의 TeX 글꼴에서 256자 모두 뒤에 하이픈 지점에 대한 하이픈 패턴이 있는 allhyph.tex 파일을 기억하고 가지고 있습니다. CTAN이나 웹 검색으로는 찾을 수 없어서 제가 쓴 것일 수도 있습니다. (반대 zerohyph.tex는 언어 "nohyphenation"으로 로드되어야 합니다.)
그러나 일반적인(기본) 영어 하이픈 넣기 규칙을 사용하는 또 다른 트릭을 발견했습니다. 패턴에서는 항상 문자 l
(ell) 뒤에 하이픈 넣기를 허용합니다. 따라서 \lowercase
or 를 사용할 수 없다는 점을 감안하여 \MakeLowercase
모든 문자의 소문자 코드를 l(108)에 대한 코드로 설정하세요. 다음은 T1 글꼴 인코딩에 대한 예입니다. 큰 글꼴 인코딩을 처리하려면 더 긴 문자 코드 포인트 목록이 필요합니다.
다음으로 필요한 요소는 글꼴(모든 글꼴에 대해)의 하이픈 문자를 너비가 0이거나 작은 공백 문자로 설정하는 것입니다. 그것은 \textcompoundwordmark이다.
두 가지 더 중요한 것은 LaTeX에게 끝에도 단어를 하이픈으로 연결하라고 지시해야 한다는 것입니다. 단락의 첫 번째 단어에 하이픈을 허용해야 합니다(대개 금지됨).
\documentclass{article}
\usepackage[T1]{fontenc} % require \textcompwordmark
\usepackage[english]{babel}
\makeatletter
\newcount\lccodepoint
\def\setAllBreak{\lccodepoint=33 \@whilenum{\lccodepoint<256}\do
{\lccode\lccodepoint=`\l\advance\lccodepoint\@ne}%
\lefthyphenmin\@ne \righthyphenmin\@ne
\hyphenchar\font=\csname\f@encoding\string\textcompwordmark\endcsname
}
\g@addto@macro\selectfont{\setAllBreak}
\AtBeginDocument{\setAllBreak}
% That finishes the setup, except for \everypar below.
\setlength\textwidth{2pt}% ultra-narrow for testing
\setlength\parskip{8pt}
\begin{document}
% This allows hyphenation of the first word in the paragraph
% but can't be in preamble
\everypar{\nolinebreak\hspace{0pt}}
abracadabra
\noindent abracadabra \emph{wowzers}
\end{document}
물론 허용되지 않는 줄 바꿈은 도입되지 않습니다! 에 대해 생각하다 \mbox{ }
. 질문에서 더 중요한 것은 표 형식의 대부분의 열 유형이 \mbox
모든 줄 바꿈과 유사하고 이를 방지한다는 것입니다. 테이블 형식 환경을 tabularx로 전환하고 모든 X 열 유형 또는 그로부터 파생된 유형(중앙화의 경우)을 사용하는 것이 좋습니다.
\newcolumntype{C}{>{\centering\arraybackslash}X}
일부 열을 다른 X 열보다 비례적으로 좁거나 넓게 만들려면 다음을 참조하세요.테이블 형식 열의 가운데 맞춤