The MASM Forum

Miscellaneous => Miscellaneous Projects => Topic started by: HSE on January 30, 2021, 01:18:23 AM

Title: File listing in BibTex format
Post by: HSE on January 30, 2021, 01:18:23 AM
Hi all!

This is a little extension of FTree.asm Masm32Sdk example, also in 32 bits.

You can build to read command line like ftree, buts it's more usefull with harcode control.

With hardcode control it's possible to list several directories and files extentions to same list.

I'm listing paper files with ".pdf" and ".doc" extentions, but perhaps can exist more interest in to list ".asm", ".inc", ".rc", etc.

Regards, HSE.
Title: Re: File listing in BibTex format
Post by: hutch-- on January 30, 2021, 08:11:14 AM
Hi Hector,

I have heard the name but don't know anything about BibTex format. What is it ?
Title: Re: File listing in BibTex format
Post by: Gunther on January 30, 2021, 08:23:27 AM
Steve,

BibTex comes mostly together with LATEX. This has nothing to do with varnish and leather, but is a professional typesetting program, written by Donald Knuth, the algorithm pope. Many publishers require their authors to have manuscripts written in LATEX.
The purpose of BibTeX is to make it easy to cite sources in a consistent manner, by separating bibliographic information from the presentation of this information, similarly to the separation of content and presentation/style supported by LaTeX itself. I'm
using LATEX on a daily basis since 2 decades.

Gunther
Title: Re: File listing in BibTex format
Post by: HSE on January 30, 2021, 09:03:58 AM
Hi Hutch!

Quote from: hutch-- on January 30, 2021, 08:11:14 AM
I have heard the name but don't know anything about BibTex format. What is it ?

The specification in https://www.bibtex.com is very simple. As Gunther explain, is a classic.

Essentially is an ascii text were entries are book, techreport, inproceeding, etc which contains a key and some fields:@techreport{arrow48,
  author = {Arrow, Kenneth J.},
  title = {The possibility of a universal social welfare function},
  institution = {RAND Corporation},
  year = {1948},
  number = {P-41},
  type = {Report}
}


Program here follow BibTex idea. More formal and more complete treatment is in ObjAsm subforum topic: BibTex routines  (http://masm32.com/board/index.php?topic=9104.0)

@unknownfile{asm_machine1_4,
   location={B:\masm32\projects\ftree\TreeBib.asm},
   store={machine1},
   path={B:\masm32\projects\ftree},
   fname={TreeBib.asm},
   extention={asm}
}
Title: Re: File listing in BibTex format
Post by: hutch-- on January 31, 2021, 04:07:19 PM
Thanks Hector and Gunther, I don't have a background in publishing so its not something that I have used even though the name is familiar.
Title: Re: File listing in BibTex format
Post by: Gunther on January 31, 2021, 08:06:46 PM
Steve,

Quote from: hutch-- on January 31, 2021, 04:07:19 PM
Thanks Hector and Gunther, I don't have a background in publishing so its not something that I have used even though the name is familiar.

This is not just for classic publications. I write all my lecture notes, collections of exercises, etc. with it. I even developed a template for letters (with letterhead). LATEX is a powerful tool and comes as public domain.

However, the whole truth is this: Donald Knuth developed TEX as a program to replace the classic typesetter in printing. But this is quite difficult to handle. TEX has over 900 commands (compare that with C). So Laslie Lamport (https://en.wikipedia.org/wiki/Leslie_Lamport) (the buddy with the Lamport timestamp (https://en.wikipedia.org/wiki/Lamport_timestamp)) wrote a set of macros that allows ordinary people like me to work with it. Hence the name: LA stands for Lamport.

It's definitely worth taking a look at LATEX. For Windows there is a very stable distribution called MIKTEX. Here (https://ftp.mpi-inf.mpg.de/pub/tex/mirror/ftp.dante.de/pub/tex/info/lshort/english/lshort.pdf), for example, is a relatively good tutorial as starting point. There are still a lot of interesting applications, e.g. music notes (https://en.wikipedia.org/wiki/MusiXTeX) or electrical circuits (https://texample.net/tikz/examples/area/electrical-engineering/) with LATEX. These images are not ordinary graphics that you embed in Word, for example. No, these images are created from ASCII text which is compiled by the LATEX compiler. As an assembly language programmer one simply has to be enthusiastic about these possibilities. I've been writing my LATEX source code with your MASM editor for years (I'm not kidding).

Please understand me correctly: normally I am not a big friend of Wikipedia, but in this case the entries are relatively ok.

Gunther
Title: Re: File listing in BibTex format
Post by: jj2007 on January 31, 2021, 08:52:05 PM
Gunther,

I never touched Latex, and was never urged to do so by a publisher. They all accepted MS Word format. Perhaps it is more important for scientists who use lots of math?

The RichEdit guys have made huge efforts to implement that in their control, but I haven't seen many usage examples, if any. However, it does work with some versions of RichEd20.dll - kind of, see the red warning. Murray's doc is here (http://unicode.org/notes/tn28/UTN28-PlainTextMath-v2.pdf).

(http://www.jj2007.eu/pics/RichEditMath.jpg)
Title: Re: File listing in BibTex format
Post by: Gunther on January 31, 2021, 09:58:49 PM
Jochen,

Quote from: jj2007 on January 31, 2021, 08:52:05 PM
Perhaps it is more important for scientists who use lots of math?

yes, of course. But also for chemists with their formulas, for electrical engineers with their circuits, for computer scientists with their UML diagrams and structure diagrams, for musicians with their sheet music, for presesntations, creation of own diagrams (bar charts, pie charts etc.), for creating index tabs in longer texts etc. etc. The sky is the limit.

But I stopped trying to convince other people years ago. I no longer proselytize. It's a bit like with the assembly language. Programmers in the high level language have to be open to such things, otherwise there's no point.

Gunther
Title: Re: File listing in BibTex format
Post by: Biterider on January 31, 2021, 10:22:25 PM
Hi Gunther
Latex has been around for a while.
Perhaps you can start a thread that explains how to install and use it in Win32 from an assembly language perspective?
That would be cool.  :biggrin:

Biterider


Title: Re: File listing in BibTex format
Post by: jj2007 on January 31, 2021, 10:54:11 PM
Quote from: Gunther on January 31, 2021, 09:58:49 PMBut I stopped trying to convince other people years ago. I no longer proselytize.

Gunther,

By all means, don't feel offended, please :thup:

LaTex is surely a very important tool. It was just an observation of mine that none of my publishers ever asked for it (and I published four books and dozens of peer-reviewed papers, with plenty of graphics). You cited some examples of professions that need it; maybe economists doing lots of math use it, too.

Quote from: Gunther on January 30, 2021, 08:23:27 AMMany publishers require their authors to have manuscripts written in LATEX.
Title: Re: File listing in BibTex format
Post by: Gunther on February 01, 2021, 06:04:09 AM
Jochen,

Quote from: jj2007 on January 31, 2021, 10:54:11 PM
By all means, don't feel offended, please :thup:

Don't worry, I don't feel attacked. It's just the experiences I've had over the years. You simply cannot force a person to be happy. Anyone who tries to do so will probably fail. (Ständig lehrt die Geschichte, doch sie findet keine Schüler).

Quote from: jj2007 on January 31, 2021, 10:54:11 PM
LaTex is surely a very important tool. It was just an observation of mine that none of my publishers ever asked for it (and I published four books and dozens of peer-reviewed papers, with plenty of graphics). You cited some examples of professions that need it; maybe economists doing lots of math use it, too.

That is certainly not the case everywhere. But at Springer (I mean the science publisher), there are LATEX templates for authors. The well-known physics book "Gerthsen" is written according to this template and provides a good visual impression. I wrote my PhD thesis using LATEX and have stuck with it ever since. When I translated a book by Yuval Fisher for Springer years ago, I also had to work with LATEX. But as I said, these are just my experiences.

Gunther
Title: Re: File listing in BibTex format
Post by: hutch-- on February 01, 2021, 11:16:50 AM
Gunther,

> It's a bit like with the assembly language. Programmers in the high level language have to be open to such things, otherwise there's no point.

Hit 'em with some missile ware, weaponised MASM is a ton of fun.  :tongue:
Title: Re: File listing in BibTex format
Post by: Gunther on February 01, 2021, 07:27:48 PM
Biterider,

Quote from: Biterider on January 31, 2021, 10:22:25 PM
Latex has been around for a while.
Perhaps you can start a thread that explains how to install and use it in Win32 from an assembly language perspective?
That would be cool.  :biggrin:

I'm not sure if that's a good idea. LATEX and assembly language have little to do with each other. Of course, with both, the learning curve is pretty steep.

In the LATEX world, everyone has their problems at the beginning. That's why there are a lot of tutorials, videos and forums. There is the right place to go.
But anyway, I've done the following. Decades ago I wrote a guide for my students showing some - by no means all - of the possibilities with LATEX. I have revised and re-compiled this.

First there is the source code lamoe.tex. This is pure ASCII code and you can read it with any halfway usable editor; the file size is 19 018 bytes. The source code starts with some declarations: These are the lines 1 up to 24. This is similar to the *.inc files and .code, .data etc. in assembly language. I will not explain all of them now, but only a few essential commands. Line 25 then says \begin{document}. There the actual text begins, which still has to be compiled. It then ends in line 513 with \end{document}. Line 26 contains \title{Möglichkeiten mit \LaTeX}, which makes the title page; line 27 says \author{Gunther}. In connection with this is line 28 \maketitle; both commands make the title. Line 29 is \tableofcontents. As the name suggests, the table of contents is created here. This is done by the LATEX compiler independently at runtime; the author does not need to take care of it. Enough now about the source code.

Once the text is written, it still needs to be compiled. I've done this via command line with:

latex lamoe.tex

As a result, a number of files are created. The most important one is lamoe.dvi with a size of 87 876 bytes; the other files are for the compiler and advanced users only. The extension DVI stands for device independent. I will try to explain this with an example. The files created with a word processor of an Office - say *.doc - are not device independent. In these files the installed printer is hard coded and therefore they look like this only on this printer. 

Fifteen years ago, I had a student who didn't listen to me; he wrote his master thesis using Word. The student had only a cheap inkjet printer at home. His idea was to print the file at the university on a very good laser printer, to have them copied and bound in a copy store. His surprise was great: the text on the laser printer was 2 pages shorter than on his printer at home, without changing one Bit of the file. He therefore had to manually revise all forward and backward references in the text. At the same time, the dead line was breathing down his neck. He had a lot of stress on his hands.

Back to the DVI file. This can be output and will look the same on any printer - whether it is the latest laser printer or an old 9-pin dot matrix printer. However, you need a DVI viewer, which is part of the LATEX installation. This file is therefore not part of the archive. I therefore used a command line utility, also part of the LATEX installation, to convert the DVI file to a Postscript file: 
dvips -Ppdf lamoe.dvi
The result was the file lamoe.ps with a size of about 6 MB. But we need it only to create a PDF file in the next step. PS plays a similar role as the OBJ file. In the end, I converted the PS file into a PDF file with a resolution of 720 dpi using the GhostScript viewer GSVIEW64. The new file is then latest.pdf and has a size of 135 KB and is included in the archive.

Finally, a few words about the content of the PDF file. The text is German, because I don't have time to translate at the moment. But the essential elements are recognizable. Page 1 shows the title page with table of contents. Pages 3 and 4 deal with typefaces, e.g. calligraphic lettering or Fraktur typeface. On p. 5 we talk about itemize, enumerate and tables. Formulas are shown on p. 6. Pages 7 to 10 are about graphics. Simple pictures can be written with the picture environment of LATEX. More complex graphics, such as coordinate systems or grids can be realized with the PICTEX package (p. 8). A conversion scale between centimeters and inches is shown on p. 9; only 14 lines of source code are required for this image. Writing a logarithmic scale is not a big problem either; you can see the result on p. 9. The last two images were created with PSTricks (post script tricks). This is a very powerful tool. On p. 9 the series connection of two resistors with the voltages is shown. Then on p. 10 the parallel connection of two resistors with the currents.

Maybe this can give a first impression about the manifold possibilities of LATEX and lure one or the other into this world.

Gunther
Title: Re: File listing in BibTex format
Post by: FORTRANS on February 02, 2021, 01:06:32 AM
Hi,

Quote from: Gunther on February 01, 2021, 07:27:48 PM
I'm not sure if that's a good idea. LATEX and assembly language have little to do with each other. Of course, with both, the learning curve is pretty steep.

In the LATEX world, everyone has their problems at the beginning. That's why there are a lot of tutorials, videos and forums. There is the right place to go.

   I think Gunther is correct in what he says.  I installed LaTEX
in '03.  The installation was not onerous and the documentation
was adequate.  I wrote one example document, a math formula,
and decided that the learning curve was a bit steep for me.  At
the time I was programming in PostScript on say a weekly basis.
And I decided that for what I was doing, that was easier.  That
was due to much more experience, having years of practice.

   I don't see assembly and either LaTEX or PostScript compli-
menting each other.  The paradigms are too different for me
to see how any normal level of effort trying to combine them
would pay off.

   LaTEX is a good tool but you need to have a real need for
it before it would be useful to learn.  Publishers requiring
authors to use it, or a teacher wanting students to turn in
assignments using it would provide the incentive.

Regards,

Steve N.
Title: Re: File listing in BibTex format
Post by: Biterider on February 02, 2021, 05:05:45 AM
Hello Gunther
Thanks for the good explanation.
As Fortrans said, after reading your post, I don't see any immediate use of latex in combination with assembly.
At least I've learned something new and I know who to ask about it  :biggrin:

Thank you, Biterider
Title: Re: File listing in BibTex format
Post by: HSE on February 02, 2021, 11:06:30 AM
Hi biterider!!

Quote from: Biterider on February 02, 2021, 05:05:45 AM
... , I don't see any immediate use of latex in combination with assembly.
:sad:

I think you was going to write a book about assembly, using LaTEX !!!  :biggrin:

Regards, HSE
Title: Re: File listing in BibTex format
Post by: Gunther on February 02, 2021, 12:05:45 PM
HSE,

Quote from: HSE on February 02, 2021, 11:06:30 AM
I think you was going to write a book about assembly, using LaTEX !!!  :biggrin:

Sure, but you wouldn't be the first.  :cool: Paul Carter did this many years ago. You can download his book here (https://pacman128.github.io/pcasm/). There are also versions in: French, German, Spanish, Italian, Korean, and Chinese, whatever you want.
Unfortunately, Paul Carter did not use BIBTEX at that time. But the book still gives quite a good impression about LATEX.

Gunther


Title: Re: File listing in BibTex format
Post by: HSE on February 02, 2021, 12:46:11 PM
Hi Gunther!

Quote from: Gunther on February 02, 2021, 12:05:45 PM
Unfortunately, Paul Carter did not use BIBTEX at that time. But the book still gives quite a good impression about LATEX.
Well, somebody rebuilded that :"November 16, 2019"   :thumbsup:

I still have to solve things like:"Proc. Fifteenth Annual ACM" # STOC because in theory <"> delimite a field content. Against the easy BibTex explanation, I found the real BibTex used that from 1988.

I used LaTEX 20 years ago to make a PDF, but never used BibTex. We will see  what we can do when BibTex routines work better :biggrin:

Regards, HSE.
Title: Re: File listing in BibTex format
Post by: Gunther on February 02, 2021, 03:02:40 PM
HSE,

Quote from: HSE on February 02, 2021, 12:46:11 PM
Hi Gunther!

I still have to solve things like:"Proc. Fifteenth Annual ACM" # STOC because in theory <"> delimite a field content. Against the easy BibTex explanation, I found the real BibTex used that from 1988.

I used LaTEX 20 years ago to make a PDF, but never used BibTex. We will see  what we can do when BibTex routines work better :biggrin:

Regards, HSE.

I took a look at the manuscript of my doctoral thesis. My bibliography contains 72 entries. I cannot show them all here. At that time I solved it like this: Each chapter has its own file, so does the bibliography. The individual chapters are
then included via a master file using:

...
\input{chapter1}
\input{chapter2}
...
\input{chapterN}
\input{bib}
...

because my bibliography is in the file bib.tex. Here now is a small excerpt from bib.tex:

\begin{thebibliography}{99}
\addcontentsline{toc}{chapter}{Literaturverzeichnis}
  \bibitem[Adobe 1990]{AS90} Adobe Systems Incorporated: \textsl{PostScript Reference
                 Manual.} Addison Wesley, Reading, MA, 1990.
  \bibitem[Banach 1922]{Ba22} Banach, S.: \textsl{Sur les op\'{e}rations dans les
                 ensembles abstraits et leur applications aux \'{e}quations
                 integrales.} Fund. Math. 3 (1922) S. 133-181.
  \bibitem[Baier 1989]{Ba89} Baier, W.: \textsl{Chaoten im Sonnensystem.}
                 Sterne und Weltraum 28 (1989), Heft 7-8.
  \bibitem[Barnsley 1988]{Ba88} Barnsley, M. F.: \textsl{Fractals Everywhere.}
                 Academic Press, Inc., Boston, 1988.
  \bibitem[Barnsley 1993]{Ba93} Barnsley, M. F.; Hurd, L. P.: \textsl{Fractal Image
                 Compression.} AK Peters, Wellesley, 1993.
  \bibitem[Bartsch 1999]{BA99} Bartsch, H.-J.: \textsl{Taschenbuch mathematischer
                 Formeln.} 18. verbesserte Auflage, Fachbuchverlag Leipzig
                 im Carl Hanser Verlag, 1999.
  \bibitem[Belkner 1972]{Be72} Belkner, H.: \textsl{Metrische Räume.} BSB B. G.
                 Teubner Verlagsgesellschaft, Leipzig, 1972.
  \bibitem[Die Bibel 1896]{Bi96} \textsl{Die Bibel.} Nach der deutschen Übersetzung
                   Martin Luthers. Durchgesehene Ausgabe mit dem von der Deutschen
                   evangelischen Kirchenkonferenz genehmigten Text.
                   Stereotyp-Ausgabe der Preu"sischen Haupt-Bibelgesellschaft.
                   Berlin, Klosterstra"se 71. Berlin, 1896.
  \bibitem[Blume 1994]{Bl94} Blume, S.: \textsl{Theorie elektromagnetischer Felder.}
                 Hüthig Buch Verlag, Heidelberg, 1994.
  \bibitem[Collatz 1968]{Co68} Collatz, L.: \textsl{Funktionalanalysis und Numerische
                 Mathematik.} Springer Verlag, Berlin, Göttingen,
                 Heidelberg, 1968.
  \bibitem[Dedekind 1901]{De01} Dedekind, R.: \textsl{Gau"s in einer Vorlesung "uber
                 die Methode der kleinsten Quadrate.} Festschrift zur Feier
                 des 150j"ahrigen Bestehens der K"oniglichen Gesellschaft
                 der Wissenschaften, G"ottingen, Berlin, 1901.
  \bibitem[Falconer 1990]{Fa90} Falconer, K.: \textsl{Fractal Geometry - Mathematical
                 Foundations and Applications.} John Wiley \& Sons,
                 Chichester, 1990.
  \bibitem[Feigenbaum 1978]{Fe78} Feigenbaum, M.: \textsl{Quantitative universality
                 for a class of nonlinear transformations.} Journal of
                 Statistical Physics, 19 (1978), p. 25-52.
  \bibitem[Fisher 1992]{Fi92} Fisher, Y.; Boss, R. D.; Jacobs, E. W.:
                 \textsl{Fractal image compression using iterated
                 transforms.} In: Storer, J. A. (Editor): Image
                 and Text Compression, Kluwer Academic Publishers,
                 Boston, 1992, p. 35-61.
  \bibitem[Fisher 1995]{Fi95} Fisher, Y.: \textsl{Fractal Image Compression.} Theory
                 and Applications. Springer Verlag, New York, 1995.
  \bibitem[Fisher 1998]{Fi98} Fisher, Y.: \textsl{Fractal Image Encoding and Analysis.}
                 Springer Verlag in cooperation with NATO
                 Scientific Affairs Division, Berlin, Heidelberg,
                 New York, 1998.
  \bibitem[Rothe 1956]{Ro56} Rothe, R.: \textsl{Höhere Mathematik.} Für Mathematiker,
                 Physiker, Ingenieure. B. G. Teubner Verlagsgesellschaft,
                 Leipzig. Teil I, 15. Auflage, 1956. Teil II, 12.
                 Auflage, 1956. Teil III, 8. Auflage, 1954.
                 Teil IV, Heft 1/2, 9. Auflage, 1955. Teil IV, Heft 3/4,
                 8. Auflage, 1955. Teil IV, Heft 5/6, 7. Auflage, 1955.
                 Teil V, 6. Auflage, 1955.
  \bibitem[Schopenhauer 1982]{Sc82} Schopenhauer, A.: \textsl{Die Welt als Wille und
                 Vorstellung.} 1. Buch, Wissenschaftliche Buchgesellschaft,
                 Darmstadt, 1982.
  \bibitem[Weierstraß 1895]{WE95} Weierstraß, K.: \textsl{Mathematische Werke.} Band 2,
                 Berlin 1895.
  \bibitem[Zeidler 1976]{Ze76} Zeidler, E.: \textsl{Vorlesungen über nichtlineare
                 Funktional\-ana\-lysis.} Fixpunkt\-sätze. Teubner Texte
                 zur Mathematik. BSB B. G. Teubner Verlagsgesellschaft,
                 Leipzig, 1976.
  \bibitem[Zurmühl 1953]{Zu53} Zurmühl, R.: \textsl{Praktische Mathematik für
                 Ingenieure und Physiker.} Springer Verlag, Berlin, 1953.
\end{thebibliography}

That was my solution.

Gunther
Title: Re: File listing in BibTex format
Post by: HSE on February 03, 2021, 02:10:11 AM
Quote from: Gunther on February 02, 2021, 03:02:40 PM
I cannot show them all here.
No, no. But that is LaTEX, not BibTEX. I think processing a .bib file with Bibtex.exe result something like you bib.tex. 

I'm making a little application. When finished I will request everyone to test their ".bib" files.  :biggrin:
Not solved yet concatenation ( the "#" thing) but ".bib" wihout that have no problems.

Thanks, HSE
Title: Re: File listing in BibTex format
Post by: Biterider on February 03, 2021, 06:06:24 AM
Quote from: HSE on February 02, 2021, 11:06:30 AM
I think you was going to write a book about assembly, using LaTEX !!!  :biggrin:
:biggrin:
Title: Re: File listing in BibTex format
Post by: HSE on February 11, 2021, 07:00:58 AM
Hi Gunther!

I build succesfully lamoe.tex with TeX Live 2020 (Win32) solving:
Last step can be maked easily:Ps2pdf lamoe.ps   
Thanks, HSE.
Title: Re: File listing in BibTex format
Post by: Gunther on February 11, 2021, 08:11:14 AM
HSE,

Quote from: HSE on February 11, 2021, 07:00:58 AM
I build succesfully lamoe.tex with TeX Live 2020 (Win32) solving:

  • picins.sty is missing. Download from https://www.ctan.org/pkg/picins, exctract in \texlive\2020\texmf-dist\tex\latex\, after that run "texhash".

  • there is a complain about "\fiverm". Apparently older versions load rawfonts by default. Now must be declared:
                  \documentclass{article}
                  \usepackage{rawfonts}
Last step can be maked easily:Ps2pdf lamoe.ps   
Thanks, HSE.

Congratulations. That's not so hard, isn't it. Hopefully you can read everything.

Gunther