LaTeX forum ⇒ TeXworksHow to debug this code?

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

How to debug this code?

Postby yaozhao » Thu May 09, 2019 4:16 am

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


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

Many thanks in advance!

User avatar
Johannes_B
Site Moderator
Posts: 4004
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu May 09, 2019 7:49 am

And where exactly is the problem? I think you are looking for \mid.
  1. \documentclass{article}
  2. \begin{document}
  3. Part a) zero conditional mean assumption,, $E(S\mid \epsilon=0)$
  4. \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: 35
Joined: Sat Oct 27, 2018 10:38 pm

Postby yaozhao » Thu May 09, 2019 1:43 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:

  1. 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?

User avatar
Johannes_B
Site Moderator
Posts: 4004
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri May 10, 2019 3:00 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.


Return to “TeXworks”

Who is online

Users browsing this forum: No registered users and 1 guest