【问题标题】:latex theorem does not wrap text in 2-column乳胶定理不会将文本包装在 2 列中
【发布时间】:2017-12-29 01:28:04
【问题描述】:

以下乳胶代码生成一个定义,其文本与第二列重叠。 ijcai18 包使它成为 2 栏文章,所以问题可能出在哪里?我不知道怎么读。

\documentclass{article}

\usepackage{ijcai18}


\usepackage{lipsum}

\newtheorem{theorem}{Theorem}[section]    
\newtheorem{definition}[theorem]{Definition}

\begin{document}

\begin{definition} [This is a long definition title that does not wrap to the next line]

...
\end{definition}
\lipsum[1-5]    
\end{document}

【问题讨论】:

    标签: latex


    【解决方案1】:

    ijcai18 conference style 不添加任何与定理相关的功能。因此,\newtheorem{definition}[.]{Definition} 仍然依赖 LaTeX 的原始定义来创建类似定理的环境。

    在 LaTeX 中,通过\newtheorem 定义的定理被设置为一个列表,整个定理由一个单数\item 组成。定理的标题作为可选参数传递给\item(即\item[<theorem title stuff>],此可选参数设置在不允许换行的框内。

    下面我重新定义了设置\item 的部分,专门用于具有可选参数的定理(如您的情况,\begin{definition}[..])。这是原始定义(来自LaTeX kernel):

    \def\@opargbegintheorem#1#2#3{\trivlist
      \item[\hskip \labelsep{\bfseries #1\ #2\ (#3)}]\itshape}
    

    这是更改后的定义:

    \def\@opargbegintheorem#1#2#3{\trivlist
       \item[]{\bfseries #1\ #2\ (#3)} \itshape}
    

    \documentclass{article}
    
    \usepackage{ijcai18}% http://www.ijcai.org/authors_kit
    \usepackage{lipsum}
    
    \newtheorem{definition}{Definition}
    
    \makeatletter
    \def\@opargbegintheorem#1#2#3{\trivlist
       \item[]{\bfseries #1\ #2\ (#3)} \itshape}
    \makeatother
    
    \begin{document}
    
    \begin{definition}[This is a long definition title that does not wrap to the next line]
    \lipsum[1]
    \end{definition}
    
    \lipsum[2-5]
    
    \end{document}
    

    【讨论】:

    • 永远感激!它解决了这个问题。他们应该更改 ijcar 包。
    • @Oferstrichman:然后考虑接受这个答案。见How do you accept an answer?
    猜你喜欢
    • 2017-06-06
    • 1970-01-01
    • 2019-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    相关资源
    最近更新 更多