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 a bit stuck in generating monospace text as is typed in de adoc file, but with formatting of some parts (bold, color) What I want to achieve is : - Monospaced text - Chord letters positioned on the right place above words - Chords letters bold and colored in green - Backing vocals in bold and colored in red Blocks can render text as is, but can't seem to format parts of the text in bold or color at the same time. *VERSE:* .... *F* G Em7 Oh oh Alabama, F G F C The devil fools with the best laid plans F G Em7 Swing low Alabama. F D You got the spare change - you got to feel strange E F G And now the moment is all that it meant. Are there ways to achieve results as in above screenshot (from libre-office) |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
I think you can use verse block with redefined font in your theme 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 |
In reply to this post by geertpeeters
https://imgur.com/F8GgqPy asciidoc excerpt .VERSE [verse] ______________________________________________________________________________ [chord]#F# [chord]#G# [chord]#Em7# Oh oh Alabama, [chord]#F# [chord]#G# [chord]#F# [chord]#C# The devil fools with the best laid plans [chord]#F# [chord]#G# [chord]#Em7# Swing low Alabama. ______________________________________________________________________________ .CHORUS [verse] ______________________________________________________________________________ [chord]#F# [chord]#D# [chorus]#You got the spare change - you got to feel strange# [chord]#E# [chord]#F# [chord]#G# [chorus]#And now the moment is all that it meant.# ______________________________________________________________________________ theme example extends: default verse: font-family: M+ 1mn role: chord: font_color: #00cc00 font_style: bold chorus: font_color: #ff7070 font_style: bold |
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,
Thanks for the quick response. Actually I was building from an existing gradle project I used in a totally different context (user manual) There I used an extended example from the internet. I reduced now this YML to the attributes you proposed. I pushed my project to https://github.com/geertpeeters/YellowMoonRising-Songbook For one or another reason, the theme code is not picked up as my pdf output in test.pdf does not have colors nor Courier is used as font family Am I missing something? Thanks again |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
I know nothing about the pipeline you use... Just some questions:
1. Are you sure theme file is picked up? (did it work for you before changes?) 2. Why are you using courier font? It is not one of built-in fonts and it is not provided anywhere in your project and is not specified in your theme as one of the fonts. (see https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#custom-fonts) 3. Did you try the M+ 1mn font that I specified in my example? It is bundled with and used by asciidoctor-pdf and actually present in your repo. 4. Does it work for you with regular asciidoctor-pdf and built-in fonts? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
This post was updated on Apr 08, 2020; 1:29pm.
Hi Habamax,
Thanks for replying. I'm definitely not an expert in this thing 1. I used the gradle project before and used the same theme file with different content. So I'm pretty sure it was picked up before... Not sure why it is not picked up now 2. I though because it was monospace and better suited for aligning chord notations with lyrics. But no hard requirement. I can switch back to 3. I put back the font M+ 1mn 4. Not sure what you mean here. Can you share your tool chain and how a typical project structure can bring the result you showed? It's really cool knowing that it's possible... EDIT : I threw the gradle project aside and used asciidoctor-pdf cli instead. Then is seems to work as you explained. Thank you for helping out. Kind regards, Geert |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
I am not sure I am an expert :) Usually it doesn't work this way. You can not set random font name to asciidoctor elements in your theme file and expect it would be applied to a document. Theming (including how to use other fonts) is extensively described in a guide: https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc But basically you should either use already defined fonts with their font names (as M +1mn) or define your own font names with real ttf files placed "next" to a theme file. And did it work for you? It is just a sudo gem install asciidoctor-pdf in linux environment or just a gem install asciidoctor-pdf in Windows (with ruby installed beforehand). Check https://github.com/asciidoctor/asciidoctor-pdf/#getting-started To compile with default settings: asciidoctor-pdf filename.adoc To add own theming consult asciidoctor-pdf parameters (you have to define path to your theme, path to your fonts, extensions if you have any etc). If you use vim then https://github.com/habamax/vim-asciidoctor might be handy. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
I just installed asciidoctor and asciidoctor-pdf in Manjaro
I use Intellij as IDE Just tried to set up a small project from scratch and included your theme snippet. The thing is rendering just fine now. Added some parts of my previous theme so I have headers and footers with page numbers. I think I'm launched now and can progress experimenting further! tnx a lot |
Free forum by Nabble | Edit this page |