I once tried software whre you create template with tags like
<seller> <price> <date>
and assign
seller = John Smith
price = 90000 $
date = current date
And generate text where tags are replaced with assigned values.
Is there a way to do something similar in Latex?
For example document type where you create tags at begining.
Or some addon?
Is there a way to insert value from a file? So I can edit current date only once for all other documents.
General ⇒ Automated documentation? Editing with tags.
-
- Posts: 2
- Joined: Tue Aug 03, 2021 2:51 am
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
Automated documentation? Editing with tags.
In LaTeX using macros is a basic feature, e.g.,
And you can either write the
See a introduction to LaTeX for more information about
As an alternative see packages like csvsimple or datatool that allow to use, e.g, CSV for a kind of serial documents.
Code: Select all
\documentclass{article}
\newcommand*{\TheNameOfTheGame}{Macro}
\begin{document}
The name of the game is: \TheNameOfTheGame.
\end{document}
\newcommand
to a file foo.tex
and load is using \input{foo.tex}
or (and this is what I would do) do the opposite:
Code: Select all
% Note: The filecontents environment is only used to make this example
% working in the only editor. Usually you will edit the template file as a
% standalone file.
\begin{filecontents}{example-template.tex}
\documentclass{article}
\providecommand*{\TheNameOfTheGame}{MISSING DEFINITION}
\begin{document}
The name of the game is: \TheNameOfTheGame.
\end{document}
\end{filecontents}
\newcommand*{\TheNameOfTheGame}{Macro}
\input{example-template.tex}
\newcommand
, \providecommand
and \input
.As an alternative see packages like csvsimple or datatool that allow to use, e.g, CSV for a kind of serial documents.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. 

-
- Posts: 2
- Joined: Tue Aug 03, 2021 2:51 am
Automated documentation? Editing with tags.
Thanks.
Commercial programs are expensive and I need only basic features.
Commercial programs are expensive and I need only basic features.