Text Formatting ⇒ how would you typeset Q and A?
how would you typeset Q and A?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Posts: 37
- Joined: Sun Mar 29, 2009 1:41 am
how would you typeset Q and A?
Code: Select all
\documentclass{article}\newenvironment{qanda}{\setlength{\parindent}{0pt}}{\bigskip}\newcommand{\Q}{\bigskip\bfseries Q: }\newcommand{\A}{\par\textbf{A:} \normalfont}\begin{document}The following Q\&A is brought to you by Perfect Tenses Unlimited, Mrs.~Antimony's Electrons, and the Free Falling Bodies' Association of the Pacific Ocean. We thank our partners indomitably.\begin{qanda}\Q What is the meaning of life?\A It is only known by the dancing kangaroos of Tibet and the neutrinos of the sun.\Q How can I be endimmened?\A Conquer the world is seventy days. Dislocate the Riemann Hypothesis. Undermine Soviet subjugation involving the juxtaposition of colorless green ideas that sleep furiously. Undeniably, this is the Way. Alternatively, you may turn off the lamp next to you.\Q What shall I ever do?!? My husband is three more eyelashes than he should! Please help me, Counselor, oh thank ye!\A Shut thy trap. Fight fiercely, Harvard.\end{qanda}This is the very end, thank you very much. May conflagarations prevail!\end{document}
how would you typeset Q and A?
What I have so far is:
Code: Select all
\subsection{Q. Are you serious man?}\hspace*{2.5em}\textbf{A.} Dead serious. Ask us.
Do you have any idea how I could change hspace to be a REAL vertical align between A. and the Q. that begins each subsection title??
Then I could work on getting that into trhe environment you started for me

Thanks again for the good work...
how would you typeset Q and A?
Anyway, what about something like this:
Code: Select all
\documentclass{article}\newcounter{question}\setcounter{question}{0}\newcommand{\question}[1]{\item[Q\refstepcounter{question}\thequestion.] \textit{#1}}\newcommand{\answer}[1]{\item[A\thequestion.] #1}\begin{document}\begin{itemize}\question{What is your favorite color?}\answer{Blue}\question{What is your quest?}\answer{To seek the holy grail.}\question{What is the air speed velocity of an unladen swallow?}\answer{I don't know that!}\end{itemize}\end{document}
- Attachments
-
- qa.png (7.58 KiB) Viewed 10987 times