How to determine leaving space after \

  • Context: LaTeX 
  • Thread starter Thread starter mech-eng
  • Start date Start date
  • Tags Tags
    Space
Click For Summary

Discussion Overview

The discussion centers around the use of the backslash (\) in programming and typesetting, particularly in LaTeX. Participants explore when to leave spaces after the backslash and the implications of doing so in various contexts, including code examples and escape characters.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant asks for clarification on when to leave space after the backslash, providing examples where spacing affects functionality.
  • Another participant explains that the backslash is an escape character and discusses how double backslashes correspond to newlines, while a single backslash followed by a hash produces a hash symbol.
  • A participant notes that the square does not appear in their example due to the space left between the backslash and the hash.
  • Some participants express uncertainty about the implications of double backslashes and request additional resources for understanding this programming concept.
  • Links to external resources are shared for further reading on related questions, emphasizing the context of LaTeX.
  • There is a suggestion to focus on LaTeX specifically, as the behavior of the backslash can vary depending on what follows it.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding the use of the backslash and its implications. There is no consensus on the best approach to explaining the nuances of its use, and some questions remain unresolved.

Contextual Notes

Participants mention limitations in accessing certain resources, which may affect their ability to fully grasp the concepts discussed. The discussion also highlights the dependency on specific programming languages and contexts.

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

Similar threads

  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
9K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K