答案1
根本不需要使用任何包,您就可以制作一张桌子。
代码:
\documentclass{amsart}
\newcommand\SINGKATAN[3]{#1&\multicolumn{1}{l}{\textit{#2}}\\}
\newcommand\LAMBANG[3]{$#1$&\multicolumn{1}{l}{#2}\\}
\begin{document}
\begin{table}
\begin{tabular}{lcl}
\multicolumn{3}{c}{{\Large \textbf{DAFTAR SINGKATAN DAN LAMBANG}}}\\~\\
SINGKATAN&Nama&Pemakaian\\
&&pertama kali\\
&&pada halaman\\
\SINGKATAN{HPLC}{High Performance Liquid Chromatography}{10}
\SINGKATAN{NMR}{Nuclear Magnetic Resonance}{1}
\SINGKATAN{PCR}{Polymerase Chain Reaction}{13}
&&\\
LAMBANG&&\\
\LAMBANG{A}{Konstanta pada hubungan tegangan}{17}
\LAMBANG{a_1}{Kecepatan}{20}
\LAMBANG{a_{ij}}{Fungisi reaksi variabel dalam koefisien}{24}
&\multicolumn{1}{l}{persamaan diferensial}&\\
\LAMBANG{b}{Parsamaan dasar perambatan gelombang}{15}
\LAMBANG{c_0}{Gaya badan spesifik}{31}
\LAMBANG{a_1}{Variabel internal pertama}{32}
\LAMBANG{a_2}{Variabel internal kedua}{28}
\LAMBANG{\delta}{Koefisien viskositas}{34}
\end{tabular}
\end{table}
\end{document}
产量:
答案2
好的,那么让我们来使用glossaries
包裹。
词汇表包已经支持分层结构化索引。但是,并不是每种样式都支持,而且没有一种符合您的期望。所以您必须编写自己的样式。这是一个示例样式。它并不完全符合您的要求,但很接近。其中大部分都很简单,所以我想您可以修改它:
% define a glossary style
\newglossarystyle{tablehierarc}{%
% base this style on the list style
\setglossarystyle{long3col}%
% Change the table type --> 3 columns and make sure the table definitions match
\renewenvironment{theglossary}{
\begin{longtable}{lp{0.6\columnwidth}c}%
\toprule
}{
\bottomrule
\end{longtable}
}%
% clear any weird headings, we do not want those
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glsgroupskip}{}%
% Change the table header
\renewcommand*{\glossaryheader}{%
& \textbf{Nama} & \multicolumn{1}{p{2cm}}{Pemakaian pertama kali pada halaman} \tabularnewline
\midrule %
\endhead %
}%
%
\renewcommand*{\glossentry}[2]{%
% Here I somehow fail to position it nicely. However, a new row
% with some negative spacing appears to work just fine.
\\[-1ex]
\multicolumn{3}{l}{\hspace{\glosshierarchindent}\textbf{{\glossentryname{##1}}}} \tabularnewline
}
% Change the displayed items
\renewcommand*{\subglossentry}[3]{
\ifglshassymbol{##2}{ % Entry Symbol
\glstarget{##2}{\glossentrysymbol{##2}}%
}{ % or if no symbol, use name
\glstarget{##2}{\glossentryname{##2}}%
}%
& \glossentrydesc{##2} % Description
& ##3 % Pagenumber
\tabularnewline
}
}
接下来你需要做的是添加词汇表中的所有条目。由于你想要一个层次结构,你必须先添加主要元素,然后添加定义选项的子项parent
。我建议你简单地定义一个新命令。例如:
\newglossaryentry{SINGKATAN}{name={SINGKATAN}, description={\glspar}}
\newcommand{\newSINGKATANentry}[3]{
% create the glossary entry in the greek category
\newglossaryentry{#1}{
name=#1,
symbol=#2,
description=\textit{#3},
parent=SINGKATAN
}
}
\newSINGKATANentry{hlpc}{HPLC}{High Performance Liquid Chromatography}
\newSINGKATANentry{nmr}{NMR}{Nulcear Magnetic Resonance}
\newglossaryentry{LAMBANG}{name={LAMBANG}, description={\glspar}}
\newcommand{\newLAMBANGentry}[3]{
% create the glossary entry in the greek category
\newglossaryentry{#1}{
name=#1,
symbol=\ensuremath{#2},
description={#3},
parent=LAMBANG
}
}
\newLAMBANGentry{a}{A}{Konstanta pada hubungan tegangan}
\newLAMBANGentry{a1}{a_1}{Kecepatan}
这负责使用正确的父级、调用数学模式、将描述设为斜体等。此时,您需要做的就是打印您的词汇表。因此,要获得一个完整、有效的示例:
\documentclass[a4paper]{report}
\usepackage{glossaries}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{array}
% define a glossary style
\newglossarystyle{tablehierarc}{%
% some configuration options
\newlength{\glosshierarchindent}\setlength{\glosshierarchindent}{1cm}
% base this style on the list style
\setglossarystyle{long3col}%
%
% Change the table type --> 3 columns
\renewenvironment{theglossary}{
\begin{longtable}{lp{0.6\columnwidth}c}%
\toprule
}{
\bottomrule
\end{longtable}
}%
%
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glsgroupskip}{}%
% Change the table header
\renewcommand*{\glossaryheader}{%
& \textbf{Nama} & \multicolumn{1}{p{2cm}}{Pemakaian pertama kali pada halaman} \tabularnewline
\midrule %
\endhead %
}%
%
\renewcommand*{\glossentry}[2]{%
% would prefer multicolumn environment for a more precise positioning, but
% this does not work (misplace \omit)
%& \hspace{-\glosshierarchindent} \textbf{{\glossentryname{##1}}} & \tabularnewline
% or we add additional space with a new line, which again is reduced
\\[-1ex]
\multicolumn{3}{l}{\hspace{\glosshierarchindent}\textbf{{\glossentryname{##1}}}} \tabularnewline
}
% Change the displayed items
\renewcommand*{\subglossentry}[3]{
\ifglshassymbol{##2}{ % Entry Symbol
\glstarget{##2}{\glossentrysymbol{##2}}%
}{ % or if no symbol, use name
\glstarget{##2}{\glossentryname{##2}}%
}%
& \glossentrydesc{##2} % Description
& ##3 % Pagenumber
\tabularnewline
}
}
\makeglossaries
\newglossaryentry{SINGKATAN}{name={SINGKATAN}, description={\glspar}}
\newcommand{\newSINGKATANentry}[3]{
% create the glossary entry in the greek category
\newglossaryentry{#1}{
name=#1,
symbol=#2,
description=\textit{#3},
parent=SINGKATAN
}
}
\newSINGKATANentry{hlpc}{HPLC}{High Performance Liquid Chromatography}
\newSINGKATANentry{nmr}{NMR}{Nulcear Magnetic Resonance}
\newglossaryentry{LAMBANG}{name={LAMBANG}, description={\glspar}}
\newcommand{\newLAMBANGentry}[3]{
% create the glossary entry in the greek category
\newglossaryentry{#1}{
name=#1,
symbol=\ensuremath{#2},
description={#3},
parent=LAMBANG
}
}
\newLAMBANGentry{a}{A}{Konstanta pada hubungan tegangan}
\newLAMBANGentry{a1}{a_1}{Kecepatan}
\begin{document}
\glsaddall
\printglossary[type=main, style=tablehierarc]
\end{document}
由于这是一个普通表格,因此您可以(几乎)按照自己习惯的方式对其进行修改。我承认,这并不完全符合您的要求,但已经很接近了。如果您在修改时遇到任何具体问题,欢迎在评论中提问(我猜)。