Closed amca01 closed 1 year ago
Does this help?
#+begin_example
This is the text that I want to in monospace font.
#+end_example
Alternatively, you can do
#+BEGIN_EXPORT HTML
<style>
.mono text {
font-family: monospace;
}
</style>
#+END_EXPORT
#+begin_mono
This is the text that I want to in monospace font.
#+end_mono
See https://ox-hugo.scripter.co/doc/org-special-blocks/#special-blocks--div-tags for reference.
Thanks for both of those. However, the first just shows the text in the same dark palette of my source code: there's no visual difference between this and starting with #+begin_src
and ending with #+end_src
.
The second one has no effect for me.
Here's what worked for me:
#+BEGIN_EXPORT HTML
<div style = "background-color:#AED6F1"><samp>
This is the stuff I want to have in monospace font.</samp></div>
#+END_EXPORT
The <samp>
is an HTML5 tag for representing sample output; a repacement for the now discontinued <tt>
tag. And there are also <kbd>
, <code>
and of course <pre>
.
Hello, I am closing this issue as it is resolved.
This is such a simple request that I'm almost ashamed to be asking it. (Only almost ashamed, though ... ) Anyway, I have some text I'd like to set off from its surroundings. Its nature is better to be in monospace. I don't want it to be formatted as a code block, because I want to keep the colour palette (dark background) for code only. (Unless there's a way of using another colour palette for a specific example). I've set
codefences = true
in myconfig.toml
file, but either ox-hugo or hugo doesn't respect the three backticks. The final html file just includes the three backticks as though they were text, and the text itself is still in the prevailing font.I've tried using
#+attr_html
, and similar. For example, here's an attempt which didn't work:I'm not sure if I should be doing this in CSS, or HTML, or a mixture. Anyway, no doubt this is trivially simple - when you know how!