
내 숫자가 전치된 테이블에서 문자열 유형이 되는 것을 원하지 않습니다.
무엇을 설정해야 합니까 \pgfplotstabletranspose
?
\documentclass[a4paper, landscape=false]{article}
\usepackage{amsmath, amssymb, amsfonts}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.16}
\begin{document}
\section{Table}
\pgfplotstablenew[
create on use/Names/.style={create col/set list={Name-A, Name-B, Name-C}, string type},
columns={Names}, string type
]{7}\modulotable
\pgfplotsinvokeforeach{4,...,0}{%% .
% Calculations ================
\pgfmathsetmacro{\aaa}{#1}
\pgfmathsetmacro{\bbb}{\aaa+1}
\pgfmathsetmacro{\ccc}{\aaa*\bbb}
% Column ===================
\edef\next{%
\noexpand\pgfplotstablecreatecol[
create col/set list={\aaa, \bbb, \ccc}
]{No-#1}\noexpand\modulotable}\next
}%
%Table =============================
\noindent\pgfplotstabletypeset[%string type, % not wanted
columns/Names/.style={string type, column type=l},
]\modulotable
\section{Transposed Table Test}
\pgfplotstabletranspose[
header=true,
%colnames from=Names, % works not...
%input colnames to=,
]\Target{\modulotable}
\pgfplotstabletypeset[ string type, % Problem
% columns/colnames/.style={string type, column type=l}, % works not
header=false,
]{\Target}
\end{document}
답변1
이름을 새 이름으로 변경하는 것은 단순히 어느 이름이 무엇인지 추적하기 위한 것입니다.
\documentclass[a4paper, landscape=false]{article}
\usepackage{amsmath, amssymb, amsfonts}
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.16}
\begin{document}
\section{Table}
\pgfplotstablenew[
create on use/Names/.style={create col/set list={Name-A, Name-B, Name-C}, string type},
columns={Names}, string type
]{3}\modulotable
\pgfplotsinvokeforeach{4,...,0}{%% .
% Calculations ================
\pgfmathsetmacro{\aaa}{#1}
\pgfmathsetmacro{\bbb}{\aaa+1}
\pgfmathsetmacro{\ccc}{\aaa*\bbb}
% Column ===================
\edef\next{%
\noexpand\pgfplotstablecreatecol[
create col/set list={\aaa, \bbb, \ccc}
]{No-#1}\noexpand\modulotable}\next
}%
%Table =============================
\noindent\pgfplotstabletypeset[%string type, % not wanted
columns/Names/.style={string type, column type=l},
]\modulotable
\section{Transposed Table Test}
\pgfplotstabletranspose[
header=true,
colnames from=Names, % works not...
input colnames to=New Names,
]\Target{\modulotable}
\pgfplotstabletypeset[% string type, % Problem
columns/New Names/.style={string type, column type=l}, % works not
%header=false,
]{\Target}
\end{document}