How to determine leaving space after \

  • Context: LaTeX 
  • Thread starter Thread starter mech-eng
  • Start date Start date
  • Tags Tags
    Space
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
6 replies · 2K views
mech-eng
Messages
826
Reaction score
13
Would you explain when the space should be left when backslash, \, is used?

For example some codes using backslash.
\ \displaystyle a=\frac{dv}{dt} \ : This one works good because there is space between the first two backslashes.

But if the space between the first backslash is removed the code does not work
##\\displaystyle a= \frac{dv}{dt} \##

And there should be a space between the last backslash and the last numbersign pair, ##.
Would you please explan this?

Thank you.
 
Last edited:
Physics news on Phys.org
\ is what is known as an escape character. In the example where it doesn't work, you have \\, which corresponds to a newline, and \# which produces #, so that the closing ## is not present.
 
##\ \displaystyle a=\frac{dv}{dt} \ ##

##\\displaystyle a= \frac{dv}{dt} \ ##

Here that square does not appear.

Thank you.
 
mech-eng said:
Here that square does not appear.
Because you left a space between \ and #.
 
DrClaude said:
\ is what is known as an escape character. In the example where it doesn't work, you have \\, which corresponds to a newline, and \# which produces #, so that the closing ## is not present.

Sorry for my being amateur, but to understand this answer will take some time for me and the questions might cause some new ones. This means you might get tired.

What if double \\ corresponds to a new line? I do not know this case. You might give me a link explaning this basic programming step, \\, so that I could learn by reading.

P.S: I cannot access wikipedia because of some political reasons but I migth try google cache.Thank you.
 
mech-eng said:
What if double \\ corresponds to a new line? I do not know this case. You might give me a link explaning this basic programming step, \\, so that I could learn by reading.
You seem to have found some links on your own. But this is language specific, so let's stick to LaTeX. One a \ appears in LaTeX, what happens depends on what immediately follows it.
mech-eng said:
P.S: I cannot access wikipedia because of some political reasons but I migth try google cache.
Just Google "escape character".