# Update 2015-03-19 Better Answer Found
This question is part of a trail of questions. The goal mine was to use this list inside of a tikz node, but I removed that from previous questions in the interest of keeping it simple. Along the way, I ran into problems with post-processing and tikz. So, for those interested, here is a quick list for reference:
For making a macro that can handle post-parsing-inputted list items, see:
Related Question for making a macro that can handle post-parsing-inputted list items, see:
Update 2015-03-12 LOOKING FOR BETTER ANSWER
This question, although I have accepted an answer, was never answered to my satisfaction, because the answer was no, it is not possible to insert a list from aux into a tikz node due to @gobble munching up the final } during the first run. Perhaps in the future, someone will arrive at another conclusion. I can only hope for this...
Question
This is an extension of another question because the answer to the other question, while correctly answering the question, fails to address the problem of a custom \maketitle command using tikz:
Problem
Code typesets unreliably. It will typeset correctly until you make one typo, then it will result it:
Argument of \@gobble has an extra }.
Problem Clarified UPDATED 2015-03-18
The problem lies in the \tikz \node {\manuallanguages};, which does not produce a satisfactory output. As expained above,
when using
@gobble, the}is "gobbled", which is essential fortikzto parse the code.Leaving out
@gobblemeans having a strange comma separating an empty item in the beginning of the list. (HOWEVER, note the\kern0ptprovided by David Carlisle's answer which solves this problem.
Super Minimalistic Code based on David Carlisle's answer.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\makeatletter
\let\@title\@empty
\let\@subtitle\@empty
\newcommand\subtitle[1]{%
\gdef\@subtitle{#1}}
\newcommand{\manuallanguages}{} % initialization
\newcommand{\inputlanguagefile}[3]{%
% #1 is unneeded for this minimal example
% #2 is used elsewhere and unneeded for this minimal example
\protected@write\@auxout{}{\string\used@language{#1}}
}%
\newcommand{\language@sep}{\ifnum\lastnodetype=12 \else, \fi}% list separator (does not use unless >1 item)
\newcommand{\used@language}[1]{%
\g@addto@macro\manuallanguages{\language@sep{#1}}% add items to list
}%
\makeatother
\begin{document}
\tikz[overlay,remember picture]\node [color=red,draw,dashed,inner sep=1cm,font=\bfseries] at (current page.center) {\kern0pt \manuallanguages};
\inputlanguagefile{En}{English}{en} %<- En added to list
\inputlanguagefile{Da}{Dansk}{da} %<- Da added to list
\inputlanguagefile{De}{Deutsch}{de} %<- Da added to list
\end{document}
Attempt
The following code based on egreg's answer to the original question.
It seems unreliable: after just making one mistake and typesetting, it no longer compiles. I get Argument of \@gobble has an extra }. It probably has something to do with tikz, because when I put the #1 and #2 variables of \maketitle into nodes, that is when I ran into problems. Because it sometimes typeset even under those conditions, I am not really sure what the issue is.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,positioning}
\makeatletter
\newcommand{\manuallanguages}{\@gobble} % initialization
\newcommand{\inputlanguagefile}[3]{%
\input{#3}% File to input
%#2 is used elsewhere and unneeded for this minimal example
\@namedef{language@#1}{#1}% Creates new command language@En for example (if I understand correctly)
\protected@write\@auxout{}{\string\used@language{}#1}% Calls \used@language command to generate list saved as string to aux
}
\AtEndDocument{\let\used@language\@gobble}% What is this doing?
\newcommand{\language@sep}{, }% list separator (does not use unless >1 item)
\newcommand{\used@language}[1]{%
\g@addto@macro\manuallanguages{\language@sep{#1}}% add items to list
}
\makeatother
\renewcommand{\maketitle}[2]{%
\begin{tikzpicture}[overlay,remember picture]
\node [font=\Huge] (title) at ($ (current page.north)!.25!(current page.south) $) {#1};
\node [font=\Large, below=of title] (subtitle) {#2};
\end{tikzpicture}
%#1
%#2
\thispagestyle{empty}
\setcounter{page}{0}
\clearpage
}
\begin{document}
\maketitle[\manuallanguages]{User Manuals}
\inputlanguagefile{En}{English}{./en.tex}
\inputlanguagefile{Da}{Dansk}{./da.tex}
\inputlanguagefile{Da}{Deutsch}{./de.tex}
\end{document}

\language@sepis not defined to take an argument... Why did you eliminate the\format@language...? I'm just trying to understand your code. (And egreg's.) – cfr Mar 08 '15 at 21:34\language@sepis set to the delimiter ", ". As far as "not being defined to take an argument", I am not sure how to answer that. Any new command can/must be set to something. I eliminated\format@language, because I do not use the mapping (e.g. {da}{Dansk}) and have no need to select one of those two as in the original code from @egreg. – Jonathan Komar Mar 09 '15 at 06:48\newcommand. Anyway, it is just a point about the syntax:\language@sep{}#1would be less confusing. Also\inputlanguagefile{En}{English}{en}rather than\inputlanguagefile{En}{English}{./en.tex}is probably better. – cfr Mar 09 '15 at 13:02tikzpictureenvironment. I'm not sure if that's why, but I've not had any problems doing it that way. (Mine is titles of a customised section command rather than\maketitlebut I can't see why that would matter.) – cfr Mar 09 '15 at 13:10\language@sep\format@language{#1}because\format@languageis defined to require an argument. – cfr Mar 09 '15 at 17:23\newcommand{\language@sep}{, }% separator, which is directly from egreg's answer. I updated the code accordingly. – Jonathan Komar Mar 09 '15 at 17:44\used@language{#1}because this command is meant to take an argument. Otherwise you get errors. This lets it compile although I doubt the output is what you want. More generally, you really don't want to redefine\maketitlelike this. The original command takes care of things which yours does not and you are just creating more and more problems this way. – cfr Mar 09 '15 at 23:17.auxfile. I said that you could not do it in the way you were doing it and gobble the comma as you were gobbling the comma. – cfr Mar 18 '15 at 00:50@gobblemunching up the final}during the first run. Pretty clear, no? Your answer was very helpful. I am just looking for a better one that makes it possible to put the list into a tikz node (with commas or whatever arbitrary character). – Jonathan Komar Mar 18 '15 at 07:31{\kern0pt \manuallanguages}as in my answer, that is the whole point, then the code adds a comma or not depending if sees the kern immediately preceding. – David Carlisle Mar 18 '15 at 20:47