PDF Info variables set inside the class
I have a simple custom class defined as:
NeedsTeXFormat{LaTeX2e}
ProvidesClass{mycustom}[2019/03/06 My custom class]
LoadClass{article}
RequirePackage{hyperxmp}
RequirePackage[unicode]{hyperref}
newcommand{name}[2]{
def@name{#1}
def@surname{#2}
def@fullname{#1 #2}
}
newcommand{address}[4]{
def@neighborhood{#1}
def@city{#2}
def@state{#3}
def@country{#4}
}
endinput
And a minimal TeX file:
documentclass{mycustom}
name{John}{Smith}
phone{+1 123 555-1234}
address{Spring Falls}{Helena-West Helena}{AR}{United States of America}
makeatletter
hypersetup{%
pdftitle={@fullname cs{ } title},
pdfsubject={@neighborhood},
pdfauthor={@fullname},
pdfcontactcity={@city},
pdfcontactcountry={@country},
pdfmetalang={en}
}
makeatother
begin{document}
foo bar barz
end{document}
On that I have two questions:
Why the document document compiles but returns a
Undefined control sequence. }at line 14?Is possible to move the texttt{hypersetup} to the class (with the variables), instead the main file?
Tried with PDFTeX and XeTeX.
xetex pdftex hyperref pdf
add a comment |
I have a simple custom class defined as:
NeedsTeXFormat{LaTeX2e}
ProvidesClass{mycustom}[2019/03/06 My custom class]
LoadClass{article}
RequirePackage{hyperxmp}
RequirePackage[unicode]{hyperref}
newcommand{name}[2]{
def@name{#1}
def@surname{#2}
def@fullname{#1 #2}
}
newcommand{address}[4]{
def@neighborhood{#1}
def@city{#2}
def@state{#3}
def@country{#4}
}
endinput
And a minimal TeX file:
documentclass{mycustom}
name{John}{Smith}
phone{+1 123 555-1234}
address{Spring Falls}{Helena-West Helena}{AR}{United States of America}
makeatletter
hypersetup{%
pdftitle={@fullname cs{ } title},
pdfsubject={@neighborhood},
pdfauthor={@fullname},
pdfcontactcity={@city},
pdfcontactcountry={@country},
pdfmetalang={en}
}
makeatother
begin{document}
foo bar barz
end{document}
On that I have two questions:
Why the document document compiles but returns a
Undefined control sequence. }at line 14?Is possible to move the texttt{hypersetup} to the class (with the variables), instead the main file?
Tried with PDFTeX and XeTeX.
xetex pdftex hyperref pdf
add a comment |
I have a simple custom class defined as:
NeedsTeXFormat{LaTeX2e}
ProvidesClass{mycustom}[2019/03/06 My custom class]
LoadClass{article}
RequirePackage{hyperxmp}
RequirePackage[unicode]{hyperref}
newcommand{name}[2]{
def@name{#1}
def@surname{#2}
def@fullname{#1 #2}
}
newcommand{address}[4]{
def@neighborhood{#1}
def@city{#2}
def@state{#3}
def@country{#4}
}
endinput
And a minimal TeX file:
documentclass{mycustom}
name{John}{Smith}
phone{+1 123 555-1234}
address{Spring Falls}{Helena-West Helena}{AR}{United States of America}
makeatletter
hypersetup{%
pdftitle={@fullname cs{ } title},
pdfsubject={@neighborhood},
pdfauthor={@fullname},
pdfcontactcity={@city},
pdfcontactcountry={@country},
pdfmetalang={en}
}
makeatother
begin{document}
foo bar barz
end{document}
On that I have two questions:
Why the document document compiles but returns a
Undefined control sequence. }at line 14?Is possible to move the texttt{hypersetup} to the class (with the variables), instead the main file?
Tried with PDFTeX and XeTeX.
xetex pdftex hyperref pdf
I have a simple custom class defined as:
NeedsTeXFormat{LaTeX2e}
ProvidesClass{mycustom}[2019/03/06 My custom class]
LoadClass{article}
RequirePackage{hyperxmp}
RequirePackage[unicode]{hyperref}
newcommand{name}[2]{
def@name{#1}
def@surname{#2}
def@fullname{#1 #2}
}
newcommand{address}[4]{
def@neighborhood{#1}
def@city{#2}
def@state{#3}
def@country{#4}
}
endinput
And a minimal TeX file:
documentclass{mycustom}
name{John}{Smith}
phone{+1 123 555-1234}
address{Spring Falls}{Helena-West Helena}{AR}{United States of America}
makeatletter
hypersetup{%
pdftitle={@fullname cs{ } title},
pdfsubject={@neighborhood},
pdfauthor={@fullname},
pdfcontactcity={@city},
pdfcontactcountry={@country},
pdfmetalang={en}
}
makeatother
begin{document}
foo bar barz
end{document}
On that I have two questions:
Why the document document compiles but returns a
Undefined control sequence. }at line 14?Is possible to move the texttt{hypersetup} to the class (with the variables), instead the main file?
Tried with PDFTeX and XeTeX.
xetex pdftex hyperref pdf
xetex pdftex hyperref pdf
asked 18 mins ago
LinLin
3117
3117
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478520%2fpdf-info-variables-set-inside-the-class%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478520%2fpdf-info-variables-set-inside-the-class%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown