Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small caps combined with language #4102

Closed
adunning opened this issue Nov 27, 2017 · 5 comments · Fixed by #7307
Closed

Small caps combined with language #4102

adunning opened this issue Nov 27, 2017 · 5 comments · Fixed by #7307

Comments

@adunning
Copy link
Contributor

If one combines .smallcaps with another attribute in a span, this is not converted into native SmallCaps. For example:

pandoc -t latex << EOT
[test1]{.smallcaps lang=la}

[test2]{.smallcaps}

EOT

Result:

\textlatin{test1}

\textsc{test2}
@mb21
Copy link
Collaborator

mb21 commented Nov 27, 2017

Note it's still there in the native rep:

$ echo '[test1]{.smallcaps lang=la}' | pandoc -t native

[Para [Span ("",["smallcaps"],[("lang","la")]) [Str "test1"]]]

The expected output for [test1]{.smallcaps lang=la} would be the following?

\textsc{\textlatin{test1}}

@mb21 mb21 changed the title Markdown reader: Small caps not recognized with other attributes LaTeX writer: Small caps combined with language Nov 27, 2017
@adunning
Copy link
Contributor Author

The problem is that it's recognized as a span class, but not actual small caps (it doesn't work in .docx either); the output of echo '[test]{.smallcaps}' | pandoc -t native is [Para [SmallCaps [Str "test"]]].

@adunning
Copy link
Contributor Author

(In other words, it has nothing to do with the LaTeX writer; I was only using that format as a readable example.)

@jgm
Copy link
Owner

jgm commented Nov 28, 2017 via email

@mb21 mb21 changed the title LaTeX writer: Small caps combined with language Small caps combined with language Nov 28, 2017
@ickc
Copy link
Contributor

ickc commented Nov 5, 2019

Parsing it as SmallCaps would lose the lang attribute -- I think that's why we didn't do it that way.

It has always been like this in pandoc even without the "native small caps syntax" such as [test2]{.smallcaps}. The problem is the native AST element representing small caps does not allow attribute. So even in the old syntax, only a very particular combination would be parsed as the small caps AST element.

(That's why when I first PR the support of [SC]{.smallcaps} syntax this behavior isn't changed. So in a sense this is a "not a regression" kind of issue.)

In this sense it is related to #684.

tarleb added a commit to tarleb/pandoc that referenced this issue May 21, 2021
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: jgm#4102
tarleb added a commit to tarleb/pandoc that referenced this issue May 21, 2021
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: jgm#4102
tarleb added a commit to tarleb/pandoc that referenced this issue May 27, 2021
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: jgm#4102
tarleb added a commit to tarleb/pandoc that referenced this issue Jul 26, 2022
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: jgm#4102
tarleb added a commit to tarleb/pandoc that referenced this issue Jul 26, 2022
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: jgm#4102
tarleb added a commit to tarleb/pandoc that referenced this issue Jul 26, 2022
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: jgm#4102
tarleb added a commit to tarleb/pandoc that referenced this issue Jul 26, 2022
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: jgm#4102
tarleb added a commit to tarleb/pandoc that referenced this issue Aug 1, 2022
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: jgm#4102
@jgm jgm closed this as completed in #7307 Aug 1, 2022
jgm pushed a commit that referenced this issue Aug 1, 2022
Spans with "smallcaps" as the first class are converted to *SmallCaps*
elements. While previously no other classes or attributes were allowed,
additional classes, attributes, and an identifier are not permitted and
kept in a *SmallCaps* wrapping *Span* element.

The same change is applied to underline spans, where the first class
must be either "ul" or "underline".

Closes: #4102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants