请帮助我格式化代码:
- 将数值放置在因子菱形的 4 个象限中
- 中心号码之内因子框表和将数字置于中心位于顶行 2 个单元格上方
- 将数字放到第一列中每个单元格的左侧
注意:显示的数字对于因数来说并不正确。我只是粘贴了图像以供说明。
当然,数字和变量会因问题而异。正如你从我的 MWE 中看到的,解决方案集采用 2 列格式。
非常感谢!如果没有您的慷慨帮助,我会不知所措。
最大误差.....
\documentclass[12pt]{exam}
%\printanswers % un-comment to print solutions.
\printanswers
\renewcommand{\solutiontitle}{}
\usepackage{multirow, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{array}
% p centers horizontally in table cell
% m centers vertically in table cell
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}
\usepackage{amsmath}
\usepackage{cancel}
\usepackage{graphicx}
\usepackage{pgfplots}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{framed}
\usepackage{tkz-euclide}
\usepackage{multicol}
\usepackage{tasks}
\pgfplotsset{compat=1.10}
\usepackage[a4paper,margin=0.5in,include head]{geometry}
\everymath{\displaystyle}
\setlength\parindent{1em}
\pagestyle{head}
\header{Algebra II Review Ch 3.2: Operations Rational Expressions and Equations: K E Y}
{}
{01/13-14/21}
\newcommand{\pagetop}{%
\noindent
\fbox{\fbox{\parbox{\dimexpr\textwidth-4\fboxsep-4\fboxrule}{
\textbf {Obj. 3.2.a: I can simplify factored rational expressions and find their restrictions.
\bigskip
\bigskipSimplify expression and state the excluded values (+1 pt numerator, +1 pt denominator, +1 pt restrictions.) each equation. Show all work/steps on this page.}
}}}
\bigskip
\vspace{0.5mm}
}
\settasks{after-item-skip=1em,
after-skip=2cm,
label-width=2em,
item-indent=3em,
label=(\arabic*),
column-sep=2em
}
% ------------ DOCUMENT STARTS HERE----------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%definition for bigskip = 1 line to replace all \bigskip
\def\bigskip{\vskip\bigskipamount}
%macro \diamondscheme. The lines are drawn too, you need not tikz. The size is controlled by the \diaw parameter. It is set to 1.5cm in this example.
% definition
\newdimen\diaw \diaw=1.5cm
\def\diamondscheme#1#2#3#4{%
\vbox to\diaw{
\kern-1ex
\hbox to\diaw{\hss$#1$\hss}
\vss
\hbox to\diaw{\hbox to0pt{\hss$#2$\hss}\hss
\raise.7ex\hbox{\diacross}\hss
\hbox to0pt{\hss$#3$\hss}}
\vss
\hbox to\diaw{\hss$#4$\hss}
\kern-1ex
}
}
\newcount\tmpnum
\tmpnum=\diaw
\divide\tmpnum by65781 % tmpnum is now equal to \diaw in bp units
\divide\tmpnum by2
\def\tmp{\the\tmpnum\space}
\edef\diacross{\pdfliteral
{q 0.4 w -\tmp \tmp m \tmp -\tmp l S -\tmp -\tmp m \tmp \tmp l S Q}}
\begin{tasks}
[style=enumerate](2)
% Prob #1
\task $\dfrac{10k^2+32k+24}{1k5+18}$
\begin{solutionorbox}[5cm]
Factor 2 out of the numerator.\bigskip
$\dfrac{2(5k^2+16k+12)} {15k+18}$\bigskip
Now factor the numerator using diamond method.
\bigskip
%call diamondscheme macro
\hspace{2cm}
\diamondscheme{60}{10}{6}{16}
\bigskip
The 5 in front of $5k^2$ means this is a non-monic quadratic trinomial. So you must proceed to the box method to complete the factorization.
\vspace{0.75cm}
%Example of fixed column width and text long (array package required)
% for the vertical padding / row height
\hspace{1cm}
{\renewcommand{\arraystretch}{1.5}
\begin{tabular}{ | m{5em} | m{2cm}| m{2cm} | }
\hline
$x^2$ & $6x$ \\
\hline
$2x$ & $12$ \\
\hline
\end{tabular}
}
\vspace{0.5cm}
\bigskip
simplified form: $7x$
Zeros: $x=0$
Holes: $none$
VA: $none$
\end{solutionorbox}
% Prob #2
\task $\dfrac{3x^2-13x-10}{x-5}$
\begin{solutionorbox}[5cm]
$\dfrac{3x^2-13x-10}{x-5}$\bigskip
Nothing can be factored out of the numerator and denominator.
Now factor the numerator using diamond method.
\bigskip
%call diamondscheme macro
\hspace{2cm}
\diamondscheme{-30}{-15}{2}{-13}
\bigskip
The 3 in front of $3k^2$ means this is a non-monic quadratic trinomial. So you must proceed to the box method to complete the factorization.
\vspace{0.75cm}
%Example of fixed column width and text long (array package required)
% for the vertical padding / row height
\hspace{1cm}
{\renewcommand{\arraystretch}{1.5}
\begin{tabular}{ | m{5em} | m{2cm}| m{2cm} | }
\hline
$x^2$ & $6x$ \\
\hline
$2x$ & $12$ \\
\hline
\end{tabular}
}
\vspace{0.5cm}
simplified form: $?$
Zeros: $x=0$
Holes: $none$
VA: $none$
\end{solutionorbox}
\end{tasks}
\end{document}
答案1
你的问题 1 应该可以通过以下宏来解决\diamondscheme
。线条也会被绘制,你不需要 tikz。尺寸由参数控制\diaw
。在这个例子中,它设置为 1.5cm。
% definition
\newdimen\diaw \diaw=1.5cm
\def\diamondscheme#1#2#3#4{%
\vbox to\diaw{
\kern-1ex
\hbox to\diaw{\hss$#1$\hss}
\vss
\hbox to\diaw{\hbox to0pt{\hss$#2$\hss}\hss
\raise.7ex\hbox{\diacross}\hss
\hbox to0pt{\hss$#3$\hss}}
\vss
\hbox to\diaw{\hss$#4$\hss}
\kern-1ex
}
}
\newcount\tmpnum
\tmpnum=\diaw
\divide\tmpnum by65781 % tmpnum is now equal to \diaw in bp units
\divide\tmpnum by2
\def\tmp{\the\tmpnum\space}
\edef\diacross{\pdfliteral
{q 0.4 w -\tmp \tmp m \tmp -\tmp l S -\tmp -\tmp m \tmp \tmp l S Q}}
%test:
\diamondscheme{20}{-4}{-5}{-9}
根据\\
文档中的内容。仔细阅读日志文件。Underfull \hbox
这里的每个警告都是\\
不正确使用的。如果您想在段落后添加一行空格,请\bigskip
通过以下方式重新定义 LaTeX:
\def\bigskip{\vskip\bigskipamount}
并将所有内容替换\\
为\bigskip
。当然,不要在tabular
环境中执行此替换,因为环境\\
使用正确。注意:原始 LaTeX\bigskip
是\vadjust{\vskip\bigskipamount}
,它不会完成当前段落,只会带来问题。
请注意,您的日志中也有一个Overfull \hbox
。这是由于第二个错误的 LaTeX 概念:它插入\leavemode
到由 LaTeX 创建的每个框之前。因此,您\fbox
的定义中的向右\pagetop
移动了。在此之前插入\indent
\noindent
\fbox