Cannot typeset an equation correctly

Cannot typeset an equation correctly



I'm trying to typeset the following equation, but I get complaints about 'missing $ inserted'.


beginequation labelPearson
begintabulary 18cmL R @ >$c<$ @ L
&Sim_a,b^PCC& =
& $displaystyle frac
sum_Pin P( r_a,p - overline ra)( r_b,p - overlinerb) %
sqrtsum_Pin P( r_a,p - overlinera)^2
sqrtsum_Pin P( r_b,p - overlinerb)^2$
endtabulary
endequation






(1) Welcome, (2) full minimal example please. How are L, 'R` etc defined? NMormally these are lower case. (3) You have math in call 2, does R take case of this? Now you know why we always ask for a full minimal example that others can copy and test withoput adding anything or having to guess.

– daleif
Sep 18 '18 at 12:23


L


R






tabulary is designed for tables with large amounts of text to adjust line breaking, you almost certainly should not be using it here at all, this seems to be a math alignment so align or aligned would be more suitable. the error is because you have math markup _ and ^ in the R column which is a text column.

– David Carlisle
Sep 18 '18 at 12:43


tabulary


align


aligned


_


^


R






@daleif tabulary columns are LCR (but using `tabulary with math is somewhat strange!)

– David Carlisle
Sep 18 '18 at 12:44




1 Answer
1



I can see no reason for employing a 4-column tabulary environment; an equation environment is all you need.


tabulary


equation



I would, though, replace all instances of overline with bar. And it should be sum_pin P rather than sum_Pin P, and barr_a and barr_b rather than barra and barrb, right?


overline


bar


sum_pin P


sum_Pin P


barr_a


barr_b


barra


barrb



If you have several equations which need to be aligned on their respective = symbols, do look into employing the align environment (provided by the amsmath package).


=


align


amsmath



enter image description here


documentclassarticle
begindocument
beginequation labelPearson
mathitSim_a,b^mathrmPCC = frac%
sum_pin P( r_a,p-barr_a)(r_b,p- barr_b) %
sqrtsum_pin P(r_a,p-barr_a)^2
sqrtsum_pin P(r_b,p-barr_b)^2
endequation
enddocument



Thanks for contributing an answer to TeX - LaTeX Stack Exchange!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

How do I collapse sections of code in Visual Studio Code for Windows?

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ