Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
J
jekyll-scholar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caesr-pub
jekyll-scholar
Commits
867c1f71
Commit
867c1f71
authored
Feb 04, 2016
by
Sylvester Keil
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #132 from edgemaster/superscript_filter
Add filter for \superscript LaTeX command
parents
f1a42aba
d0d3ea40
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
1 deletion
+74
-1
README.md
README.md
+9
-0
features/filter.feature
features/filter.feature
+51
-0
lib/jekyll/scholar.rb
lib/jekyll/scholar.rb
+1
-0
lib/jekyll/scholar/defaults.rb
lib/jekyll/scholar/defaults.rb
+1
-1
lib/jekyll/scholar/plugins/superscript.rb
lib/jekyll/scholar/plugins/superscript.rb
+12
-0
No files found.
README.md
View file @
867c1f71
...
...
@@ -74,6 +74,9 @@ default configuration is as follows:
join_strings: true
use_raw_bibtex_entry: false
bibtex_filters:
- superscript
- latex
details_dir: bibliography
details_layout: bibtex.html
...
...
@@ -130,6 +133,12 @@ extended or overridden. For example, the default name for `article` is
*Journal Articles*
, but it can be changed to
*Papers*
using
`type_name: { article => 'Papers' }`
.
The
`bibtex_filters`
option configures which
[
BibTeX-Ruby
](
https://github.com/inukshuk/bibtex-ruby
)
formatting filters
values of entries should be passed through. This defaults to the
`latex`
filter which converts LaTeX character escapes into unicode, and
`superscript`
which converts the
`\textsuperscript`
command into a HTML
`<sup>`
tag.
### Bibliographies
Once you have loaded Jekyll-Scholar, all files with the extension
`.bib`
or
...
...
features/filter.feature
View file @
867c1f71
...
...
@@ -228,3 +228,54 @@ Feature: BibTeX
Then
the _site directory should exist
And
the
"_site/scholar.html"
file should exist
And I should see "\[Pragmatic Bookshelf\]\(https
:
//pragprog.com\)"
in
"_site/scholar.html"
@tags
@superscript
Scenario
:
LaTeX Superscript as HTML
Given I have a scholar configuration with
:
|
key
|
value
|
|
source
|
./_bibliography
|
And I have the following BibTeX filters
:
|
superscript
|
And
I
have
a
"_bibliography"
directory
And I have a file "_bibliography/references.bib"
:
"""
@misc{pickaxe,
title = {This is \textsuperscript{superscript text}.}
}
"""
And I have a page "scholar.html"
:
"""
---
---
{% bibliography %}
"""
When
I run jekyll
Then
the _site directory should exist
And
the
"_site/scholar.html"
file should exist
And
I should see
"This is <sup>superscript text</sup>."
in
"_site/scholar.html"
@tags
@superscript
Scenario
:
LaTeX Superscript with embedded LaTeX chars as HTML
Given I have a scholar configuration with
:
|
key
|
value
|
|
source
|
./_bibliography
|
And I have the following BibTeX filters
:
|
superscript
|
|
latex
|
And
I have a
"_bibliography"
directory
And I have a file "_bibliography/references.bib"
:
"""
@misc{pickaxe,
title = {\textsuperscript{\"u \"{u} \v{z}}}
}
"""
And I have a page "scholar.html"
:
"""
---
---
{% bibliography %}
"""
When
I run jekyll
Then
the _site directory should exist
And
the
"_site/scholar.html"
file should exist
And
I should see
"<sup>ü ü ž</sup>"
in
"_site/scholar.html"
lib/jekyll/scholar.rb
View file @
867c1f71
...
...
@@ -21,3 +21,4 @@ require 'jekyll/scholar/tags/reference'
require
'jekyll/scholar/generators/details'
require
'jekyll/scholar/plugins/markdown_links'
require
'jekyll/scholar/plugins/superscript'
lib/jekyll/scholar/defaults.rb
View file @
867c1f71
...
...
@@ -17,7 +17,7 @@ module Jekyll
'repository'
=>
nil
,
'bibtex_options'
=>
{
:strip
=>
false
,
:parse_months
=>
true
},
'bibtex_filters'
=>
[
:latex
],
'bibtex_filters'
=>
[
:
superscript
,
:
latex
],
'bibtex_skip_fields'
=>
[
:abstract
,
:month_numeric
],
'replace_strings'
=>
true
,
...
...
lib/jekyll/scholar/plugins/superscript.rb
0 → 100644
View file @
867c1f71
module
Jekyll
class
Scholar
class
Superscript
<
BibTeX
::
Filter
def
apply
(
value
)
# Use of \g<1> pattern back-reference to allow for capturing nested {} groups
value
.
to_s
.
gsub
(
/\\textsuperscript(\{((?:.|\g<1>)*)\})/
)
{
"<sup>
#{
$2
}
</sup>"
}
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment