Comments (8)
Hi @chedgala ,
Not ridiculous, but I haven't built in a way to do this.
The good news is that it's very easy for you to add this yourself by generating a variant macro that expands its argument once (or more times if you need). You could then make a LaTeX macro for your new expanding variant if you needed it (using \NewDocumentCommand
).
Try this:
\documentclass{article}
\newcommand*{\name}{example-image}
\usepackage{pdfoverlay}
\ExplSyntaxOn
\cs_generate_variant:Nn \pdfoverlay_set_pdf:n { o }
\pdfoverlay_set_pdf:o { \name.pdf }
\ExplSyntaxOff
\begin{document}
\null
\end{document}
If you needed a macro that expands its argument more than once you can use:
\ExplSyntaxOn
\cs_generate_variant:Nn \pdfoverlay_set_pdf:n { x }
\pdfoverlay_set_pdf:x { \name.pdf }
\ExplSyntaxOff
And if you needed a LaTeX macro, you can use:
\ExplSyntaxOn
\cs_generate_variant:Nn \pdfoverlay_set_pdf:n { o }
\NewDocumentCommand \pdfoverlaySetPDFo { m }
{
\pdfoverlay_set_pdf:o { #1 }
}
\ExplSyntaxOff
\pdfoverlaySetPDFo{\name.pdf}
from pdfoverlay.
Thank you very much for this. I will try this and let you know.
from pdfoverlay.
Another option if you store the entire filename in \name
is to use V
variant function. I think this is slightly more efficient and correct expl3
than the o
variant:
\documentclass{article}
\newcommand*{\name}{example-image.pdf}
\usepackage{pdfoverlay}
\ExplSyntaxOn
\cs_generate_variant:Nn \pdfoverlay_set_pdf:n { V }
\pdfoverlay_set_pdf:V \name
\ExplSyntaxOff
\begin{document}
\null
\end{document}
from pdfoverlay.
I used the second method. Much neater. Thank you very much!
from pdfoverlay.
@chedgala , can you please check if the lastest changes to master work for you with your original code and no workarounds?
from pdfoverlay.
Hi @dcpurton. Sorry the late response. I'm on "vacation". I'm working in overleaf, so I don't know if it automatically load the last version of your package.
Anyway, I'm trying the following codes with no results.
% \newcommand*{\namepdf}{Formato_azul}
% \pdfoverlaySetPDF{\namepdf.pdf}
\newcommand*{\namepdf}{Formato_azul.pdf}
\pdfoverlaySetPDF{\namepdf}
No one is working.
from pdfoverlay.
Ah, I haven't released it. You would have to check it out of GitHub. And overleaf only rarely gets updates.
from pdfoverlay.
I think it's likely OK, so I'll do a release to CTAN. Eventually it will get to overleaf, but they usually only update once a year.
You could also upload the new style file to you project directory in overleaf.
from pdfoverlay.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdfoverlay.