emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code blocks and quotes export style


From: Juan Manuel Macías
Subject: Re: Code blocks and quotes export style
Date: Sun, 13 Mar 2022 18:39:26 +0000

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 via email to

[Prev in Thread] Current Thread [Next in Thread]