3

Consider the following MWE:

\documentclass{article}
\usepackage{tasks}

\begin{document}
\begin{tasks}[label-format=\itshape](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}
\end{document}

With italics

I would like to not italicize the parentheses:

Without italics

Is it possible to achieve it in an easy way?

Thanks!

3
  • 1
    Perhaps this can provide you some ideas: Upright parentheses in italic text
    – Alan Munn
    Aug 25, 2018 at 23:35
  • @AlanMunn yes! I use \begin{tasks}[label-format=\itshape,counter-format=tsk[r]\upshape{)}](4) but now I can't remember how to change the task numbers (i, ii, iii and iv) as before (a, b, c and d) :(. Edit: NVM, changed tsk[r] to tsk[a] :). Do you want to post an answer?
    – manooooh
    Aug 25, 2018 at 23:40
  • 1
    No, it's fine for you to post a self-answer. I just gave a hint.
    – Alan Munn
    Aug 25, 2018 at 23:44

2 Answers 2

4

One should use \textup{)}, so the italic correction would be automatically added; unfortunately, this crashes because of the nature of \textup that doesn't really like to be used in that place. However, there's an easy fix.

Note that \upshape doesn't take an argument.

\documentclass{article}
\usepackage{tasks}
\usepackage{etoolbox}
\robustify{\textup}

\begin{document}

\begin{tasks}[label-format=\itshape,counter-format=tsk[a]\upshape{)}](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}

\begin{tasks}[label-format=\itshape,counter-format=tsk[a]\/\upshape)](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}

\begin{tasks}[label-format=\itshape,counter-format=tsk[a]\textup{)}](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}

\end{document}

You can see that the second and third examples print the same. In the second example, the italic correction \/ is explicitly added.

enter image description here

3

Thanks to @AlanMunn for the hint.

I added the \upshape command only for the parentheses and used tsk[a] for a, b, c, ... style numbers, all inside counter-format command.

\documentclass{article}
\usepackage{tasks}

\begin{document}
\begin{tasks}[label-format=\itshape,counter-format=tsk[a]\upshape{)}](4)
    \task Ex. 1
    \task Ex. 2
    \task Ex. 3
    \task Ex. 4
\end{tasks}
\end{document}

Right parentheses

5
  • 1
    You should italicize both the counter a,b,.. and the ), look at the d), either you italicize both or add a small space between the counter and the paren. In your case, it's the latter choice as done in the image with red arrows.
    – AboAmmar
    Aug 26, 2018 at 0:24
  • @AboAmmar I would like to keep the actual style. I use \upshape{ )} but the space is too large, and then \upshape{$\,$)} but is the same space. Also tried with \upshape{~)}. What do you recommend?
    – manooooh
    Aug 26, 2018 at 0:42
  • 1
    A \, might be nice, in case you need to try many variants, see this great answer about horizontal spaces in LaTeX.
    – AboAmmar
    Aug 26, 2018 at 0:48
  • @AboAmmar woo excellent! Anyway \, isn't the same space of, for example, \begin{enumerate} with a), b), etc.
    – manooooh
    Aug 26, 2018 at 0:51
  • 1
    You can try with math mode: $\mkern1.5mu)$ (\, is 3mu).
    – Bernard
    Aug 26, 2018 at 9:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .