的背景
我正在尝试确定如何方便地并排排版来自不同圣经译本的一些圣经经文。我想到的解决方案是为每个圣经译本设置自定义环境。每个环境都包含只能在该环境中工作的宏。这些宏决定了最终结果的显示方式。最后,圣经经文与禁忌表并排显示。
这里的想法是,这些宏应该使以后更改格式变得容易。例如,如果我想关闭特定翻译中交叉引用标记的显示,我可以通过修改相应的宏来实现。
我目前拥有的工作代码如下......
\documentclass{article}
\usepackage{tabu}
\newenvironment{net}{
\def\bibleref##1{\textsuperscript{##1}}
\def\book##1{##1 }
\def\chapter##1{##1:}
\def\verse##1{##1}
\def\yhwh##1{\textsc{##1}}
\def\translatorsnote##1{\textsuperscript{##1}}
\def\studynote##1{\textsuperscript{##1}}
}{}
\newenvironment{nasb}{
\def\bibleref##1{\textsuperscript{##1}}
\def\book##1{##1 }
\def\chapter##1{##1:}
\def\verse##1{##1}
\def\yhwh##1{\textsc{##1}}
\def\crossref##1{\textsuperscript{##1}}
\def\implied##1{\textit{##1}}
}{}
\begin{document}
\begin{tabu}{XX}
\begin{net}
\bibleref{\book{Psa.}\chapter{20}\verse{1}}
May the \yhwh{Lord} answer\translatorsnote{2} you\studynote{3} when
you are in trouble;\studynote{4} may the God of Jacob\studynote{5}
make you secure!
\end{net}
&
\begin{nasb}
\bibleref{\book{Psa.}\chapter{20}\verse{1}}
May the \yhwh{Lord} answer you \crossref{a}in the day of trouble! May
the \crossref{b}name of the \crossref{c}God of Jacob set you
\implied{securely} on high!
\end{nasb}
\end{tabu}
\end{document}
问题
我遇到的问题是,当我尝试将环境\begin{...}
和\end{...}
声明从每个单独的单元格移动到 tabu-table 的表 spec 参数时,代码不再编译。最终的想法是,也许为每个圣经翻译设置自定义列类型,以使最终“产品”尽可能轻松。
不幸的是,我对 LaTeX 的了解不足以理解这个问题,甚至不知道寻找解决方案的大致方向。这也是为什么我必须尽可能全面但紧凑地描述整个设置的原因。所以,如果你有想法如何更好地服务于社区,请随意编辑问题。
不起作用的代码...
\documentclass{article}
\usepackage{tabu}
\newenvironment{net}{
\def\bibleref##1{\textsuperscript{##1}}
\def\book##1{##1 }
\def\chapter##1{##1:}
\def\verse##1{##1}
\def\yhwh##1{\textsc{##1}}
\def\translatorsnote##1{\textsuperscript{##1}}
\def\studynote##1{\textsuperscript{##1}}
}{}
\newenvironment{nasb}{
\def\bibleref##1{\textsuperscript{##1}}
\def\book##1{##1 }
\def\chapter##1{##1:}
\def\verse##1{##1}
\def\yhwh##1{\textsc{##1}}
\def\crossref##1{\textsuperscript{##1}}
\def\implied##1{\textit{##1}}
}{}
\begin{document}
\begin{tabu}{>{\begin{net}}X<{\end{net}} >{\begin{nasb}}X<{\end{nasb}}}
% Moving \begin{...} and \end{...} declarations to previous line causes the problems.
%\begin{net}
\bibleref{\book{Psa.}\chapter{20}\verse{1}}
May the \yhwh{Lord} answer\translatorsnote{2} you\studynote{3} when
you are in trouble;\studynote{4} may the God of Jacob\studynote{5}
make you secure!
%\end{net}
&
%\begin{nasb}
\bibleref{\book{Psa.}\chapter{20}\verse{1}}
May the \yhwh{Lord} answer you \crossref{a}in the day of trouble! May
the \crossref{b}name of the \crossref{c}God of Jacob set you
\implied{securely} on high!
%\end{nasb}
\end{tabu}
\end{document}
答案1
您想用环境包围第一X
列的原因是什么?从您的示例来看,您在两个环境和net
中定义的宏是相同的。我建议您将它们定义在顶层一次,不要经历麻烦。此外,我建议您不要重新定义 LaTeX 提供的宏(即使在课堂或中)。您可以使用 3 个参数定义来完成这项工作。我还建议不要使用长表;一旦您有一个长文档并且您失去了其他功能,它就会变得非常混乱。这里有一个解决方案:net
nasb
chapter
article
verse
\bibleref
paracol
\documentclass{article}
\usepackage{paracol}
\newcommand{\Bibleref}[3]{%
\noindent \textsuperscript{#1~#2:3}%
}
\newcommand\Yhwh[1]{\textsc{#1}}
\newcommand\Translatorsnote[1]{\textsuperscript{#1}}
\newcommand\Studynote[1]{\textsuperscript{#1}}
\newcommand\Crossref[1]{\textsuperscript{#1}}
\newcommand\Implied[1]{\textit{#1}}
\begin{document}
\begin{center}
With column synchronization:
\end{center}
\begin{paracol}{2}
\Bibleref{Psa.}{20}{1} May the \Yhwh{Lord} answer\Translatorsnote{2}
you\Studynote{3} when you are in trouble;\Studynote{4} may the God
of Jacob\Studynote{5} make you secure!
\switchcolumn
\Bibleref{Psa.}{20}{1} May the \Yhwh{Lord} answer you \Crossref{a}in
the day of trouble! May the \Crossref{b}name of the \Crossref{c}God
of Jacob set you \Implied{securely} on high! \par
\Bibleref{Psa.}{20}{1} May the \Yhwh{Lord} answer you \Crossref{a}in
the day of trouble! May the \Crossref{b}name of the \Crossref{c}God
of Jacob set you \Implied{securely} on high!
\switchcolumn*
\Bibleref{Psa.}{20}{1} May the \Yhwh{Lord} answer\Translatorsnote{2}
you\Studynote{3} when you are in trouble;\Studynote{4} may the God
of Jacob\Studynote{5} make you secure!
\end{paracol}
\vspace{3ex}
\begin{center}
Without column synchronization:
\end{center}
\begin{paracol}{2}
\Bibleref{Psa.}{20}{1} May the \Yhwh{Lord} answer\Translatorsnote{2}
you\Studynote{3} when you are in trouble;\Studynote{4} may the God
of Jacob\Studynote{5} make you secure!
\switchcolumn
\Bibleref{Psa.}{20}{1} May the \Yhwh{Lord} answer you \Crossref{a}in
the day of trouble! May the \Crossref{b}name of the \Crossref{c}God
of Jacob set you \Implied{securely} on high! \par
\Bibleref{Psa.}{20}{1} May the \Yhwh{Lord} answer you \Crossref{a}in
the day of trouble! May the \Crossref{b}name of the \Crossref{c}God
of Jacob set you \Implied{securely} on high!
\switchcolumn
\Bibleref{Psa.}{20}{1} May the \Yhwh{Lord} answer\Translatorsnote{2}
you\Studynote{3} when you are in trouble;\Studynote{4} may the God
of Jacob\Studynote{5} make you secure!
\end{paracol}
\end{document}