Text FormattingClipboard Package And Gdef N Argument Conflict

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
kurttodoroff
Posts: 24
Joined: Thu Feb 07, 2019 4:25 pm

Clipboard Package And Gdef N Argument Conflict

Post by kurttodoroff »

I use Eduardo Louren ̧co de Lima’s excellent Clipboard package in several documents.

In one recent usage, I embedded a \gdef command within the \Copy command. The \gdef command includes the n argument "#1."

Source Document Code:

Code: Select all

\Copy{Preamble-permissible-operations-how-to-be-assured-of-having-latest-data}{
\gdef\PreamblePermissibleOperationsHowToBeAssuredOfHavingLatestData#1{
\section*{PERMISSIBLE OPERATIONS}
The {#1} takes a positive approach.  Lorem ipsum.

\section*{HOW TO BE ASSURED OF HAVING LATEST DATA}
Refer to the {#1} Flyleaf.  Also, check the {#1} title page, and, all status pages contained in the {#1}.  Lorem ipsum
}
}
\PreamblePermissibleOperationsHowToBeAssuredOfHavingLatestData{\fltmanLUC}
Destination Document Code:

Code: Select all

\Paste{Preamble-permissible-operations-how-to-be-assured-of-having-latest-data}
\PreamblePermissibleOperationsHowToBeAssuredOfHavingLatestData{\wpnsmanLUC}
When I compile the source document, LaTeX generates five error messages (each of which requires depressing the RETURN key to resume compilation), which correspond to the five occurrences of "#1". However, the source PDF does display my desired content, correctly. If I remove each occurrence of "#1", LaTeX produces one less error message for each removal.

The same five error messages are:

./DocumentName.tex:9106: Illegal parameter number in definition of
\clipboard@Preamble-permissible-operations-how-to-be-assured-of-having-latest-data.
<to be read again>
1
l.9106 }

When I compile the destination document, LaTeX generates no error messages. The destination PDF displays my desired content, correctly.

How can I include the characters "#1" within the \Copy command, such that Clipboard will acknowledge them properly, rather than consider them to be illegal parameters?

Thank you for any and all assistance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
kurttodoroff
Posts: 24
Joined: Thu Feb 07, 2019 4:25 pm

Clipboard Package And Gdef N Argument Conflict

Post by kurttodoroff »

The Clipboard package developer, Eduardo Louren ̧co de Lima, suggested a different solution. I simplified it.

Source Document Code:

Code: Select all

\gdef\ClipboardFltManOrWpnsMan{\fltmanLUC}
\Copy{Preamble-permissible-operations-how-to-be-assured-of-having-latest-data}{
\section*{PERMISSIBLE OPERATIONS}
The \ClipboardFltManOrWpnsMan\ takes a positive approach.  Lorem ipsum.

\section*{HOW TO BE ASSURED OF HAVING LATEST DATA}
Refer to the \ClipboardFltManOrWpnsMan\ Flyleaf.  Also, check the \ClipboardFltManOrWpnsMan\ title page, and, all status pages contained in the \ClipboardFltManOrWpnsMan.  Lorem ipsum
}
\Paste{Flight-Manual-Preamble-permissible-operations-how-to-be-assured-of-having-latest-data}
Destination Document Code:

Code: Select all

\gdef\ClipboardFltManOrWpnsMan{\wpnsmanLUC}
\Paste{Flight-Manual-Preamble-permissible-operations-how-to-be-assured-of-having-latest-data}
This solved the problem.
Post Reply