繁体   English   中英

Latex \\ newcommand参数

[英]Latex \newcommand argument

我有一个Latex文本,我想写一个非常基本的类来渲染。 基本上所有文本的命令都需要定义。 到目前为止,我做得很好,直到我点击这个:

\\swordfootnote{1}{}{Philemon 1:23}{crossReference}{}{See \\swordxref{Col.1.7}{Col. 1:7}}

基本上这是一个花哨的脚注,我至少在这个时刻想要作为一个脚注呈现。 它有6个参数,但我真的只需要最后一个,这是脚注文本。

我做了以下事情:

\\RequirePackage{hyperref} \\newcommand{\\swordxref}[2]{\\hyperref{#1}{#2}} \\newcommand{\\swordfootnote}[6]{\\footnote{#6}}

我正在编译消息,这是多余的}。

! Argument of \\@finalstrut has an extra }. <inserted text> \\par l.9 ...ver. 9}; See \\swordxref{Eph.3.1}{Eph. 3:1}}

关于我做错了什么的任何建议?

您对\\hyperref使用不正确。 \\hyperref的“双参数”版本使用该接口

\hyperref[<label>]{<text>}

用方括号表示第一个参数。

这是一个显示用法的最小示例:

在此输入图像描述

\documentclass{article}
\usepackage[paperheight=20\baselineskip]{geometry}% Just for this example
\usepackage{hyperref}
\newcommand{\swordxref}[2]{\hyperref[#1]{#2}}
\newcommand{\swordfootnote}[6]{\footnote{#6}}
\begin{document}

\section{A section}\label{sec:section}

See~\swordxref{sec:section}{this section} or a footnote\swordfootnote{1}{2}{3}{4}{5}{See~\swordxref{sec:section}{this section}.}.

\end{document}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM