James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.66k stars 530 forks source link

Add maximum width setting to the formatters #3918

Closed vahvero closed 1 year ago

vahvero commented 1 year ago

Pre-checks*

The Missed*

Is your feature request related to a problem? Please provide a clear and concise description of what the problem is.

  • The extension is working as intended.

The Solution*

Please provide a solution you would like to have.

  • Add formatter setting for maximum width. For example bibtex entry:
    @article{Huamin2017,
    author   = {Li, Huamin and Shaham, Uri and Stanton, Kelly P and Yao, Yi and Montgomery, Ruth R and Kluger, Yuval},
    title    = {{Gating mass cytometry data by deep learning}},
    journal  = {Bioinformatics},
    volume   = {33},
    number   = {21},
    pages    = {3423-3430},
    year     = {2017},
    month    = {07},
    abstract = {{Mass cytometry or CyTOF is an emerging technology for high-dimensional multiparameter single cell analysis that overcomes many limitations of fluorescence-based flow cytometry. New methods for analyzing CyTOF data attempt to improve automation, scalability, performance and interpretation of data generated in large studies. Assigning individual cells into discrete groups of cell types (gating) involves time-consuming sequential manual steps, untenable for larger studies.We introduce DeepCyTOF, a standardization approach for gating, based on deep learning techniques. DeepCyTOF requires labeled cells from only a single sample. It is based on domain adaptation principles and is a generalization of previous work that allows us to calibrate between a target distribution and a source distribution in an unsupervised manner. We show that DeepCyTOF is highly concordant (98 \%) with cell classification obtained by individual manual gating of each sample when applied to a collection of 16 biological replicates of primary immune blood cells, even when measured across several instruments. Further, DeepCyTOF achieves very high accuracy on the semi-automated gating challenge of the FlowCAP-I competition as well as two CyTOF datasets generated from primary immune blood cells: (i) 14 subjects with a history of infection with West Nile virus (WNV), (ii) 34 healthy subjects of different ages. We conclude that deep learning in general, and DeepCyTOF specifically, offers a powerful computational approach for semi-automated gating of CyTOF and flow cytometry data.Our codes and data are publicly available at https://github.com/KlugerLab/deepcytof.git.Supplementary data are available at Bioinformatics online.}},
    issn     = {1367-4803},
    doi      = {10.1093/bioinformatics/btx448},
    url      = {https://doi.org/10.1093/bioinformatics/btx448},
    eprint   = {https://academic.oup.com/bioinformatics/article-pdf/33/21/3423/50315161/bioinformatics\_33\_21\_3423.pdf}
    }

Is difficult to read compared to manually formatted version

@article{Huamin2017,
  author   = {Li, Huamin and Shaham, Uri and Stanton, Kelly P and Yao, Yi 
  and Montgomery, Ruth R and Kluger, Yuval},
  title    = {{Gating mass cytometry data by deep learning}},
  journal  = {Bioinformatics},
  volume   = {33},
  number   = {21},
  pages    = {3423-3430},
  year     = {2017},
  month    = {07},
  abstract = {{Mass cytometry or CyTOF is an emerging technology 
  for high-dimensional multiparameter single cell analysis that 
  overcomes many limitations of fluorescence-based flow cytometry. 
  New methods for analyzing CyTOF data attempt to improve automation, 
  scalability, performance and interpretation of data generated in 
  large studies. Assigning individual cells into discrete groups of 
  cell types (gating) involves time-consuming sequential manual steps, 
  untenable for larger studies.We introduce DeepCyTOF, a 
  standardization approach for gating, based on deep learning 
  techniques. DeepCyTOF requires labeled cells from only a single 
  sample. It is based on domain adaptation principles and is a 
  generalization of previous work that allows us to calibrate between 
  a target distribution and a source distribution in an unsupervised 
  manner. We show that DeepCyTOF is highly concordant (98 \%) with 
  cell classification obtained by individual manual gating of each 
  sample when applied to a collection of 16 biological replicates 
  of primary immune blood cells, even when measured across several 
  instruments. Further, DeepCyTOF achieves very high accuracy on 
  the semi-automated gating challenge of the FlowCAP-I competition 
  as well as two CyTOF datasets generated from primary immune blood 
  cells: (i) 14 subjects with a history of infection with West Nile 
  virus (WNV), (ii) 34 healthy subjects of different ages. We 
  conclude that deep learning in general, and DeepCyTOF 
  specifically, offers a powerful computational approach for 
  semi-automated gating of CyTOF and flow cytometry data. Our 
  codes and data are publicly available at 
  https://github.com/KlugerLab/deepcytof.git. Supplementary data are 
  available at Bioinformatics online.}},
  issn     = {1367-4803},
  doi      = {10.1093/bioinformatics/btx448},
  url      = {https://doi.org/10.1093/bioinformatics/btx448},
  eprint   = {https://academic.oup.com/bioinformatics/article-pdf/33/21/3423/50315161/bioinformatics\_33\_21\_3423.pdf}
}

Similar formatting does make reading tex files difficult too, if they have been written in a poor way.

Anything Else?

Add any other context about the feature request below.

  • How major change this would be, I have no idea. However, I would personally enjoy this feature. I just found out that the example bib-entry had originally had issues in the abstract, which was annoying to find in the unformatted version.
James-Yu commented 1 year ago

I'm not sure if that is a good idea. For instance, the abstract field in your latter example looks quite unintuitive to me, and extra intendation may be required. I would suggest use word wrapping instead of formatter to achieve this objective. Also, the hard line breaks introduced, if at unfavorable locations, may break how LaTeX parses macros in bib entries.

Discussion still welcomed.