Giter Club home page Giter Club logo

Comments (4)

qinglee avatar qinglee commented on August 12, 2024

问题出在 \par 用在数学环境中会出错,需要对 \obeylines 的定义稍加调整。

\makeatletter
\begingroup
\catcode\active\active
\protected\gdef\mathobeylines{%
  \catcode\active\active \let^^M\math@obeylines}
\endgroup
\protected\def\math@obeylines{%
  \unless\ifmmode\expandafter\par\fi}

\newcommand\testE[2]{\item[5.]#1\par#2\par
	\ifteacher\begingroup\mathobeylines\expandafter\testEaux
	\else\expandafter\@gobble\fi}
\newcommand\testEaux[1]{\indent\color{red}#1\par\endgroup}
\makeatother

from forum.

rch2008 avatar rch2008 commented on August 12, 2024

十分感谢李老师的再次耐心解答,真心感谢!

from forum.

rch2008 avatar rch2008 commented on August 12, 2024

李老师,您好,最近用您写的代码有发现了一个新问题,之前我没有考虑到 tabular 环境,现在如果答案中包含 tabular 环境且用了 \hline 就会报错,不知道该怎么解决,尝试了一下用 @currenvir 去做判定,但是我没有做成功,不知道李老师有没有好办法能解决,麻烦您了。

\begin{itemize}
\testE{15}{设实数$x$$y$满足约束条件$\begin{cases}%
x\geqslant 0\
x\leqslant y\
x+y\geqslant 2
\end{cases}%
$,则$z=2x+y$的取值范围为 .
}%
{解:由约束条件$\begin{cases}%
x\geqslant 0\
x\leqslant y\
x+y\geqslant 2
\end{cases}%
$作出可行域如图,
化$z=2x+y$$y=-2x+z$,由图可知,当直线$y=-2x+z$$A$时,直线在$y$轴上的截距最小,$z$有最小值为$2$${\therefore}z=2x+y$的取值范围为$[2$$+\infty)$\hh\color{blue}故答案为:$[2$$+\infty)$\begin{tabular}{|c|c|c|c|}%\hline
$x$ & $(0$$\ln (2k))$ & $\ln (2k)$ & $(\ln (2k)$$k) $\
%\hline
$f'(x)$ & $-$ & $0$ & $+ $\
%\hline
$f(x)$ & ${\searrow}$ & 极小值 & ${\nearrow} $\
%\hline
\end{tabular}
}

@qinglee

from forum.

muzimuzhi avatar muzimuzhi commented on August 12, 2024

既然是新问题,建议使用新标题、开一个新 issue。

这样,既能方便用户「读标题以了解 issue 大意」,也可能提高搜索准确率。如果需要在新 issue 中引用当前 issue(#37),GitHub 也提供了多种便利方式

from forum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.