Asciidoctor-pdf: How to do underline in the pdf?

Created on 19 Oct 2015  路  11Comments  路  Source: asciidoctor/asciidoctor-pdf

I have a ton of teaching material we are moving to asciidoctor. So I can publish online and to pdf with the same sources.

The teacher that generated this content used her word processor to do it and used underline to highlight unstress in sentences and bold to highlight stress, for example.

@mojavelinux already indicated why he is against the use of underline in https://github.com/asciidoctor/asciidoctor/issues/867 but that doesn't mean people aren't using it. Even after the arguments provided in that issue, my word processor has bold, italics, and underline as the three most accessible buttons to do any kind of highlighting with the text to convey different meanings.

For the HTML I am using [.underline]#word# everywhere but this is not making it to the PDF output.

How can I underline in both the PDF and HTML output?

Additionally, I am trying to create a tree processor extension so I can use _ as underline and / for italics when the :italics_as_underline: attribute is set. I'll share as soon as I have something working.

compliance

Most helpful comment

I'll schedule to address in alpha.14.

All 11 comments

This feature is implemented in PR #350

my word processor has bold, italics, and underline as the three most accessible buttons to do any kind of highlighting with the text to convey different meanings.

While a case can be made that there are use cases for underline, the fact that a word processor has these buttons is not a viable defense. Word processors are enabling bad behavior. I'm much more open to listening to the semantics of the teacher's use case.

For the HTML I am using [.underline]#word# everywhere but this is not making it to the PDF output.

I think it's fair to implement this for consistency.

PR #350 addresses this for both [underline]#text# and [.underline]#text#. Thanks @veeg for pointing it out.

I'll review asap.

I'll review asap

@mojavelinux: What's the status of this? The PR is still not merged. We need a way to underline in PDFs.

I'll schedule to address in alpha.14.

@mojavelinux, just to add another teacher's perspective, we too use underlining with some frequency in CS50 at Harvard in order to distinguish in monospaced blocks which characters are from stdout and stderr and which are from stdin (i.e., a user's input). In that context, italicizing code hasn't appealed, and while we could highlight stdin with some CSS role, that's seemed no less verbose than [.underline]#...#.

So we'd love to cast a vote for some shorter syntax for underlining (and strikethrough as well), not only for PDF output but HTML as well.

Many thanks!

Another use case for this is in writing (snail-mail) letters using asciidoc.
Some may consider this old-fashioned but the subject line is often underlined rather than emboldened for emphasis. See for example:

http://www.libraryonline.com/?pID=46

@dmalan I can understand that. I'm prepared to move forward with at least supporting [underline]#phrase#. Then we can go from there.

I've implemented the underline and line-through roles on a phrase node. We'll address other text formatting in separate issues.

Thanks very much, @mojavelinux!

Was this page helpful?
0 / 5 - 0 ratings