Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

LaTeX How to determine leaving space after \

  1. May 26, 2017 #1
    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: May 26, 2017
  2. jcsd
  3. May 26, 2017 #2

    DrClaude

    User Avatar

    Staff: Mentor

    \ 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.
     
  4. May 26, 2017 #3
    ##\ \displaystyle a=\frac{dv}{dt} \ ##

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

    Here that square does not appear.

    Thank you.
     
  5. May 26, 2017 #4

    DrClaude

    User Avatar

    Staff: Mentor

    Because you left a space between \ and #.
     
  6. May 26, 2017 #5
    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.
     
  7. May 26, 2017 #6
  8. May 26, 2017 #7

    DrClaude

    User Avatar

    Staff: Mentor

    You seem to have found some links on your own. But this is language specific, so lets stick to LaTeX. One a \ appears in LaTeX, what happens depends on what immediately follows it.


    Just Google "escape character".
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted