mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[cm6] Include affiliation in document preamble (#14824)
* [cm6] Include affiliation in document preamble * add affil command * Add mapping to attributeValue --------- Co-authored-by: Alf Eaton <alf.eaton@overleaf.com> GitOrigin-RevId: 6034e07bc5fec23ea704d820acbbe4e77caba651
This commit is contained in:
parent
20f49ae325
commit
f7cf7b9028
4 changed files with 23 additions and 0 deletions
|
@ -217,6 +217,14 @@ export const atomicDecorations = (options: Options) => {
|
|||
preamble.authors.push({ node, content })
|
||||
preamble.to = nodeRef.node.to
|
||||
}
|
||||
} else if (
|
||||
nodeRef.node.type.is('Affil') ||
|
||||
nodeRef.node.type.is('Affiliation')
|
||||
) {
|
||||
const node = nodeRef.node.getChild('TextArgument')
|
||||
if (node) {
|
||||
preamble.to = nodeRef.node.to
|
||||
}
|
||||
}
|
||||
|
||||
if (nodeRef.type.is('$Environment')) {
|
||||
|
|
|
@ -178,6 +178,9 @@ export const LaTeXLanguage = LRLanguage.define({
|
|||
Comment: t.comment,
|
||||
'UsePackage/OptionalArgument/ShortOptionalArg/Normal': t.attributeValue,
|
||||
'UsePackage/ShortTextArgument/ShortArg/Normal': t.tagName,
|
||||
'Affiliation/OptionalArgument/ShortOptionalArg/Normal':
|
||||
t.attributeValue,
|
||||
'Affil/OptionalArgument/ShortOptionalArg/Normal': t.attributeValue,
|
||||
'LiteralArgContent VerbContent VerbatimContent LstInlineContent':
|
||||
t.string,
|
||||
'NewCommand/LiteralArgContent': t.typeName,
|
||||
|
|
|
@ -88,6 +88,8 @@
|
|||
BibliographyCtrlSeq,
|
||||
BibliographyStyleCtrlSeq,
|
||||
AuthorCtrlSeq,
|
||||
AffilCtrlSeq,
|
||||
AffiliationCtrlSeq,
|
||||
MaketitleCtrlSeq,
|
||||
TextColorCtrlSeq,
|
||||
ColorBoxCtrlSeq,
|
||||
|
@ -241,6 +243,12 @@ KnownCommand {
|
|||
Author {
|
||||
AuthorCtrlSeq optionalWhitespace? OptionalArgument? optionalWhitespace? TextArgument
|
||||
} |
|
||||
Affil {
|
||||
AffilCtrlSeq optionalWhitespace? OptionalArgument? optionalWhitespace? TextArgument
|
||||
} |
|
||||
Affiliation {
|
||||
AffiliationCtrlSeq optionalWhitespace? OptionalArgument? optionalWhitespace? TextArgument
|
||||
} |
|
||||
DocumentClass {
|
||||
DocumentClassCtrlSeq optionalWhitespace? OptionalArgument?
|
||||
DocumentClassArgument { ShortTextArgument }
|
||||
|
|
|
@ -24,6 +24,8 @@ import {
|
|||
HboxCtrlSeq,
|
||||
TitleCtrlSeq,
|
||||
AuthorCtrlSeq,
|
||||
AffilCtrlSeq,
|
||||
AffiliationCtrlSeq,
|
||||
DocumentClassCtrlSeq,
|
||||
UsePackageCtrlSeq,
|
||||
HrefCtrlSeq,
|
||||
|
@ -589,6 +591,8 @@ const otherKnowncommands = {
|
|||
'\\hbox': HboxCtrlSeq,
|
||||
'\\title': TitleCtrlSeq,
|
||||
'\\author': AuthorCtrlSeq,
|
||||
'\\affil': AffilCtrlSeq,
|
||||
'\\affiliation': AffiliationCtrlSeq,
|
||||
'\\documentclass': DocumentClassCtrlSeq,
|
||||
'\\usepackage': UsePackageCtrlSeq,
|
||||
'\\href': HrefCtrlSeq,
|
||||
|
|
Loading…
Reference in a new issue