summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/q-and-a
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-11-21 21:30:29 +0000
committerKarl Berry <karl@freefriends.org>2023-11-21 21:30:29 +0000
commit939cba126e345d56b8a815e7a673208aec07dd2d (patch)
tree498950812bf9dbf1f38f0b980dd7bc9e10b6ac58 /Master/texmf-dist/doc/latex/q-and-a
parent8f7f354ef6f6ffca87151344ba8315e0e76e3bec (diff)
q-and-a (21nov23)
git-svn-id: svn://tug.org/texlive/trunk@68928 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/README.md38
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple-content.tex48
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/demo/mode-multiple/Q-and-A-demo-multiple.pdfbin29542 -> 33140 bytes
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.pdfbin110412 -> 116495 bytes
-rw-r--r--Master/texmf-dist/doc/latex/q-and-a/doc/Q-and-A-doc.tex24
5 files changed, 78 insertions, 32 deletions
diff --git a/Master/texmf-dist/doc/latex/q-and-a/README.md b/Master/texmf-dist/doc/latex/q-and-a/README.md
index d9937df788b..e36b3a9e1ac 100644
--- a/Master/texmf-dist/doc/latex/q-and-a/README.md
+++ b/Master/texmf-dist/doc/latex/q-and-a/README.md
@@ -8,6 +8,33 @@
Notably, it features two themes, `ChatGPT-light` and `ChatGPT-dark`, enabling you to format your Q&A dialog in a way that closely resembles the interface of ChatGPT.
+### Screenshots
+
+<!-- ![image](https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-default.png) -->
+<div align=center><img width="400" src="https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-default.png"/></div>
+
+> From [the documentation](https://github.com/Jinwen-XU/Q-and-A/blob/main/doc/Q-and-A-doc.pdf).
+
+<!-- ![image](https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-ChatGPT-1.png) -->
+<div align=center><img width="750" src="https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-ChatGPT-1.png"/></div>
+
+> From [the demo document for theme "ChatGPT-dark"](https://github.com/Jinwen-XU/Q-and-A/blob/main/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-dark.pdf).
+
+<!-- ![image](https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-ChatGPT-classical-1.png) -->
+<div align=center><img width="750" src="https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-ChatGPT-classical-1.png"/></div>
+
+> From [the demo document for theme "ChatGPT-classical-dark"](https://github.com/Jinwen-XU/Q-and-A/blob/main/demo/theme-ChatGPT-classical/Q-and-A-demo-ChatGPT-classical-dark.pdf).
+
+<!-- ![image](https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-default-1.png) -->
+<div align=center><img width="750" src="https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-default-1.png"/></div>
+
+> From [the English demo document](https://github.com/Jinwen-XU/Q-and-A/blob/main/demo/lang-en/Q-and-A-demo-en.pdf).
+
+<!-- ![image](https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-multiple-1.png) -->
+<div align=center><img width="750" src="https://github.com/Jinwen-XU/Q-and-A/raw/main/screenshots/screenshot-multiple-1.png"/></div>
+
+> From [the demo document for multiple questions/answers](https://github.com/Jinwen-XU/Q-and-A/blob/main/demo/mode-multiple/Q-and-A-demo-multiple.pdf).
+
## Installation and preparation
### How to install this package
@@ -16,6 +43,9 @@ If you are using TeX Live 2024 or newer, or the most recent version of MikTeX, t
Otherwise, you need to check for package update to see if you can receive it. In case not, you can always go to [the CTAN page](https://ctan.org/pkg/Q-and-A) to download the `.zip` file with all related files included.
+> **Attention:**
+> For this document class to function properly, the LaTeX2e kernel must be at least as new as `2023/11/01`.
+
## Usage
Please refer to [the documentation](https://github.com/Jinwen-XU/Q-and-A/blob/main/doc/Q-and-A-doc.pdf) for detailed usage.
@@ -43,17 +73,19 @@ If you are using XeLaTeX or LuaLaTeX to compile your document, then the current
These are necessary if you wish to write your document in Chinese (either simplified or traditional) or Japanese. Also, without these fonts installed, the compilation speed might be much slower — the compilation would still pass, but the system shall spend (quite) some time verifying that the fonts are indeed missing before switching to the fallback fonts.
-### Functionality
+### Some aspects
+
+#### On the functionality
The main features are achieved with the power of LaTeX3's regex functionality. It scans the content paragraph by paragraph and converts recognized patterns into corresponding TeX commands.
However, this comes with a price: in order to scan the content, it is firstly stored in a macro, and that means that you cannot use commands like `\verb` in your main text.
Also, synctex won't work properly.
-### Language and date format
+#### Language and date format
Language and date format can both be set in two ways: as class option or with corresponding commands.
- The user-level command for setting language is `\UseLanguage`, provided by `projlib-language`; the one for setting date format is `\SetDatetimeInputFormat`, provided by `projlib-date`.
- When you set the language, it is not exactly the same using class option or using command: when you select a language via class option, only the setting for this language would be loaded; however, with `\UseLanguage`, it would load *all* the language settings and then switch to your selected one. Sometimes the page breaking behavior differs slightly. Personally I prefer the `\UseLanguage` approach, for this would allow you to switch language in the middle of your document.
-### Scroll mode
+#### Scroll mode
The scroll mode is achieved by directly accessing `\pdfpageheight` (pdfTeX and XeTeX) or `\pageheight` (LuaTeX). <!-- The minimal page height is set to be `10in`. --> It is worth noting that in order to calculate the height needed, the entire content are put into a single box, which puts a limitation on the length of your document (but this usually wouldn't be a problem).
# License
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
index 9dabdc5dc78..689d34987cb 100644
--- 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
@@ -1,31 +1,31 @@
"
We start with the **normal** mode.
-?
+? \QALabel{Q:normal-1}
Question.
:
- Answer.
+ Answer to \QARef{Q:normal-1}.
-?
+? \QALabel{Q:normal-2}
Question.
:
- Answer.
+ Answer to \QARef{Q:normal-2}.
"
Now start the **multiple question** mode.
\EnableMultipleQuestion
-?
- Question.
+? \QALabel{Q:multi-1}
+ First question.
-?
- Question.
+? \QALabel{Q:multi-2}
+ Second question.
:
- Answer.
+ Answer to \QARef{Q:multi-1} and \QARef{Q:multi-2}.
"
Now stop the multiple question mode, and start the **multiple answer** mode.
@@ -34,14 +34,14 @@
\EnableMultipleAnswer
-?
- Question.
+? \QALabel{Q:normal-multi}
+ Question with two answers \QARef{A:multi-1} and \QARef{A:multi-2}.
-:
- Answer.
+: \QALabel{A:multi-1}
+ First answer to \QARef{Q:normal-multi}.
-:
- Answer.
+: \QALabel{A:multi-2}
+ Second answer to \QARef{Q:normal-multi}.
"
Now start both the **multiple question** mode and the **multiple answer** mode.
@@ -50,20 +50,20 @@
\EnableMultipleAnswer
-?
+? \QALabel{Q:multi-1'}
Question.
-?
+? \QALabel{Q:multi-2'}
Question.
:
- Answer.
+ First answer to \QARef{Q:multi-1'} and \QARef{Q:multi-2'}.
:
- Answer.
+ Second answer to \QARef{Q:multi-1'} and \QARef{Q:multi-2'}.
:
- Answer.
+ Third answer to \QARef{Q:multi-1'} and \QARef{Q:multi-2'}.
"
Back to the **normal** mode.
@@ -72,14 +72,14 @@
\DisableMultipleAnswer
-?
+? \QALabel{Q:normal-1'}
Question.
:
- Answer.
+ Answer to \QARef{Q:normal-1'}.
-?
+? \QALabel{Q:normal-2'}
Question.
:
- Answer.
+ Answer \QARef{Q:normal-2'}.
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
index 620746bd503..c1378c72218 100644
--- 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
Binary files differ
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 aaf9b6c8121..4681a23425c 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 ef442a22596..44b57cf98f3 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,7 +5,7 @@
scroll,
]{Q-and-A}
-\def\PackageVersion{2023/11/19}
+\def\PackageVersion{2023/11/21}
\def\PackageSubVersion{}
\newcommand{\QApackage}{{\normalfont\textsf{Q-and-A}}}
@@ -57,6 +57,10 @@
Otherwise, you need to check for package update to see if you can receive it. In case not, you can always go to \href{https://ctan.org/pkg/Q-and-A}{the CTAN page} to download the `.zip` file with all related files included.
+"
+ **Attention:**\\
+ For this document class to function properly, the \LaTeX2e kernel must be at least as new as `2023/11/01`.
+
##+ {Usage}
@@ -114,8 +118,11 @@
\item for simplified Chinese, it is also possible to use the prefix `问:` for questions, `答:` for answers, and `注:` for narrations; similarly for traditional Chinese;
\item for Chinese or Japanese, it is also possible to use the prefix `?` for questions, `:` for answers, and `“`, `”` or `「` for narrations.
\end{itemize}}
- You may specify the identity of the current speaker by placing `<\meta{name}>` after the prefix (there could be some spaces in between). For example, `? <You>` would set the questioner's name to `You`. How this name is disposed of depends on your current selected theme.
- \QANote{The identity for the current type would be recorded, so unless you wish to change it, you only need to write it once.}
+ \begin{itemize}
+ \item You may specify the identity of the current speaker by placing `<\meta{name}>` after the prefix (there could be some spaces in between). For example, `? <You>` would set the questioner's name to `You`. How this name is disposed of depends on your current selected theme.
+ \QANote{The identity for the current type would be recorded, so unless you wish to change it, you only need to write it once.}
+ \item To reference a question/answer, use the commands `\textbackslash QALabel\{\meta{label}\}` and `\textbackslash QARef\{\meta{label}\}` (of course, for this to work, you first need to turn on the numbering via the class options `numbered question` and `numbered answer`).
+ \end{itemize}
[Emphasize and Bold]
\begin{itemize}
@@ -150,7 +157,8 @@
\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{By default, the `\meta{caption text}` shall be directly printed in the center. To redefine its style, you may use the command `\textbackslash QASetCaptionStyle\{\meta{settings}\}`, where `\meta{settings}` is some code containing `\textsharp 1`, which refers to `\meta{caption text}`.\\
+ For example, `\textbackslash QASetCaptionStyle\{\textbackslash textcolor\{.!50\}\{(\textsharp 1)\}\}` adds a pair of parentheses around the \meta{caption text} and sets it to half transparent.}
[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.
@@ -251,7 +259,7 @@
\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 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.}
+ \QANote{In the demo documents, you may find examples 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.
@@ -289,6 +297,12 @@
%% 2023-11-05, solved with the new option "answer outside the box".
\item Due to the current implementation, though it is already possible to automatically adopt the identifiers and labels for supported languages, you still need to use the identifiers `Q`, `A` and `N` when setting them.
\item Currently, for typesetting questions and answers, the text is in fact being put into some sort of `description` list (upon reflection, why did I do this? I could have simply put the label into margin...). As a result, the level of lists might be slightly messed up, which could sometimes lead to issues with the list labels.
+ % \item It is not yet possible to cite the questions/answers.
+ %% 2023-11-19, solved with new commands \QALabel and \QARef.
+ % \item Referencing of questions/answers doesn't have hyperlinks.
+ %% 2023-11-20, solved by using the `target` property.
+ \item Referencing of questions/answers doesn't work for all themes.
+ \item If you decide to change the language in the middle of the text, referencing text wouldn't be shown in the original language, but would be shown according to the language of the context where the referencing command is being specified.
\item Some vertical and horizontal spacing still needs to be fine-tuned.
\item The code for all those themes is currently mixed up, which poses difficulties for maintenance and expandability.
\end{itemize}