TransWikia.com

How to reuse color profile file in multiple documents?

TeX - LaTeX Asked on May 23, 2021

I am trying to reuse files in multiple documents, but I am having problems with the color profile file.

The idea is to have the .icc file in the icc folder inside the main folder and access that file from the different documents that I am going to create.

This is my code:

usepackage[x-1a1]{pdfx}
immediatepdfobj stream attr{/N 4} file{../icc/ISOcoated_v2_300_eci.icc}
pdfcatalog{%
    /OutputIntents [ <<
    /Type /OutputIntent
    /S/GTS_PDFX
    /DestOutputProfile thepdflastobjspace 0 R
    /OutputConditionIdentifier (ISO Coated v2 300 (ECI))
    /Info(ISO Coated v2 300 (ECI))
    /RegistryName (http://www.color.org/)
    >> ]
}
pdfinfo{% not needed with newer PDF/X versions
    /GTS_PDFXVersion (PDF/X-1:2001)%
    /GTS_PDFXConformance (PDF/X-1a:2001)%
}

Here file{../icc/ISOcoated_v2_300_eci.icc} I thought it would look for the file in the icc folder of the parent directory, but that doesn’t happen, it tells me that it can’t find the document. If I put the file in the folder where the .tex file is, the error disappears and the document compiles without problems.

How can I include the color profile from the icc folder of the parent directory?

This is my folder tree:

├── parent
│   ├── ciclo-A 
│   │   ├── vol-1
│   │   │   └── 00-main.tex
│   │   │   └── p01-chapter01.tex
│   │   │   └── p01-chapter02.tex
│   │   │   └── p01-chapter01.tex
│   │   ├── vol-2
│   │   │   └── 00-main.tex
│   │   │   └── p01-chapter01.tex
│   │   │   └── p01-chapter02.tex
│   │   │   └── ...
│   │   └── vol-3
│   ├── ciclo-B 
│   │   ├── vol-1
│   │   │   └── 00-main.tex
│   │   │   └── p01-chapter01.tex
│   │   │   └── ...
│   │   ├── vol-2
│   │   │   └── 00-main.tex
│   │   │   └── p01-chapter01.tex
│   │   │   └── ...
│   ├── icc 
│   │   └── ISOcoated_v2_300_eci.icc
└── main-template.tex

Important clarification:

This is the order in which I link the files:

Suppose I am going to work on the document that I will create in vol-1.

One

In the file parent/ciclo-A/vol-1/00-main.tex I load the following:

% !TeX program = lualatex
%documentclass[10pt,twoside,openany,showtrims,titlepage]{memoir}
newcommandtheAuthor{ACG }
newcommandtitleA{HD (A) *Documento Provisional*}
newcommandtitleB{Adv}
newcommandtheKeywords{Homilíassep Liturgiasep Cristianismosep Iglesia Católica}
newcommandtheSubject{Esta obra recoge las homilías dominicales de los últimos papas. Contiene además las lecturas bíblicas según el nuevo Leccionario de la Misa, Comentarios Patrísticos a los Evangelios y los Temas del Catecismo de la Iglesia Católica sugeridos por el Directorio Homilético}
newcommandtheOrg{www.example.org}
newcommandisCopyrighted{TRUE}
newcommandthePublicationType{Book}
newcommandtheVolume{1}
newcommandthePublisher{example.org}
newcommandtheYear{2021}
newcommandvolume{Volumen 2}
newcommandsubTitle{Textos bíblicos del nuevo Leccionario de la Misa, Comentarios Patrísticos a los Evangelios y Temas del Directorio Homilético}

RequirePackage{filecontents} %if filecontents should overwrite old files

begin{filecontents}{jobname.xmpdata}
    Title{titleA titleB}
    Author{theAuthor}
    Volume{theVolume}
    Subject{theSubject}
    Keywords{theKeywords} 
    Org{theOrg}
    Copyrighted{isCopyrighted}
    PublicationType{thePublicationType}
end{filecontents}

input{../../main-template} 

begin{document}
    mainmatter
    label{files}
    input{p01-chapter01}
    % ...
    
end{document}

Two

As you can see, within 00-main.tex I load the file main-template.tex in this line: input{../../main-template} and this is the file that loads the icc file:

main-template.tex:

usepackage[x-1a1]{pdfx}
immediatepdfobj stream attr{/N 4} file{../icc/ISOcoated_v2_300_eci.icc}
pdfcatalog{%
    /OutputIntents [ <<
    /Type /OutputIntent
    /S/GTS_PDFX
    /DestOutputProfile thepdflastobjspace 0 R
    /OutputConditionIdentifier (ISO Coated v2 300 (ECI))
    /Info(ISO Coated v2 300 (ECI))
    /RegistryName (http://www.color.org/)
    >> ]
}
pdfinfo{% not needed with newer PDF/X versions
    /GTS_PDFXVersion (PDF/X-1:2001)%
    /GTS_PDFXConformance (PDF/X-1a:2001)%
}

One Answer

I don't know whether this can help you, since it does not use the pdfx package, but I once had a similar arrangement and used the hyperref package and XeLaTeX (it seems not to work with PDFLaTeX though) with the following set up. The .icc file is located in the parent directory of the .tex file.

documentclass{article}
usepackage[bookmarks=false]{hyperref}

deficcprofilepath{../PSOcoated_v3.icc}

AtBeginDocument{
  special{pdf:minorversion 3}
  special{pdf:docinfo <<
   /GTS_PDFXVersion (PDF/X-1:2001)
   /GTS_PDFXConformance (PDF/X-1a:2001)
  >>}%
  special{pdf:fstream @cmykdata (iccprofilepath) <<
   /N 4^^J/Alternate/DeviceCMYK
  >>}%
  special{pdf:put @catalog <<
   /PageMode /UseNone
   /OutputIntents [<<
    /Type /OutputIntent
    /S /GTS_PDFX
    /DestOutputProfile @cmykdata
    /OutputConditionIdentifier (PSOcoated_v3)
    /Info(PSO coated v3)
    /RegistryName (http://www.color.org/)
   >>]
  >>}%
}

begin{document}

Hello World!

end{document}

Answered by Jasper Habicht on May 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP