Giter Club home page Giter Club logo

Comments (3)

LazyScholar avatar LazyScholar commented on September 20, 2024

Sorry i have way too much on my hands right now. I saw the other issue and PR but choose not to participate bacause... well too much to do rn.

But i should at least try to explain my intention on that PR.
I introduced that rule in order to strip out the grouping braces which are sometimes used in BibTex titles or publisher names (e.g. capital letter abbreviations) (see: BibTex.org : Text enclosed in braces ).
I intended for it to be applied in the last step of substitutions.

But as you are stating, that example might be is doing it wrong. It depends on how you want to see the 'Text enclosed in braces'-Rule. I tried not to step into that (never ending 'have to fix that too') pitfall back then.
One big problem (imo) with regular expression substitution rules are braces. You can not account for all cases with regex.
And i did not want to implement a BibTex parser or even LaTeX parser. I was satisfied by adding some further cases well knowing that the package does not fully supports the syntax.

I just remembered that i had another PR prepared where i wanted to add
r"\\\\\"\{\\i\}" => s"\u0069\u308", # \"{\i} ï Latin Small Letter I with Diaeresis link
to the substitution rules. As i do not see any movement on the related PR in Documenter.jl you could ad that to the substitutions in case if you want to add LaTeX support.

Or you could use \={M} instead of $\overline{M}$?

from documentercitations.jl.

fingolfin avatar fingolfin commented on September 20, 2024

@LazyScholar thank you for the explanation, now at least I understand the motivation and that helps finding alternatives.

I don't think removing {} blindly like this is easily salvageable, and I would suggest to remove it: as long as it is there, it always has a chance of wrecking user input, with no recourse open to the user. But if we instead don't remove it, then the user can easily deal with this, by tweaking the bib data suitably.

from documentercitations.jl.

simonbyrne avatar simonbyrne commented on September 20, 2024

Unfortunately, {} is pretty common in bibtex text, as its the desired way to enforce capitalization, e.g. https://tex.stackexchange.com/a/10775/245, which we would want to remove, so it's helpful to keep.

Honestly, at this point we probably need a proper TeX parser to do this properly. @Kolaru has a basic math-mode tex parser in MathTeXEngine.jl (https://github.com/Kolaru/MathTeXEngine.jl/tree/master/src/parser), it might be possible to adapt that to handle text mode as well.

from documentercitations.jl.

Related Issues (20)

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.