Login  Register

Chapter number change to an alpha after level 5

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Chapter number change to an alpha after level 5

ggenier
21 posts
Hello,

I want to change the chapter number by a letter for level 5.

 I want to put an alpha on title "a", "b", "c"...

In Ruby I show opts : puts string, opts

In this display i don't see any information about the level, I have :

title1
{:align=>:left, :level=>5, :outdent=>true}
title2
{:align=>:left, :level=>5, :outdent=>true}
title3
{:align=>:left, :level=>5, :outdent=>true}

It's possible to retrieve the title number ?

Thanks in advance.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Chapter number change to an alpha after level 5

mojavelinux
Administrator
2681 posts
I'm not sure I understand your question. You say that there's no info about the level, but then you show that level is one of the keys in the options hash (i.e., :level => 5)

Based on the option values you showed, I infer you are talking about Asciidoctor PDF. You are correct that layout_heading does not accept a node, but rather the title. The number is at the start of the title (e.g., 1.1.1.1.1)

If you showed an example of the output you are trying to achieve, I can probably help you find the right method to override.

Best Regards,

-Dan

On Thu, Sep 17, 2020 at 8:36 AM ggenier [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello,

I want to change the chapter number by a letter for level 5.

 I want to put an alpha on title "a", "b", "c"...

In Ruby I show opts : puts string, opts

In this display i don't see any information about the level, I have :

title1
{:align=>:left, :level=>5, :outdent=>true}
title2
{:align=>:left, :level=>5, :outdent=>true}
title3
{:align=>:left, :level=>5, :outdent=>true}

It's possible to retrieve the title number ?

Thanks in advance.


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Chapter-number-change-to-an-alpha-after-level-5-tp8261.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Chapter number change to an alpha after level 5

ggenier
21 posts
Yes, it show the level, but I don't have any information about previous level.

Yes you are right, I speak about Asciidoctor PDF.

For example I  have this code :
==== Title
===== Title_1
blablablabla

===== Title_2
blablablabla

The render is :
6.1.1 Title
    Title_1
blablablabla

    Title_2
blablablabla

Render I want is :
6.1.1 Title
    a. Title_1
blablablabla

    b. Title_2
blablablabla

I search a solution to retrieve number of Title_1, to convert it to a letter of the alphabet (1=a, 2=b...)

I will thinking to put this in ruby, by at this point of my code opts does not give me enough information to do this.

I don't know if I am more clear.