Comments (4)
问题出在 \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.
十分感谢李老师的再次耐心解答,真心感谢!
from forum.
李老师,您好,最近用您写的代码有发现了一个新问题,之前我没有考虑到 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}
}
from forum.
既然是新问题,建议使用新标题、开一个新 issue。
这样,既能方便用户「读标题以了解 issue 大意」,也可能提高搜索准确率。如果需要在新 issue 中引用当前 issue(#37),GitHub 也提供了多种便利方式。
from forum.
Related Issues (20)
- 如何在标题页插入背景图的情况下修改使标题上移 HOT 2
- 希望在同一 tabular 的多个 cell 内生成不同的多个脚注 HOT 3
- 如何增加"不能出现在行首" 的符号 HOT 11
- 如何实现源代码和生成的表格都出现在生成的pdf文件上? HOT 4
- error
- 超页面问题 HOT 2
- 如何让“摘要”出现在目录中,但不要显示后面的“......页码” HOT 10
- 应用需求:识别传递的参数中 `{}` 的数量 HOT 6
- 空白页控制问题 HOT 10
- 命令可选参数键值的值为 LaTeX3 的 cs 的可行性 HOT 3
- 关于 `ntheorem` 和 `amsthm` 中的 `\qedhere` 优化问题 HOT 5
- 给特殊符号设置xeCJKsetcharclass,并打开CJKmath,特殊符号仍不能直接用于数学模式 HOT 9
- `\keys_define:nn` 中 `.initial:n` 失效的问题 HOT 15
- `xampl.bib` 无法用于 `gbt7714` 包和 `natbib` 的 `authoryear` 模式吗? HOT 8
- 安装ctex时报错 HOT 1
- 如何在每一章的指定位置插入边注 HOT 8
- \newtheorem和amsthm冲突问题 HOT 7
- 如何优雅的让行内公式换行? HOT 4
- datetime2宏包如何在使用xelatex编译时取当前详细时间(秒数+时区)并转换为东八区 HOT 13
- 采用 listings 宏包排代码,代码里的汉字之间有空格 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forum.