Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi,
I'm new here. I have done my first pdf file with asciidoctor-pdf. It worked but not perfectly, words between [.small]# and # did not shrink in the pdf file. Anyone knows why that could happen? Thank you! |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi, welcome to the forum.
I believe [small]#small text# is only supported in HTML output. It is not supported with asciidoctor-pdf. Marc. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hey, thanks for answering!
And, is there any way I could use asciidoc to make some text smaller in a pdf? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
And also colors!
I cannot see them in the pdf file. Is there any way to make colors appear in the pdf file? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Amuza,
As far as I am aware, you cannot change font size or colour on an arbitrary piece of text with asciidoctor-pdf. I certainly hope that these sort of features will be implemented in the upcoming 2.x version of asciidoctor-pdf. Marc. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
In fact, it is possible to make text smaller in Asciidoctor PDF. It's just not very pretty. The word +++<font size=".5em">small</font>+++ is smaller than the rest of the line. The issue that deals with inline roles is here: https://github.com/asciidoctor/asciidoctor-pdf/issues/368 (there are other issues as well). small is role, so it falls under this domain. I don't have the bandwidth at the moment to address this. My focus right now is Asciidoctor 2.0. Cheers, -Dan On Sun, Feb 10, 2019 at 4:17 AM 1marc1 [via Asciidoctor :: Discussion] <[hidden email]> wrote: Amuza, -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Dan,
I wasn't aware of that possibility. I tried to extend it to colours, but the following does not work: Attempt to provide +++<font color="#d3173c">some colour</font>+++ in a line of text. Attempt to provide +++<font color=#d3173c>some colour</font>+++ in a line of text. I also had a look at making life easier when working with changing font sizes, by doing this: :smallfont: +++<font size=".5em"> :largefont: +++<font size="1.5em"> :endfont: </font>+++ The word {smallfont}small{endfont} is smaller than the rest of the line. The word {largefont}big{endfont} is bigger than the rest of the line. Unfortunately, the above does not work. Marc. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
If you want to understand what's possible and what's not with the inline pseudo-HTML, see this code: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor-pdf/formatted_text/transform.rb#L118-L248 The font tag doesn't support color. But the color tag does. Remember there's no actual HTML renderer here. We're doing all this with custom code. -Dan On Sun, Feb 10, 2019 at 2:55 PM 1marc1 [via Asciidoctor :: Discussion] <[hidden email]> wrote: Dan, ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Dan,
Thank you for pointing this out. For reference, the following works: Attempt to provide +++<color rgb="#d3173c">some colour</color>+++ in a line of text. Unfortunately, the following does not work: :my_red: #d3173c Attempt to provide +++<color rgb=$my_red>some colour</color>+++ in a line of text. Another question: is there a way to change the background color of text? Marc. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Oops, silly me: attribute substitution works via {}. I was actually trying to pull a variable from my theme file...
:my_red: #d3173c Attempt to provide +++<color rgb={my_red}>some colour</color>+++ in a line of text. Attempt to provide +++<color rgb="{my_red}">some colour</color>+++ in a line of text. Unfortunately, neither of the above works. Marc. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
Marc, If you want to use an attribute, then you have to switch to the inline pass macro: :red: #ff0000 Attempt to provide pass:a[<color rgb="{red}">some colour</color>] in a line of text. (The triple plus passthrough does not allow any substitutions). -Dan On Tue, Feb 12, 2019 at 1:48 AM 1marc1 [via Asciidoctor :: Discussion] <[hidden email]> wrote: Oops, silly me: attribute substitution works via {}.:my_red: #d3173c Attempt to provide +++<color rgb={my_red}>some colour</color>+++ in a line of text. Attempt to provide +++<color rgb="{my_red}">some colour</color>+++ in a line of text. ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Dan,
Great. Thank you for your reply. This is very helpful. I have been playing around with this and can confirm this also works inside tables: :red: #ff0000 |=== |Column 1| Column 2 |row 1 | pass:a[<color rgb="{red}">row 1</color>] |=== The drawback I can see is that this works for asciidoctor-pdf, but does not work for the HTML output. So, if I want to create a document that I want to turn into both a PDF and an HTML document, I essentially need to first create the PDF (with the above code), then update the code for my HTML output. Is that correct? If so, is this something that will be addressed in the upcoming version 2.0? Is there any more news on 2.0? Marc. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
Marc, Yes, that is correct. It would be Asciidoctor PDF specific. Asciidoctor 2.0 is in the process of rolling out. News will follow shortly thereafter about Asciidoctor PDF. Cheers, -Dan On Tue, Feb 12, 2019 at 4:51 AM 1marc1 [via Asciidoctor :: Discussion] <[hidden email]> wrote: Dan, ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |