10

If I search on TeX - LaTeX for \cs_set_eq, only one result is returned: "Q: Patch font with LuaTeX" whereas e.g. this answer contains code containing \cs_set_eq.

Do you know what's going on?

  • Okay, searching for \cs_set_eq:NN gives more results. Strange anyway, and I guess others could fall into the same trap as I did. – Denis Bitouzé Nov 5 '17 at 18:46
  • 3
    conjecture: in the "found" question, the string is in the text, whereas in the "undiscovered" answer, it's in a code block. if true, that's a distinct disadvantage for finding good answers. – barbara beeton Nov 5 '17 at 18:47
  • @barbarabeeton Indeed, the string in the "found" question being in the text as a code snippet. Still strange that \cs_set_eq:NN is found even in code blocks and not \cs_set_eq. – Denis Bitouzé Nov 5 '17 at 18:56
  • 7
    But the actual question is: why LaTeX 3 has such a complicated syntax? – CarLaTeX Nov 6 '17 at 6:43
  • 4
    @CarLaTeX: No, that's not the question. I find the expl3 syntax very elegant and better suited for programming. – user31729 Nov 6 '17 at 13:45
  • 1
    @ChristianHupfer I don't know it enough to judge, till now it seems very complicated to me! – CarLaTeX Nov 6 '17 at 13:56
  • 4
    @CarLaTeX just try something complicated with standard LaTeX2e and TeX code and then do the same once in expl3, after that, you like it :) – Skillmon Nov 7 '17 at 8:42
14

Searching for xyz finds results that are listed in the text only and not the code part, unless that code part is set using the <pre>...</pre> tags. So, this type of search excludes code segments that are not set via the <pre>...</pre> tags (indented by 4 spaces).

If you want to search within those segments, you need to use code:"<code>". This, however, requires an exact match for a code segment. So searching for code:"xyz" would miss code segments with xyzz or xxyz in it.

In-line code content (those between backticks `<code>`) seem to fall within both categories.

The difference here stems (I guess) from the fact that there's two different versions of question content that is active in the background - a "raw" and a "baked" format. The latter is an HTML (or visual/display) format for representing content within the browser, while the latter is the content as-is.

You can't combine these searches, since the OR operator is only used for combining tags (as in, [widgets] or [geegaws]).

Here are some choices:

It is often better to search using a site-specific Google search, as in "cs_set_eq" site:tex.stackexchange.com. However, since questions and answers are contained within the same visible page, the search results will necessarily cover both (as opposed to having a is:question or is:answer operator).

enter image description here

Searching is definitely not perfect on the network and takes some practice getting used to. Escaping characters may also cause issues, and this is especially true on TeX.SE where the use of \ is prevalent.

Reference(s):

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .