You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
Adding (necessary) lines to what is copied.
More precisely, I'd like to use sphinx-copybutton for a LaTeX FAQ. It is common for such a FAQ:
to give examples with only code blocks that should go in the "document body" (which is between \begin{document} and \end{document}),
to not display the necessary:
preamble (\documentclass{article}, many occurrences of \usepackage{...}, etc.),
pair \begin{document} and \end{document}.
For instance, instead of:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
This a \textcolor{red}{text in red}.
\end{document}
only:
This a \textcolor{red}{text in red}.
is given (with a mention to the necessary xcolor package).
But if the user just copy and paste the latter and compile it, he will go into troubles. On the other hand, giving the whole code for each example would be tedious to read.
So what could be nice is to display only:
This a \textcolor{red}{text in red}.
and the actual copied text would be:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
This a \textcolor{red}{text in red}.
\end{document}
Additional context
I'm aware this could be considered as unsafe but maybe a pop up could warn the user the actual content of what has been copied.
The text was updated successfully, but these errors were encountered:
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
Adding (necessary) lines to what is copied.
More precisely, I'd like to use
sphinx-copybutton
for a LaTeX FAQ. It is common for such a FAQ:\begin{document}
and\end{document}
),\documentclass{article}
, many occurrences of\usepackage{...}
, etc.),\begin{document}
and\end{document}
.For instance, instead of:
only:
This a \textcolor{red}{text in red}.
is given (with a mention to the necessary
xcolor
package).But if the user just copy and paste the latter and compile it, he will go into troubles. On the other hand, giving the whole code for each example would be tedious to read.
So what could be nice is to display only:
This a \textcolor{red}{text in red}.
and the actual copied text would be:
Additional context
I'm aware this could be considered as unsafe but maybe a pop up could warn the user the actual content of what has been copied.
The text was updated successfully, but these errors were encountered: