不能去掉括号!LaTeX 发票包

不能去掉括号!LaTeX 发票包

我正在尝试使用 LaTeX 编写发票invoice。但是,我不希望“金额”后面有货币或括号。我可以通过将该字段留空来轻松删除货币,但我无法删除括号。

我的代码:

\documentclass{letter}
\usepackage{invoice}
\address{Name\\Business\\etc.}

\date{\today}

\begin{document}
\begin{letter}{Customer name }
\opening{}

\begin{invoice}{}{0}
  \ProjectTitle{Invoice}
  \Fee{Example} {25.99} {1}
\end{invoice}

\closing{}
\end{letter}
\end{document}

这给了我:

在此处输入图片描述

正如我上面所说,我正在尝试删除“金额”后的括号。

答案1

要删除括号,您必须重新定义内部\Fee@Title命令:

\documentclass{letter}
\usepackage{invoice}
\address{Name\\Business\\etc.}

\date{\today}

\makeatletter
\renewcommand{\Fee@Title}{%
    \\
    \noindent\textbf{\Activity}&&\UnitRate&\Count&\Amount\\% removed part in parentheses here
    \hline%
}
\makeatother

\begin{document}
\begin{letter}{Customer name }
\opening{}


\begin{invoice}{}{0}
  \ProjectTitle{Invoice}
  \Fee{Example} {25.99} {1}
\end{invoice}

\closing{Bye}
\end{letter}
\end{document}

结果:

在此处输入图片描述

答案2

环境的第一个参数invoice用于指定Base Currency(或\BC),并自动放置在后面Amount。重新定义\Fee@Title- 负责设置发票表中标题的宏,或通过以下方式对其进行修补etoolbox

\usepackage{etoolbox}
\makeatletter
\patchcmd{\Fee@Title}{\ (\BC)}{}{}{}% Remove "\ (\BC)" from \Fee@Title
\makeatother

在此处输入图片描述

\documentclass{letter}
\usepackage{invoice}

\address{Name\\Business\\etc.}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\Fee@Title}{\ (\BC)}{}{}{}% Remove "\ (\BC)" from \Fee@Title
\makeatother

\date{\today}

\begin{document}
\begin{letter}{Customer name }
\opening{}

\begin{invoice}{}{0}
  \ProjectTitle{Invoice}
  \Fee{Example} {25.99} {1}
\end{invoice}

\closing{Thanks}
\end{letter}
\end{document}

相关内容