emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>, "Sébastien Gendre" <seb@k-7.ch>
Subject: Re: Code blocks and quotes export style
Date: Sun, 13 Mar 2022 18:39:26 +0000	[thread overview]
Message-ID: <8735jlbstd.fsf@posteo.net> (raw)
In-Reply-To: <CAFyQvY14goSqcVTVTGytjif42ESRvy1Gm369Hpthv+r5+Jx7nw@mail.gmail.com> (Kaushal Modi's message of "Sun, 13 Mar 2022 12:06:11 -0400")

Kaushal Modi writes:

> Well, that will at least help the code blocks going out of bounds. It
> won't help the quotes. 

With the quotes going out of bounds issue it would be nice to see a
screenshot. But if a line of normal text goes outside the margin, it is
usually due to a TeX overfull hbox, perhaps because TeX hasn't been able
to hyphenate a long word correctly (also perhaps because the text is in
a language other than the main language, and that text should be encased
in the secondary language specifications).

For this type of lines outside the margin there are several LaTeX
solutions:

The quick fix is to add a discretionary hyphen (\-). For example, if the
word that goes outside the margin is "supercalifragilistic", the
discretionary can be added with an export snipett:

Supercali@@latex:\-@@fragilistic

Or even breakpoints can be indicated with the '\hyphenation' macro in the
preamble (we can add a list of words separated by commas):

#+LaTeX_Header: \hyphenation{Supercali-fragilistic}

Another solution is to disable TeX's line break algorithm at the
paragraph where the line overflows, using the slopypar environment. The
result can be ugly, with too wide separations between words.

On the other hand, loading the microtype package (in pdfTeX or LuaTeX)
usually helps a lot in the construction of the paragraphs.

And finally, if LuaTeX is used to compile, the linebreaker
(https://www.ctan.org/pkg/linebreaker) package automatically prevents
all overfull hboxes in the document.

Also note that the Org quote block supports the :environments attribute,
where we can apply environments other than 'quote', such as quotation or
those provided by the csquotes package. For example, for quotes in
another language:

#+LaTeX_Header:\usepackage[german,english]{babel}
#+LaTeX_Header:\usepackage{quoting}
#+LaTeX_Header:\usepackage[babel=true,autostyle=true,german=quotes]{csquotes}
#+LaTeX_Header:\SetBlockEnvironment{quoting}
#+ATTR_LaTeX: :environment foreigndisplayquote :options {german}
#+begin_quote
Eine Erklärung, wie sie einer Schrift in einer Vorrede nach der
Gewohnheit vorausgeschickt wird (Hegel).
#+end_quote

Best regards,

Juan Manuel 




  reply	other threads:[~2022-03-13 18:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13 10:54 Code blocks and quotes export style Sébastien Gendre
2022-03-13 16:06 ` Kaushal Modi
2022-03-13 18:39   ` Juan Manuel Macías [this message]
2022-03-14 12:50     ` Max Nikulin
2022-03-14 18:09       ` Juan Manuel Macías
2022-03-13 18:55 ` Barton, Mark
2022-03-13 21:13   ` Tim Cross
  -- strict thread matches above, loose matches on Subject: below --
2022-03-13 16:22 autofrettage

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=8735jlbstd.fsf@posteo.net \
    --to=maciaschain@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    --cc=seb@k-7.ch \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).