3

I write some choice questions into beamer frame, after some research, here is my code:

\documentclass[aspectratio=169]{beamer}
\usetheme{Berkeley}
\usepackage{tasks,CJK}
\begin{document}
\begin{CJK*}{utf8}{bsmi}
\begin{frame}
\transwipe
1.Which one you want to choose?
\begin{tasks}[counter-format=tsk[A].,debug=true](4)
\task A
\task B
\task C
\task D
\end{tasks}
\end{frame}
\end{CJK*}
\end{document}

output with pdflatex: enter image description here But I don't want the D choice goto the second line, I want them stay in one line, what should I do?

  • Welcome to TeX.SX! Please post a compilable MWE in your question, not just a code fragment. Adding your fragment to an MWE of my choise leads to a 4 column output. – alwaysask Oct 19 '16 at 11:10
  • @alwaysask Thanks for your advice. I still got two line with your code, what additional information should I attach? – Page David Oct 19 '16 at 11:48
  • Now your MWE needs an \end{document} at the end. Most likely your TeX installation needs an update. You can compile your code using online compilers to test the result against your installation -- for example on papeeria.com. – alwaysask Oct 19 '16 at 12:12
  • @alwaysask but I installed it with the latest ISO file yesterday... – Page David Oct 19 '16 at 12:26
  • Generally, ISO's don't get updated. Please point me to the link you downloaded the ISO and/or give details of your system (OS, TeX installation etc). – alwaysask Oct 19 '16 at 12:36
  • @alwaysask I added full import of packages in the question hope it helps. – Page David Oct 19 '16 at 12:42
  • @alwaysask the ctan mirror I download the ISO: https://mirrors.tuna.tsinghua.edu.cn/CTAN/ os:ubuntu gnome 16.04 installed without most of language packages. Install position etc..was default value. Tlmgr was updated after install. – Page David Oct 19 '16 at 12:56
  • Well, the aspectratiosetting is what leads to two lines, you can remove the CJK related code. Any aspect ratio different from 43 (4:3 -- I think it's the default) breaks the tasks line in two. Now you can see the importance of posting a full MWE rather than just code fragments. (your TeX installation is fine). – alwaysask Oct 19 '16 at 12:59
  • @alwaysask oh yeah, but I need use Chinese language in tasks, without cjk I cannot deal with that, is there any better solution for UTF8 support? – Page David Oct 19 '16 at 13:05
  • Keep CJK in your document. It's just that to demonstrate the issue you have in this question, CJK has no [bad] influence. The issue (tasks breaks in two lines) is present without CJK as well. So, according to the MWE guiding rules in the link I gave you, it can be removed. – alwaysask Oct 19 '16 at 13:12
  • It seems that tasks cannot compute the right width for the tasks with beamer when aspectratio=169 is in effect. – egreg Oct 19 '16 at 14:05

1 Answers1

1

This is fixed in the newest version of tasks:

\documentclass[aspectratio=169]{beamer}
\usetheme{Berkeley}
\usepackage{tasks}[2019-10-04]% version 1.0 or newer

\begin{document}

\begin{frame}
  \transwipe
  1. Which one you want to choose?
  \begin{tasks}[label=\Alph*.,debug=true](4)
    \task A
    \task B
    \task C
    \task D
  \end{tasks}
\end{frame}

\end{document}

enter image description here


PS: Please note that the option counter-format has been dropped in version 1.0. The functionality is included in label which is now set the same way as in enumitem.

cgnieder
  • 66,645