긴 테이블이 너무 넓어 내용이 수직으로 중앙에 위치함

긴 테이블이 너무 넓어 내용이 수직으로 중앙에 위치함

나는 몇 가지 질문을 읽었으며 longtable페이지 너비에 맞추는 방법을 읽었지만 성공하지 못했습니다. 예제에서 테이블은 페이지 너비에 맞지만 지정된 여백을 벗어납니다. MWE가 첨부되었습니다. 감사합니다!

\documentclass[12pt, oneside]{article}      % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}
\geometry{left=1.5in, right=1in, top=1in, bottom=1in}   % ... or a4paper or a5paper or ... 
%\geometry{landscape}             % Activate for rotated page geometry
\usepackage{graphicx}       % Use pdf, png, jpg, or eps§ with pdflatex; use eps in DVI mode
                        % TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
\renewcommand{\labelitemi}{--}

\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}

\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\floatsetup[figure]{capposition=top}

\DeclareCaptionFont{xipt}{\fontsize{11}{13}\mdseries}
\usepackage[font=xipt]{caption}

\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\renewcommand\tabularxcolumn[1]{m{#1}}

\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixpagename}{\centering Appendices}

\usepackage{amsmath} 
\newcommand{\dd}[1]{\mathrm{d}#1}

\usepackage{enumerate}

\usepackage[nottoc]{tocbibind}

\usepackage{caption}
\captionsetup{justification=centerlast}
\usepackage{setspace}
\setstretch{1.6}

\usepackage{color,soul}

\usepackage{longtable}

\graphicspath{ {Images/} }                      

\begin{document}

\begin{center}
\begin{longtable}{|*{2}{>{\centering\arraybackslash}p{8cm}|}}
\hline \textbf{Material} & \textbf{Description} \\
\hline Nickel Titanium Alloy (50/50) Thin Walls & Otherwise known as Nitinol; exhibits shape memory effect--ability to undergo deformation and resume original shape above "transformation temperature"--and super elasticity \cite{borges} \\
\hline Maraging Steel & Group of steels that possesses superior strength and toughness without losing malleability; this is due to aging, which incorporates heat treatment resulting in the precipitation of intermetallic compounds \cite{degarmo} \\
\hline Aluminum Copper Alloy & Aluminum is one of the most versatile, economical, and attractive metallic materials; these alloys are most valuable for their high strength and corrosion resistance \cite{ahmad} \\
\hline Ceramic with Polyamide Coating & Polyamide coatings afford materials durability, thermal properties, chemical resistance, electrical properties, and abrasion and chemical resistance \\
\hline Amdry, Inconel 718 & High-strength corrosion-resistant nickel chromium material; age-hardened, post-weld crack resistant, and has good tensile, fatigue, creep, and rupture strength properties \cite{specialmetals} \\
\hline Stainless Steel & Notable for its corrosion and oxidation resistance; comes with various finishes to suit the applicable environment \cite{british} \\
\hline Neodymium Magnet & Strongest permanent commercial magnet available; graded according to maximum energy product (Joules per cubic meter); sintered neodymium generally not corrosion resistant \cite{fraden, wisegeek, warren} \\
\hline Hot Work Tool Steel Cubes & Group of steels used to cut or shape material at high temperatures; good hot hardness and toughness and fair wear resistance due to substantial amounts of carbide \cite{reardon} \\
\hline O-1 Tool Steel & Part of the cold work, oil-hardening tool steels group; used to materials at low temperatures possessing high hardenability and wear resistance along with average toughness and heat softening resistance \cite{machinery} \\
\hline Unknown Tensile Specimens & EDX analysis suggests that this unknown specimen is iron-chromium \\
\hline Unknown Mounted Specimens & EDX analysis suggests that this unknown specimen is silumin (aluminum-silicon alloy) \\ \hline
\caption{Analyzed Material Descriptions} \end{longtable} \end{center}

\end{document}

답변1

(a) 중앙 정렬 대신 'raggedright'를 사용하고 (b) 단일 간격을 사용하면 테이블이 훨씬 더 좋아 보일 것이라고 생각합니다. 또한 "표가 페이지 너비에 맞습니다"라는 주장이 올바른지 검토하십시오. 내 계산(아래 코드 참조)에서 열의 너비는 엄격하게 8cm보다 작아야 합니다.

아, 환경은 자동으로 중앙에 배치됩니다 . 환경 longtable을 둘러쌀 필요가 없습니다 .center

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

\documentclass[12pt, oneside]{article}
\usepackage{geometry}  
\geometry{letterpaper,left=1.5in,right=1in,vmargin=1in}   
\usepackage{graphicx}
\usepackage{amssymb}
\renewcommand{\labelitemi}{--}

\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}

\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\floatsetup[figure]{capposition=top}

\DeclareCaptionFont{xipt}{\fontsize{11}{13}\mdseries}
\usepackage[font=xipt]{caption}

\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\renewcommand\tabularxcolumn[1]{m{#1}}

\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixpagename}{\centering Appendices}

\usepackage{amsmath} 
\newcommand{\dd}[1]{\mathrm{d}#1}

\usepackage{enumerate}
\usepackage[nottoc]{tocbibind}

%%%\usepackage{caption}
\captionsetup{justification=centerlast}

\usepackage{setspace}
\setstretch{1.6}

\usepackage{color,soul,ragged2e}
\setlength\extrarowheight{2pt}

\usepackage{longtable}

\graphicspath{ {Images/} }    

% Calculate width of columns in 'longtable'      
% Width of "letterpaper" page is 8.5"       
\newlength\mylen
\setlength\mylen{3in} % 3" = (8.5"-1"-1.5")/2
\addtolength\mylen{\dimexpr-2\tabcolsep-1.5\arrayrulewidth\relax}

\begin{document}

\begin{singlespacing} % optional but recommended
\begin{longtable}{|*{2}{>{\RaggedRight\arraybackslash}p{\mylen}|}}
\hline 
\textbf{Material} & \textbf{Description} \\
\hline 
\endhead

\hline
\caption{Analyzed Material Descriptions} 
\endlastfoot

Nickel Titanium Alloy (50/50) Thin Walls & Otherwise known as Nitinol; exhibits shape memory effect--ability to undergo deformation and resume original shape above "transformation temperature"--and super elasticity \cite{borges} \\
\hline 
Maraging Steel & Group of steels that possesses superior strength and toughness without losing malleability; this is due to aging, which incorporates heat treatment resulting in the precipitation of intermetallic compounds \cite{degarmo} \\
\hline 
Aluminum Copper Alloy & Aluminum is one of the most versatile, economical, and attractive metallic materials; these alloys are most valuable for their high strength and corrosion resistance \cite{ahmad} \\
\hline 
Ceramic with Polyamide Coating & Polyamide coatings afford materials durability, thermal properties, chemical resistance, electrical properties, and abrasion and chemical resistance \\
\hline 
Amdry, Inconel 718 & High-strength corrosion-resistant nickel chromium material; age-hardened, post-weld crack resistant, and has good tensile, fatigue, creep, and rupture strength properties \cite{specialmetals} \\
\hline 
Stainless Steel & Notable for its corrosion and oxidation resistance; comes with various finishes to suit the applicable environment \cite{british} \\
\hline 
Neodymium Magnet & Strongest permanent commercial magnet available; graded according to maximum energy product (Joules per cubic meter); sintered neodymium generally not corrosion resistant \cite{fraden, wisegeek, warren} \\
\hline 
Hot Work Tool Steel Cubes & Group of steels used to cut or shape material at high temperatures; good hot hardness and toughness and fair wear resistance due to substantial amounts of carbide \cite{reardon} \\
\hline 
O-1 Tool Steel & Part of the cold work, oil-hardening tool steels group; used to materials at low temperatures possessing high hardenability and wear resistance along with average toughness and heat softening resistance \cite{machinery} \\
\hline 
Unknown Tensile Specimens & EDX analysis suggests that this unknown specimen is iron-chromium \\
\hline Unknown Mounted Specimens & EDX analysis suggests that this unknown specimen is silumin (aluminum-silicon alloy) \\ 
\end{longtable} 
\end{singlespacing}
\end{document}

답변2

개인적으로 나는 ltablex( tabularx"긴 테이블"을 만듭니다) 다음 tabularx열을 사용합니다(어느 쪽이든 사용하고 싶은 대로 tabularx). 다음은 출력 사진입니다( showframe여백에 맞는 것을 확인할 수 있도록 가 포함됨).

테이블

\documentclass[12pt, oneside]{article}      % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry}                       % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}
\geometry{left=1.5in, right=1in, top=1in, bottom=1in,showframe}   % ... or a4paper or a5paper or ... 
%\geometry{landscape}             % Activate for rotated page geometry
\usepackage{graphicx}       % Use pdf, png, jpg, or eps§ with pdflatex; use eps in DVI mode
                        % TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
\renewcommand{\labelitemi}{--}

\usepackage [english]{babel}
\usepackage [autostyle, english = american]{csquotes}
\MakeOuterQuote{"}

\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\floatsetup[figure]{capposition=top}

\DeclareCaptionFont{xipt}{\fontsize{11}{13}\mdseries}
\usepackage[font=xipt]{caption}

\usepackage{ltablex}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\renewcommand\tabularxcolumn[1]{m{#1}}

\usepackage[title,titletoc]{appendix}
\renewcommand{\appendixpagename}{\centering Appendices}

\usepackage{amsmath} 
\newcommand{\dd}[1]{\mathrm{d}#1}

\usepackage{enumerate}

\usepackage[nottoc]{tocbibind}

\usepackage{caption}
\captionsetup{justification=centerlast}
\usepackage{setspace}
\setstretch{1.6}

\usepackage{color,soul}

\graphicspath{ {Images/} }                      

\begin{document}

\begingroup\renewcommand\tabularxcolumn[1]{p{#1}}
\begin{tabularx}{\textwidth}{|*{2}{C|}}
\hline \textbf{Material} & \textbf{Description} \\
\hline Nickel Titanium Alloy (50/50) Thin Walls & Otherwise known as Nitinol; exhibits shape memory effect--ability to undergo deformation and resume original shape above "transformation temperature"--and super elasticity \cite{borges} \\
\hline Maraging Steel & Group of steels that possesses superior strength and toughness without losing malleability; this is due to aging, which incorporates heat treatment resulting in the precipitation of intermetallic compounds \cite{degarmo} \\
\hline Aluminum Copper Alloy & Aluminum is one of the most versatile, economical, and attractive metallic materials; these alloys are most valuable for their high strength and corrosion resistance \cite{ahmad} \\
\hline Ceramic with Polyamide Coating & Polyamide coatings afford materials durability, thermal properties, chemical resistance, electrical properties, and abrasion and chemical resistance \\
\hline Amdry, Inconel 718 & High-strength corrosion-resistant nickel chromium material; age-hardened, post-weld crack resistant, and has good tensile, fatigue, creep, and rupture strength properties \cite{specialmetals} \\
\hline Stainless Steel & Notable for its corrosion and oxidation resistance; comes with various finishes to suit the applicable environment \cite{british} \\
\hline Neodymium Magnet & Strongest permanent commercial magnet available; graded according to maximum energy product (Joules per cubic meter); sintered neodymium generally not corrosion resistant \cite{fraden, wisegeek, warren} \\
\hline Hot Work Tool Steel Cubes & Group of steels used to cut or shape material at high temperatures; good hot hardness and toughness and fair wear resistance due to substantial amounts of carbide \cite{reardon} \\
\hline O-1 Tool Steel & Part of the cold work, oil-hardening tool steels group; used to materials at low temperatures possessing high hardenability and wear resistance along with average toughness and heat softening resistance \cite{machinery} \\
\hline Unknown Tensile Specimens & EDX analysis suggests that this unknown specimen is iron-chromium \\
\hline Unknown Mounted Specimens & EDX analysis suggests that this unknown specimen is silumin (aluminum-silicon alloy) \\ \hline
\caption{Analyzed Material Descriptions} \end{tabularx}\endgroup

\end{document}

관련 정보