
EViews에는 분명히 라텍스를 출력하는 추가 기능이 있지만 교직원 컴퓨터에는 설치할 수 없습니다. 출력을 csv로 저장할 수 있습니다. 수동으로 숫자를 입력하지 않고도 내 문서에 보기 좋은 표를 만들 수 있는 방법이 있나요?
답변1
나는 걸릴 것이다pgfplotstable
csvdata를 테이블로 조판합니다. 고도로 구성 가능한 패키지입니다. 그것과 비교할 수가 없어요datatool
또는csvsimple
(@Paul Stanley의 의견 참조) 하지만 그 중 하나를 사용하지 않았기 때문입니다. 다음 코드는 세 가지 열 유형을 사용하는 간단한 예를 보여줍니다. 더 많은 옵션을 보려면 포괄적인 내용을 참조하세요.pgfplotstable 매뉴얼.
\documentclass{article}
\usepackage{filecontents}
\usepackage{pgfplotstable}
\usepackage{array}
\usepackage{booktabs}
\begin{filecontents}{data.csv}
Month, Small Value, Large Value
January, 12.50, 12.3E5
February, 3.32, 8.7E3
March, 43, 3.1E6
April, 0.33, 21.2E4
May, 5.12, 3.45E6
June, 6.44, 6.66E6
July, 123.2, 7.3E7
August, 12.3, 5.3E4
September, 2.3, 4.4E4
October, 6.5, 6.5E6
November,0.55, 5.5E5
December,2.2, 3.3E3
\end{filecontents}
% Define style for cvs file format
\pgfplotstableset{
csv file/.style={col sep=comma,row sep=newline}
}
% Add rules for all 'pgfplotstable's
\pgfplotstableset{
every head row/.style={
before row=\toprule,after row=\midrule},
every last row/.style={
after row=\bottomrule}
}
\begin{document}
\pgfplotstabletypeset[csv file,
column type=l, % default is left alignment
columns/Month/.style={string type},
columns/Small Value/.style={dec sep align}, % align at the decimal point
columns/Large Value/.style={sci,sci sep align} % use scientific notation
]{data.csv}
\end{document}
답변2
csvsimple
이는 데이터 읽기용 패키지와 siunitx
숫자 형식 지정용 패키지를 사용하는 CSV 예제입니다 . 를 보여준 @quinmars의 예제 데이터를 사용하고 있습니다 pgfplotstable
. datatool
세 번째 후보가 되겠습니다.
\documentclass{article}
\usepackage{filecontents}
\usepackage{csvsimple}
\usepackage{array}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{filecontents*}{data.csv}
Month, Small Value, Large Value
January, 12.50, 12.3E5
February, 3.32, 8.7E3
March, 43, 3.1E6
April, 0.33, 21.2E4
May, 5.12, 3.45E6
June, 6.44, 6.66E6
July, 123.2, 7.3E7
August, 12.3, 5.3E4
September, 2.3, 4.4E4
October, 6.5, 6.5E6
November,0.55, 5.5E5
December,2.2, 3.3E3
\end{filecontents*}
\sisetup{table-number-alignment=center}
\csvloop{%--- from csvsimple
file=data.csv,
tabular={lSS[table-figures-exponent=1]},%--- column 'S' from siunitx
table head=\toprule\textbf{Month} & \textbf{Small Value} & \textbf{Large Value}\\\midrule,
command=\csvcoli & \csvcolii & \csvcoliii\relax,
table foot=\bottomrule}
\end{document}
답변3
Windows에서는 일반적으로 다음을 사용합니다.Excel2LaTeX, OSx에서는 내가 사용하는csv2LaTeX. 후자는 TeXShop
테이블 코드를 라텍스 코드에 즉시 복사하여 붙여넣을 수 있는 Perl 플러그인을 통해 정말 훌륭하게 통합됩니다. 전자는 MS Excel
VBA를 통해 통합됩니다. 따라서 Mac에서는 제대로 작동하지 않지만 적어도 제 생각에는 별 고민 없이 LaTeX에 테이블을 가져오는 가장 좋은 방법 중 하나입니다. 출력이 에 있는 경우 csv
먼저 파일을 가져오거나 Excel의 열에 텍스트를 사용해야 합니다. 그런 다음 새로 추가된 리본을 사용하여 라텍스 출력을 얻습니다.
아무튼, 제가 얼마전에 이것에 대해 조사했을 때 제가 찾은 가장 편리한 해결책은 이것이 두 가지였습니다.