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













1















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?










share|improve this question







New contributor




B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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













  • Thank you so much!

    – B. Lop
    13 hours ago
















1















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?










share|improve this question







New contributor




B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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













  • Thank you so much!

    – B. Lop
    13 hours ago














1












1








1








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?










share|improve this question







New contributor




B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question







New contributor




B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 13 hours ago









B. LopB. Lop

82




82




New contributor




B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






B. Lop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 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













  • Thank you so much!

    – B. Lop
    13 hours ago














  • 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













  • 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










1 Answer
1






active

oldest

votes


















1














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}


enter image description here



Changes taken:





  1. sum to sum


  2. { j=1} to _{j=1} (to make j=1 subscript)


  3. n to n. n is undefined, hence the compilation error


  4. n -1 to math mode

  5. 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:




  1. Remove all vertical lines

  2. Use booktabs, which provides toprule, midrule and bottomrule for beautiful tables

  3. 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}


enter image description here






share|improve this answer



















  • 3





    Maybe the code would be simpler with an array or a matrix environment?

    – Bernard
    13 hours ago












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.










draft saved

draft discarded


















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









1














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}


enter image description here



Changes taken:





  1. sum to sum


  2. { j=1} to _{j=1} (to make j=1 subscript)


  3. n to n. n is undefined, hence the compilation error


  4. n -1 to math mode

  5. 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:




  1. Remove all vertical lines

  2. Use booktabs, which provides toprule, midrule and bottomrule for beautiful tables

  3. 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}


enter image description here






share|improve this answer



















  • 3





    Maybe the code would be simpler with an array or a matrix environment?

    – Bernard
    13 hours ago
















1














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}


enter image description here



Changes taken:





  1. sum to sum


  2. { j=1} to _{j=1} (to make j=1 subscript)


  3. n to n. n is undefined, hence the compilation error


  4. n -1 to math mode

  5. 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:




  1. Remove all vertical lines

  2. Use booktabs, which provides toprule, midrule and bottomrule for beautiful tables

  3. 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}


enter image description here






share|improve this answer



















  • 3





    Maybe the code would be simpler with an array or a matrix environment?

    – Bernard
    13 hours ago














1












1








1







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}


enter image description here



Changes taken:





  1. sum to sum


  2. { j=1} to _{j=1} (to make j=1 subscript)


  3. n to n. n is undefined, hence the compilation error


  4. n -1 to math mode

  5. 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:




  1. Remove all vertical lines

  2. Use booktabs, which provides toprule, midrule and bottomrule for beautiful tables

  3. 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}


enter image description here






share|improve this answer













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}


enter image description here



Changes taken:





  1. sum to sum


  2. { j=1} to _{j=1} (to make j=1 subscript)


  3. n to n. n is undefined, hence the compilation error


  4. n -1 to math mode

  5. 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:




  1. Remove all vertical lines

  2. Use booktabs, which provides toprule, midrule and bottomrule for beautiful tables

  3. 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}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 13 hours ago









JouleVJouleV

11.4k22561




11.4k22561








  • 3





    Maybe the code would be simpler with an array or a matrix environment?

    – Bernard
    13 hours ago














  • 3





    Maybe the code would be simpler with an array or a matrix 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










B. Lop is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...

Castillo d'Acher Características Menú de navegación