Skip to content
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

Create list of figures and bibliography #55

Open
danrot opened this issue Jul 12, 2014 · 4 comments
Open

Create list of figures and bibliography #55

danrot opened this issue Jul 12, 2014 · 4 comments

Comments

@danrot
Copy link

danrot commented Jul 12, 2014

I would like to write my master thesis in markdown, but for that I would need support for creating list of figures and bibliographies. As far as I have seen the options are not existent until now. Is it possible to introduce them?

@walle
Copy link
Owner

walle commented Jul 12, 2014

Not really sure how you mean. There should be tools to do this eg. reference style links http://daringfireball.net/projects/markdown/syntax#link, lists http://daringfireball.net/projects/markdown/syntax#list and images http://daringfireball.net/projects/markdown/syntax#img

Oh, I looked into it some more, I guess you want to use anchor links? To a references list in the bottom? Like this:

# Thesis

This thesis is using references<sup>[\[1\]](#reference1)</sup>.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut accumsan elit non tincidunt sagittis. Maecenas suscipit varius enim ut eleifend. Fusce et iaculis leo. Nulla sed ligula nunc. Donec eleifend enim turpis. Cras ut orci dapibus metus iaculis cursus. Nam suscipit nisl quis nunc lacinia hendrerit. Fusce commodo vulputate risus non suscipit. Morbi et placerat tellus. Nunc ut consectetur erat. Ut vitae mi sit amet massa porta adipiscing.

Nunc interdum nisl ac erat venenatis tempor. Suspendisse lacinia eget justo egestas dictum. Donec commodo id orci vel malesuada. Suspendisse potenti. Etiam auctor ornare nisi, ut tempor augue blandit a. Sed lobortis dui nulla. Phasellus massa lectus, malesuada a dignissim id, cursus at quam. Curabitur faucibus tortor quis egestas luctus.

Morbi feugiat felis in nibh<sup>[\[2\]](#reference2)</sup> lacinia molestie eget pharetra sem. Maecenas iaculis id urna at aliquet. Pellentesque a egestas dolor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam sed fringilla diam, at blandit metus. Phasellus vel risus urna. Proin sollicitudin neque et libero condimentum, quis porttitor libero consequat. Praesent venenatis erat sed lorem vulputate semper. Sed suscipit quis odio nec tincidunt. Fusce nibh erat, iaculis a quam et, commodo ullamcorper felis. Vivamus lobortis erat a dolor pharetra sodales. Fusce tellus nisi, posuere a lorem eget, pharetra tempus sem.

Aliquam condimentum aliquet nisi vitae fermentum. Etiam laoreet vitae arcu ornare lobortis. Nam pretium urna eu egestas dictum. Mauris auctor odio id feugiat pellentesque. In porttitor et mauris non tincidunt. Interdum et malesuada fames ac ante ipsum primis in faucibus. In varius facilisis diam non congue. Duis ut pretium justo, eget accumsan tellus. Praesent in mattis justo. Cras eleifend, erat at pellentesque aliquam, urna quam ullamcorper erat, at tristique risus ante eu dui. Proin luctus tempus vulputate. Donec sollicitudin lacus id orci commodo euismod.

Ut molestie arcu at sodales tempus. Nullam vitae magna hendrerit, sollicitudin velit sit amet, venenatis diam. Donec tincidunt nulla in nibh eleifend, eu porttitor justo porta. Duis sit amet nunc tortor. Fusce elementum justo ac justo scelerisque aliquet. Cras augue arcu, porttitor eu dapibus non, commodo eu felis. Morbi vitae ligula sed lorem feugiat luctus ut non dui. Cras dictum erat ac diam faucibus, sed ornare lacus ultrices. Pellentesque vestibulum vitae diam eu ornare. Sed pellentesque interdum viverra. Nullam in est faucibus, tincidunt diam a, viverra libero. Quisque dignissim dui in arcu ultrices gravida. Nunc euismod erat eget urna dictum iaculis.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut accumsan elit non tincidunt sagittis. Maecenas suscipit varius enim ut eleifend. Fusce et iaculis leo. Nulla sed ligula nunc. Donec eleifend enim turpis. Cras ut orci dapibus metus iaculis cursus. Nam suscipit nisl quis nunc lacinia hendrerit. Fusce commodo vulputate risus non suscipit. Morbi et placerat tellus. Nunc ut consectetur erat. Ut vitae mi sit amet massa porta adipiscing.

Nunc interdum nisl ac erat venenatis tempor. Suspendisse lacinia eget justo egestas dictum. Donec commodo id orci vel malesuada. Suspendisse potenti. Etiam auctor ornare nisi, ut tempor augue blandit a. Sed lobortis dui nulla. Phasellus massa lectus, malesuada a dignissim id, cursus at quam. Curabitur faucibus tortor quis egestas luctus.

Morbi feugiat felis in nibh lacinia molestie eget pharetra sem. Maecenas iaculis id urna at aliquet. Pellentesque a egestas dolor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam sed fringilla diam, at blandit metus. Phasellus vel risus urna. Proin sollicitudin neque et libero condimentum, quis porttitor libero consequat. Praesent venenatis erat sed lorem vulputate semper. Sed suscipit quis odio nec tincidunt. Fusce nibh erat, iaculis a quam et, commodo ullamcorper felis. Vivamus lobortis erat a dolor pharetra sodales. Fusce tellus nisi, posuere a lorem eget, pharetra tempus sem.

Aliquam condimentum aliquet nisi vitae fermentum. Etiam laoreet vitae arcu ornare lobortis. Nam pretium urna eu egestas dictum. Mauris auctor odio id feugiat pellentesque. In porttitor et mauris non tincidunt. Interdum et malesuada fames ac ante ipsum primis in faucibus. In varius facilisis diam non congue. Duis ut pretium justo, eget accumsan tellus. Praesent in mattis justo. Cras eleifend, erat at pellentesque aliquam, urna quam ullamcorper erat, at tristique risus ante eu dui. Proin luctus tempus vulputate. Donec sollicitudin lacus id orci commodo euismod.

Ut molestie arcu at sodales tempus. Nullam vitae magna hendrerit, sollicitudin velit sit amet, venenatis diam. Donec tincidunt nulla in nibh eleifend, eu porttitor justo porta. Duis sit amet nunc tortor. Fusce elementum justo ac justo scelerisque aliquet. Cras augue arcu, porttitor eu dapibus non, commodo eu felis. Morbi vitae ligula sed lorem feugiat luctus ut non dui. Cras dictum erat ac diam faucibus, sed ornare lacus ultrices. Pellentesque vestibulum vitae diam eu ornare. Sed pellentesque interdum viverra. Nullam in est faucibus, tincidunt diam a, viverra libero. Quisque dignissim dui in arcu ultrices gravida. Nunc euismod erat eget urna dictum iaculis.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut accumsan elit non tincidunt sagittis. Maecenas suscipit varius enim ut eleifend. Fusce et iaculis leo. Nulla sed ligula nunc. Donec eleifend enim turpis. Cras ut orci dapibus metus iaculis cursus. Nam suscipit nisl quis nunc lacinia hendrerit. Fusce commodo vulputate risus non suscipit. Morbi et placerat tellus. Nunc ut consectetur erat. Ut vitae mi sit amet massa porta adipiscing.

Nunc interdum nisl ac erat venenatis tempor. Suspendisse lacinia eget justo egestas dictum. Donec commodo id orci vel malesuada. Suspendisse potenti. Etiam auctor ornare nisi, ut tempor augue blandit a. Sed lobortis dui nulla. Phasellus massa lectus, malesuada a dignissim id, cursus at quam. Curabitur faucibus tortor quis egestas luctus.

Morbi feugiat felis in nibh lacinia molestie eget pharetra sem. Maecenas iaculis id urna at aliquet. Pellentesque a egestas dolor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam sed fringilla diam, at blandit metus. Phasellus vel risus urna. Proin sollicitudin neque et libero condimentum, quis porttitor libero consequat. Praesent venenatis erat sed lorem vulputate semper. Sed suscipit quis odio nec tincidunt. Fusce nibh erat, iaculis a quam et, commodo ullamcorper felis. Vivamus lobortis erat a dolor pharetra sodales. Fusce tellus nisi, posuere a lorem eget, pharetra tempus sem.

Aliquam condimentum aliquet nisi vitae fermentum. Etiam laoreet vitae arcu ornare lobortis. Nam pretium urna eu egestas dictum. Mauris auctor odio id feugiat pellentesque. In porttitor et mauris non tincidunt. Interdum et malesuada fames ac ante ipsum primis in faucibus. In varius facilisis diam non congue. Duis ut pretium justo, eget accumsan tellus. Praesent in mattis justo. Cras eleifend, erat at pellentesque aliquam, urna quam ullamcorper erat, at tristique risus ante eu dui. Proin luctus tempus vulputate. Donec sollicitudin lacus id orci commodo euismod.

Ut molestie arcu at sodales tempus. Nullam vitae magna hendrerit, sollicitudin velit sit amet, venenatis diam. Donec tincidunt nulla in nibh eleifend, eu porttitor justo porta. Duis sit amet nunc tortor. Fusce elementum justo ac justo scelerisque aliquet. Cras augue arcu, porttitor eu dapibus non, commodo eu felis. Morbi vitae ligula sed lorem feugiat luctus ut non dui. Cras dictum erat ac diam faucibus, sed ornare lacus ultrices. Pellentesque vestibulum vitae diam eu ornare. Sed pellentesque interdum viverra. Nullam in est faucibus, tincidunt diam a, viverra libero. Quisque dignissim dui in arcu ultrices gravida. Nunc euismod erat eget urna dictum iaculis.

## References

* <a id="reference1"></a> http://example.com/
* <a id="reference2"></a> http://example2.com/

This is an example on how to do this. Unfortunately the wkhtml2pdf-binary that gimli uses does not support this. I will release a 0.6.0.pre version so you can test it out. In the pre version I've changed the binary gem so it uses a more recent version of wkhtmltopdf.

I'm using the <sup> tag to get the link superscripted, and the backslash \[ to escape the bracket to include it in the link text.

Oh, and remember, you can always use html and classes and css in your document. So if you need a byline for images in your document you could do something like this

![Graphic 1](images/graphic1.png)
<p class="byline">This is the byline</p>

And in eg. style.css

.byline {
  font-size: 11px;
  color: #888;
}

To include your style you can call gimli with the -s flag eg.

$ gimli -f thesis.md -s style.css

To test it out install the pre version

$ gem install gimli --pre 

Is this enough, or are there anything else that you would need?

@danrot
Copy link
Author

danrot commented Jul 12, 2014

Sry, looks like I have not been exact enough, I think I am too deep in this topic...

With bibliography I mean what I can do with bibtex in latex, it would also be really great if this format can be used, and the reference list at the end can be autogenerated. But I guess for this your solution would be more than enough.

The same goes for the list of figures, in latex you mark all the included pictures as figures, and add a caption to them. With the command \listoffigures latex generates an overview of all pictures with the pages they are used on (like described in http://texblog.org/2007/07/30/list-of-figures-and-list-of-tables-listoffigures-listoftables/).

Of course this stuff is already possible, but the auto generations would be really comfortable. Especially with a long document with quite a lot of references you would end up to update all the texts twice...

@walle
Copy link
Owner

walle commented Jul 12, 2014

Yes, I see your point. This is unfortunately not something I have time to implement now. My guess is that it should be implemented on the markdown parser level too. As an extension of markdown. Gimli could then use that markdown parser.

My suggestion is: if it's important to get the auto generation, use latex. It's well proven and will give good results. The syntax is a little trickier though. Otherwise you could do it manually.

Another solution is, if you determine a format it should be a "small" task to write a domain specific script that auto generates your references list. The pages they are used on is hard though, since the pdf is built from HTML and the page is determined by the CSS (kind of). The best way would be with anchor links( eg. < a id="figure1">). The script could parse out all references and add a list in the bottom of the document at least. But I don't really know how feasible that is.

I hope you can get some help from gimli, but as always, it is best to use the right tool for the work.

Thank you for your issue that made me look into a thing I have had in the back of my mind a while (the anchor links).

@danrot
Copy link
Author

danrot commented Jul 12, 2014

I already wrote some documents in latex, and keeping the relative complex latex syntax in mind while you are trying to write is not too easy. I also already found pandoc, which converts the markdown to latex with pretty much everything I need, but none of the other solutions result in such a nice code highlighting as yours.

However, I still got some time left to make a decision :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants