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

How to do correct subsection/paragraph titles? #184

Open
MatthiasLohr opened this issue Aug 4, 2021 · 4 comments
Open

How to do correct subsection/paragraph titles? #184

MatthiasLohr opened this issue Aug 4, 2021 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@MatthiasLohr
Copy link
Contributor

I'm struggling with providing subsection/paragraph titles where texttidote does not complain. Currenty, I'm getting the following errors:

* L103C18-L103C18 Please add a punctuation mark at the end of paragraph. 
  Suggestions: [Structure., Structure!, Structure?, Structure:, Structure,, 
  Structure;] (5240) [lt:en:PUNCTUATION_PARAGRAPH_END] 
  \paragraph{Paper Structure}
                   ^
* L124C18-L124C18 Please add a punctuation mark at the end of paragraph. 
  Suggestions: [Exchange., Exchange!, Exchange?, Exchange:, Exchange,, 
  Exchange;] (6393) [lt:en:PUNCTUATION_PARAGRAPH_END] 
  \subsection{Fair Exchange}
                   ^
* L137C18-L137C18 Please add a punctuation mark at the end of paragraph. 
  Suggestions: [Theory., Theory!, Theory?, Theory:, Theory,, Theory;] (7013) 
  [lt:en:PUNCTUATION_PARAGRAPH_END] 
  \subsection{Game Theory}
                   ^

When I add a period at the end of the headlines (which seems to be odd in scientific documents) I'm getting the following:

* L103C1-L103C1 A paragraph heading should not end with a punctuation symbol. 
  [sh:008] 
  \paragraph{Paper Structure.}
  ^
* L124C1-L124C1 A section title should not end with a punctuation symbol. 
  [sh:002] 
  \subsection{Fair Exchange.}
  ^
* L137C1-L137C1 A section title should not end with a punctuation symbol. 
  [sh:002] 
  \subsection{Game Theory.}
  ^

Removing the periods obviously ends up in the upper errors...

Am I missing something here?

@MatthiasLohr
Copy link
Contributor Author

Additional info: For some reason, it does not seem to be complaining about all sections etc. For example, \section{Related Work} is fine for textidote. Single word section/subsection/paragraph titles are also ok.

@sylvainhalle sylvainhalle added help wanted Extra attention is needed wontfix This will not be worked on labels Aug 5, 2021
@sylvainhalle
Copy link
Owner

This is caused by the fact that "basic" rules see the whole document with the LaTeX markup, so they know that a piece of text is a section heading. In contrast, the grammar checker must be passed a cleaned-up version with only plain text, so it treats every heading as a normal paragraph.

I don't know how to instruct the LanguageTool checker to see portions of text as headings and stop issuing warnings about punctuation. (Ideas anyone?) For this reason I'll mark this issue both as help wanted.

The best I can suggest for the moment is to disable one of the two rules (or both) using the --ignore command line switch.

@sylvainhalle sylvainhalle removed the wontfix This will not be worked on label Aug 5, 2021
@MatthiasLohr
Copy link
Contributor Author

MatthiasLohr commented Aug 6, 2021

Thank you for you reply!

In contrast, the grammar checker must be passed a cleaned-up version with only plain text, so it treats every heading as a normal paragraph.

But why are \section commands then fine? I only have the problem with subsection, subsubsection and paragraph.

The best I can suggest for the moment is to disable one of the two rules (or both) using the --ignore command line switch.

Thanks for this idea. However, I was thinking about if replacement rules could be used to just remove subsections/paragraphs completely from the text. However, my replacement rule for that does not have to seem any effect...

\\paragraph\{[\sa-zA-Z]+\}	Replaced.
\\subsection\{[\sa-zA-Z]+\}	Replaced.

@sylvainhalle
Copy link
Owner

On my side, all levels of headings produce the same effect, even \section.

The replacement rules you suggest are an excellent workaround until a longer-term solution is found. Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants