summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/novel/lualatex/novel-FileData.sty
blob: 922b221a6e66b5e1b8a5eecf404aa9662d302d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
%% This is file `novel-FileData.sty', part of `novel' document class.
%% Copyright 2017-2023 Robert Allgeyer.
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, version 1.3c only.
%%   https://www.latex-project.org/lppl/lppl-1-3c/
%%
\ProvidesFile{novel-FileData.sty}%
[2023/03/25 v1.81b LaTeX file (File Data settings)]
%% 


%% File Data, also known as PDF Metadata, is non-printing identifying
%%   information in the PDF file. Some or all of it can be read by various
%%   PDF reader software.
%% PDF/X is also considered File Data, as it concerns the structure of the
%%   file and its relationaship to printers, rather than its visible content.
%% In principle, you could set the title as empty. But in that case, no other
%%   File Data will be included, and you cannot have PDF/X compliance.
%% There are many more kinds of File Data that a PDF can include, such as
%%   subject and keywords. But `novel' is specifically for printing to paper,
%%   not for electronic documents that would be found by database search.
%%   Thus, there is no provision for such additional File Data.
%% When you sign up with a print service, you will provide subject, keywords,
%%   and description directly to their database, rather than in the PDF.
%% No need to set copyright in metadata, since your file is only for use by
%%   the print service, and is not being distributed as a PDF e-book.
%%   Your copyright notice is on the printed page, where it should be.
%% Particularly note that your print service is NOT the publisher: YOU are!


%% FILE DATA (PDF Metadata)
%% ----------------------------------------------------------------------------
%%
% \title{} or \SetTitle{}
% Copied to File Data at end of Preamble, unless not set.
% Provides \theTitle anywhere.
% If not set, PDF cannot conform to PDF/X.
\newif \if@HasTitle % true if \SetTitle or \title used
\gdef\SetTitle#1{\gdef\@title{#1}} % for stylistic consistency
\gdef\title#1{\gdef\@title{#1}}
\gdef\thetitle{\@title} % for convenience
\gdef\theTitle{\@title}
\SetTitle{IMPORTANT: Provide Book Title} % Default.
%
% \author{} or \SetAuthor{}
% Copied to File Data at end of preamble, unless not set.
% Provides \theAuthor anywhere.
\gdef\SetAuthor#1{\gdef\@author{#1}} % for stylistic consistency
\gdef\author#1{\gdef\@author{#1}}
\gdef\theauthor{\@author} % for convenience
\gdef\theAuthor{\@author}
\SetAuthor{}
%
% \subtitle{}  or \SetSubtitle{}  (if any)
% Not copied to File Data by itself, as there is no such metadata entry.
% Provides \theSubtitle anywhere.
\gdef\SetSubtitle#1{\gdef\@subtitle{#1}} % for stylistic consistency
\gdef\subtitle#1{\gdef\@subtitle{#1}}
\gdef\thesubtitle{\@subtitle} % compatibility
\gdef\theSubtitle{\@subtitle}
\SetSubtitle{}
%
% \SetApplication{}  (rarely used)
% Also known as CreatorTool.
% Name of the software that created the source document.
% Changing this does not change the software, it just changes the information.
% Normally leave as default, but can change if urgent.
\gdef\SetApplication#1{\gdef\@novelApplication{#1}}
\SetApplication{LuaLaTeX with novel and microtype} % default
%
% \SetProducer{}  (rarely used)
% Name of the software that compiles the source to make PDF.
% Changing this does not change the software, it just changes the information.
% Normally leave as default, but can change if urgent.
\gdef\SetProducer#1{\gdef\@novelProducer{#1}}
\SetProducer{LuaLaTeX with novel-pdfx and hyperref} % default
%
%% End file data.


%% SET PDF/X ARGUMENTS
%% ----------------------------------------------------------------------------
%% \SetPDFX[Output Intent]{compliance standard} % No embed *.icc. Default.
%% \SetPDFX*[Output Intent]{compliance standard} % Embed *.icc.
%% Default: \SetPDFX[CGATSTR001]{X-1a:2001}
%
% \@pdfxSEToff refers to the setting, rather than whether it really is off.
% \@pdfxISoff refers to whether it really is off.
\newif \if@pdfxSEToff
\newif \if@pdfxISoff
% These will get meaningful info when an output intent file is loaded:
\gdef\@OIidentifier{}
\gdef\@OIcondition{}
\gdef\@OIinfo{}
\gdef\@OIregistry{}
\gdef\@OIprofile{}
%
%%
\newif \if@HasConformance
\newif \if@EmbedICC
\gdef\SetPDFX{\@ifstar\@setpdfxst\@setpdfxns}
\newcommand\@setpdfxst[2][CGATSTR001]{
  \global\@EmbedICCtrue
  \@setpdfx{#1}{#2}
}
\newcommand\@setpdfxns[2][CGATSTR001]{
  \global\@EmbedICCfalse
  \@setpdfx{#1}{#2}
}
%
\newcommand\@setpdfx[2]{
  \@tempTFfalse
  \ifthenelse{\equal{#2}{off}}{
    \@tempTFtrue
    \global\@pdfxSETofftrue
    \global\@pdfxISofftrue
  }{}
  \ifthenelse{\equal{#2}{X-1a:2001}}{
    \@tempTFtrue
    \global\@pdfxSETofffalse
    \global\@pdfxISofffalse
    \gdef\@PDFversion{PDF/X-1}
    \gdef\@PDFXversion{PDF/X-1a:2001}
    \gdef\@PDFXconformance{PDF/X-1a:2001}
    \global\@HasConformancetrue
    \global\pdfminorversion=3
  }{}
  \ifthenelse{\equal{#2}{X-1a:2003}}{
    \@tempTFtrue
    \global\@pdfxSETofffalse
    \global\@pdfxISofffalse
    \gdef\@PDFversion{PDF/X-1}
    \gdef\@PDFXversion{PDF/X-1a:2003}
    \gdef\@PDFXconformance{PDF/X-1a:2003}
    \global\@HasConformancetrue
    \global\pdfminorversion=3
  }{}
  \ifthenelse{\equal{#2}{X-3:2002}}{
    \@tempTFtrue
    \global\@pdfxSETofffalse
    \global\@pdfxISofffalse
    \gdef\@PDFversion{PDF/X-3}
    \gdef\@PDFXversion{PDF/X-3:2002}
    \global\pdfminorversion=3
  }{}
  \ifthenelse{\equal{#2}{X-3:2003}}{
    \@tempTFtrue
    \global\@pdfxSETofffalse
    \global\@pdfxISofffalse
    \gdef\@PDFversion{PDF/X-3}
    \gdef\@PDFXversion{PDF/X-3:2003}
    \global\pdfminorversion=4
  }{}
  \if@tempTF\else
    \ClassError{novel}{Bad compliance argument for \string\SetPDFX}%
     {Choose: X-1a:2001, X-1a:2003, X-3:2002, X-3:2003, off.}%
  \fi
  % Grab the file that defines the Output Intent information:
  % File name format: novel-YourIntent.clo
  % Setting: \SetPDFX[YourIntent]{compliance}
  % Contents of file: See the above included Output Intent data.
  \StrDel{#1}{\space}[\NPDFXOINS]
  \IfFileExists{novel-\NPDFXOINS.clo}{\input{novel-\NPDFXOINS.clo}}{%
    \ClassError{novel}{Bad Output Intent for \string\SetPDFX}%
     {Use filename (without extension) of a file with *.clo extension. ^^J%
      Filename must begin with novel- ^^J%
      Example: File novel-FOGRA39.clo is called as [FOGRA39]. ^^J%
      The file must be where TeX can find it. ^^J%
      For contents of the file, see package documentation.}%
   }{}%
} % end \@setpdfx
%
\SetPDFX[CGATSTR001]{X-1a:2001} % Default.
%%



%% Neutralize file data settings:
\gdef\@DisableFileDataSettings{% called by `novel.cls' \AtBeginDocument
  \let\title\relax
  \let\author\relax
  \let\subtitle\relax
  \LetLtxMacro\SetAuthor\relax
  \LetLtxMacro\SetTitle\relax
  \LetLtxMacro\SetSubtitle\relax
  \LetLtxMacro\SetApplication\relax
  \LetLtxMacro\SetProducer\relax
  \LetLtxMacro\SetPDFX\relax
}% end \@DisableFileDataSettings
%%



%%
\endinput
%%
%% End of file `novel-FileData.sty'.