LaTeX forum ⇒ Text FormattingNeed horizontal strip: two column book template

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
praveen25488
Posts: 2
Joined: Mon Sep 25, 2017 7:35 am

Need horizontal strip: two column book template

Postby praveen25488 » Fri Mar 08, 2019 10:06 am

I managed to get the sheading tab, but still, there are some problems. Problem 1: A black box on gray strip with question number in white. Problem 2 Insert indent of 1 cm for text throughout the document. Problem 3: Can we define globally for spacing between items or there is the only way to put '\\'. Here is the code for your kind reference,
  1. \documentclass{book}
  2. \usepackage{multicol}
  3. \setlength{\columnsep}{1cm}
  4. \usepackage[top=0.75in, bottom=0.75in, left=0.55in, right=0.85in]{geometry}
  5. \usepackage{color}
  6. \definecolor{mygrey}{gray}{0.75}
  7. \textheight=9.75in
  8. \raggedbottom
  9. \setlength{\tabcolsep}{0in}
  10. \newcommand{\isep}{-2 pt}
  11. \newcommand{\lsep}{-0.5cm}
  12. \newcommand{\psep}{-0.6cm}
  13. \renewcommand{\labelitemii}{$\circ$}
  14. %-----------------------------------------------------------
  15. %Custom commands
  16. \newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
  17. \newcommand{\resheading}[1]{{\small \colorbox{mygrey}{\begin{minipage}
  18. {1\linewidth}{\textbf{#1 \vphantom{p\^{E}}}}\end{minipage}}}}
  19. \newcommand{\ressubheading}[3]{
  20. \begin{tabular*}{6.62in}{l @{\extracolsep{\fill}} r}
  21. \textsc{{\textbf{#1}}} & \textsc{\textit{[#2]}} \\
  22. \end{tabular*}\vspace{-8pt}}
  23. %-----------------------------------------------------------
  24. \begin{document}
  25. \chapter{Exponents 1}
  26. \begin{multicols}{2}
  27. %%%% Start Question 1
  28. \resheading{\hspace{0.5cm}\textbf{1.} }\\[\lsep]\\
  29. $$\sqrt{9x^2}$$
  30. If $x>0$, which of the following is equivalent to the given expression?\\
  31. \\
  32. \begin{enumerate}
  33. \item[A)] 3x\\
  34. \item[B)] $3x^2$\\
  35. \item[C)] 18x\\
  36. \item[D)] $18x^4$\\
  37. \end{enumerate}
  38. %%%% End Question 1
  39. \end{multicols}
  40. \end{document}

User avatar
Johannes_B
Site Moderator
Posts: 3970
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Mar 08, 2019 11:08 am

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 3 guests