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
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

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
(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, doesRtake 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