latex3 / tagpdf

Tagging support code for LaTeX
60 stars 7 forks source link

PDF resource management is no active! #37

Closed buehlere closed 3 years ago

buehlere commented 3 years ago

Hi @u-fischer ,

I'm working with tagpdf to produce Latex reports via Rmarkdown. My pipeline for producing the tagged reports was working. However, the recent update from version 0.61 to 0.8 seems to have broken things and I am now experiencing this error:

image

I've tried making the changes suggested in the documentation: image

But am still experiencing the same issue. Any ideas what might be causing this issue? Please let me know what other information I can provide. Would it be possible for version 0.61 to be made available again?

u-fischer commented 3 years ago

Well you are not saying which changes you made, so I can't tell you what your document is missing.

Would it be possible for version 0.61 to be made available again?

Well the version is somewhere in the github. But beside this: no, I won't make it available. As the documentation says: tagpdf is a package to experiment and test tagging. It is not meant for production environments. If the tests and the developments in latex and the pdfmanagement require incompatible changes I will make them and I won't spent time on support for older code. This type of support will only start when the code has been declared stable and has been integrated into latex. So if you want to use tagpdf now, you will have to keep pace with the development and adapt your documents.

buehlere commented 3 years ago

Thanks for the quick reply!

But beside this: no, I won't make it available. As the documentation says: tagpdf is a package to experiment and test tagging.

This is reasonable I was just wondering due to some timeline restraints on my end.

In terms of changes I made, I tried:

Below I provide the setup for one of my documents:

% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
  \setsansfont[]{Open Sans}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
  hidelinks,
  pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[left=0cm,right=0cm,top=0cm,bottom=0cm]{geometry}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\usepackage[english]{babel}
\usepackage{tagpdf}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[default,defaultsans,scale=0.9]{opensans}
\usepackage[none]{hyphenat}

\definecolor{theyellow}{RGB}{255, 198, 30}
\definecolor{thewhite}{RGB}{255, 255, 255}
\definecolor{thebackupblue}{RGB}{0, 165, 219}
\definecolor{theblue}{RGB}{33,62,141}
\definecolor{theblack}{RGB}{46, 41, 37}
\definecolor{theorange}{RGB}{242, 132, 17}
\definecolor{thegray}{RGB}{232,231,236}
\definecolor{thelightgray}{RGB}{241,240,245}

\definecolor{colorMain}{RGB}{32,79,151}
\definecolor{colorMainLight}{RGB}{180,199,231}
\definecolor{thedarkblue}{RGB}{0,66,101}
\definecolor{thegreen}{RGB}{82,162,123}

\begin{filecontents}{\jobname.xmpdata} 
\Title{Al_Seeliger_Elementary_School.pdf} 
\Author{American Institutes for Research} 
\Subject{Nevada School Climate/Social Emotional Learning}
\Keywords{Social and Emotional Learning; Nevada Reports; School Climate; School Climate; School Climate; School Climate Improvement; NV-SCSEL survey}
\end{filecontents}

\tagpdfifpdftexT
 {
  \pdfcatalog{/Lang (en-UK)}
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}

 }

\usepackage{colortbl,hhline}

\tagpdfifluatexT
 {
  \pdfextension catalog{/Lang (en-UK)}
  \usepackage{fontspec}
 }

\tagpdfsetup
  {
    tabsorder=structure,
    activate-all,
    uncompress,
    interwordspace=true,
    newattribute = {TH-col} { /O /Table /Scope /Column },
    newattribute = {TH-row} { /O /Table /Scope /Row   },
    newattribute = {TH-both}{ /O /Table /Scope /Both  }
  }
\usepackage{bm}
\usepackage{booktabs}
\usepackage{array}
\usepackage{pdfmanagement-testphase}
\usepackage{colortbl}
\usepackage{geometry}
\usepackage{colorprofiles}
\usepackage{luatex85}
\usepackage[a-1b]{pdfx}
\usepackage{enumitem}
\usepackage{frcursive}
\usepackage{amssymb}
\usetikzlibrary{fit,matrix,positioning,calc}
\usepackage{varwidth}
\usepackage{amsmath}
\usepackage{fancyhdr}
\usepackage{mdframed}
\usepackage{fontspec}
\usepackage{setspace}
\usepackage{ragged2e}
\usepackage{opensans}
\usepackage[none]{hyphenat}
\ifluatex
  \usepackage{selnolig}  % disable illegal ligatures
\fi

Notice the removed <<..>> from newattribute as well as the inclusion of \usepackage{pdfmanagement-testphase}. Does it look like I am missing anything else important to the set-up?

Please let me know if there is a better / preferred format to provide some of this information. I am fairly new to working with Latex on this of a level. I normally interface with Latex through Rmarkdown and want to make sure I'm being as informative as possible.

Again thanks so much for your help. Your package has been extremely helpful to the work I do!

u-fischer commented 3 years ago

You missed that the new pdfmanagement must be loaded as first package. That means your document must begin with

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{pdfversion=1.7,lang=en-UK}

\documentclass{article}

Be aware that the pdfmanagement is incompatible with the pdfx package. You can add xmp-Data with hyperxmp.

You also shouldn't use \pdfcatalog{/Lang (en-UK)} and \pdfextension catalog, the lang=en-UK above will take care of this.

FrankMittelbach commented 3 years ago

Am 25.03.21 um 20:00 schrieb Eric Buehler:

|\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{textcomp} % provide euro and other symbols|

not relevant to your problem (which Ulrike addressed, but note that only fontenc is necessary here as these days LaTeX contains both textcomp symbols and is utf8 by default

buehlere commented 3 years ago

I wanted to follow up on this issue and say that these suggestions worked for me! Thanks so much for all the help!