When adding PDF meta data using hyperref you can also use certain LaTeX commands which are magically stripped away during the conversion into a PDF string. But this doesn't seem to work with environments.
\documentclass{article}
\newcommand\foo[1]{foo #1}
\newenvironment{fooenv}{foobegin}{fooend}
\usepackage{hyperref}
\hypersetup{pdfauthor=\foo{Author}} % works
\hypersetup{pdftitle={\begin{fooenv}Title\end{fooenv}.}} % error
\begin{document}
\end{document}
Is there any way to make enviroments behave like regular commands in this setting?
\pdfstringdef), but it is faulty. It uses#1instead of##1. Make a bug report. (But imho it is not a good idea to use environments there, that's probably the reason nobody ever reported the error.) – Ulrike Fischer Mar 05 '15 at 17:13etoolboxor something in the short run? – porst17 Mar 06 '15 at 08:42\def\begin#1{\csname#1\endcsname}% \def\end#1{\csname end#1\endcsname}%– Ulrike Fischer Mar 06 '15 at 08:58