代码

代码

我想要一个多行方程(最好是相对于相应的列居中,因为我已经使用 [ 和 ] 或 $$ $$ 的单行方程没有居中)作为 \newglossaryentry 描述的一部分。

所以基本上我想要的是,在词汇表的列中,单行和多行方程式居中。

谢谢!

PS我想我可以从中得到一些东西:在此处输入链接描述 但我不能……

\documentclass[twoside]{amsbook}

\usepackage[colorlinks]{hyperref}

    \usepackage[xindy,counter=section,sanitize={name=false},style=index]{glossaries} %[toc]% %\glstoctrue
    \usepackage{nomencl}
        \makeglossaries %has to be after \usepackage{hyperref}              
        %
                \glossarystyle{long3col}            
                %\glossarystyle{super3col}

                \setlength{\glsdescwidth}{0.6\textwidth}
                \setlength{\glspagelistwidth}{0.15\textwidth}
            \newglossaryentry{AffineVariety}
                {
                    name=Affine Variety,
                    description={Affine varieties are defined to be anything that looks like the set of common zeros of a collection of polynomials. E.g., $A = \mathbb{C}[X]$ is the ring of polynomials in $X$ with complex coefficients. Let $f=X-1 \in A$ and its set of zeros, $Z(\{f\})=\{1\}$ is an example of an affine variety.}
                }
            \newglossaryentry{RemovableSingularity}
                {
                    name=Removable Singularity,
                    description={Formally, if $U \subset \mathbb{C}$ is an open subset of the complex plane $\mathbb{C}$, and $a \in U$, and $f: U\backslash\{a\} \to \mathbb{C}$ a holmorphic function, then $a$ is a removable singularity for $f$ if there exists a holomorphic function $g: U \to \mathbb{C}$, coinciding with $f$ on $U\backslash\{a\}$. It is said that $f$ is holomorphically extended over $U$ if such a $g$ exists.  A simple example is the function $$f(z) = \frac{\sin(z)}{z}$$ at $z=0$ (even this: \[f(z) = \frac{\sin(z)}{z}\] doesn't center.). The singularity, due to the indeterminate form, can be removed by defining $f(0)=1$, which is the limit of $f$ as $z$ approaches zero.}
                }
            \newglossaryentry{TetrahedralCoordinates}
                {
                    name=Tetrahedral Coordinates,
                    description={Coordinates useful in plotting projective three-dimensional curves of the form $f(x_0,x_1,x_2,x_3)=0$, which are defined by  
    %               \begin{minipage}[t][5cm][b]{0,5\textwidth}
    %               \ensuremath{
    %               $$ {\setlength\arraycolsep{0.2em} \begin{eqnarray} x_0 = 1-z-\sqrt{2}\,x \\  x_1 = 1 - z + \sqrt{2}\,x \\ x_2 = 1+ z+ \sqrt{2}\,y \\ x_3 = 1 + z - \sqrt{2}\,y \end{eqnarray} } $$ 
    %               \end{minipage}
    %               }
                    }
                }


\makeglossaries




\begin{document}

Consider the equation
\begin{equation}
e = m * c^2
\end{equation}
in which \gls{AffineVariety} is here, but not here \gls{TetrahedralCoordinates} oh and this \gls{RemovableSingularity}.


\printglossary

\end{document} 

答案1

将内容包装在minipage环境中可以使显示的数学运算位于longtable环境中的中心。但每次都这样做会很繁琐、不灵活且容易出错。

更好的选择是使用包\newcolumntype的命令array为表格环境设置新的列类型,然后我们可以使用它来定义新的词汇表样式my3col。此样式将基于long3col但更改了描述的列类型。

glossaries之前已经加载了,因此\glsdescwidth在定义新列类型时可以使用。这反过来在设置将使用它的新词汇表样式之前定义。最后,新样式被激活。

代码

\documentclass[twoside]{amsbook}

\usepackage[colorlinks]{hyperref}
\usepackage[xindy,counter=section,sanitize={name=false},style=index]{glossaries} %[toc]% %\glstoctrue
\usepackage{nomencl}
    \setlength{\glsdescwidth}{0.6\textwidth}
    \setlength{\glspagelistwidth}{0.15\textwidth}
\usepackage{array}
  \newcolumntype{G}{% This is defining a new column type for tabulars which we will use to define the longtable environment in the new glossary style
    >{\begin{minipage}[t]{\glsdescwidth}}{c}<{\end{minipage}}%
    }
\newglossarystyle{my3col}{% call that style my3col
\setglossarystyle{long3col}% base it on long3col so we don't need to define the everything from scratch
\renewenvironment{theglossary}% here's the bit we want to alter
    {\begin{longtable}{lGp{\glspagelistwidth}}}% just change the central column to our new column type, G
    {\end{longtable}}}

\glossarystyle{my3col}% we want to use the new style!
\makeglossaries %has to be after \usepackage{hyperref}

    \newglossaryentry{AffineVariety}
        {
            name=Affine Variety,
            description={Affine varieties are defined to be anything that looks like the set of common zeros of a collection of polynomials. E.g., $A = \mathbb{C}[X]$ is the ring of polynomials in $X$ with complex coefficients. Let $f=X-1 \in A$ and its set of zeros, $Z(\{f\})=\{1\}$ is an example of an affine variety.}
        }
    \newglossaryentry{RemovableSingularity}
        {
            name=Removable Singularity,
            description={Formally, if $U \subset \mathbb{C}$ is an open subset of the complex plane $\mathbb{C}$, and $a \in U$, and $f: U\backslash\{a\} \to \mathbb{C}$ a holmorphic function, then $a$ is a removable singularity for $f$ if there exists a holomorphic function $g: U \to \mathbb{C}$, coinciding with $f$ on $U\backslash\{a\}$. It is said that $f$ is holomorphically extended over $U$ if such a $g$ exists.  A simple example is the function
              \[f(z) = \frac{\sin(z)}{z}\]
            at $z=0$ (even this:
              \[f(z) = \frac{\sin(z)}{z}\]
            doesn't center.). The singularity, due to the indeterminate form, can be removed by defining $f(0)=1$, which is the limit of $f$ as $z$ approaches zero.}
        }
    \newglossaryentry{TetrahedralCoordinates}
        {
            name=Tetrahedral Coordinates,
            description={Coordinates useful in plotting projective three-dimensional curves of the form $f(x_0,x_1,x_2,x_3)=0$, which are defined by
             \begin{gather*}
               X_0 = 1-Z-\sqrt{2}\,X \\
               X_1 = 1 - Z + \sqrt{2}\,X \\
               X_2 = 1+ Z+ \sqrt{2}\,Y \\
               X_3 = 1 + Z - \sqrt{2}\,Y
              \end{gather*}
            }
        }

\begin{document}

Consider the equation
\begin{equation}
e = m * c^2
\end{equation}
in which \gls{AffineVariety} is here, but not here \gls{TetrahedralCoordinates} oh and this \gls{RemovableSingularity}.


\printglossary

\end{document}

输出

新式词汇表

笔记

  • 你不需要\makeglossaries在序言中重复两次。
  • $$...$$已弃用,不应使用。\[...\]例如,请改用 。

相关内容