sawhney17 / logseq-citation-manager

73 stars 12 forks source link

[Bug] Multiple Notes (from Zotero), or New Paragraphs Within A Single Note Are Ignored #20

Open rsomani95 opened 1 year ago

rsomani95 commented 1 year ago

Currently, when a note in an entry has LaTeX formatting (this seems to an unchangeable option from BetterBiBTeX via Zotero), it gets parsed as HTML when importing into LogSeq.

This note from my Zotero library: CleanShot 2022-07-12 at 09 13 50

Corresponds with this bib entry:

@article{WorldShiftsWhen__Yong__2019,
  title = {The {{World Shifts When}} a {{Black Widow Squats}}},
  author = {Yong, Ed},
  date = {2019-01-09T14:42:45Z},
  journaltitle = {The Atlantic},
  url = {https://www.theatlantic.com/science/archive/2019/01/entire-black-widow-spider-sensor/579814/},
  urldate = {2019-06-03},
  abstract = {By changing its posture on its web, the arachnid can tune vibration in its legs to different frequencies.},
  entrysubtype = {magazine},
  langid = {english},
  keywords = {biodiversity,biology,black-widow,cognition,crickets,emobied-cognition,insect,octopus,spider},
  note = {\subsection{Main Takeaways}

\begin{itemize}

\item 
A spider can actively tune its web to channel specific kinds of vibrations/frequencies

\item 
Spiders' entire bodies act as a sensor through \emph{slit sensilla, }organs that are dotted throughout the exoskeleton, forming tiny cracks that can narrow and widen

\item 
It doesn't tune its body or web to focus on different parts of the physical space, but rather the \emph{information space} around it

\item 
A black widow can change its posture to tune its \emph{own body (not its web) }to perceive certain frequencies — it can choose to focus on the wind, a nearby prey, nearby mate, etc. It's like a human squatting to focus on red colors, or going into downward dog to tune in to high pitched sounds

\item 
Just by changing the way it stands/sits, or by moving a single leg, the spider can choose what to focus on!

\end{itemize}

\par
Test Note \#2
\par
\begin{itemize}

\item 
Testing, 1… 2… 3…

\end{itemize}},
  file = {/Users/rahulsomani/ZotFiles/yong_2019_the_world_shifts_when_a_black_widow_squats.html}
}

shows up as follows in LogSeq: CleanShot 2022-07-12 at 09 18 57


The second note has not been parsed. Based on some additional testing I did, I think the problematic part is the \par LaTeX symbol, as even if you have that within a single note, nothing beyond it gets parsed.

Worth noting that the BibTeX plugin you're using converts this LaTeX to HTML. This is the raw HTML of the block shown above:

<h2>Main Takeaways</h2> <ul> <li>A spider can actively tune its web to channel specific kinds of vibrations/frequencies <li>Spiders' entire bodies act as a sensor through <i>slit sensilla, </i>organs that are dotted throughout the exoskeleton, forming tiny cracks that can narrow and widen <li>It doesn't tune its body or web to focus on different parts of the physical space, but rather the <i>information space</i> around it <li>A black widow can change its posture to tune its <i>own body (not its web) </i>to perceive certain frequencies — it can choose to focus on the wind, a nearby prey, nearby mate, etc. It's like a human squatting to focus on red colors, or going into downward dog to tune in to high pitched sounds <li>Just by changing the way it stands/sits, or by moving a single leg, the spider can choose what to focus on! </ul>

I don't know if this is feasible / too much work, but would be uber cool to have that HTML converted to Markdown and have separate bullet points as new blocks. That's probably overkill, but I could see that being useful in some use cases.


Also, this "issue" isn't a critical bug IMO. I typically don't have a new paragraph in my notes, and also never have more than a single note for an item. I found this bug more out of curiosity to test the limits of the plugin :)

If someone else faces this, I'd recommend making bullet points only in the Zotero note to ensure all info is parsed.

jacobtfisher commented 1 year ago

+1 for this. I also noticed that when notes are imported they are imported as HTML. This makes it such that notes that Zotero creates from extracted annotations (which use \par to separate different annotations rather than creating an itemized list) are imported as a single block. This also means that links back to the annotations in Zotero don't import into Logseq correctly. For example, if I have this entry in my bib:

@article{liederResourcerational2020,
  title = {Resource-Rational Analysis: {{Understanding}} Human Cognition as the Optimal Use of Limited Computational Resources},
  shorttitle = {Resource-Rational Analysis},
  author = {Lieder, Falk and Griffiths, Thomas L.},
  journaltitle = {Behavioral and Brain Sciences},
  volume = {43},
  publisher = {{Cambridge University Press}},
  issn = {0140-525X, 1469-1825},
  doi = {10.1017/S0140525X1900061X},
  url = {http://www.cambridge.org/core/journals/behavioral-and-brain-sciences/article/resourcerational-analysis-understanding-human-cognition-as-the-optimal-use-of-limited-computational-resources/586866D9AD1D1EA7A1EECE217D392F4A},
  urldate = {2021-04-07},
  abstract = {Modeling human cognition is challenging because there are infinitely many mechanisms that can generate any given observation. Some researchers address this by constraining the hypothesis space through assumptions about what the human mind can and cannot do, while others constrain it through principles of rationality and adaptation. Recent work in economics, psychology, neuroscience, and linguistics has begun to integrate both approaches by augmenting rational models with cognitive constraints, incorporating rational principles into cognitive architectures, and applying optimality principles to understanding neural representations. We identify the rational use of limited resources as a unifying principle underlying these diverse approaches, expressing it in a new cognitive modeling paradigm called resource-rational analysis. The integration of rational principles with realistic cognitive constraints makes resource-rational analysis a promising framework for reverse-engineering cognitive mechanisms and representations. It has already shed new light on the debate about human rationality and can be leveraged to revisit classic questions of cognitive psychology within a principled computational framework. We demonstrate that resource-rational models can reconcile the mind's most impressive cognitive skills with people's ostensive irrationality. Resource-rational analysis also provides a new way to connect psychological theory more deeply with artificial intelligence, economics, neuroscience, and linguistics.},
  langid = {english},
  keywords = {attention,LC4MP,motivation,resources},
  note = {\textbf{Extracted Annotations (8/3/2021, 4:43:52 PM)}
\par
"Building models of people's cognitive strategies and representations is useful for at least three reasons. First, testing our understanding of psychological phenomena by recreating them in computer simulations forces precision and helps to identify gaps in explanations. Second, computational modeling permits the transfer of insights about human intelligence to the creation of artificial intelligence (AI) and vice versa. Third, cognitive modeling of empirical phenomena is a way to infer the underlying psychological mechanisms, which is critical to predicting human behavior in novel situations." (\href{zotero://open-pdf/library/items/PVBVKKQP?page=1}{Lieder 2020:1})
\par
"Perhaps the most influential framework for developing rational models of cognition is rational analysis (Anderson 1990). In contrast to traditional cognitive psychology, rational analysis capitalizes on the functional constraints imposed by goals and the structures of the environment rather than the structural constraints imposed by cognitive architectures. Its inductive bias toward rational explanations is often rooted in the assumption that evolution and learning have optimally adapted the human mind to the structure of its environment (Anderson 1990)." (\href{zotero://open-pdf/library/items/PVBVKKQP?page=2}{Lieder 2020:2})
\par
"Most rational models of the human mind are premised on the classic notion of rationality (Sosis \& Bishop 2014), according to which people act to maximize their expected utility, reason based on the laws of logic, and handle uncertainty according to probability theory." (\href{zotero://open-pdf/library/items/PVBVKKQP?page=2}{Lieder 2020:2})},
  file = {/Users/jfisher/Zotero/storage/PVBVKKQP/lieder2020resource-ration.pdf;/Users/jfisher/Zotero/storage/PI2XTCLX/586866D9AD1D1EA7A1EECE217D392F4A.html},
  uri = {http://zotero.org/users/5397735/items/A4T975EB},
  select-link = {zotero://select/library/items/A4T975EB}
}

the note gets imported as this:

<b>Extracted Annotations (8/3/2021, 4:43:52 PM)</b> 

"Building models of people's cognitive strategies and representations is useful for at least three reasons. First, testing our understanding of psychological phenomena by recreating them in computer simulations forces precision and helps to identify gaps in explanations. Second, computational modeling permits the transfer of insights about human intelligence to the creation of artificial intelligence (AI) and vice versa. Third, cognitive modeling of empirical phenomena is a way to infer the underlying psychological mechanisms, which is critical to predicting human behavior in novel situations." (<a href="zotero://open-pdf/library/items/PVBVKKQP?page=1">Lieder 2020:1</a>) 

"Perhaps the most influential framework for developing rational models of cognition is rational analysis (Anderson 1990). In contrast to traditional cognitive psychology, rational analysis capitalizes on the functional constraints imposed by goals and the structures of the environment rather than the structural constraints imposed by cognitive architectures. Its inductive bias toward rational explanations is often rooted in the assumption that evolution and learning have optimally adapted the human mind to the structure of its environment (Anderson 1990)." (<a href="zotero://open-pdf/library/items/PVBVKKQP?page=2">Lieder 2020:2</a>) 

"Most rational models of the human mind are premised on the classic notion of rationality (Sosis &amp; Bishop 2014), according to which people act to maximize their expected utility, reason based on the laws of logic, and handle uncertainty according to probability theory." (<a href="zotero://open-pdf/library/items/PVBVKKQP?page=2">Lieder 2020:2</a>) 

Having the note(s) parsed to markdown rather than HTML upon import would be a fantastic enhancement. Thank you!