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.

[rebber] Caption of code (and image) needs protection for comma and square brackets.

See original GitHub issue

A (not so) funny unexpected issue arise when there is a comma in the legend of codes.

If #275 is fixed, then the following code

```c
int main() {
  return 0;
}
```
Code: un truc, comme ça

Generates

\begin{CodeBlock}[un truc, comme ça]{c}
int main() {
  return 0;
}
\end{CodeBlock}

while, to avoid issue, it should generates a “protection” for any comma in the caption:

\begin{CodeBlock}[un truc\protect{,} comme ça]{c}
int main() {
  return 0;
}
\end{CodeBlock}

… Otherwise LaTeX thinks it is another option, and fails. It is normally limited to code captions (not table and figures, normally), but if it is easier for you, \protect{,} is harmless, so it would work in any caption.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
pierre-24commented, Sep 4, 2018

Quotation works differently (like the attention or info box, actually), and do not use a floating environment (thus no \captionof). We could do it, though, but would it make sense to give a caption to a quotation ? (especially since it would render like “Quotation 26 – The author of that quotation”).

0reactions
vhfcommented, Sep 6, 2018

Deployed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I remove the commas, quotes, and parentheses from ...
Right now, my Python 3 code takes data from a CSV file, stores the data as a list, creates permutations of that data,...
Read more >
How to Use Brackets in Academic Writing: Some Common Rules
Enclose “sic” (loosely meaning, “as written”) in square brackets to indicate that the quote is exactly as is in the original, even if...
Read more >
Style Manual (Updated 2022) - Oregon Judicial Department
B. Identifying Caption of the Appellate Court Issuing the Opinion . ... [No comma in original; brackets not needed, because comma is part...
Read more >
8 Comma Rules - EnglishForEveryone.org
8 Comma Rules. (Practice Quiz). Directions: Add commas to the following sentences where needed. Section 1: Lists of three or more.
Read more >
sec_E_SB_ELA_G8.pdf - TN.gov
SpringBoard English Language Arts provides you with the support you need ... Caption—box that provides background information about the scene or character.
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