Closed nanov closed 7 years ago
Does your document have any metadata in it?
Of course :) I have also tried also with this one, result is the same...
Use the develop
branch.
Still the same behavior
It works fine for me (using the file you linked to above):
[minime:5 - Maintenance/mmd6-public/build] fletcher% ./multimarkdown -m test.txt
title
css
htmlheader
latexleader
latexbegin
latexfooter
foo
foo
htmlheaderlevel
latexheaderlevel
baseheaderlevel
multimarkdown -m test.txt
works fine for me if test.txt
contains metadata but returns (null)
without a return character if there is no metadata. I might have expected no output if nothing if found.
Also, multimarkdown -e metadata test.txt
works as expected if metadata
is found but fails when not found.
donald$ multimarkdown -e css test.txt
http://foo.com/bar.css
donald$ multimarkdown -e nothing test.txt
Segmentation fault: 11
Maybe no output and an error code to stderr would be a more consistent and graceful result for each of these cases.
Fixed in develop.
Thanks!
Hi Fletcher,
Thanks for the fast response and fix.
I am not a programmer but wonder, since you are so meticulous about releasing memory, whether it would be better to put the free(char_result) outside the if clause. ((Line 422 and line 434 of main.c in develop branch)
Background I have used multimarkdown markup for several years but have almost exclusively used Marked(2) to display the result, with adequate results. Now that Composer is being redeveloped/enhanced I am keen to move on to using it instead. This led me to revisit your multimarkdown program and I have had a few issues getting it to match the output you provide for QuickStart.txt. Since the pdf output requires the mmd2pdf script, I encountered the metadata error on the way to understanding the \latextitle error I first raised. When I work around that I next run into the tufte-handout error involving \MakeTextLowercase in tufte-common.def which nobody seems to have resolved. This is strange as I have used tufte-handout before without issue. Maybe different programs (e.g. TeXnicle) just skip minor errors and move on.
Regards,
Donald
On 20170821, at 12:59 am, Fletcher T. Penney notifications@github.com wrote:
Fixed in develop.
Thanks!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fletcher/MultiMarkdown-6/issues/78#issuecomment-323590352, or mute the thread https://github.com/notifications/unsubscribe-auth/AFUuEsaK1Yu0EOLVJqLscHvQ38wT9W9Wks5saEnQgaJpZM4OwQtP.
Why free memory if it wasn't allocated? The only reason the if clause would not be traversed is if char_result
is NULL, in which case it doesn't need to be freed.
Right?
mmd2pdf
is a useful shortcut if everything is exactly right. LaTeX is a complex program, to say the least, and things rarely work exactly right the first time. I recommend creating PDFs "manually" until you're confident in your workflow. I use latexmk
when creating pdf's -- I almost never use mmd2pdf
.
I knew it was unwise for me to comment on code since I haven’t written C (or anything much else) for over 30 years!
Nevertheless: Dare I suggest that mmd6-tufte-handout-leader.tex and mmd6-tufte-book-leader.tex would benefit from the inclusion of mm6-title.tex before mmd6-default-metadata.tex is input. Maybe it could go inside mmd6-default-metadata.tex, above the existing code, but I see it is called in mmd6-article-begin.tex, which is after mmd6-default-metadata in this case. Presumably, \myauthor and \mytitle get overwritten with “Author” and “Title” respectively.
% Configure default metadata to avoid errors \input{mmd6-title} \input{mmd6-default-metadata}
This stops the following error when there is no latex title metadata.
Writing index file QuickStart.idx (/Users/donald/Library/texmf/tex/latex/mmd6/shared/mmd6-default-metadata.tex)) (/Users/donald/Library/texmf/tex/latex/mmd6/tufte-handout/mmd6-tufte-handout-be gin.tex /Users/donald/Library/texmf/tex/latex/mmd6/tufte-handout/mmd6-tufte-handout-beg in.tex:3: Undefined control sequence.
Are you sure you've installed the latest versions of the latex support files? The following works just fine for me:
Title: MultiMarkdown v6 Quick Start Guide
Author: Fletcher T. Penney
Version: 6.1.0
LaTeX Config: tufte-handout
Base Header Level: 3
# Test #
Hi.
I am seriously confused. I have copied the mmd6 support files from the Master branch (again) but still can't get your minimal example to compile to PDF. The tex file is as expected:
\input{mmd6-tufte-handout-leader}
\def\mytitle{MultiMarkdown v6 Quick Start Guide}
\def\myauthor{Fletcher T. Penney}
\def\version{6.1.0}
\input{mmd6-tufte-handout-begin}
\section{Test }
\label{test}
\input{mmd6-tufte-handout-footer}
\end{document}
but this fails in pdfTex with:
/Users/donald/Library/texmf/tex/latex/mmd6/tufte-handout/mmd6-tufte-handout-beg
in.tex:12: Undefined control sequence.
\@title ->\latextitle
l.12 \maketitle
I expect this to fail since \latextitle is only defined in mmd6-title.tex
, which is only referenced in
mmd6-article-begin.tex
and nowhere else. So \latextitle is never set in the support files when using tufte-handout
or tufte-book
, although it is set inside latex.c
if and only if the latex title metadata is used.
Donalds-iMac:mmd6 donald$ pwd
/Users/donald/Library/texmf/tex/latex/mmd6
Donalds-iMac:mmd6 donald$ ls -l
total 0
drwxr-xr-x@ 5 donald staff 170 15 Aug 10:19 article
drwxr-xr-x@ 7 donald staff 238 15 Aug 10:19 letterhead
drwxr-xr-x@ 10 donald staff 340 15 Aug 10:19 shared
drwxr-xr-x@ 5 donald staff 170 15 Aug 10:19 tufte-book
drwxr-xr-x@ 5 donald staff 170 15 Aug 10:19 tufte-handout
Donalds-iMac:mmd6 donald$
Donalds-iMac:mmd6 donald$ grep 'latextitle' */*
article/mmd6-article-begin.tex:\title{\latextitle}
shared/mmd6-title.tex:\ifx\latextitle\undefined
shared/mmd6-title.tex: \def\latextitle{\mytitle}
tufte-book/mmd6-tufte-book-begin.tex:\title{\latextitle}
tufte-handout/mmd6-tufte-handout-begin.tex:\title{\latextitle}
Donalds-iMac:mmd6 donald$
Donalds-iMac:mmd6 donald$ grep 'mmd6-title' */*
article/mmd6-article-begin.tex:\input{mmd6-title}
Since I cannot get a simple example to work, I feel that I should leave this to more experienced people to resolve, assuming they encounter they same problem.
Thanks anyway for your responses to my questions.
I checked again -- looks like the last changes I made were not pushed to github, and only existed in my own texmf
folder.
When I was working on it, one problem that arose was related to some trickiness with concatenating fields....
Try adding \input{mmd6-title}
to beginning of mmd6-tufte-book-begin.tex
and mmd6-tufte-handout-begin.tex
.
Otherwise, I had to do some craziness in mmd6-title.tex
.... Convert each instance of \addtodef{\myauthor}{}{ \\ ...}
to \expandafter\defexpandafter\myauthor\expandafter{\myauthor \\ ...}
.
It seems to work for me, but might need more testing.
MMD v 6.10, when I execute multimarkdown with the -m parameter i get just (null), am I getting something wrong, or is it intended?