question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add cleanup action: "Make LaTeX ready: Escape $"

See original GitHub issue

Problem:

  1. Want to prepare entries to be used with LaTeX
  2. Want to not start math-mode, but instead simply render $ character in my bibliography

Describe the solution you’d like

  • Add cleanup action that adds a backslash in front of $
  • Name this cleanup action: Make LaTeX ready: Escape $
  • Add to the documentation: Adds backslash to $ characters. \$ will be rendered by LaTeX as $ instead of starting math-mode. Do not use this cleanup action, if you have entries that require usage of LaTeX math-mode.

Additional context

  • Why not add this function to Make LaTeX ready: Cleanup or Make LaTeX ready: Unicode to LaTeX? Both allow the usage of math-mode, which is fine. This seems to be a zero-sum game and there is no heuristic that can find out if the user wants to use math-mode or simply render the $.

Related to https://github.com/JabRef/jabref/issues/8490#issuecomment-1091209909 and #8650

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
Siedlerchrcommented, Apr 19, 2022

@fly-ing-fish No need to adapt the latex <> unicode conversion map. See the existing LatexCleanupFormatter with the regex pattern for ESCAPE_PERCENT_SIGN_ONCE that also works when the value is already escaped.

@ThiloteE For unicode <-> latex it’s kind of both. We use https://github.com/plurimath/unicode2latex

1reaction
ThiloteEcommented, Apr 18, 2022

I finished my tests. Here my test library: test-8673-encoding of special characters.bib.txt

I wrote some comments into this file.

Most interesting results:

  • entries with citationkeys test1ca and test1cb show that %, $, _, # and & all do not get backslashed when using the Unicode to LaTeX cleanup action. We know the $ is because of math-mode. I wonder why the others are not converted…
  • ... does not get converted from Unicode to LaTeX.
  • _ seems to be a special case. \_ does also not get converted back via LaTeX to Unicode cleanup action.

Will try to compile the rest of the symbols with Latex one of these days and see what happens

Read more comments on GitHub >

github_iconTop Results From Across the Web

Escape the ] character [duplicate] - LaTeX Stack Exchange
Using the help of this answer, I am trying to create a list in which each item is numbered by [1] , [2]...
Read more >
A short manual for TEXworks - Whitman People
4We also use the words “compilation” and “to compile” for the same action; indeed LATEX works on the source file to produce a...
Read more >
Python: Pandas to latex - Issues with the backslash
You can use the escape=False option of to_latex : In [9]: df = pd.DataFrame([[1,2],[3,4]], columns=['$ \\beta $', r'$ \gamma $']) In [12]: ...
Read more >
Cleanup of Large Areas Contaminated as a Result of a ...
making process should include socioeconomic, political and psychological factors, the type of area, population distribution, environmental impact of cleanup ...
Read more >
modelsummary.pdf
notes list or vector of notes to append to the bottom of the table. escape boolean TRUE escapes or substitutes LaTeX/HTML characters which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found