Undefined Control Sequence (with installed package)?Generating tables with @for commandUsing columncolor...
Why is this code 6.5x slower with optimizations enabled?
Concept of linear mappings are confusing me
Is there a familial term for apples and pears?
The use of multiple foreign keys on same column in SQL Server
Email Account under attack (really) - anything I can do?
How old can references or sources in a thesis be?
How does one intimidate enemies without having the capacity for violence?
Prevent a directory in /tmp from being deleted
My colleague's body is amazing
A Journey Through Space and Time
How to make payment on the internet without leaving a money trail?
Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).
Are white and non-white police officers equally likely to kill black suspects?
I see my dog run
What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?
What is the command to reset a PC without deleting any files
What is the offset in a seaplane's hull?
What is the meaning of "of trouble" in the following sentence?
Non-Jewish family in an Orthodox Jewish Wedding
How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?
What makes Graph invariants so useful/important?
Why was the small council so happy for Tyrion to become the Master of Coin?
XeLaTeX and pdfLaTeX ignore hyphenation
What does "enim et" mean?
Undefined Control Sequence (with installed package)?
Generating tables with @for commandUsing columncolor outside column definitionProblems with toprule and midrule in a tableeqparbox causes error for hline and hdashlineGreek letters do not function inside tabular even with dollar signUndefined control sequence with table xcolor packageProblem aligning decimals in multi-column tableError with own environment using ltablex“Undefined control sequence” Regression table from StataHaving trouble understanding the tabular environment
I am trying to make a table that includes sums. This is what my code looks like:
begin{center}
begin{tabular}{ || c c c c || }
hline
Line & Cost & Executions \ [0.5ex]
hlinehline
1 & $c_1$ & n -1 \
hline
2 & $c_2$ & $sum{ j=1}^{n} j$ \
hline
3 & $c_3$ & $sum{ j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum{ j=1}^{n} j - 1$ \ [lex]
hline
end{tabular}
end{center}
I get the error that the first line including a sum has an undefined control sequence. I have the package: usepackage{amsmath}.
Any ideas how to fix this?
tables
New contributor
add a comment |
I am trying to make a table that includes sums. This is what my code looks like:
begin{center}
begin{tabular}{ || c c c c || }
hline
Line & Cost & Executions \ [0.5ex]
hlinehline
1 & $c_1$ & n -1 \
hline
2 & $c_2$ & $sum{ j=1}^{n} j$ \
hline
3 & $c_3$ & $sum{ j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum{ j=1}^{n} j - 1$ \ [lex]
hline
end{tabular}
end{center}
I get the error that the first line including a sum has an undefined control sequence. I have the package: usepackage{amsmath}.
Any ideas how to fix this?
tables
New contributor
1
It issum
, notsum
, and_{j=1}
, not{j=1}
, and^n
or^{n}
, not^{n}
, and[1ex]
, not[lex]
.
– JouleV
13 hours ago
Thank you so much!
– B. Lop
13 hours ago
add a comment |
I am trying to make a table that includes sums. This is what my code looks like:
begin{center}
begin{tabular}{ || c c c c || }
hline
Line & Cost & Executions \ [0.5ex]
hlinehline
1 & $c_1$ & n -1 \
hline
2 & $c_2$ & $sum{ j=1}^{n} j$ \
hline
3 & $c_3$ & $sum{ j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum{ j=1}^{n} j - 1$ \ [lex]
hline
end{tabular}
end{center}
I get the error that the first line including a sum has an undefined control sequence. I have the package: usepackage{amsmath}.
Any ideas how to fix this?
tables
New contributor
I am trying to make a table that includes sums. This is what my code looks like:
begin{center}
begin{tabular}{ || c c c c || }
hline
Line & Cost & Executions \ [0.5ex]
hlinehline
1 & $c_1$ & n -1 \
hline
2 & $c_2$ & $sum{ j=1}^{n} j$ \
hline
3 & $c_3$ & $sum{ j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum{ j=1}^{n} j - 1$ \ [lex]
hline
end{tabular}
end{center}
I get the error that the first line including a sum has an undefined control sequence. I have the package: usepackage{amsmath}.
Any ideas how to fix this?
tables
tables
New contributor
New contributor
New contributor
asked 13 hours ago
B. LopB. Lop
82
82
New contributor
New contributor
1
It issum
, notsum
, and_{j=1}
, not{j=1}
, and^n
or^{n}
, not^{n}
, and[1ex]
, not[lex]
.
– JouleV
13 hours ago
Thank you so much!
– B. Lop
13 hours ago
add a comment |
1
It issum
, notsum
, and_{j=1}
, not{j=1}
, and^n
or^{n}
, not^{n}
, and[1ex]
, not[lex]
.
– JouleV
13 hours ago
Thank you so much!
– B. Lop
13 hours ago
1
1
It is
sum
, not sum
, and _{j=1}
, not {j=1}
, and ^n
or ^{n}
, not ^{n}
, and [1ex]
, not [lex]
.– JouleV
13 hours ago
It is
sum
, not sum
, and _{j=1}
, not {j=1}
, and ^n
or ^{n}
, not ^{n}
, and [1ex]
, not [lex]
.– JouleV
13 hours ago
Thank you so much!
– B. Lop
13 hours ago
Thank you so much!
– B. Lop
13 hours ago
add a comment |
1 Answer
1
active
oldest
votes
Completed code:
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{ || Sc Sc Sc Sc || }
hline
Line & Cost & Executions \
hlinehline
1 & $c_1$ & $n -1$ \
hline
2 & $c_2$ & $sum_{j=1}^{n} j$ \
hline
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
hline
end{tabular}
end{center}
end{document}
Changes taken:
sum
tosum
{ j=1}
to_{j=1}
(to makej=1
subscript)
n
ton
.n
is undefined, hence the compilation error
n -1
to math mode- Use
cellspace
to adjust height of cells instead of manually adding[1ex]
, etc., which is worse. Btw it is[1ex]
instead of[lex]
Recommended table:
- Remove all vertical lines
- Use
booktabs
, which providestoprule
,midrule
andbottomrule
for beautiful tables - Make phantom height so that all rows have the same height
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
usepackage{booktabs}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{Sc Sc Sc Sc}
toprule
Line & Cost & Executions \
midrule
1 & $c_1$ & $n -1vphantom{sum_{j=1}^n}$ \
2 & $c_2$ & $sum_{j=1}^{n} j$ \
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
bottomrule
end{tabular}
end{center}
end{document}
3
Maybe the code would be simpler with anarray
or amatrix
environment?
– Bernard
13 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
B. Lop is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483687%2fundefined-control-sequence-with-installed-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Completed code:
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{ || Sc Sc Sc Sc || }
hline
Line & Cost & Executions \
hlinehline
1 & $c_1$ & $n -1$ \
hline
2 & $c_2$ & $sum_{j=1}^{n} j$ \
hline
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
hline
end{tabular}
end{center}
end{document}
Changes taken:
sum
tosum
{ j=1}
to_{j=1}
(to makej=1
subscript)
n
ton
.n
is undefined, hence the compilation error
n -1
to math mode- Use
cellspace
to adjust height of cells instead of manually adding[1ex]
, etc., which is worse. Btw it is[1ex]
instead of[lex]
Recommended table:
- Remove all vertical lines
- Use
booktabs
, which providestoprule
,midrule
andbottomrule
for beautiful tables - Make phantom height so that all rows have the same height
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
usepackage{booktabs}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{Sc Sc Sc Sc}
toprule
Line & Cost & Executions \
midrule
1 & $c_1$ & $n -1vphantom{sum_{j=1}^n}$ \
2 & $c_2$ & $sum_{j=1}^{n} j$ \
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
bottomrule
end{tabular}
end{center}
end{document}
3
Maybe the code would be simpler with anarray
or amatrix
environment?
– Bernard
13 hours ago
add a comment |
Completed code:
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{ || Sc Sc Sc Sc || }
hline
Line & Cost & Executions \
hlinehline
1 & $c_1$ & $n -1$ \
hline
2 & $c_2$ & $sum_{j=1}^{n} j$ \
hline
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
hline
end{tabular}
end{center}
end{document}
Changes taken:
sum
tosum
{ j=1}
to_{j=1}
(to makej=1
subscript)
n
ton
.n
is undefined, hence the compilation error
n -1
to math mode- Use
cellspace
to adjust height of cells instead of manually adding[1ex]
, etc., which is worse. Btw it is[1ex]
instead of[lex]
Recommended table:
- Remove all vertical lines
- Use
booktabs
, which providestoprule
,midrule
andbottomrule
for beautiful tables - Make phantom height so that all rows have the same height
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
usepackage{booktabs}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{Sc Sc Sc Sc}
toprule
Line & Cost & Executions \
midrule
1 & $c_1$ & $n -1vphantom{sum_{j=1}^n}$ \
2 & $c_2$ & $sum_{j=1}^{n} j$ \
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
bottomrule
end{tabular}
end{center}
end{document}
3
Maybe the code would be simpler with anarray
or amatrix
environment?
– Bernard
13 hours ago
add a comment |
Completed code:
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{ || Sc Sc Sc Sc || }
hline
Line & Cost & Executions \
hlinehline
1 & $c_1$ & $n -1$ \
hline
2 & $c_2$ & $sum_{j=1}^{n} j$ \
hline
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
hline
end{tabular}
end{center}
end{document}
Changes taken:
sum
tosum
{ j=1}
to_{j=1}
(to makej=1
subscript)
n
ton
.n
is undefined, hence the compilation error
n -1
to math mode- Use
cellspace
to adjust height of cells instead of manually adding[1ex]
, etc., which is worse. Btw it is[1ex]
instead of[lex]
Recommended table:
- Remove all vertical lines
- Use
booktabs
, which providestoprule
,midrule
andbottomrule
for beautiful tables - Make phantom height so that all rows have the same height
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
usepackage{booktabs}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{Sc Sc Sc Sc}
toprule
Line & Cost & Executions \
midrule
1 & $c_1$ & $n -1vphantom{sum_{j=1}^n}$ \
2 & $c_2$ & $sum_{j=1}^{n} j$ \
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
bottomrule
end{tabular}
end{center}
end{document}
Completed code:
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{ || Sc Sc Sc Sc || }
hline
Line & Cost & Executions \
hlinehline
1 & $c_1$ & $n -1$ \
hline
2 & $c_2$ & $sum_{j=1}^{n} j$ \
hline
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
hline
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
hline
end{tabular}
end{center}
end{document}
Changes taken:
sum
tosum
{ j=1}
to_{j=1}
(to makej=1
subscript)
n
ton
.n
is undefined, hence the compilation error
n -1
to math mode- Use
cellspace
to adjust height of cells instead of manually adding[1ex]
, etc., which is worse. Btw it is[1ex]
instead of[lex]
Recommended table:
- Remove all vertical lines
- Use
booktabs
, which providestoprule
,midrule
andbottomrule
for beautiful tables - Make phantom height so that all rows have the same height
documentclass{article}
usepackage{amsmath}
usepackage{cellspace}
usepackage{booktabs}
setlength{cellspacetoplimit}{2pt}
setlength{cellspacebottomlimit}{2pt}
begin{document}
begin{center}
begin{tabular}{Sc Sc Sc Sc}
toprule
Line & Cost & Executions \
midrule
1 & $c_1$ & $n -1vphantom{sum_{j=1}^n}$ \
2 & $c_2$ & $sum_{j=1}^{n} j$ \
3 & $c_3$ & $sum_{j=1}^{n} j - 1$ \
4 & $c_4$ & $sum_{j=1}^{n} j - 1$ \
bottomrule
end{tabular}
end{center}
end{document}
answered 13 hours ago
JouleVJouleV
11.4k22561
11.4k22561
3
Maybe the code would be simpler with anarray
or amatrix
environment?
– Bernard
13 hours ago
add a comment |
3
Maybe the code would be simpler with anarray
or amatrix
environment?
– Bernard
13 hours ago
3
3
Maybe the code would be simpler with an
array
or a matrix
environment?– Bernard
13 hours ago
Maybe the code would be simpler with an
array
or a matrix
environment?– Bernard
13 hours ago
add a comment |
B. Lop is a new contributor. Be nice, and check out our Code of Conduct.
B. Lop is a new contributor. Be nice, and check out our Code of Conduct.
B. Lop is a new contributor. Be nice, and check out our Code of Conduct.
B. Lop is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483687%2fundefined-control-sequence-with-installed-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
It is
sum
, notsum
, and_{j=1}
, not{j=1}
, and^n
or^{n}
, not^{n}
, and[1ex]
, not[lex]
.– JouleV
13 hours ago
Thank you so much!
– B. Lop
13 hours ago