我使用newenvironment
来构造我的符号列表和缩写列表。在一些文档中,它们只有一个。因此,我尝试计算此环境的使用情况,以更正我的表列表中的偏移量,否则它会多计算一两个表,并从两个或三个开始。
我尝试过这样的:
\newcounter{tableCounter}
\renewenvironment{theglossary}{\begin{longtable}[l]{@{}p{\dimexpr 2cm-\tabcolsep}p{0.8\hsize}}}{\stepcounter{tableCounter}\end{longtable}}}
\addtocounter{table}{-\value{tableCounter}}
编辑:
\documentclass[fontsize=12pt,paper=a4,bibliography=totoc,headings=normal, titlepage=true,toc=listof,toc=indent,listof=entryprefix,twoside=false]{scrbook}
\usepackage{gensymb}
\usepackage{placeins}
\usepackage{chngcntr}
\usepackage{enumitem}
\usepackage[nonumberlist,acronym,toc]{glossaries}
\usepackage[autooneside=false,automark,headsepline]{scrlayer-scrpage}
\newcounter{tableCounter}
\counterwithout{table}{chapter}
\newglossarystyle{mylong}{
\setglossarystyle{long}
\renewenvironment{theglossary}{\begin{longtable}[l]{@{}p{\dimexpr 2cm-\tabcolsep}p{0.8\hsize}}}{\end{longtable}}}
%\stepcounter{tableCounter}
\addtocounter{table}{-\value{tableCounter}}
\newglossary{symbolslist}{syi}{syg}{}
\newglossaryentry{symb:R_GAIN}{name={R\textsubscript{GAIN}},description={Gain Resistor\hspace{5mm}[\ohm]},first={Gain Resistor (R\textsubscript{GAIN})},type=symbolslist,sort=R_GAIN}
\newacronym[plural=LED,firstplural=LED,description={Light Emitting Diode}]{LED}{LED}{Light Emitting Diode}
\makeglossaries
\begin{document}
\listoftables
\printglossary[type=symbolslist,style=mylong,title=List of symbols]
\printglossary[style=mylong,type=\acronymtype]
\chapter{Chapter}
Symbol: \gls{symb:R_GAIN}
\newline
Abbreviation: \gls{LED}
\newline
\begin{table}
\centering
\begin{tabular}{|c|c|}
\hline
First & Second \\
\hline
1 & 2 \\
\hline
\end{tabular}
\caption{First table}
\label{tab:First table}
\end{table}
\end{document}
此 MWE 呈现:
如您所见,我的表格列表从数字 3 开始。