Hot answers tagged

9

Here is an alternative using the tasks package: \documentclass{article} \usepackage{tasks} \setlength{\parindent}{0pt} \begin{document} \textbf{Question}: Here is the question text. Answers are arranged in 4 columns. \begin{tasks}(4) \task first answer \task second answer \task third answer \task fourth answer \end{tasks} \bigskip \textbf{Question}: ...


6

All of this is really not recommended, unless you really know what you are doing and/or is willing to suffer the consequences. In the words of Mr. Cat, this is "living dangerously", and you may end up being dead when someone opens the box ;-) \DeclareMathSymbol is used to select the glyph in a font which will be used to write a specific symbol on the paper. ...


4

I am pretty sure that there are several ways. I propose TikZ way due to its flexibility. We can write a new command for this. \documentclass{article} \usepackage{tikz} \begin{document} \centerline{\LARGE\bfseries\textcolor{blue}{TIKZ for multiple choices}} \vspace*{1cm} \noindent{\bfseries Question 1.} This question has $2$ choices. \noindent\begin{...


3

Here is a workaround I have arrived at: \documentclass{beamer} \begin{document} \begin{frame} \frametitle{Lorem Ipsum} \begin{columns}[T] \column{.49\textwidth} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ...


2

You can make these symbols math active by setting their mathcode to 8000 and then define them by the lowercase trick: \documentclass{article} \usepackage{amsmath} \usepackage{mleftright} \makeatletter \def\@mathactive#1#2{\begingroup \lccode`~=`#1 \lowercase{\endgroup \def~{#2}}% \mathcode`#1="8000\relax} \@mathactive({\mleft(} \@...


2

Add two commands, one for testing the presence of a property, the other for typesetting the info. \NewExpandableDocumentCommand{\contactTestTF}{mmmm} {% #1 = contact, #2 = property to test, #3 = code for true, #4 = code for false \prop_if_in:cnTF { \__nebu_contact_prop:n { #1 } } { #2 } { #3 } { #4 } } \NewDocumentCommand{\FrontpageUiTsetup}{m} { \...


2

You can use \edef, which requires making a few control sequence names unexpandable; a lower level interface is needed to ensure \fig is a new command. \makeatletter \@ifdefinable{\fig}{% \edef\fig#1{% \noexpand\raisebox{-2pt}{% \noexpand\lilypond{% \string#(set-global-staff-size 18)% \noexpand\figures {#1}% }% }% }% } ...


2

Edit: Here is a redefinition of the environment columns and it's column command to contain vertical lines between the columns calculates as best as possible (for me) but with the exception of environment greater then the real text width (there it gives small differences because I used the \textwidth of the slide as the maximum width but this environment ...


2

According to your comment, I believe this is what you want: \documentclass{article} \usepackage{amsmath} \usepackage{amsthm} \usepackage{etoolbox} \newtheorem{theorem}{Theorem} \newcommand{\thfootnote}[2][]{% \hspace{-0.4em}% \ifstrempty{#1}{\footnote}{\footnote[#1]}% {#2}\hspace{0.3em}} \begin{document} \section{Something} \begin{theorem}[...


2

The mandatory argument to \includegraphics must expand to a string of characters, in order to identify a file name. Instructions such as \stepcounter{...} cannot be used in that argument. A simple way out is to use a new command: \newcommand{\numberedimage}[1][]{% \includegraphics[#1]{\jobname_fig_\arabic{nomfigcpt}}% \stepcounter{nomfigcpt}% } so you ...


2

As @campa said, this can easily be achieved with the \includegraphics command. But if your goal is it to make a shorter command this could be one solution: \documentclass{article} \usepackage{graphicx} \graphicspath{ {./images/} } % The path where you store the graphics \newcommand{\1}{\includegraphics[scale=0.06]{square}} \begin{document} Lorem ipsum ...


1

The reason behind the issue is discussed in How to include graphics inside the section name which suggests using \protect to avoid expansion of commands like \includegraphics when that's written to the auxiliary files. Why? Because \sections are eventually included in the ToC, which is read from the .toc file. In your particular case, you also have an ...


1

I am not sure what the purpose of \thfootnote is, but if you want to get rid of the space without writing \hspace{-0.4em} before every footnote in a theorem, you may define your new footnote with only one argument. You then hook it to the numbering of the other footnotes. See the MWE. If the purpose is something different, please elaborate your question. If ...


1

If the # can be catcode 12 going into \lilypad, then this: \documentclass{article} \begin{document} \newcommand{\fig}[1]{% \raisebox{-2pt}{% \prelilypond{% ##(set-global-staff-size 18)% figures {#1}% I removed the backslash for this non-working example. }% }% } \newcommand\prelilypond[1]{\expandafter\lilypond\...


Only top voted, non community-wiki answers of a minimum length are eligible