public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Noel Ullreich <n.ullreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-docs 1/3] Fixed inline code breaking in pdf docs
Date: Tue,  3 Jan 2023 14:31:19 +0100	[thread overview]
Message-ID: <20230103133121.114234-2-n.ullreich@proxmox.com> (raw)
In-Reply-To: <20230103133121.114234-1-n.ullreich@proxmox.com>

Had to overwrite the `texttt` command to allow breaks in long strings
with no space. Now the line can be broken on specific chars as well.

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
---
 asciidoc/dblatex-custom.sty | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/asciidoc/dblatex-custom.sty b/asciidoc/dblatex-custom.sty
index 6b2578c..02fbe16 100644
--- a/asciidoc/dblatex-custom.sty
+++ b/asciidoc/dblatex-custom.sty
@@ -66,3 +66,16 @@
   \drawtitlepage
   \pagebreak[4]
 }
+
+% to correctly break inline code the texttt command needs to be renewed
+\DeclareRobustCommand{\texttt}[1]{
+  \begingroup%
+  \ttfamily%
+  % characters on which to break. `_` does not work
+  \begingroup\lccode`~=`/\lowercase{\endgroup\def~}{/\discretionary{}{}{}}%
+  \begingroup\lccode`~=`.\lowercase{\endgroup\def~}{.\discretionary{}{}{}}%
+  \begingroup\lccode`~=`-\lowercase{\endgroup\def~}{-\discretionary{}{}{}}%
+  \catcode`/=\active\catcode`.=\active\catcode`-=\active%
+  \scantokens{#1\noexpand}%
+  \endgroup%
+}
-- 
2.30.2





  reply	other threads:[~2023-01-03 13:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 13:31 [pve-devel] [PATCH pve-docs 0/3] Fixed formatting of " Noel Ullreich
2023-01-03 13:31 ` Noel Ullreich [this message]
2023-01-03 15:36   ` [pve-devel] [PATCH pve-docs 1/3] Fixed inline code breaking in " Thomas Lamprecht
2023-01-03 13:31 ` [pve-devel] [PATCH pve-docs 2/3] Fixed the table in 3.11.8 Noel Ullreich
2023-01-03 15:35   ` Thomas Lamprecht
2023-01-10 12:56     ` Noel Ullreich
2023-01-03 13:31 ` [pve-devel] [PATCH pve-docs 3/3] Fixed kerning in table of contents Noel Ullreich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230103133121.114234-2-n.ullreich@proxmox.com \
    --to=n.ullreich@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal