Escaping backslashes

Lucas Burke's Avatar

Lucas Burke

11 Aug, 2014 08:22 PM

Fletcher,

When going to latex, both \ and \\ are converted to \textbackslash{}. Would it be useful for one of those to convert to a literal backslash?

I type a lot of abbreviations that end in periods and so I have to surround a lot of stuff in HTML comments so that the backslash will not be converted and I can escape the subsequent space so that it is not turned into a sentence space. Does that make sense? In other words, that is the only way I’ve been able to get, for example, “he moved to Mass.\ in May” into my tex file. I write a ton of them because I need to abbreviate all of my law citations.

I would appreciate any suggestions.

Best,
Lucas.

  1. Support Staff 1 Posted by fletcher on 16 Aug, 2014 01:52 PM

    fletcher's Avatar

    If you escape a space ("\ "), what would end up in the output is simply a space(" "), which would not do what you want. (It doesn't happen this way because a space character is not recognized as something that can be escaped, since there isn't any reason to escape a space character in HTML).

    What you're doing is specific to LaTeX, not other formats, and specific to only a subset of MMD/LaTeX users.

    What I would suggest is a custom pre-processor that converts "\ " to the HTML comment version so that you don't have to do this manually. Alternatively a TextExpander snippet could do this for you while typing the source.

    Fletcher

  2. fletcher closed this discussion on 16 Aug, 2014 01:52 PM.

  3. Lucas Burke re-opened this discussion on 16 Aug, 2014 02:05 PM

  4. 2 Posted by Lucas Burke on 16 Aug, 2014 02:05 PM

    Lucas Burke's Avatar

    OK, thanks.

    Best,
    Lucas

  5. fletcher closed this discussion on 23 Nov, 2014 05:35 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

11 Dec, 2022 09:57 PM
11 Dec, 2022 07:57 PM
26 Sep, 2022 02:40 AM
21 Jul, 2022 10:22 AM
11 Jan, 2022 02:33 PM

Recent Articles