Discussion of my usage of madoko and problems

Nov 15, 2015 at 11:12 AM
Edited Nov 16, 2015 at 6:49 PM
Instead of further spamming the issues section, I'll try to summarize my current stand with regard to the changes in current repository version (11/15/2015):
  1. Using "Heading Base: 1" seems to come pretty close to my use case. I get chapters which are recognized when creating page headings with latex. [There still seems to be aproblem with the index though since on chapter level I get the latex index and the madoko index: Screenshot] FIXED!
  2. Headings with line break are formatted in a different way by madoko (Screenshot) than latex does (Screenshot). I'd prefer the way latex does the formatting.
  3. [I still have issues with trailing dots in the index of headings. It's easy to get rid of them in latex (numbers=noendperiod) and it would be nice to have a metadata key that can be set to true/false to toggle that behavior. I found out that ".heading-before" in prelude.mdk defines this behavior so I can disable it there but I'd prefer not to change the defaults in the config files.] FIXED!
  4. [BIB] comes with a heading by default. I'm not sure if that is the intended behavior. It's not a problem since the headline in correct and in german but it's not consistent with [TOC] that needs a separate headline. Possibly that is a side effect of my document class "scrreprt" but I'm not sure.
I hope this feedback helps. Thanks for your great work!

Nov 16, 2015 at 11:31 AM
Edited Nov 16, 2015 at 1:01 PM
Yay, with today's/yesterday's changes point 1 and 3 are fixed. I already tried it and it looks great. Thanks a lot! :)

5. One thing that might be a bug:

# Appendix { - }

Text ...
On the page where the Appendix starts I still get "Literaturverzeichnis" (=Bibliography from [BIB]) in the page header: Screenshot.

Another thing I wanted to share: I found some way to convert the sublime text language settings to atom following these steps. You can download it here. I don't know how much work it would mean to maintain it but Atom is a free alternative to sublime text.
Nov 16, 2015 at 12:57 PM
Edited Nov 16, 2015 at 1:01 PM
6. Just realized that even though bibtex technically works now with the ajs style, there are advantages in using biblatex that I now start to remember when going thru the bibliography output of bibtex:

The formatting and the degree of internationalization of the output differs between bibtex (Screenshot) and biblatex (Screenshot). While the formatting (indentation, braces around year, better word spacing in biblatex) isn't that important, the language/country specific differences ("and" --> "und", "In:", "S.") are since I need need a consistent language usage (german) throughout the document. Since biblatex does most of its processing thru latex, you get all that stuff for "free". I'm not sure if I can accomplish this within madoko or additional bibtex related commands in the Tex Header. With biblatex I use the following biblatex related entries in the header:
Package     : [style=authoryear,natbib=true,backend=biber,doi=false,url=false,isbn=false,eprint=false] biblatex
Tex Header  :
Is there sth. similar I can do with bibtex so it recognizes my country specific settings etc.?
Nov 16, 2015 at 7:55 PM
Hi Tobias,

Great for collecting all your feedback together :-) As you see, I have already applied many fixes in the development head.
  • Note that tex-chapters is no longer needed (I'll remove it) -- all the logic is now in the prelude
  • I have now defined an element heading-format: &label;&heading-endperiod; , so by saying heading-endperiod: it is no longer applied.
  • With regard to the different formatting of long titles: this is tricky to fix since different packages define chapter headings in very different ways. One way to get it is to let TeX number all sections instead of Madoko -- but that is risky too since they may be 'out of sync' if you are not careful. But you can enable it using:
    Tex Section Num: True
    and the long titles will be formatted as expected.
    Another solution is to do some extra latex to format the section numbers from Madoko. If you look in the test\latex\article-biblatex.mdk file you can see I have four different solutions to type setting the code; the one called withbreak uses Madoko to number but breaks titles nicely using the \mychapter command. This would be perhaps my preferred solution.
Nov 16, 2015 at 8:07 PM
With regard to [BIB] and [TOC] headings: the [BIB] element indeed includes a heading -- this is not a great design I think, but I need to do it since it is very hard to suppress the heading in general for the LaTeX output. I will make it more customizable though so it is easier to create language modules that customize the heading names.

For [TOC] I don't generate a heading but perhaps I should do so for consistency and also make it easy to customize it.

I looked more into bibtex and it seems that many bibliography files are generated from a master file called merlin.mbs (or the older genbst.mbs) which can actually generate styles that work with the babel package to generate the bibliography in the right language. I will later update the Madoko bbl reader to correctly parse these \bblxxxx commands. The current ajs.bst is just generated from the older genbst.mbs file which does not issue these language dependent commands -- perhaps we can regenerate a newer ajs.bst from merlin.bst -- or, for now, you can perhaps fix manually the ajs.bst file: there are just a few occurrences of " and ", "In " etc. :-)

You could also add some replacers for now:
bibliography { replace:"//\band\b/und//\bIn:\b/S.//" }
for example.
Nov 16, 2015 at 9:22 PM
daan wrote:
Another solution is to do some extra latex to format the section numbers from Madoko. If you look in the test\latex\article-biblatex.mdk file you can see I have four different solutions to type setting the code; the one called withbreak uses Madoko to number but breaks titles nicely using the \mychapter command. This would be perhaps my preferred solution.
This works indeed fine. Thank you. I'd just need to manually do this for h1-h4 which would take quite a lot of space in the header (in the example only h1 is handled). Do you plan to make this a general meta data key? Would be great! :)

Regarding bibliography, I saw following code in the test\latex\article-biblatex.mdk file:
xPackage     : natbib
xPackage*    : [style=authoryear,natbib=true,backend=biber,doi=false,url=false,isbn=false,eprint=false] biblatex
I was unable to make it work though. Did you completely bury your biblatex plans? At the moment I'd favor the idea to go back to manually use biblatex but the problem is that citing the madoko way would stop working. Would you know an easy workaround? This would be the only thing I'd worry about.

Thanks for your suggestions regarding bibtex anyway! I'll try them tomorrow and report back how well it went.

Thanks for your support!
Nov 16, 2015 at 9:55 PM
Hi Tobias,

I just generated a asj-new-german.bst -- it turns out the makebst program works really well. This is what I get now on my test file (screenshot).

You can download the new bst file and control file here -- if you also get the custom-bib package from CTAN and unzip in there, you can manually toggle settings in the .dbj file. I will use this file to create at least support in Madoko for bst files that support the Babel package commands.

I think supporting biblatex soon will hard... the way it is set up is that that all the formatting is done by the biblatex package -- but that means a tool like Madoko cannot extract that from the generated content to show it nicely in HTML; it just sees generic commands like \field{year}{2014} for example. With bibtex it gets formatted into parseable latex, like (\textit{2014}) which can now be shown nicely in HTML or other backends too. The multiple backends, especially re-flowable, re-scalable, HTML is of course paramount to Madoko.
Nov 18, 2015 at 3:05 PM
Hi Daan,

Your generated german asj bib style works so far. Thanks a lot. Besides the formatting the output seems fine. It's just for pdf output that biblatex makes a overall nicer looking text. I did some googling to find out if there is anything that can translate biblatex output to html and it seems like the newer code of the TeX4ht project has a file called biblatex.4ht that handles biblatex output when translating to html. In my texlive installation the file resides under /usr/local/texlive/2015/texmf-dist/tex/generic/tex4ht but I also uploaded the file here. Perhaps you can find some usable code there. Otherwise I guess I can live with bibtex. For pdf output there's always the option to compile the bibliography separately and merge the files.
Nov 18, 2015 at 10:47 PM
It looks like the Visual Studio Code editor just got open source'd. Might be a good candidate for a madoko language addon. :)
Nov 19, 2015 at 1:14 AM
Actually, already the Madoko.net website uses the VS code editor -- good to see it is now open source :-) I am working on getting Madoko in there.

With regard to biblatex -- it looks pretty similar at this stage to me. Perhaps the only difference is the hanging indentation? That would be an easy fix -- each bibitem command is just an \item in a list and can be configured easily to do hanging indentation. Are there other things that make it look 'nicer'?
Thanks again for all your help and suggestions :-)
Nov 19, 2015 at 7:51 AM
I worked some more on my bib managing software and excluded all the fields that I don't want to be visible in the bibliography and that latex has issues with when it comes to line breaks. Now it looks indeed very close to the biblatex output. If you can tell me how to accomplish the hanging indentations, I'd experiment some more with the look of my bibliography.

Regarding line breaks in headings, is there an efficient way to apply the withbreakstyle to all headings?

It also seems like there is a bug with page headings/chaptermark:

# Appendix { - }

Text ...
This results in "Bibliography" in the page heading on the appendix page (there is a page break after the bbliography since I use chapters).

Thanks for having so much patience with me. :)
Nov 24, 2015 at 12:49 PM
Hi again!

Congratulations to the new release (0.9.17-beta). Now that [BIB] and [TOC] contain their respective headings, how can I configure them to be listed in the TOC or to not print their headings (old style)?

Above problem regarding wrong page headings (References) on the first Appendix page still exists. And it would be really cool to have the withbreak heading style being applicable to all headings with index prefix automagically via a metadata key. (sorry for my annoying nagging)