Giter Club home page Giter Club logo

Comments (2)

CLRafaelR avatar CLRafaelR commented on July 20, 2024

I think a formatting function similar to formatGlossLine is necessary for splitSource so that a string ~...~ is converted into small caps via pandoc.SmallCaps(), and non-alphabetical symbols like / are rendered as they are (i.e. / is not italicised).

pandoc-ling/pandoc-ling.lua

Lines 444 to 465 in 2a1e55a

function formatGlossLine (s)
-- turn uppercase in gloss into small caps
local split = {}
for lower,upper in string.gmatch(s, "(.-)([%u%d][%u%d]+)") do
if lower ~= "" then
lower = pandoc.Str(lower)
table.insert(split, lower)
end
upper = pandoc.SmallCaps(pandoc.text.lower(upper))
table.insert(split, upper)
end
for leftover in string.gmatch(s, "[%u%d][%u%d]+(.-[^%u%s])$") do
leftover = pandoc.Str(leftover)
table.insert(split, leftover)
end
if #split == 0 then
if s == "~" then s = "   " end -- sequence "space-nobreakspace-space"
table.insert(split, pandoc.Str(s))
end
-- result is list of inlines
return split
end

from pandoc-ling.

cysouw avatar cysouw commented on July 20, 2024

The basic problem is the automatic formatting that is done by panda-ling, which can be controlled by the option 'formatGloss`. Basically, this is a convenience option that works for many glosses, but it will never work for all options that people would like to throw at their glossing.

For that reason I added the possibility to prevent this automatic formatting on a per-example basis. So, if you find that a certain gloss is not formatted as you would like it to be, then you should start the example with ::: {.ex formatGloss=false} and then simply exactly format the gloss as you would like it to be.

from pandoc-ling.

Related Issues (12)

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.