# How to add a tab or space in docs?

**URL:** https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425
**Category:** New to Julia
**Tags:** question, markdown
**Created:** [September 2, 2018, 6:50am UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425 "2018-09-02T06:50:59Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [September 2, 2018, 6:50am UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/1 "2018-09-02T06:50:59Z")

</div>

hello,

I could not find things about how to add a tab (or space) in docs markdown. Anyone could please help? Thanks.

```julia

"""
a new line after this \\\n is ok.

a tab after this \\\t is NOT ok.
"""
function f()
  1
end

help?> f
search: f fd for fma fld fft full fld1 find filt fill fft! fdio frexp foldr foldl flush floor float first findn filt!

  a new line after this
   is ok.

  a tab after this \ is NOT ok.

```

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [September 2, 2018, 7:01am UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/2 "2018-09-02T07:01:01Z")

</div>

Why do you need tabs in Markdown? I think they are just equivalent to space. If you want to use them in code blocks, no special syntax is required:

```julia
julia> """
       `A\tA`
       
       `A A`
       """
       f()
f

help?> f
search: f fd for fma fld fld1 fill fdio frexp foldr foldl flush floor float first fill! fetch fldmod filter falses finally foreach fldmod1 findmin findmax findall filter! function Float64

  A A

  A A

```

---

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [September 3, 2018, 3:39am UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/3 "2018-09-03T03:39:24Z")

</div>

using v0.7.0, I could not produce what like u did:

```julia
julia> """
       `a\nb`

       `a\tb`

       `a b`

       """
       function f()
         1
       end
f

help?> f
search: f fd for fma fld fft full fld1 find filt fill fft! fdio frexp foldr foldl flush floor float first findn filt!

  a b

  a b

  a b

```

for the needs of tabs … I mean, it’s always good to have better control of spacing and indentation…

also, the behavior of escape-tab (not within a code block) is kind of _ **weird** _, consider the following:

- `\\\t` produces `\`
- `\\t` produces `\t`
- `\t` produces nothing

is it a “ **bug** ”? If it is, where should I go? Is it related to the codes in `stdlib/Markdown`? Also noted that the official documentation (v0.7.0, v1.0.0, v1) is empty on `Markdown`.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [September 3, 2018, 6:10am UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/4 "2018-09-03T06:10:33Z")

</div>

For me everything works fine on 0.7 and 1.0 (which should be the same, of course):

```julia
julia> """
       `a\nb`
       
       `a\tb`
       
       `a b`
       """
       function f()
         1
       end
f

help?> f
search: f fd for fma fld fft full fld1 find filt fill fft! fdio frexp foldr foldl flush floor

  a b

  a b

  a b

julia> VERSION
v"0.7.0"

```

It may be something with the interface you are using (is it the REPL directly)?

> [@tomtom](#):
>
> for the needs of tabs … I mean, it’s always good to have better control of spacing and indentation…

You shouldn’t ever user tabs, especially in Julia, only spaces, and your editor should help you with indentation.

---

<div class="post-metadata">

### Author: ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)
#### Post date: [September 3, 2018, 6:28am UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/5 "2018-09-03T06:28:49Z")

</div>

Using TABs for formatting can lead to unexpected spacing.

You don’t believe me? Look at this thread 😉 Just avoid them, as @Tamas_Papp already said. Spaces are fixed size, no matter what editor or viewer use use, thus they are totally predictable and consistent.

---

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [September 3, 2018, 7:18am UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/6 "2018-09-03T07:18:08Z")

</div>

I mean, tab could be (or should be) avoided in coding. But what about for **_docs_**?

Now, **markdown** is used inside a **_doc_** (i.e. between `"""`s), and **multiple spaces are simply ignored**! In HTML, I could use things like `<br>`, `&nbsp;` or `&#09;` to control spacing.

Somehow, in my (mac version) of v0.7.0, only `\\\n` works so far…

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [September 3, 2018, 7:49am UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/7 "2018-09-03T07:49:47Z")

</div>

> [@tomtom](#):
>
> tab could be (or should be) avoided in coding. But what about for _ **docs** _ ?

The same. Especially within fenced code in Markdown.

> [@tomtom](#):
>
> **multiple spaces are simply ignored**

If this comes as a surprise, perhaps you should invest in learning Markdown first. The [manual](https://docs.julialang.org/en/stable/manual/documentation/#Markdown-syntax-1) is a reasonable start.

---

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [September 3, 2018, 12:41pm UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/8 "2018-09-03T12:41:01Z")

</div>

ok. thanks… I mean, HTML provides control over spaces, so should Markdown… anyway, it’s not a big issue.

the last question to ask is: are these docs formatting related to the codes in `stdlib/Markdown` ?

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [September 3, 2018, 12:45pm UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/9 "2018-09-03T12:45:30Z")

</div>

> [@tomtom](#):
>
> are these docs formatting related to the codes in `stdlib/Markdown` ?

I think so, but it is not [overdocumented](https://docs.julialang.org/en/stable/stdlib/Markdown/) 😉

---

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [September 3, 2018, 1:31pm UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/10 "2018-09-03T13:31:31Z")

</div>

update: everything (space, tab, newline) is fine inside **triple backticks** (not single) for my mac v0.7.0. For example:

````julia

julia> """
       ```
       a b c
           efg
         hij
       zzz
       ```
       """
       function f()
        1
       end
f

help?> f
search: f fd for fma fld fft full fld1 find filt fill fft! fdio frexp foldr foldl flush floor float first findn filt!

  a b c
      efg
    hij
  zzz

````

---

<div class="post-metadata">

### Author: ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)
#### Post date: [September 3, 2018, 1:39pm UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/11 "2018-09-03T13:39:23Z")

</div>

That’s because triple backticks indicate a preformatted code block in markdown. Just like here on discourse (which uses markdown as well).

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [September 3, 2018, 1:49pm UTC](https://discourse.julialang.org/t/how-to-add-a-tab-or-space-in-docs/14425/12 "2018-09-03T13:49:07Z")

</div>

> [@tomtom](#):
>
> update: everything (space, tab, newline) is fine inside **triple backticks**

Yes, as @Sukera said, this is part of the syntax 🙂 Instead of discovering Markdown experimentally, just looking at [some short introduction](https://commonmark.org/help/) may be a good investment.
