summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/q-and-a
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/q-and-a')
-rw-r--r--macros/latex/contrib/q-and-a/Q-and-A.cls13
-rw-r--r--macros/latex/contrib/q-and-a/README.md3
-rw-r--r--macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-dark.pdfbin43260 -> 45683 bytes
-rw-r--r--macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-light.pdfbin43239 -> 45654 bytes
-rw-r--r--macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT.tex37
-rw-r--r--macros/latex/contrib/q-and-a/demo/theme-ChatGPT/images/Q-and-A-demo-logo-ChatGPT.pdfbin2106 -> 2703 bytes
-rw-r--r--macros/latex/contrib/q-and-a/doc/Q-and-A-doc.pdfbin100627 -> 101697 bytes
-rw-r--r--macros/latex/contrib/q-and-a/doc/Q-and-A-doc.tex7
8 files changed, 53 insertions, 7 deletions
diff --git a/macros/latex/contrib/q-and-a/Q-and-A.cls b/macros/latex/contrib/q-and-a/Q-and-A.cls
index 82e1cd7d5a..95de42d609 100644
--- a/macros/latex/contrib/q-and-a/Q-and-A.cls
+++ b/macros/latex/contrib/q-and-a/Q-and-A.cls
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplClass
{Q-and-A}
- {2023/11/07} {}
+ {2023/11/08} {}
{Document class for typesetting Q&A conversation}
\keys_define:nn { Q-and-A }
@@ -320,6 +320,7 @@
NewDocumentCommand,NewDocumentEnvironment,
includegraphics,
definecolor, colorlet, color, textcolor,
+ tikz, draw, fill, filldraw, node, clip,
}
{% LaTeX3 commands
}
@@ -379,12 +380,19 @@
\group_end:
}
+\def\QAendmark{}
\NewDocumentCommand \QAInput { m }
{
\file_get:nnN { #1 } { } \l_tmpa_tl
\exp_args:No \QAtext { \l_tmpa_tl }
% Currently, for some reason, the following adjustment is needed
- \vspace{-2\parskip}
+ \peek_regex:nF { (\ *)? (\c{par}*)? (\ *)? \c{QAendmark} }
+ {
+ \peek_meaning:NF \QAendmark
+ {% only do this in the middle of the text
+ \vspace{-2\parskip}
+ }
+ }
}
\NewDocumentCommand \QAInclude { m }
{
@@ -1134,6 +1142,7 @@
}
}
\__QA_put_current_content:n { #1 }
+ \tl_gput_right:Nn #1 { \QAendmark }
}
\box_new:N \l__QA_tmp_box
diff --git a/macros/latex/contrib/q-and-a/README.md b/macros/latex/contrib/q-and-a/README.md
index 4c3d474cc1..d9937df788 100644
--- a/macros/latex/contrib/q-and-a/README.md
+++ b/macros/latex/contrib/q-and-a/README.md
@@ -59,3 +59,6 @@ The scroll mode is achieved by directly accessing `\pdfpageheight` (pdfTeX and X
# License
This work is released under the LaTeX Project Public License, v1.3c or later.
+
+The ChatGPT logo image used in the demo document is *not* an official version. It has been created by the author by overlaying the OpenAI logo onto a colored background, with the background color being extracted directly from the ChatGPT interface using a color picker tool. This was done solely for the purpose of replicating the layout of the actual ChatGPT interface.
+The author does not assert any copyright claims or ownership over the design of this logo. Users are kindly advised to replace this logo image in their respective documents with their own authorized version.
diff --git a/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-dark.pdf b/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-dark.pdf
index 99b80904b1..9ccbae5242 100644
--- a/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-dark.pdf
+++ b/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-dark.pdf
Binary files differ
diff --git a/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-light.pdf b/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-light.pdf
index 69175ceb7f..82349a5414 100644
--- a/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-light.pdf
+++ b/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT-light.pdf
Binary files differ
diff --git a/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT.tex b/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT.tex
index 318bc65ee7..fb5be3e4ce 100644
--- a/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT.tex
+++ b/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/Q-and-A-demo-ChatGPT.tex
@@ -4,9 +4,40 @@
scroll,
]{Q-and-A}
-
-\SetLogoCode[Q]{\smash{\raisebox{-.45\baselineskip}{\includegraphics[height=1.35\baselineskip]{Q-and-A-demo-logo-User}}}}
-\SetLogoCode[A]{\smash{\raisebox{-.45\baselineskip}{\includegraphics[height=1.35\baselineskip]{Q-and-A-demo-logo-ChatGPT}}}}
+% The User Logo
+\SetLogoCode[Q]{%
+ \smash{\raisebox{-.65\baselineskip}{%
+ \begin{tikzpicture}
+ \node [inner sep=0pt] at (0,0) {\includegraphics[height=1.5\baselineskip]{Q-and-A-demo-logo-User}};
+ \draw [QA-Q-back, rounded corners=.15\baselineskip, line width=.2\baselineskip]
+ (current bounding box.north west) --
+ (current bounding box.north east) --
+ (current bounding box.south east) --
+ (current bounding box.south west) -- cycle;
+ \clip (current bounding box.north west) --
+ (current bounding box.north east) --
+ (current bounding box.south east) --
+ (current bounding box.south west) -- cycle;
+ \end{tikzpicture}%
+ }\hspace{-.25em}%
+ }}
+% The ChatGPT Logo
+\SetLogoCode[A]{%
+ \smash{\raisebox{-.65\baselineskip}{%
+ \begin{tikzpicture}
+ \node [inner sep=0pt] at (0,0) {\includegraphics[height=1.5\baselineskip]{Q-and-A-demo-logo-ChatGPT}};
+ \draw [QA-A-back, rounded corners=.15\baselineskip, line width=.2\baselineskip]
+ (current bounding box.north west) --
+ (current bounding box.north east) --
+ (current bounding box.south east) --
+ (current bounding box.south west) -- cycle;
+ \clip (current bounding box.north west) --
+ (current bounding box.north east) --
+ (current bounding box.south east) --
+ (current bounding box.south west) -- cycle;
+ \end{tikzpicture}%
+ }\hspace{-.25em}%
+ }}
\begin{document}
diff --git a/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/images/Q-and-A-demo-logo-ChatGPT.pdf b/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/images/Q-and-A-demo-logo-ChatGPT.pdf
index 6ab76f7083..bd89da4131 100644
--- a/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/images/Q-and-A-demo-logo-ChatGPT.pdf
+++ b/macros/latex/contrib/q-and-a/demo/theme-ChatGPT/images/Q-and-A-demo-logo-ChatGPT.pdf
Binary files differ
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 dadca3b63e..137559f16a 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 48894878d7..5cdaa152bd 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,7 +5,7 @@
scroll,
]{Q-and-A}
-\def\PackageVersion{2023/11/07}
+\def\PackageVersion{2023/11/08}
\def\PackageSubVersion{}
\newcommand{\QApackage}{{\normalfont\textsf{Q-and-A}}}
@@ -247,10 +247,13 @@
\begin{itemize}
\item Currently, the code highlight is done by the package `listings`. Due to its own limitations, the result is still far from satisfactory. Using `minted` instead could improve the situation, but this would require `-shell-escape` and some external tweaking, thus it would still take some effort to make it work with the current document class.
+ \item Due to the current implementation, one cannot direct write code (either inline or displayed) within the text (alternative solution has been proposed above).
+ \item Due to the current implementation, one may not be able to directly write certain characters (such as `\textasterisk`) in the text, this might be especially inconvenient in math mode (temporary alternative solution has been proposed above).
+ \item Due to the current implementation, the method for inputting and including subfiles doesn't really work like `\textbackslash input` and `\textbackslash include`. In particular, the current type of conversation would be reset, this might cause some confusion in certain cases.
% \item The code block containing long piece of code usually won't properly break across the page (which is essentially why this documentation and the demo documents enabled the `scroll` mode).
%% 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. As a result, the level of lists might be slightly messed up, which could sometimes lead to issues with the list labels.
+ \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.
\end{itemize}