[英]Filter file alphabetically
I have a file kuerzel.tex
.我有一个文件
kuerzel.tex
。 What is the best way to sort them alphabetically by the value in the square brackets []
or the second value inside the {}
(eg [EU]
or Europäische Union
)?按方括号
[]
的值或{}
的第二个值(例如[EU]
或Europäische Union
)按字母顺序对它们进行排序的最佳方法是什么? This should happen best automatically when I also create the latex file.当我还创建乳胶文件时,这应该自动发生。 Say at the end I would like to have the following:
最后说我想要以下内容:
\acro{eugh}[EuGH]{Europäischer Gerichtshof}
\acro{eu}[EU]{Europäische Union}
\acro{gr}[GR]{Griechenland}
main.tex主文件
\documentclass{report}
\usepackage[ngerman]{babel}
\usepackage[demo]{graphicx}
\usepackage[nohyperlinks, printonlyused]{acronym}
\usepackage{hyperref}
\usepackage[ngerman]{cleveref}
\usepackage[parfill]{parskip}
\begin{document}
\begin{acronym}[EuGH]
\input{kuerzel}
\end{acronym}
Der \ac{eugh} ist das oberste rechtsprechende Organ der
\ac{eu}. Die \ac{eu} ist dabei ein Staatenverbund aus 27 europäischen Ländern. Und \ac{gr} hat eine sehr gute Landwirtschaft, welcher stark gefördert werden sollte.
\end{document}
kuerzel.tex kuerzel.tex
\acro{gr}[GR]{Griechenland}
\acro{eu}[EU]{Europäische Union}
\acro{eugh}[EuGH]{Europäischer Gerichtshof}
You can use the glossaries
package instead:您可以改用
glossaries
包:
\documentclass{report}
\usepackage[ngerman]{babel}
\usepackage[demo]{graphicx}
\usepackage[acronym,nonumberlist,nogroupskip]{glossaries}
\makeglossaries
\usepackage{hyperref}
\usepackage[ngerman]{cleveref}
\usepackage[parfill]{parskip}
\begin{filecontents*}[overwrite]{kuerzel.tex}
\newacronym{gr}{GR}{Griechenland}
\newacronym{eu}{EU}{Europäische Union}
\newacronym{eugh}{EuGH}{Europäischer Gerichtshof}
\end{filecontents*}
\begin{document}
\include{kuerzel}
\printacronyms
Der \gls{eugh} ist das oberste rechtsprechende Organ der
\gls{eu}. Die \gls{eu} ist dabei ein Staatenverbund aus 27 europäischen Ländern. Und \gls{gr} hat eine sehr gute Landwirtschaft, welcher stark gefördert werden sollte.
\end{document}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.