summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/q-and-a
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-11-17 22:02:41 +0000
committerKarl Berry <karl@freefriends.org>2023-11-17 22:02:41 +0000
commit6719122c781ae5bcef2f225c8f5246f31dacf704 (patch)
treec3d8f43b02eb78aa8cb80c619451888bbdb0941d /Master/texmf-dist/doc/latex/q-and-a
parentd44419c83dcadbcb3e7bf923b8ad1e7ec6902502 (diff)
q-and-a (17nov23)
git-svn-id: svn://tug.org/texlive/trunk@68880 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/q-and-a')
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple-content.tex85
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.pdfbin0 -> 29394 bytes
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.tex33
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.pdfbin102869 -> 108248 bytes
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.tex36
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex3
6 files changed, 147 insertions, 10 deletions
diff --git a/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple-content.tex b/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple-content.tex
new file mode 100644
index 00000000000..a7ee5787ed9
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple-content.tex
@@ -0,0 +1,85 @@
+"
+ We start with the **normal** mode.
+
+?
+ Question.
+
+:
+ Answer.
+
+?
+ Question.
+
+:
+ Answer.
+
+"
+ Now start the **multiple question** mode.
+
+\EnableMultipleQuestion
+
+?
+ Question.
+
+?
+ Question.
+
+:
+ Answer.
+
+"
+ Now stop the **multiple question** mode, and start the **multiple answer** mode.
+
+\DisableMultipleQuestion
+
+\EnableMultipleAnswer
+
+?
+ Question.
+
+:
+ Answer.
+
+:
+ Answer.
+
+"
+ Now start both the **multiple question** mode and the **multiple answer** mode.
+
+\EnableMultipleQuestion
+
+\EnableMultipleAnswer
+
+?
+ Question.
+
+?
+ Question.
+
+:
+ Answer.
+
+:
+ Answer.
+
+:
+ Answer.
+
+"
+ Back to the **normal** mode.
+
+\DisableMultipleQuestion
+
+\DisableMultipleAnswer
+
+?
+ Question.
+
+:
+ Answer.
+
+?
+ Question.
+
+:
+ Answer.
diff --git a/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.pdf b/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.pdf
new file mode 100644
index 00000000000..8c7b209882f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.tex b/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.tex
new file mode 100644
index 00000000000..3e04ada640c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.tex
@@ -0,0 +1,33 @@
+\documentclass[%11pt,
+ numbered question,
+ numbered answer,
+ % multiple question,
+ % multiple answer,
+ enlarge left margin by = .5cm,
+ scroll,
+]{Q-and-A}
+
+\SetSubcounterStyle{\smaller}
+\SetSubcounterSeparator{\,/\,}
+% \SetSubcounterSeparator{-}
+
+\begin{document}
+
+
+:: {Q-and-A-demo-multiple-content}
+
+
+---
+
+"
+ Below is the code of this conversation.
+
+ == {Q-and-A-demo-multiple-content}
+
+"
+ Below is the code of the main document.
+
+ == [latex] {\jobname}
+
+
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.pdf b/Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.pdf
index 4f5d79d7e67..f810f598d1a 100644
--- a/Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.pdf
+++ b/Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.tex b/Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.tex
index 4043c4cb918..369b6efd908 100644
--- a/Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.tex
+++ b/Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.tex
@@ -5,8 +5,8 @@
scroll,
]{Q-and-A}
-\def\PackageVersion{2023/11/11}
-\def\PackageSubVersion{}
+\def\PackageVersion{2023/11/17}
+\def\PackageSubVersion{a}
\newcommand{\QApackage}{{\normalfont\textsf{Q-and-A}}}
@@ -75,6 +75,10 @@
\item `use theme = \meta{theme}`: use the selected theme, available choices include: `default` (like the current document), `ChatGPT-light` and `ChatGPT-dark` (see the demo documents).
\item `numbered question`, or `question number`: enable the numbering of questions.
\item `numbered answer`, or `answer number`: enable the numbering of answers.
+ \item `multiple question` and `multiple answer`: enable subcounter for questions and answers. This can also be enabled/disabled manually in the middle of the document, via `\textbackslash EnableMultipleQuestion` / `\textbackslash DisableMultipleQuestion` and `\textbackslash EnableMultipleAnswer` / `\textbackslash DisableMultipleAnswer`.
+ \item `smaller subcounter`: when `multiple question` (and/or `multiple answer`) is enabled, use this option to show the subcounter in a smaller size.
+ \item `enlarge left margin by = \meta{length}`, or `increase left margin by = \meta{length}`: enlarge the left margin by the amount of `\meta{length}`. This would be useful if there are so many questions/answers that the numbering becomes too long to fit in the margin.
+ \QANote{Here `\meta{length}` should be specified with absolute unit like `pt`, `cm`, `mm`, `in`, etc., but not with unit like `ex` or `em`.}
\item `answer outside the box`, or `answer out of the box` (or even omit `the`): enable another implementation for printing the answer that does not involve putting it into a colored box. This would be useful if the answers contain many long pieces of code while you still want the pages to break normally.
\end{itemize}
@@ -135,13 +139,13 @@
\begin{itemize}
\item For centered image, the caption can be written via `\textgreater\textgreater{} \meta{caption text}`.
\end{itemize}
- \QANote{Currently, the `\meta{caption text}` shall be directly printed in the center. You may wish to add a pair of parentheses around it.}
+ % \QANote{Currently, the `\meta{caption text}` shall be directly printed in the center. You may wish to add a pair of parentheses around it.}
[Code]
Due to the current implementation of this document class, it is unfortunate that you cannot directly insert source code in your document. There are some workarounds, though.
\begin{itemize}
\item For *inline* code, you may simply write it between two backticks `\textbacktick\meta{code}\textbacktick`, similar to the Markdown syntax. However, be aware that special characters need to be escaped, for example, `\textbackslash` should be written as `\textbackslash textbackslash`, `\{` should be written as `\textbackslash\{`, `\%` should be written as `\textbackslash\%`, etc.
- \item For *displayed* code, stored the code into a separate file, and then use `\textequalsign\textequalsign{} \{\meta{file name}\}` to print~it. You may also use an optional argument like `\textequalsign\textequalsign{} [\meta{language}] \{\meta{file name}\}` to select the language of your code.
+ \item For *displayed* code, store the code into a separate file, and then use `\textequalsign\textequalsign{} \{\meta{file name}\}` to print~it. You may also use an optional argument like `\textequalsign\textequalsign{} [\meta{language}] \{\meta{file name}\}` to select the language of your code.
\QANote{If the answers contain many long pieces of code, you may consider using the class option `answer outside the box`.}
\end{itemize}
@@ -166,6 +170,8 @@
And don't forget that you are still using \LaTeX, so images, tables and lists can be written as usual.
+ \medskip
+
>>> Currently, the default style for showing tables has not been settled (since the color configuration for tables with or without headers would be slightly different). As a temporary solution, it is recommended for you to consult the several nice answers of this question: \url{https://tex.stackexchange.com/q/10224}.
@@ -220,21 +226,31 @@
Here, \meta{identifier} is a comma list of your specified identifiers. For example, the default identifier for narrations is preset via `\textbackslash QASetTypePrefix\{N\}\{N:,",“,”,「\}`.
\QANote{Note that, due to its implementation, the identifier cannot contain comma `,` in it. If you wish to use an identifier that contains a comma, you may use `\textbackslash QAAddTypePrefix` instead, which only adds *one* identifier per use.}
\QANote{Note also that, the identifiers are *reset* upon changing of language. Thus, you need to put your setting into the corresponding language configuration, for example, via `\textbackslash AddLanguageSetting[\meta{language name}]\{\meta{settings}\}`}
+ \QANote{You may use `\textbackslash QARemovePrefix\{\meta{identifier}\}` to remove a certain identifier, or use `\textbackslash QARemoveAllPrefix` to remove all of them. This is especially useful if you wish to clear all the previous setting in the language configuration.}
[Changing labels]
- You may also change the labels. For example, from the text \textquote{Q:} to a logo icon. This can be done via the use of `\textbackslash SetLogoCode` in the preamble of your document.
+ You may also change the labels. For example, from the text \textquote{Q:} to a logo icon. This can be done via the use of `\textbackslash QASetLogoCode` in the preamble of your document.
\begin{itemize}
- \item Use `\textbackslash SetLogoCode\{Q\}\{\meta{logo code}\}` to set the labels for questions.
- \item Use `\textbackslash SetLogoCode\{A\}\{\meta{logo code}\}` to set the labels for answers.
+ \item Use `\textbackslash QASetLogoCode\{Q\}\{\meta{logo code}\}` to set the labels for questions.
+ \item Use `\textbackslash QASetLogoCode\{A\}\{\meta{logo code}\}` to set the labels for answers.
\end{itemize}
- Here, \meta{logo code} is the actual code for displaying the corresponding label. For example, the default label for (unnumbered) questions is preset via `\textbackslash SetLogoCode\{Q\}\{\textbackslash textbf\{Q\textbackslash,:\}\}`.
+ Here, \meta{logo code} is the actual code for displaying the corresponding label. For example, the default label for (unnumbered) questions is preset via `\textbackslash QASetLogoCode\{Q\}\{\textbackslash textbf\{Q\textbackslash,:\}\}`.
\QANote{In the demo document, you can find an example on how to use this command to specify a logo for each role in the conversation.}
If you wish to include the question number or answer number, you may use the command `\textbackslash QAShowCounter`:
\begin{itemize}
\item Use `\textbackslash QAShowCounter\{Q\}` to step the counter of question and print it.
\item Use `\textbackslash QAShowCounter\{A\}` to step the counter of answer and print it.
\end{itemize}
- For example, the default label for numbered questions is preset by adding `\textbackslash QAShowCounter\{Q\}` to the unnumbered version: `\textbackslash SetLogoCode\{Q\}\{\textbackslash textbf\{Q\textbackslash QAShowCounter\{Q\}\textbackslash,:\}\}`.
+ For example, the default label for numbered questions is preset by adding `\textbackslash QAShowCounter\{Q\}` to the unnumbered version: `\textbackslash QASetLogoCode\{Q\}\{\textbackslash textbf\{Q\textbackslash QAShowCounter\{Q\}\textbackslash,:\}\}`.
+
+ [Controlling subcounters]
+ When using `\textbackslash QAShowCounter` to show a counter that contains a subcounter, it is possible to control the style and the separator of the subcounter:
+ \begin{itemize}
+ \item Use `\textbackslash QASetSubcounterStyle\{\meta{style code}\}` to define the style of the subcounter. For example, the class option `smaller subcounter` is equivalent to `\textbackslash QASetSubcounterStyle\{\textbackslash smaller\}`.
+ \item Use `\textbackslash QASetSubcounterSeparator\{\meta{separator}\}` to define the separator between the parent and child counters. By default it is `.`, but you may set it to, say, `-`, or `/`.
+ \end{itemize}
+
+ >>> In this section, all commands with the prefix `QASet` also has an abbreviation form with the prefix `Set`. For example, instead of `\textbackslash QASetLogoCode`, you may simply write `\textbackslash SetLogoCode`.
##+ {Known Issues}
@@ -260,7 +276,7 @@
\end{itemize}
-##+ {Get Support}
+##+ {Getting Support}
?
What should I do if I encounter any problem?
diff --git a/Master/texmf-dist/doc/latex/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex b/Master/texmf-dist/doc/latex/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex
index 29aa3599e13..e8f259f0681 100644
--- a/Master/texmf-dist/doc/latex/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex
+++ b/Master/texmf-dist/doc/latex/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex
@@ -2,6 +2,9 @@
use theme = (@@@\meta{theme}),
numbered question,
numbered answer,
+ % multiple question,
+ % multiple answer,
+ % smaller subcounter,
% answer outside the box,
scroll,
]{Q-and-A}