3

I'm using TeX for a long time now, but I'm currently struggling integrating some features for my daily use. To be more precise: I'm intending to use features like text highlighting (yellow markup), strikeout text passages, and so on. For punctuation i've the package 'csquotes' in use for ages.

So far, I tried to realize this by using 'ulem' and 'soul'.

soul: breaks with 'csquotes' its \enquote{}-command.

! Argument of \csq@quote@i has an extra }

ulem: breaks also with \enquote{}.

MWE (wished by TeXnician)

\documentclass{article}
\usepackage{csquotes}
\usepackage{soulutf8}
\begin{document}
\hl{Alpha particles named after and denoted by the \enquote{first letter in the Greek alphabet, alpha consist of two protons} and two neutrons bound together.}
\end{document}

Any ideas? Any alternative packages?

Thanks in advance.

Best regards

guest
  • 31
  • 2
    Welcome to TeX.SX! Could you please post a minimal compilable code example (MWE) of what you're trying to achieve? – TeXnician Jul 24 '18 at 17:10
  • Here you are... MWE added to topic. Didn't seem to be relevant to me, but it makes it maybe easier. – guest Jul 24 '18 at 17:31
  • 1
    It's an unfortunate (but known) limitation of soul(utf8) and ulem that their underlining commands can only accept light markup (from very few select macros) in their arguments. If you use LuaLaTeX you can use Lua callbacks to construct a more robust underlining. – moewe Jul 24 '18 at 17:38
  • 1
    \soulregister{\enquote}{1} works but breaks the underline before and after the quotation mark. – moewe Jul 24 '18 at 17:42
  • See https://tex.stackexchange.com/q/284544/35864 for underlining. – moewe Jul 24 '18 at 17:45
  • Well, I'm using LuaLaTeX so that shouldn't be a limitation for a working solution. Thanks for the approach to realize a robust underlining. But strikethrough and highlighting are still fundamental to me. I'm wondering why such functions (which are very basic) are so poorly integrated in TeX. – guest Jul 24 '18 at 18:02
  • 1
    @guest Because line-breaking and breaking boxes is not that easy (and underlining is not considered proper typographical style anyway). Design restrictions of the most software packages will be noticeable at some point. – TeXnician Jul 24 '18 at 19:16
  • I agree, but these common functions help to develop a document by marking critical text passages. – guest Jul 25 '18 at 04:34
  • You could simply use the color package and do \newcommand{\hl}{\textcolor{red}}. It would also allow you to mark critical text and is compatible with csquotes. – TeXnician Jul 25 '18 at 06:06
  • That's my solution I used so far, but I'm really missing features like strikeout et cetera. – guest Jul 25 '18 at 07:51
  • A dirty solution for me was to use \hl{``quotes''}. Anyway ... I think the same, it is a pity this basic and common functions are not well implemented. Maybe the soul or ulem devs could have thought about csquotes or bibtex integration.

    A more elegant solution is to use \soulregister with identifier 7 like https://tex.stackexchange.com/a/139500/83189 answer suggest. But I'm afraid it is not a valid solution for you due your sentence length.

    – jfernandz Nov 07 '19 at 10:02

1 Answers1

5

With lualatex and the new lua-ul package your example works fine:

\documentclass{article}
\usepackage{csquotes}
\usepackage{luacolor}
\usepackage[soul]{lua-ul}
\begin{document}
\hl{Alpha particles named after and denoted by the \enquote{first letter in the Greek alphabet, alpha consist of two protons} and two neutrons bound together.}
\end{document}

enter image description here

Ulrike Fischer
  • 327,261