GithubHelp home page GithubHelp logo

timtylin / scholdoc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jgm/pandoc

336.0 336.0 16.0 24.36 MB

Fork of Pandoc for the implementation of a ScholarlyMarkdown parser

Home Page: scholdoc.scholarlymarkdown.com

License: GNU General Public License v2.0

Haskell 81.78% Makefile 0.14% JavaScript 0.26% HTML 14.91% Lua 0.84% Shell 0.58% Perl 0.22% Groff 1.27%

scholdoc's People

Contributors

alexanders avatar arlol avatar aslatter avatar astanin avatar bergey avatar bgamari avatar bos avatar cben avatar claremacrae avatar davidlazar avatar dfc avatar hdevalence avatar heurist avatar jgm avatar jkr avatar jlduran avatar lierdakil avatar markwright avatar mb21 avatar merijn avatar mpickering avatar punchagan avatar semorrison avatar sheremetyev avatar tarleb avatar thumphries avatar timtylin avatar wilx avatar xabbu42 avatar xkollar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scholdoc's Issues

Support for subfloatrow type referencing

Do we have support for subfigure/subfloatrow referencing for figures? And if we don't ... could we? What I mean by that is explicit reference to Figure 2a vs Figure 2b. I hope that's clear. I guess the subcaption part is already there.

Internal reference syntax

Scholdoc's current internal reference syntax is

  • (#label) -> \eqref{label}
  • [#label] -> \ref{label}

In my internal reference filter I started out with [#ref] but am now using #ref, with the mapping

  • #label -> \autoref{label}

I did this for consistency with the @citekey syntax (and because it was less typing!). It was a difficult choice though and I'm still not sure what the best choice is. Did you consider the #label syntax?

Also, I'm not sure how you do figure references in html output? My filter converts in a context dependent way. e.g. if #label refers to figure 1 (which is an image in a div):

  • #label -> <a href="#label">Figure 1</a>

Nice work on scholdoc! I'm going to compile it later on.

Internal reference of aligned equation array

The example given on the scholarly markdown syntax guide website doesn't seem to work for me.

$$\left.\begin{aligned} B'&=-\partial\times E\\ E'&=\partial\times B - 4\pi j \end{aligned} \right} \qquad \text{Maxwell's equations} ``` produces <span class="math scholmd-math-display" style="display: block;">\[ \begin{equation} \label{maxwellEq} \left.\begin{aligned} B&jgm#39;&amp;=-\partial\times E\\\ E&jgm#39;&amp;=\partial\times B - 4\pi j \end{aligned} \right\} \qquad \text{Maxwell&jgm#39;s equations} \end{equation} \]</span> However, I notice that on the html file on the website, the label is placed at the end just before \end{equation}. If I modify my html file manually to do the same thing, the reference works! Could anyone help me solve this issue. ```$$

Go beyond \section when using --shift-heading-level-by=-1

I frequently use this command for converting mediawiki-encoded text:

pandoc input.txt -f mediawiki -t latex -o output.tex

The output is included in a scrbook class book project.

Problem: pandoc converts =heading= to \section, but I need it to be \chapter instead.

If I change the input to this:

pandoc input.txt -f mediawiki -t latex --shift-heading-level-by=-1 -o output.tex

the =heading= encoding loses its encoding altogether.

Expected behaviour: If --shift-heading-level-by=-1 ist used, =heading= should be converted to \chapter, --shift-heading-level-by=-2 should be converted to \part.

haskell dependency issues during install

Homebrew install doesn't work, and I don't know enough about Haskell to figure it out. Halp!

[11:56 ~ 522] brew install scholdoc
==> Installing scholdoc from timtylin/scholdoc
==> Downloading https://hackage.haskell.org/package/scholdoc-0.1.3/scholdoc-0.1.3.tar.gz
Already downloaded: /Users/wchang/Library/Caches/Homebrew/scholdoc-0.1.3.tar.gz
==> cabal sandbox init
==> cabal update
==> cabal install --jobs=4 --max-backjumps=100000 --only-dependencies
Last 15 lines from /Users/wchang/Library/Logs/Homebrew/scholdoc/03.cabal:
rejecting: array-0.4.0.0 (conflict: base==4.9.0.0/installed-4.9..., array =>
base>=4.2 && <4.6)
rejecting: array-0.3.0.3 (conflict: base==4.9.0.0/installed-4.9..., array =>
base>=4.2 && <4.5)
rejecting: array-0.3.0.2, array-0.3.0.1 (conflict:
base==4.9.0.0/installed-4.9..., array => base>=4.2 && <4.4)
rejecting: array-0.3.0.0 (conflict: base==4.9.0.0/installed-4.9..., array =>
base>=3 && <4.4)
rejecting: array-0.2.0.0, array-0.1.0.0 (conflict:
base==4.9.0.0/installed-4.9..., array => base<4.3)
Dependency tree exhaustively searched.

I'm running macos Sierra.

"Undefined control sequence" for \chapter when using `#`-level headers

When trying to generate a document with scholdoc I get this error:

$ scholdoc -t latex -o test.pdf md_docs/draft3.md
! Undefined control sequence.
l.119 \chapter

scholdoc: Error producing PDF from TeX source

The document works fine with pandoc.

If I add the -f markdown flag pdf generation works fine, but figure referencing (the reason I wanted to change to scholdoc in the first place) gets screwed up; the special 'scholdoc' image syntax gets generated like normal markdown.

The problem seems to be headers of the following types

# Title
some text

and

Title
=====
some text

If I strip the document of all instances of H1 type headers, document generation works again. They are a supported format for markdown documents, though, so that is a workaround, not a solution.

table parsing is broken in table floats

The following multiline table float fails to parse the hrule element


#### Table:

--------- ------------ ----------
item 1    item 2       item 3

item 4    item 5       item 6
---------------------------------

* * *

Some other text

But if we remove the float header, the hrule is again recognized

--------- ------------ ----------
item 1    item 2       item 3

item 4    item 5       item 6
---------------------------------

***

Some other text

Scholdoc behaves almost like pandoc on Windows

The title might suggest that the well-intended pandoc-like feature works. But I mean it differently:
When calling scholdoc on my ScholarlyMarkdown files to create .html, for instance, it looks almost exactly like the result which pandoc would have produced....

  • the new ScholarlyMarkdown math blocks are interpreted as code and not math
  • blocks with three tildes are interpreted as strike-through text
  • no labels or referencing works
  • the standalone feature is NOT activated by default (requires explicit -s)
  • the mathjax feature is NOT activated by default (requires explicit --mathjax)
  • maybe more?

However, somehow scholdoc seems to be alive, because the class names of the html tags have scholdoc prefixes.
I have downloaded and tested the Scholdoc example Dolphin Capture, and it does not work at all, make html produces a html file without the scholdoc features expected.

Is this behaviour a bug? Is it Windows/Cygwin specific? What could go wrong?
I am using the latest stable binary for Windows.

Use a different user data directory

Making the trivial change from ~/.pandoc to ~/.scholdoc would make using both (surely not uncommon) a bit less messy, particularly in terms of templates.

Dependencies need updating (urgent! - Can't install scholdoc)

$ cabal update
Config file path source is default config file.
Config file /home/userm/.cabal/config not found.
Writing default configuration to /home/userm/.cabal/config
Downloading the latest package list from hackage.haskell.org
$ cabal install scholdoc
Resolving dependencies...
Downloading SHA-1.6.4.2...
Downloading cryptonite-0.7...
Downloading highlighting-kate-0.5.15...
Configuring SHA-1.6.4.2...
Failed to install SHA-1.6.4.2
Build log ( /home/userm/.cabal/logs/SHA-1.6.4.2.log ):
Downloading http-client-0.4.24...
Configuring highlighting-kate-0.5.15...
Failed to install highlighting-kate-0.5.15
Build log ( /home/userm/.cabal/logs/highlighting-kate-0.5.15.log ):
Configuring http-client-0.4.24...
Downloading monad-control-1.0.0.4...
Failed to install http-client-0.4.24
Build log ( /home/userm/.cabal/logs/http-client-0.4.24.log ):
Configuring monad-control-1.0.0.4...
Downloading vector-0.10.12.3...
Failed to install monad-control-1.0.0.4
Build log ( /home/userm/.cabal/logs/monad-control-1.0.0.4.log ):
Configuring vector-0.10.12.3...
Failed to install vector-0.10.12.3
Build log ( /home/userm/.cabal/logs/vector-0.10.12.3.log ):
Failed to install cryptonite-0.7
Build log ( /home/userm/.cabal/logs/cryptonite-0.7.log ):
cabal: /home/userm/.cabal/logs/cryptonite-0.7.log: does not exist
$ cabal --version && ghc --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library 
The Glorious Glasgow Haskell Compilation System, version 7.8.3

Note that all the log files in ~/.cabal/logs are 0 bytes.

Homebrew build fails on El Capitan

I tried installing scholdoc on El Capitan (10.11.2) but it failed. I tried the bottle and build from source. I don't know much about Haskell, so I'm not sure what's going on here.

$ brew install scholdoc
==> Installing scholdoc from timtylin/scholdoc
==> Downloading https://hackage.haskell.org/package/scholdoc-0.1.3/scholdoc-0.1.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/scholdoc-0.1.3.tar.gz
==> cabal sandbox init
==> cabal update
==> cabal install --jobs=8 --only-dependencies
Last 15 lines from /Users/dcode/Library/Logs/Homebrew/scholdoc/03.cabal:
rejecting: array-0.4.0.0 (conflict: base==4.8.2.0/installed-bfc..., array =>
base>=4.2 && <4.6)
rejecting: array-0.3.0.3 (conflict: base==4.8.2.0/installed-bfc..., array =>
base>=4.2 && <4.5)
rejecting: array-0.3.0.2, 0.3.0.1 (conflict: base==4.8.2.0/installed-bfc...,
array => base>=4.2 && <4.4)
rejecting: array-0.3.0.0 (conflict: base==4.8.2.0/installed-bfc..., array =>
base>=3 && <4.4)
rejecting: array-0.2.0.0, 0.1.0.0 (conflict: base==4.8.2.0/installed-bfc...,
array => base<4.3)
Dependency tree exhaustively searched.

Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/timtylin/scholdoc/issues

Force Figure Position in Scholarly Markdown?

Hi, I was wondering if there is a syntax in Scholarly Markdown to force a figure position (for pdf and tex outputs). Such syntax should ideally attach placement properties (htbp, etc.) to the figure float environment.

Is this supported in the current scholdoc?

Thanks,
Dan

Is this project alive?

Hi!

@timtylin, are you still actively developing this project? Based on the commits, it's hard to decide whether the development is completely abandoned or just suspended for a couple of month.

Gabor

Support for abbreviations

As far as I know, Scholdoc (like Pandoc) does not handle abbreviations when converting to LaTex (of course, correct me if I am wrong). It would be so great though if Scholdoc included support for abbreviations, since abbreviations are very regularly used in academic writing. One possible solution is to do something similar to MultiMarkdown's abbreviation handling:

When exporting to LaTeX, the acronym package is used; this means that the first usage will result in full text (short), and subsequent uses will result in short.

Could this be accomplished rather simply with a scholdoc filter? If so, let me know. I'm a noobie with filters.

Anyway, keep up the great work! Cheers!

Is this project still alive?

Hey everyone,
Is this project still alive. Last commit was 2015..
I would really love to here positive from you :-)

Windows installer

Since pandoc has a windows installer, it shouldn't be too hard to adapt for scholdoc

can't reference an equation that contains an array

```math #foo
\begin{array}{ccc}
1+1 & = & 2
\end{array}
```
Equation (#foo) shows as Equation (???).

Inspecting the html code, schodoc seems to be doing the right thing - is this a known mathjax issue then?

Internal reference to an equation does not work in docx

A minimal example:

~~~math #firstequation
\frac{\partial C}{\partial t} = \nabla \cdot \left( \nu \nabla C \right ),
~~~

See equation (#firstequation).

converted to docx with

scholdoc test_minimal.md -o test_minimal.docx

does not produce the equation number nor the internal reference to equation (1) in the docx file. Converting to tex works fine.

rather than maintaining it as fork of pandoc, why not make it an extension

When you make and maintain it as fork of pandoc, then there is always a splitted effort .
Why not make it as an extension

for example: currently

   pandoc -f html+epub_html_exts            ......

currently already
markdown_phpextra ,markdown_github
are implemented


NOW, in the same way, the scholarlydoc extension can be:
pandoc -f +markdown_scholdoc ......
Hence, it will be not be a fork as two separate project - pandoc and scholdoc, but rather markdown_scholdoc is just extension flag of markdown of pandoc

So,It will co-exist with main codebase of pandoc, without always catching up with the bugs fixed there in the docx generation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.