How do I solve this type of question? I don't understand what im suppose to do. What does it mean "show two uses with different arguments?"
2 Answers
I don't understand what I'm supposed to do.
I'm virtually certain that you are supposed to
create a TeX or LaTeX command -- a "macro" in TeX jargon -- called
\summationwhich takes two arguments, andshow two uses of this macro, say,
\summation{n}{\alpha}and\summation{m}{\omega}.
Presumably, you are also supposed to create a sample PlainTeX or LaTeX document which (a) features the macro definition and the two uses of \summation and (b) compiles without crashing.
First, a PlainTeX-based solution:
\def\summation#1#2{\sum_{i=0}^{#1}#2_i} % use in math mode only
$\summation{n}{\alpha}$, $\summation{m}{\omega}$
\bye
Second, a LaTeX-based solution:
\documentclass{article}
\newcommand\summation[2]{\sum_{i=0}^{#1}#2_i} % use in math mode only
\begin{document}
$\summation{n}{\alpha}$, $\summation{m}{\omega}$
\end{document}
- 506,678
You can create this command by adding the following line in the preamble of your latex document:
\newcommand{\summation}[2]{$\sum\limits_{i=0}^{#1} #2 _i$}
And the question asks to use this command within text for different arguments. For example, you can add this code to the main latex file:
This is an example when we type \verb|\summation{n}{\alpha}|
within text yields \summation{n}{\alpha} and if we change parameters
as \verb|\summation{k}{\beta}| we get \summation{k}{\beta} after compilation.
after compiling you will get:
It is just to show that you have created a new command and you use it in your document in two different cases.
- 176
-
It's typographically rather questionable to use
\sum\limitsfor inline-math material. Moreover, the OP's explicitly given task is to show a summation operation with the limits of summation to the side of the summation symbol. – Mico Dec 16 '19 at 00:36 -
1
-


\newcommand{\summation}[2]{\ensuremath{\sum_{i=0}^{#1}#2_i}}. MWE:\documentclass{article} \newcommand{\summation}[2]{\ensuremath{\sum_{i=1}^{#1}#2_i}} \begin{document} \summation{n}{\alpha} \summation{m}{\beta} \end{document}. This site is not necessarily made for asking for solutions of homework problems. (I apologize for this comment if this is not a homework problem) – Dec 15 '19 at 19:10\ensuremath? That is clearly misplaced here. – Henri Menke Dec 16 '19 at 01:19