2

Why is red vertical alignment not regular? I want to show choices in capital bold letter and i want to horizontal align choices. Help me please
enter image description here

\documentclass[a4paper]{article}
\usepackage[margin=1.5cm]{geometry}
\usepackage{helvet}
\renewcommand\familydefault{\sfdefault}
\usepackage{mathastext}
\usepackage{tasks}
\usepackage{multicol}
\usepackage{lastpage}
\usepackage{pgfplots,relsize}
\usetikzlibrary{shapes.symbols}
\usepackage{ragged2e}
\usepgfplotslibrary{fillbetween}
\usepackage{fancyhdr}
\usepackage{amsmath}
\makeatletter
\newcommand\myfrac[2]{\frac{\;\;#1\;\;}{\;\;#2\;\;}}
\makeatother
\usetikzlibrary{calc}

\pagestyle{fancy} 
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\newcounter{numex}


\setlength{\columnseprule}{1pt}
\setlength{\columnsep}{1.2cm}

\newcommand\Startex{%
    \stepcounter{numex}
    \begin{flushleft}
    \textbf{\thenumex)}
    \end{flushleft}}
    \vspace{1.65cm}

\newcommand{\thickfrac}[2]{\genfrac{}{}{0.9pt}{0}{#1}{#2}}
\newcommand\bigfrac[3][2.0pt]{%
{\thickfrac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}}}

\let\oldfrac\frac
\let\frac\bigfrac
%
\usepackage{MnSymbol}
\begin{document}
\begin{multicols*}{2}
%-
\vspace*{0.2cm}
\Startex
\begin{justify}
Here is the question text Here is the question text text
\end{justify}
\hspace{0.5cm}$\myfrac{15^x+ 35^y}{25^y+21^z}$
\begin{justify}
Here is the question text 
\end{justify}
\begin{justify}
\textbf{Here is the question text}
\end{justify}
\begin{tasks}(2)
\task first answer
\task second answer
\task third answer
\task fourth answer
\end{tasks}
\end{multicols*}
\end{document}
\end{document}
7
  • Can anyone help?
    – suarez
    Commented Sep 12, 2021 at 12:59
  • What do you mean with‘vertical alignment’? Is it ‘vertical spacing’?
    – Bernard
    Commented Sep 12, 2021 at 13:50
  • @Bernard The lengths of the red lines are not equal
    – suarez
    Commented Sep 12, 2021 at 15:05
  • This may be due to the flushbottom default directive. You may tru adding \raggedbottom in your preamble. Another possibilitu: adding \useshortskip, from the nccmath` package, just before the equation.
    – Bernard
    Commented Sep 12, 2021 at 15:12
  • I added \raggedbottom but has not changed. I don't understand what you said other @Bernard
    – suarez
    Commented Sep 12, 2021 at 15:32

1 Answer 1

1

I think this meets your requirements.

b

I changed the definition of \Startex. You have to use as \Startex{<text of the question>}. All the text of the question will be left justified.

Also added the configuration of the tasks, to get the uppercase, the bold face and the left margin.

% !TeX TS-program = pdflatex

\documentclass[a4paper]{article}
\usepackage[margin=1.5cm]{geometry}
\usepackage{helvet}
\renewcommand\familydefault{\sfdefault}
\usepackage{mathastext}
\usepackage{tasks}
\usepackage{multicol}
\usepackage{lastpage}
\usepackage{pgfplots,relsize}
\usetikzlibrary{shapes.symbols}
\usepackage{ragged2e}
\usepgfplotslibrary{fillbetween}
\usepackage{fancyhdr}
\usepackage{amsmath}
\makeatletter
\newcommand\myfrac[2]{\frac{\;\;#1\;\;}{\;\;#2\;\;}}
\makeatother
\usetikzlibrary{calc}

\pagestyle{fancy} 
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\newcounter{numex}


\setlength{\columnseprule}{1pt}
\setlength{\columnsep}{1.2cm}

%%******************
\newcommand{\Startex}[1]{% changed <<<<<<<<<<<<<<<<<<<<<
\noindent
\parbox[t]{\columnwidth}{%
    \stepcounter{numex}
    \setlength{\parskip}{0pt}
    \textbf{\thenumex)}\vspace*{0.2cm}
        
#1}
}

\newlength{\taskindent}
\settowidth{\taskindent}{\textbf{m)}}
\settasks{% added <<<<<<<<<<
    item-indent=\taskindent, % align with margin <<<<<<<<<<<
    label-format = \bfseries\MakeUppercase, % format labels <<<<<<<<<<
    after-skip = 3ex, % space after the list
}   
%%******************


\newcommand{\thickfrac}[2]{\genfrac{}{}{0.9pt}{0}{#1}{#2}}
\newcommand\bigfrac[3][2.0pt]{%
    {\thickfrac{\hspace{#1}#2\hspace{#1}}{\hspace{#1}#3\hspace{#1}}}}

\let\oldfrac\frac
\let\frac\bigfrac
%
\usepackage{MnSymbol}

\usepackage{showframe} % only to show the margin <<<<<<<<<<

\begin{document}
    \begin{multicols*}{2}   
    \Startex{%
        Here is the question text Here is the question text text
        \bigskip
        
        \hspace{0.5cm}$\myfrac{15^x+ 35^y}{25^y+21^z}$
        \bigskip
        
        Here is the question text 
        
        \textbf{Here is the question text}  
    }
    
            \begin{tasks}(2)
                \task first answer
                \task second answer
                \task third answer
                \task fourth answer
            \end{tasks} 
    
    \Startex{% new question <<<<<
        Here is a new question text Here is a new question text text
        \bigskip
        
        \hspace{0.5cm}$\myfrac{15^x+ 35^y}{25^y+21^z}$
        \bigskip
        
        Here is the question text 
        
        \textbf{Here is the question text}  
    }
    
    \begin{tasks}(2)
        \task first answer
        \task second answer
        \task third answer
        \task fourth answer
    \end{tasks}
\end{multicols*}
\end{document}
1
  • Thank you for your work @SİmonDispa
    – suarez
    Commented Sep 12, 2021 at 15:44

You must log in to answer this question.

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