표에 텍스트가 있는데 강제 줄 바꿈을 추가하고 싶습니다. 열 너비를 지정하지 않고도 다음과 같이 강제 줄 바꿈을 삽입하고 싶습니다:
\begin{tabular}{|c|c|c|}
\hline
Foo bar & Foo <forced line break here> bar & Foo bar \\
\hline
\end{tabular}
대부분의 경우 \\
가 줄 바꿈을 삽입한다는 것을 알고 있지만 여기서는 대신 새 테이블 행을 시작합니다.
이전에도 비슷한 질문이 있었습니다: 표에서 줄 바꿈하는 방법
\begin{tabular}{|c|c|c|}
\hline
Foo bar & \begin{tabular}[x]{@{}c@{}}Foo\\bar\end{tabular} & Foo bar \\
\hline
\end{tabular}
여기서 'x' 안 ',' c '또는' b '는 강제로 필요한 vertical alignment.
이 경우에, s # 39 더 이상 요구되는가 몇 곳을 it& 정의하십시오 명령
\newcommand{\specialcell}[2][c]{%
\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}
그래서 전 줄을 표 중 하나가 될 수 있습니다.
Foo bar & \specialcell{Foo\\bar} & Foo bar \\ % vertically centered
Foo bar & \specialcell[t]{Foo\\bar} & Foo bar \\ % aligned with top rule
Foo bar & \specialcell[b]{Foo\\bar} & Foo bar \\ % aligned with bottom rule
예를 들어, 또 특별한 셀 수 있는 변형은 더 specifying 수펑 맞춤에는.
{} 이 '@' 을 전후에 셀입니다 디이브이 억제할지 추가된 공간을 사용한다.
풀코스 응답 없음 (# 39, ve 잘못읽은 I& 않으면 그들에게) 언급을 한 것은 바로 이 전용임 패키지이므로 질문: '셀 수 있는 특정 서식을 마케셀' 일반적인 ',' 와 '덕분에' 명령 줄 바꿈 인사이드라면 \thead \makecell 경우, 이러한 셀입니다. 수평 및 수직 정렬을 별도로 해당 they& # 39 표, re 포함된 사탄들 수 있습니다. 기본값은 'cc' 로 바꿀 수 있는 확장하지만 전역으로라는 프리앰블
\renewcommand{\cellalign/theadalign}{vh}
여기서 v 는 h, l '안' 과 '중 하나로, c,b c,r. 하나의 셀을 위한 '또는' 명령을 사용할 수 있습니다 '또는' \thead \makecell 옵션으로 인수 ' [vh]'.
그래서 이 데모:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{fourier}
\usepackage{array}
\usepackage{makecell}
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}
\begin{document}
\begin{center}
\begin{tabular}{ | c | c | c |}
\hline
\thead{A Head} & \thead{A Second \\ Head} & \thead{A Third \\ Head} \\
\hline
Some text & \makecell{Some really \\ longer text} & Text text text \\
\hline
\end{tabular}
\end{center}
\end{document}
! 컴파일됨 뭬
정말 이유를 알 수 없다』 는 LaTeX 복잡한! 쉬운 대답을 생각해 봐도 이런 질문! 매일 문제에 대한 해결 쉬운 어때?
\usepackage{pbox}
\begin{tabular}{|l|l|} \hline
\pbox{20cm}{This is the first \\ cell} & second \\ \hline
3rd & and the last cell \\ \hline
\end{tabular}
어떤 같습니다.
참고로 너비입니다 \pbox '에서' 은 최대 너비입니다. 만약 내용이 짧은 길이가 긴 줄이 생성할 수 있습니다.
새줄` 명령을 사용하여 셀 레이아웃을 단락으로 전환할 수 있습니다.
\begin{tabular}{|p{2cm}|p{2cm}|}
\hline
Test & foo \newline bar \\
...
수정:
정렬도 지정하려면 p
대신 다음 명령을 사용합니다:
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
'환경' 표 '다음' 대신 '타브라스 list. \newline 사용할 줄 바꿈 세포 내에서' where you want.
\usepackage{tabularx}
\begin{tabularx}{\textwidth}{lX}
Section: & This is my \newline
long paragraph \\
\end{tabularx}
이 ',' X '는' 환경 스페셜 타브라스 열 유형을 보면, 그 외에도 수준들과 필요한 첫 인수는 너비입니다 표. 'X' 를 열 경우 전체 표의 하기 위해 필요한 너버 필요한 너비입니다.
[Here] [1] '에' 타브라스 정보를 찾을 수 있습니다.
[1]: http://en.wikibooks.org/wiki/LaTeX/Tables # The_tabularx_package
표 환경:
\begin{tabular}{|c|c|c|}
\hline
here&\vtop{\hbox{\strut top line}\hbox{\strut botline}}&more\\
\hline
x&y&z\\
\hline
\end{tabular}
텍스트, 그러므로 너비입니다 하비우스 결합할지 이 너비입니다 비토프. 이러한 방식으로 우리는 알아야 don& # 39, t 텍스트 너비입니다 열었다. '바른' 은 \strut 유지관리하지 위와 아래의 공간이 있는 텍스트 하상자.
오늘 진짜 오래된 질문, 그러나 이는 최근 링크됨 대한 질문을 받고 에서 [구분하는 컨텐츠 및 프레젠테이션입니다] (https://tex.stackexchange.com/q/68940/323), I& # 39, ll 추가하기에서는 컨텍스트로 문제에 대한 비교.
라인 브레이크 라인 브레이크 '의' 강제 컨텍스트로 \crlf 자도으로 도왔으매 경험을 한 표는 그냥 단순하게 '강제' 를 적절하게 \crlf 추가. 다음은 완료율 (예:
% Setup for rules at the top and bottom
\startsetups table:rules
\setupTABLE[frame=off]
\setupTABLE[row][first][topframe=on]
\setupTABLE[row][last][bottomframe=on]
\stopsetups
% Setups for middle alignment
\startsetups table:middle
\setupTABLE[align=middle]
\stopsetups
\starttext
\startTABLE[setups={table:rules, table:middle}]
\NC Foo bar \NC Foo \crlf Bar \NC Foo bar \NC \NR
\NC Foo bar \NC Foo \crlf Bar \NC Foo bar \NC \NR
\stopTABLE
\stoptext
이로써:
나는 여기서 스택을 사용하여 효과를 거둘 수 있습니다. 주목할 만한 몇 가지 있다.
'내가', '3', '와' \Centerstack 제시하십시오 \Longstack \Longunderstack 제공하는 다른 정렬.
T}, {않기 위해 '선언' a '샌드위치 아니했으니 수직 여유폭 \strutlongstacks 발행되었는지. 또는 스택 내의 한 지정값이 랩 (wrap) ' [<, gap>] {}' \addstackgap 컨텐츠를 추가할 위 / 아래 수직 스택 버퍼.
다음은 없습니다 수펑 설정할 수 있는 기능을 정렬 스택된 컨텐츠 (옵션) 에 인수 또는 변경하십시오 EOL 문자 ("에서\ '다른 사용자정의된 토큰인지)
다음은 뭬.
\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\begin{document}
\strutlongstacks{T}
\begin{tabular}{|c|c|c|}
\hline
Foo bar & \Longstack{ Foo \\ bar \\ baz} & Foo bar \\
\hline
Foo bar & \Longunderstack{ Foo \\ bar \\ baz} & Foo bar \\
\hline
Foo bar & \Centerstack{ Foo \\ bar} & Foo bar \\
\hline
\end{tabular}
\end{document}
'어떻게' \parbox 명령을 사용하여 사용자 정의
\documentclass{article}
\newsavebox\mybox
\newlength\mylength
\newcommand\boxup[2]{%
\savebox\mybox{#1}%
\setlength\mylength{\wd\mybox}%
\parbox{\mylength}{#1 \\ #2}%
}
\begin{document}
\begin{tabular}{|c|c|c|}
Foo bar & \boxup{Foo}{bar} & Foo bar \\
\end{tabular}
\end{document}
이 경우 두 개의 인수 가정할 수 있는 첫 번째 행은 이상 두 번째. 이 가능할 것 "이라고 재조정하려면 코드를 통해 작동합니까 임의의 개수의 보조선과 groupx 가장 길다. # 39 의 경우, 관심, ll write something, 아마도 that& I& # 39 를 사용하여 'expl3' 을 루프을.
내 생각엔 멀티로프 '가 단순 솔루션' 우아한 적어도 단순 표.
예를 들어, 노력했다고 하지만 내가 가장 좋은 결과 이 같은 몇 가지 제안을 했다.
\usepackage{multirow}
\begin{table}[ht]
\caption{RESTful Resources}
\centering
\begin{tabular}{l l l}
\hline
Resource & Methods & Description \\
\hline
\multirow{2}{*}{Resource1} & \multirow{2}{*}{POST, PUT}
& This resource contains ...\\
& & \emph{Media types: text/plain, application/json}\\
\multirow{2}{*}{Resource2} & \multirow{2}{*}{POST, PUT}
& This resource contains ...\\
& & \emph{Media types: text/plain, application/json} \\
\hline
\end{tabular}
\label{table:resources}
\end{table}
I believe I 가장 간단한 답을 할 수 있습니다.
단락 열을 사용하는 경우, 표의 에서는 텍스트를 맞춤에는 환경과및 가지러 언약보다는 테이블에 올릴 수 있습니다 "\" 새 테이블로 사용할 수 있도록 행, 일반적으로. 예를 들면 다음과 같습니다.
\begin{tabular}{p{2in}p{2in}}
\begin{flushleft}
Some text over here \\
newline! \\
\bigskip all the way down
\end{flushleft}
&
\begin{flushleft}
Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo\\ \bigskip
consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.\\
\bigskip \bigskip lorem ipsum\\
\end{flushleft}\\
\end{tabular}\
너희에의 부여하느뇨 줄바꿈을 사용하여 테이블을 사용하여 '' 함장님이요\
줄 바꿈을 추가하는 방법에 대한 직접적인 도움말은 없지만 다중 행 패키지를 사용하면 원하는 목적지까지 다른 경로를 제공할 수 있습니다. 여기에서 튜토리얼을 읽을 수 있습니다:
그러나 나는 당신이 링크 한 유사한 질문의 \ parbox 답변이 당신이 찾고있는 것 같습니다. 셀에 상자를 사용하는 것이 가장 간단하고 가장 좋은 방법이라고 생각하는데, 그게 효과가 없으셨나요?
너비를 하드코딩할 필요 없이 파박스를 사용하려면 다음과 같은 방법이 있습니다. 여러 줄 열에서 가장 긴 줄의 텍스트를 미리 알고 있어야 하기 때문에 완벽하지는 않지만 작동합니다:
% define new length and set to length of longest line
\newlength{\longline}
\settowidth{\longline}{longest line in table}\\
\begin{tabular}{lll}
one line & \parbox[t]{\longline}{longest line in table \\ and another line} & more text \\
second line here& and what & more text
\end{tabular}
안녕하세요, 제가 어렸을 때 난 조판 환경 인사이드라면 표 표 드립니다. 이후 우리는 내가 사용하는 환경, 심지어 티크스피스투라 티크스 티크스피스투라 δ1 테이블 δ1 티크스피스투라. 난 다음 노드를 단순 티크스 포지셔닝하십시오 아래에 있지만, 실제 작업 서로 달려 있다. 내가 한 텍스트 높이 둘러싸려면 뭬 의 빠른 교정. <! - 모든 언어: 라텍스 - >.
\documentclass{article}
\usepackage{tikz}\pagestyle{empty}
\begin{document}
\tikzset{inner sep=0pt}
\begin{tabular}{|l|l|} \hline
\begin{tikzpicture}
\node[align=left, text height=4.5ex]{This is the\\[3pt]first cell};
\end{tikzpicture}
& second \\ \hline
3rd & and the last cell \\ \hline
\end{tabular}
\end{document}
! 뭬
개인적으로 {}, {" \multirow 멀티로프 '\usepackage 사용을 선호하지만,} {} {" contents" width" rows" 수를 ";;;}' 을 제외한 다른 모든 정보를 서로 다른 행에 한다고 지적했다.
예를 들면 다음과 같습니다.
\begin{tabular}{p{2.5cm}@{\hskip 0mm} p{5cm}@{\hskip 4mm} p{5cm} }
Parameter & Description & Used by\\
\hline
\\[-0.1cm]
\multirow{2}{*}{Accuracy}&1. The error rate or frequency of correctness of sensor readings. & \\[0.3cm]
& 2. The degree of correspondence of measured values to actual values.& \\[0.3cm]
\hline
\\[-0.1cm]
\end{tabular}
오히려 단순한 솔루션 있을 것으로 보인다. 그냥 '텍스트' 를 사용하여 다음과 같은 \raggedright 커리 중괄호 및 랩
{\raggedright \bfseries WS 2016 \\(average)}
다음은 간단한 예:
\begin{tabularx}{\textwidth}[ht]{|X|p{1.8cm}|}
\hline
Some Longer Column &
{\raggedright \bfseries Line \\Break} \\\hline
This is a wide line with some text & Small \\\hline
\end{tabularx}
따라서:
예선 (아마도 in your 프리앰블):
\usepackage{array} % needed if you're going to use \\ together with centering,
% raggedright, raggedleft in your column specifier (see
% manuals on \arraybackslash)
\newlength{\mywidestcolwidth}
\newcommand*\mycellformat{\protect\footnotesize}
\newcommand*\mytableparskip{\setlength\parskip{4pt}}
\newcommand*\setmywidestcolwidth[1]{
\settowidth{\mywidestcolwidth}{\mycellformat #1}
}
사용법:
\setmywidestcolwidth{foo baz bar}
\begin{tabular}{|>{\mycellformat}c
|>{\mytableparskip\mycellformat\centering\arraybackslash}p{\mywidestcolwidth}
|>{\mycellformat}c|}
\hline
foo bar baz&
foo
foo baz bar
baz&
foo
foo baz bar
baz\\ \hline
\end{tabular}
'' 와 '\parskip 건너뛰십시오 \mycellformat 경우 그들을 필요로 하지 않습니다.' (아니지만 필요한 케이스에 나 포함 '\parskip' 이후 it& # 39 에 유용한 시각적으로 구별할 단락 충스러웠으니 채널이어야 이후 단락 밀어맞춤 값이 자동으로 끌 표, 추가된 '유니폼' 표 디자인 문서 와이드 \mycellformat 수 있도록 설정).