emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Gustavo Barros <gusbrs.2016@gmail.com>
To: "Blair, Erik" <Enrique_Blair@baylor.edu>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: underline with line breaks doesn't work
Date: Fri, 01 Jan 2021 09:28:13 -0300	[thread overview]
Message-ID: <8735zkc04i.fsf@gmail.com> (raw)
In-Reply-To: <78B14F19-01D5-4EA8-B344-535AB8E84B9D@baylor.edu> (Erik Blair's message of "Fri, 1 Jan 2021 05:22:59 +0000")

Hi Enrique,

On Fri, 01 Jan 2021 at 05:22, "Blair, Erik" <Enrique_Blair@baylor.edu> wrote:

> I would like to use \ul from the soul package in Org mode for underlining with
> line breaks (and *not* underlining spaces). It’s not working well. It fails
> like \underline (spaces get underlined, and lines don’t break and run off the
> page). My LaTeX export doesn’t work if I insert \ul{abc} into the org file,
> but I can insert \ulem{abc} or \underline{abc}, as well as the typical _abc_.
>
> More information: I’m actually trying to define a new command using logic in
> the LaTeX header. This way, I can make notes with key words. I can toggle a
> Boolean variable, and it makes key words show up; or, it underlines the words,
> which are also hidden by \phantom. Also, we would like to avoid underlining
> spaces because it cues the reader to know how many words are missing.
>
> I note this previous discussion:
>    https://lists.gnu.org/archive/html/emacs-orgmode/2013-06/msg00376.html
>
> It seems like the issue that was fixed at one point and \ul should work, but
> maybe it’s not now. Or, maybe I don’t have the experience to know how to apply
> the solution to my Emacs/Org mode on my computer.

`soul' was considered as a default for underline and strike-through in
that thread, but some people reported problems with Chinese characters,
so that eventually it was replaced by `ulem'.  In other words, `soul' is
not loaded by default by Org when exporting to LaTeX, `ulem' is.

Much later, I've argued in that same thread in favor of `soulutf8' as
a better default:

https://orgmode.org/list/8736iobefh.fsf@gmail.com/
https://orgmode.org/list/871ry8bdo8.fsf@gmail.com/

But my necrobumping seems to have missed the opportunity at that point.


Regarding your particular situation, you just tell us "it's not work
well / doesn't work" which is not much to go about.  And also not much
about any Org export configurations you might have in your init.
Anyway, the only guess I have with what you provided is that you are
missing to load `soul' altogether.  If that's the case, adding the
following to your document should do:

#+latex_header: \usepackage{soulutf8}

That is, it should be enough for you to use it in your `\keyTest' or to
use `\ul' directly.  For Org to export `_abc_' as `\ul{abc}' you'd also
need to configure `org-latex-text-markup-alist`.

Note, however, that the `soul' underline will underline spaces.  But
that's an issue on the LaTeX side, and has nothing to do with Org.  For
this to work as you expect, you will either have to go fancy in your
underlining (for which there is plenty of examples in
tex.stackexchange) or, which is probably the easiest, provide that this
is handled appropriately in your conditional for `\keyTest'.

HTH,
Gustavo.


      reply	other threads:[~2021-01-01 12:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-01  5:22 underline with line breaks doesn't work Blair, Erik
2021-01-01 12:28 ` Gustavo Barros [this message]

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=8735zkc04i.fsf@gmail.com \
    --to=gusbrs.2016@gmail.com \
    --cc=Enrique_Blair@baylor.edu \
    --cc=emacs-orgmode@gnu.org \
    /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).