带点填充的缩写 LaTex

带点填充的缩写 LaTex

我对我的首字母缩略词使用了 \dotfill,一切正常。但是当我在文本中引用首字母缩略词时,LaTex 也会包含点。有没有办法使用 dotfill,而之后文本中不会出现点?

\documentclass[fontsize=11pt,
twoside,
BCOR=10mm, 
DIV=calc,  
titlepage=on,
idxtotoc,
xcolor = pdftex,
dvipsnames,
bibliography=totoc,
liststotoc
]{scrreprt}

\begin{document}

\begin{acronym}
      \acro{cta}[CTA]{\dotfill Constant Temperature Anemometer}
\end{acronym}

       Test \ac{cta}

\end{document}

提前谢谢了!

答案1

姆韦

\documentclass{scrreprt}
\usepackage[margin=1cm,paperheight=6cm,paperwidth=9cm]{geometry}
\usepackage{acronym}
\usepackage[colorlinks,linkcolor=blue]{hyperref}
\begin{document}
\Ac{imho}, is better not to \ac{rw}. \Ac{rtfm} could help to follow the \acfi{kiss} principle. Always  \ac{imho}, and only \acl{imho}. 
\newpage 
\section*{Acronyms}
\begin{acronym}[YesIcan]
      \acro{imho}[IMHO]{\acroextra{\dotfill}in my humble opinion}
      \acro{kiss}[KISS]{\acroextra{\dotfill}keep it simple and small}
     \acro{rtfm}[RTFM]{\acroextra{\dotfill}read the fine manual}
     \acro{rw}[NTRTW]{\acroextra{\dotfill}reinvent the wheel}
\end{acronym}
\end{document}

答案2

您可以修补acronym环境(实际上是一些定义奇怪的命令)。

\documentclass[
  fontsize=11pt,
  twoside,
  BCOR=10mm, 
  DIV=calc,  
  titlepage=on,
  index=totoc,
  bibliography=totoc,
  listof=totoc,
]{scrreprt}

\usepackage{acronym}
\usepackage{etoolbox}

\makeatletter
\expandafter\patchcmd\csname AC@\AC@prefix{}@acro\endcsname
 {#1]{#3}}
 {#1]\dotfill\ {#3}}
 {}{}
\expandafter\patchcmd\csname AC@\AC@prefix{}@acro\endcsname
 {#1]{#3}}
 {#1]\dotfill\ {#3}}
 {}{}
\makeatother

\begin{document}

\begin{acronym}
\acro{cta}[CTA]{Constant Temperature Anemometer}
\end{acronym}

       Test \ac{cta}

\end{document}

在此处输入图片描述

有必要进行两次修补,因为无论是否hyperref加载,代码几乎都是重复的。

我更改了几个文档类选项以避免出现烦人的警告。 也不xcolor是 的选项scrreprt

答案3

姆韦

\documentclass{scrreprt}
\usepackage[margin=1cm,paperheight=6cm,paperwidth=9cm]{geometry}
\usepackage{acronym}
\usepackage[colorlinks,linkcolor=blue]{hyperref}
\begin{document}
\Ac{imho}, is better not to \ac{rtw}. \Ac{rtfm} could help to follow the \acfi{kiss} principle. Always  \ac{imho}, and only \acl{imho}. 
\newpage 
\section*{Acronyms}
\begin{acronym}[YesWeCan]
      \acro{imho}[IMHO]{\acroextra{\dotfill}in my humble opinion}
      \acro{kiss}[KISS]{\acroextra{\dotfill}keep it simple and small}
     \acro{rtfm}[RTFM]{\acroextra{\dotfill}read the fine manual}
     \acro{rtw}[RTW]{\acroextra{\dotfill}reinvent the whell}
\end{acronym}
\end{document}

相关内容