summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/q-and-a/doc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-11-18 03:01:07 +0000
committerNorbert Preining <norbert@preining.info>2023-11-18 03:01:07 +0000
commitbcd1a2a7dfe36b38f10a8fa23b4b6f0c325ca899 (patch)
tree2df3f6c998a7a44c9c5365c0ab78e7c152bc0082 /macros/latex/contrib/q-and-a/doc
parentd91bb5cad66508ec34d77ea60c0a02c79308edef (diff)
CTAN sync 202311180301
Diffstat (limited to 'macros/latex/contrib/q-and-a/doc')
-rw-r--r--macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdfbin102869 -> 108248 bytes
-rw-r--r--macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex36
-rw-r--r--macros/latex/contrib/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex3
3 files changed, 29 insertions, 10 deletions
diff --git a/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdf b/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdf
index 4f5d79d7e6..f810f598d1 100644
--- a/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdf
+++ b/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex b/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex
index 4043c4cb91..369b6efd90 100644
--- a/macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex
+++ b/macros/latex/contrib/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/macros/latex/contrib/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex b/macros/latex/contrib/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex
index 29aa3599e1..e8f259f068 100644
--- a/macros/latex/contrib/q-and-a/doc/code/Q-and-A-doc-code-sample-document.tex
+++ b/macros/latex/contrib/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}