为什么复数形式在 中不起作用glossaries
?抱歉缩进错误
前言:
\documentclass[a4paper,11pt]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{scrhack}
\usepackage{lmodern}
\usepackage{chscite2}
\usepackage{listings}
\usepackage[intlimits]{amsmath}
\usepackage{amssymb}
\usepackage{isomath}
\renewcommand{\vec}{\vectorsym}
\newcommand{\mat}{\matrixsym}
\newcommand{\ten}{\tensorsym}
\usepackage{braket}
\usepackage{lmodern}
\usepackage[per-mode=fraction]{siunitx}
\usepackage{icomma}
\usepackage{color}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{bbm}
\usepackage{mleftright}
\usepackage{tikz}
\usepackage{pstricks}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{titling}
\usepackage[toc,xindy]{glossaries}
\newcommand*{\glossfirstformat}[1]{\textit{#1}}
\renewcommand*{\glsseeformat}[3][\seename]{\textit{See}: \glsseelist{#2}}
\newacronymstyle{myacro}{%
\GlsUseAcrEntryDispStyle{long-short}%
}%
{%
\GlsUseAcrStyleDefs{long-short}%
\renewcommand*{\genacrfullformat}[1]{%
\glossfirstformat{\glsentrylong{##1}}\space(\glsentryshort{##1})%}
\renewcommand*{\Genacrfullformat}[2]{%
\glossfirstformat{\Glsentrylong{##1}}\space(\glsentryshort{##1})%
}%
\renewcommand*{\genplacrfullformat}[2]{%
\glossfirstformat{\glsentrylongpl{##1}}\space(\glsentryshortpl{##1})%
}%
\renewcommand*{\Genplacrfullformat}[2]{%
\glossfirstformat{\Glsentrylongpl{##1}}\space
(\glsentryshortpl{##1})%
}%
}
\setacronymstyle{myacro}
\defglsentryfmt{%
\ifglshaslong{\glslabel}{%
\glsgenacfmt%
}{%
\ifglsused{\glslabel}{%
\glsgenentryfmt%
}{%
\glossfirstformat{\glsgenentryfmt}%
}%
}%6
}
\renewcommand*{\glsnamefont}{\sffamily}
\usepackage{xparse}
\DeclareDocumentCommand{\newdualentry}{ O{} O{} m m m m } {
\newglossaryentry{gls-#3}{name={#5},text={#5\glsadd{#3}},
description={#6},#1
}
\newacronym[see={[See:]{gls-#3}},#2]{#3}{#4}{#5\glsadd{gls-#3}}
}
\usepackage{import}
\addto\captionsenglish{\renewcommand{\figurename}
{\sffamily{\textbf{Figure}}}}
\renewcommand*{\figureformat}{%
\figurename~\thefigure%
% \autodot% DELETED
}
\usetikzlibrary{arrows,shapes}
\newcommand{\N}{\ensuremath{\mathbbm{N}}}
\newcommand{\Z}{\ensuremath{\mathbbm{Z}}}
\newcommand{\Q}{\ensuremath{\mathbbm{Q}}}
\newcommand{\R}{\ensuremath{\mathbbm{R}}}
\newcommand{\C}{\ensuremath{\mathbbm{C}}}
\newcommand{\rd}{\ensuremath{\mathrm{d}}}
\newcommand{\id}{\ensuremath{\,\rd}}
\definecolor{boxcolor}{rgb}{0.9,0.9,0.9}
\mleftright
\newcommand{\umltitle}[1]{\footnotesize{\textbf{#1}}}
\newcommand{\umlentry}[1]{\footnotesize{#1}}
\newcommand{\umlabstract}[1]{\footnotesize{\textit{#1}}}
\newcommand{\figuretext}[1]{\footnotesize{#1}}
\newcommand{\textclassname}[1]{\mbox{\texttt{#1}}}
\newcommand{\bigo}[1]{\mathcal{O}\left(#1 \right)}
在文档中
\makeglossaries
\begin{document}
\newglossaryentry{polymesh}{name={polygon mesh},plural={polygon meshes},description={A storage model that is frequently used in 3D computer graphics to represent 3D objects}}\glspl{polymesh}
\printglossary
\end{document}
输出自\glspl{polymesh}
多边形网格
pdflatex --版本
pdfTeX 3.1415926-2.5-1.40.14(TeX Live 2013/Debian)
kpathsea 版本 6.1.1
版权所有 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX)。不提供任何保证。此软件的再分发受 pdfTeX 版权和宽 GNU 通用公共许可证条款的约束。有关这些事项的更多信息,请参阅名为 COPYING 的文件和 pdfTeX 源。
pdfTeX 的主要作者:Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX)。
使用 libpng 1.2.49 编译;使用 libpng 1.2.50 使用 zlib 1.2.8 编译;使用 zlib 1.2.8 使用 poppler 版本 0.24.5 编译
xindy --版本
xindy 发布日期:未知
xindy 脚本版本:1.16
xindy内核版本:3.0
CLISP 版本 2.49(2010-07-07)(基于 brownie.buildd [127.0.1.1] 构建)架构:X86_64
词汇表版本:
软件包:词汇表 2014/01/20 v4.03 (NLCT)
构建命令:
rm -f output/report.*
pdflatex -interaction=batchmode -halt-on-error -output-directory output report.tex
xindy -q -L english -C utf8 -I xindy -M "output/report" -t "output/report.glg" -o "output/report.gls" "output/report.glo"
bibtex output/report.aux
pdflatex -interaction=batchmode -halt-on-error -output-directory output report.tex
pdflatex -interaction=batchmode -halt-on-error -output-directory output report.tex
pdflatex -interaction=batchmode -halt-on-error -output-directory output report.tex
Nicola 提供的最小示例:
\documentclass[a4paper,11pt]{scrreprt}
\usepackage{xparse}
\usepackage[toc,xindy]{glossaries}
\makeglossaries
\newcommand*{\glossfirstformat}[1]{\textit{#1}}
\renewcommand*{\glsseeformat}[3][\seename]{\textit{See}:
\glsseelist{#2}}
\newacronymstyle{myacro}{%
\GlsUseAcrEntryDispStyle{long-short}%
}%
{%
\GlsUseAcrStyleDefs{long-short}%
\renewcommand*{\genacrfullformat}[1]{%
\glossfirstformat{\glsentrylong{##1}}\space(\glsentryshort{##1})%
}
\renewcommand*{\Genacrfullformat}[2]{%
\glossfirstformat{\Glsentrylong{##1}}\space(\glsentryshort{##1})%
}%
\renewcommand*{\genplacrfullformat}[2]{%
\glossfirstformat{\glsentrylongpl{##1}}\space(\glsentryshortpl{##1})%
}%
\renewcommand*{\Genplacrfullformat}[2]{%
\glossfirstformat{\Glsentrylongpl{##1}}\space
(\glsentryshortpl{##1})%
}%
}
\setacronymstyle{myacro}
\defglsentryfmt{%
\ifglshaslong{\glslabel}{%
\glsgenacfmt%
}{%
\ifglsused{\glslabel}{%
\glsgenentryfmt%
}{%
\glossfirstformat{\glsgenentryfmt}%
}%
}%6
}
\renewcommand*{\glsnamefont}{\sffamily}
\DeclareDocumentCommand{\newdualentry}{ O{} O{} m m m m } {%
\newglossaryentry{gls-#3}{name={#5},text={#5\glsadd{#3}},
description={#6},#1
}
\newacronym[see={[See:]{gls-#3}},#2]{#3}{#4}{#5\glsadd{gls-#3}}
}
\newglossaryentry{polymesh}{name={polygon mesh},plural={polygon
meshes},description={A storage model that is frequently used in 3D
computer graphics to represent 3D objects}}
\begin{document}
\glspl{polymesh}
\printglossary
\end{document}
答案1
以下对我来说很好用:
\documentclass[a4paper,11pt]{scrreprt}
\usepackage{xparse}
\usepackage[toc,xindy]{glossaries}
\makeglossaries
\newcommand*{\glossfirstformat}[1]{\textit{#1}}
\renewcommand*{\glsseeformat}[3][\seename]{\textit{See}:
\glsseelist{#2}}
\newacronymstyle{myacro}{%
\GlsUseAcrEntryDispStyle{long-short}%
}%
{%
\GlsUseAcrStyleDefs{long-short}%
\renewcommand*{\genacrfullformat}[1]{%
\glossfirstformat{\glsentrylong{##1}}\space(\glsentryshort{##1})%
}
\renewcommand*{\Genacrfullformat}[2]{%
\glossfirstformat{\Glsentrylong{##1}}\space(\glsentryshort{##1})%
}%
\renewcommand*{\genplacrfullformat}[2]{%
\glossfirstformat{\glsentrylongpl{##1}}\space(\glsentryshortpl{##1})%
}%
\renewcommand*{\Genplacrfullformat}[2]{%
\glossfirstformat{\Glsentrylongpl{##1}}\space
(\glsentryshortpl{##1})%
}%
}
\setacronymstyle{myacro}
\defglsentryfmt{%
\ifglshaslong{\glslabel}{%
\glsgenacfmt%
}{%
\ifglsused{\glslabel}{%
\glsgenentryfmt%
}{%
\glossfirstformat{\glsgenentryfmt}%
}%
}%6
}
\renewcommand*{\glsnamefont}{\sffamily}
\newglossaryentry{polymesh}{name={polygon mesh},plural={polygon
meshes},description={A storage model that is frequently used in 3D
computer graphics to represent 3D objects}}
\begin{document}
\glspl{polymesh}
\printglossary
\end{document}
检查事项:
glossaries
确保您拥有该软件包的最新版本;- 确保你的定义在序言中;
- 如果您使用
\newacronym
而不是\newglossaryentry
,则使用\setacronymstyle
(如示例中所示)和longplural
或shortplural
键(根据需要)来覆盖默认的长或短复数形式。