LaTeX forum ⇒ TeXworks ⇒ How to debug this code?

Information and discussion about TeXworks, an integrated LaTeX environment for several platforms
yaozhao
Posts: 55
Joined: Sat Oct 27, 2018 10:38 pm

How to debug this code?

Part a)  zero conditional mean assumption，$E(S|\epsilon=0)$

I want to type E(S|epsilon=0).

Johannes_B
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm
And where exactly is the problem? I think you are looking for \mid.
\documentclass{article}\begin{document}Part a)  zero conditional mean assumption，, $E(S\mid \epsilon=0)$\end{document}

Beware the difference between the comma as found on a regular keyboard and what you typed in. -> Unicode Character 'FULLWIDTH COMMA' (U+FF0C)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

yaozhao
Posts: 55
Joined: Sat Oct 27, 2018 10:38 pm
Q1: I know where the problem is. | should be coded as \mid. What's the difference? I can also type | usually in TeXworks.

Q2: Another problem is that yesterday you told me the tilde in LaTeX is an unbreakable space. Thus, I tried to use this idea in my code:

multiple linear regression model $S_i = \alpha + \beta_1~Aid_i + \beta_2 inc_i + \beta_3 sts_i + \epsilon_i$

Conversely, adding a tilde will cause a space. If I just enter a space keyboard like other coefficients, then there is no space. Why is that?

Johannes_B
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm
See https://tex.stackexchange.com/questions ... rt-divides for the first question. What you need depends on the math you are doing.

To the second question: There are no spaces in math mode as far as TeX is concerned. If you want a space, you need to use a special command depending on the amount of space you need. What you have as Aid in your code is typed out as A times i times d, a sequence of factors. If Aid is the word Aid (i.e. help or assistence), you need to use something else.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.