0

I would like to get the release info of my custom class, so I can add this information in the PDF metadata. In other words, if I have a class that starts like this:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{SomeClass}[2025/01/01 SomeClass is a new custom class]

How do I get "2025/01/01 SomeClass is a new custom class"? I tried using \@currname right after, but it only contains "SomeClass" (i.e., the class name).

1 Answer 1

1

Since you didn't provide an example, I used article:

\documentclass{article}
\begin{document}
\csname [email protected]\endcsname
\end{document}

version info for article.cls

The following code generates the same result:

\documentclass{article}
\begin{document}
\makeatletter
\newcommand\@classinfo{}
\xdef\@classinfo{%
  \csname [email protected]\endcsname
}
\@classinfo
\makeatother
\end{document}
5
  • I did provide an example. Following your answer, I think the solution is something like this (but I can't figure out how to make it work properly with \expandafter): \newcommand\@classinfo{\csname [email protected]\endcsname} Commented Jan 19 at 2:41
  • 1
    @drl you didn't provide an example I could compile and edit. I have no idea, for example, where you are trying to define or insert this. I don't know if you are using primitives to insert it, macros from a package or the new format's tagging stuff. Commented Jan 19 at 5:26
  • @drl see edit above. you don't need the control \expandafter provides, you just want to expand the stuff when setting the definition. so either ensure the name is new and use \edef or \xdef or use e.g. \ExpandArgs {Ne}. Commented Jan 19 at 5:35
  • 2
    You don't need \makeatletter and \makeatother around \csname [email protected]\endcsname. You can also do \UseName{[email protected]}. Commented Jan 19 at 15:18
  • @egreg updated, thanks. I don't think I've ever used \UseName. should I add that alternative? Commented Jan 19 at 16:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.