GithubHelp home page GithubHelp logo

doclicense and pdfmanagement about latex-packages HOT 2 OPEN

ypid avatar ypid commented on June 3, 2024
doclicense and pdfmanagement

from latex-packages.

Comments (2)

ypid avatar ypid commented on June 3, 2024

doclicense should therefore not assume that hyperref is loaded through hyperxmp but load it itself.

Does it really assume that? When I look at the code

\AtEndPreamble{%
\@ifpackageloaded{ccicons}{}{\RequirePackage{ccicons}}
% For \doclicenseIcon
\@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}}
% For \doclicenseImage
\@ifpackageloaded{hyperref}{}{\RequirePackage{hyperref}}
\@ifpackageloaded{csquotes}{%
% csquotes has already been loaded so we are fine.
}{%
\ifcsdef{enquote}{%
% \enquote is defined but not by csquotes.
\@ifpackageloaded{biblatex}{%
\PackageError{doclicense}{The enquote macro is defined by biblatex}
{This package assumes that the enquote macro is defined by the
csquotes package. Please load csquotes before you load biblatex so
that biblatex does not define enquote instead.}%
}{%
\PackageError{doclicense}{The enquote macro is defined by an unknown package}
{This package assumes that the enquote macro is defined by the
csquotes package. Please check why enquote is defined without
csquotes being loaded. Maybe try loading csquotes early so that it
can define the enquote macro instead.}%
}
}{%
\RequirePackage{csquotes}
}
}
\@ifpackageloaded{hyperxmp}{%
% The following options are only defined when the hyperxmp package was loaded.
\hypersetup{%
pdfcopyright = {\doclicenseLongTextForHyperref},
pdflicenseurl = {\doclicenseURL},
}
}{}
}
both packages are loaded independently by doclicense if they were not loaded at the end of the preamble.

Can you propose a patch/pull request that fixes it for you? I currently don’t have the latest TeX Live installed so I cannot test your example.

from latex-packages.

u-fischer avatar u-fischer commented on June 3, 2024

sorry I got a bit lost in your various if-clauses and so tried to fix the problem it the wrong way. I will update the pdfmanagement to remove the error there.

But it remains the problem that hyperxmp is not loaded and so your hypersetup is lost. I suggest that you replace

  \@ifpackageloaded{hyperxmp}{%
    % The following options are only defined when the hyperxmp package was loaded.
    \hypersetup{%
      pdfcopyright  = {\doclicenseLongTextForHyperref},
      pdflicenseurl = {\doclicenseURL},
    }
  }{}

by

\IfDocumentMetadataTF
 {
    \hypersetup{%
      pdfcopyright  = {\doclicenseLongTextForHyperref},
      pdflicenseurl = {\doclicenseURL},
    }
 }
 {
   \@ifpackageloaded{hyperxmp}{%
    \hypersetup{%
      pdfcopyright  = {\doclicenseLongTextForHyperref},
      pdflicenseurl = {\doclicenseURL},
    }}{}
 }  

from latex-packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.