LyX 中的多项式长除法

LyX 中的多项式长除法

我在这里寻找一种显示多项式长除法的方法,并且我在这里读到有关的内容polynom.sty,但我的问题是是否有一种方法可以写出整个除法,而不仅仅是给出两个多项式作为输入。

我正在寻找一种方法来多项式的长除法。

如果您有任何建议我很乐意阅读!!

PS:我正在使用 LyX。

答案1

我知道这不是最好的方法,但我们还是开始吧......

(我之前尝试过一种更好的方法,但失败了。我给你我即兴的结果)

只需将多项式输入常规表格中,并使用分隔线来区分顶部和侧面。在 LyX 中,它看起来像这样:

lyx 中的长除法

编译后如下所示:

pdf 中的长除法

答案2

如果您不介意自己做代数运算,这可能会帮助您入门。

\documentclass{article}
\usepackage{mathtools}
\usepackage{xspace,xcolor}
\usepackage[display]{texpower}
\usepackage[screen,nopanel]{pdfscreen}

\margins{0.25in}{0.25in}{0.25in}{0.25in}
\screensize{4.5in}{6in}
\backgroundcolor{lightgray}

\newcommand{\ldsym}{$\left.\mathstrut\right)$}% unbalanced )
\newlength{\ldwidth}

\newcommand{\longdivide}[2]% #1 = denominator, #2 = numerator
{\settowidth{\ldwidth}{\ldsym}
$#1\,\raisebox{1.5pt}{\ldsym}\hspace*{-.65\ldwidth}\overline{
\mathstrut\hspace*{.35\ldwidth}\ #2}$}

\begin{document}
\stepwise{
\begin{center}
\begin{tabular}{r}
\bstep[\value{step}=1]{$7x$}\bstep[\value{step}=4]{$\strut+8$}\\
\longdivide{x^{2}-4x+1}{7x^{3}-20x^{2}-25x+8}\\
\bstep[\value{step}=2]{\underline{$7x^3-28x^2+7x$}}\hphantom{$\strut+8$}\\
\bstep[\value{step}=3]{$8x^2-32x+8$}\\
\bstep[\value{step}=5]{$8x^2-32x+8$}
\end{tabular}
\end{center}
}
\end{document}

滑动

答案3

据我所知,无法通过 LyX GUI\clinearray环境中使用。因此,要使用 GUI 创建表格结构,必须使用tabular:插入 --> 表格。这不是理想的解决方案,因为每个单元格都必须置于(内联)数学模式。下面的代码是一个.lyx带有示例的文件,将代码复制到文本编辑器中并将文件另存为something.lyx

注意事项:

  • 我不知道这是否是你喜欢的那种布局。
  • 通过表格工具栏添加线条,只需选择要加下划线的单元格,然后单击相应的按钮。
  • 通过在表格设置中添加自定义列声明,已从某些列中删除了列间距。右键单击单元格 --> 更多... --> 设置。在LaTeX 参数框中你会看到类似的内容@{}r,它会创建一个r右对齐的列,并且在删除列之前有列填充。
  • 加号前的空括号 ( {}) 是为了确保正确的间距。在书写 时$+4$,加号是一元关系,而带${}+4$是二元关系,这正是您想要的。
  • 我在第 1 行第 2 列添加了一个幻像),如下所示Peter Grill 的回答,以提高对齐效果。
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="5" columns="4">
<features tabularvalignment="middle">
<column alignment="center" valignment="top" width="0pt" special="@{}r">
<column alignment="center" valignment="top" width="0pt" special="@{}r">
<column alignment="center" valignment="top" width="0pt" special="@{}r@{}">
<column alignment="center" valignment="top" width="0pt" special="l">
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula $x^{2}$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula ${}+4x\phantom{)}$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula ${}+4$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula ${}:x+2=x+2$
\end_inset


\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula $-(x^{2}$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula ${}+2x)$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula $2x$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula ${}+4$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula $2x$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" bottomline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula ${}+4$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
\begin_inset Formula $0$
\end_inset


\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\end_body
\end_document

答案4

使用表格和边框。在 LyX 中:

在此处输入图片描述

PDF 输出:

在此处输入图片描述

(在网上搜索了一段时间后,这是我能找到的最简单、最好的解决方案。它基于 DalyaG 的回答。)

相关内容