-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store section information for each routine / constant #11
Comments
Do you mean the actual numbered section, e.g. MPI_Send number "3.2.1" or just text "Blocking Send" which is a subsection? The numbers are internal to Latex so I wouldn't have an idea to extract that. |
As far as I understood all these things were extracted from the tex files? And the writing the section (numbers and /or titles) isn't that much of a problem. |
Yes the prepass has full access to all tex files, but at that time the numbers aren't determined yet, they are compile time latex internal. The names are easy. And the subsection/section labels are also easy of course. I am not aware of a method with which I could extract the numbering at compile time, if there is then I could write this additionally into the json file of course. |
But upon a 2nd pass you'll also have access to the section numbers? Here is a small example: \documentclass{article}
\usepackage{etoolbox}
\newwrite\outsections
\immediate\openout\outsections=\jobname.sectionnumbers
\def\concatvalue#1#2{%
\ifnumequal{\value{#2}}{0}%
% == 0
{}% do nothing since #1 is already correct
{\expandafter\edef\csname #1\endcsname{\csname #1\endcsname.\the\value{#2}}}
}
\makeatletter
\def\writecurrentsection{%
\def\outcurrent@section{}%
% \concatvalue{outcurrent@section}{chapter}%
\concatvalue{outcurrent@section}{section}%
\concatvalue{outcurrent@section}{subsection}%
\concatvalue{outcurrent@section}{subsubsection}%
\outcurrent@section%
\expandafter\write\expandafter\outsections\expandafter{\outcurrent@section}%
}
\makeatother
\begin{document}
\writecurrentsection
\section{First}
\writecurrentsection
\section{Second}
\writecurrentsection
\subsection{Second Second}
\writecurrentsection
\end{document} it will create the jobname.sectionnumbers with the numbers existing, of course it needs some editing, but in principle... |
Lots of things can't be determined (at least globally) until at least one pass has completed, and page numbers can require two passes (you get close on the first pass, but references to items, such as section numbers and page numbers, that are determined in the first pass, may change pagination on the second pass, needing a third pass for things to stabilize. There is quite a bit of processing after the first pass for the bib and index entries, for example. And updating the index macros might be the easiest way to capture this information. |
Agreed that the |
I guess we would just build a post-pass into the build system? We don't need intermediate data, but just what ever comes out after the pdf is fully built. But I need to read into the snippet you posted above. I am not enough into latex for that. :)
|
This actually also forces me to have a look at the binding_prepass and binding_emitter code which is probably a good thing. It is not as modular as it could be. I discovered that in the constants branch where I had to copy paste the entire parse_file function. |
In this way it will become very easy for MPI implementors to always have up to date references in their documentation.
The text was updated successfully, but these errors were encountered: