LaTeX Pop-Ups: Copy-and-Pasteable Syntax?

  • LaTeX
  • Thread starter ehrenfest
  • Start date
  • Tags
    Latex
In summary, the LaTex pop-up that results from clicking on a LaTeX block can sometimes have a different syntax from the original post, with the use of single-quote characters being a common example. This can be remedied by replacing single quote characters with the HTML escape code & #39; when displaying the post. Additionally, to introduce whitespace in LaTex, one can use the commands \, \:, \;, \quad, \qquad, \hspace{1in}, and \text{}, depending on the desired size and spacing. However, caution must be taken when using \text{} as it may be interpreted by JavaScript.
  • #1
ehrenfest
2,020
1
The LaTex pop-up that results from clicking on a LaTeX block sometimes has syntax different from the original post for example,

[tex] \psi(x,t) = \int{U(x,t;xsingle-quote,tsingle-quote)\psi(xsingle-quote,tsingle-quote)dxsingle-quote}[/tex] is from recent post of mine.

It would be nice if all of those LaTex pop-ups were copy-and-pastable :)
 
Physics news on Phys.org
  • #2
ehrenfest said:
The LaTex pop-up that results from clicking on a LaTeX block sometimes has syntax different from the original post for example,

[tex] \psi(x,t) = \int{U(x,t;xsingle-quote,tsingle-quote)\psi(xsingle-quote,tsingle-quote)dxsingle-quote}[/tex]
is from recent post of mine.

It would be nice if all of those LaTex pop-ups were copy-and-pastable :)

What do you mean by different? To me, they look axactly the same. Your syntax in the post, and the pop-up (you can quote ur self, or edit the post to see the syntax) are identical.

I'm not very sure if I understand you correctly. =.="
 
  • #3
Yes I probably explained that a bit unclearly. I went to the following page
https://www.physicsforums.com/showthread.php?t=177059 and copied a Latex block from that post and pasted it here in order to show how copying and pasting can mess up you're LaTeX. However, to see how the syntax in a pop-up can give you a different result than the original compare my first latex block in this thread to my first latex block in the linked thread and see that the pop-up gives the same result. I think it is just the " ' "s that are different.
 
  • #4
Ah, yes, I got it. :biggrin:

Well, I noticed that a while ago. Whenever, you type in 's in your LaTeX, it'll be shown as single-quote when you try to see the syntax by clicking on it. However, when you quote it, it'll show you exactly how it was written, i.e the 's. So instead of clicking, and pasting. You can try quoting instead. :smile:
 
  • #5
I believe the reason for this is a security issue we had a while back.
We should be replacing single quote characters with & #39; (no space after the &) which renders as ' and is safe.
 
  • #6
Wasn't there a \prime ([itex]\prime[/itex]) command in LaTeX?
 
  • #7
Not related, but I haven't got my head around spacing in latex, how do you introduce a space, I can see how to align text but not to introduce a blank.
 
  • #8
Schrodinger's Dog said:
Not related, but I haven't got my head around spacing in latex, how do you introduce a space, I can see how to align text but not to introduce a blank.

Just use a "\" between each word as in This\ is\ how\ to\ add a\ whitespace\ in\ Latex
[tex]This\ is\ how\ to\ add\ a\ whitespace\ in\ Latex[/tex]
 
  • #9
ranger said:
Just use a "\" between each word as in This\ is\ how\ to\ add a\ whitespace\ in\ Latex
[tex]This\ is\ how\ to\ add\ a\ whitespace\ in\ Latex[/tex]

Ah [tex]thank\ you[/tex] very helpful. :smile:

test

[tex]\int {x^2}\ dx\rightarrow \frac{1}{3}\ x^3\ +\ c[/tex]
 
Last edited:
  • #10
Schrodinger's Dog said:
Not related, but I haven't got my head around spacing in latex, how do you introduce a space, I can see how to align text but not to introduce a blank.

here is how to add spaces in LaTex...

small \,

medium \:

large\;

quad \quad

double quad \qquad
 
  • #11
I think we're in math mode, by default:

ab
[tex]ab [/tex]

a b
[tex]a b[/tex]

a\ b
[tex]a\ b[/tex]

a\!b
[tex]a\!b[/tex] a negative thin space

a\hspace{1in}b
[tex]a\hspace{1in}b[/tex]

a\hspace{1in}b\hspace{-.5in}c
[tex]a\hspace{1in}b\hspace{-.5in}c[/tex]
 
  • #12
don't forget, you can use the \text command if you [tex]\text{just want to make text, which looks better} than\ text\ with\ manual\ spacing\ in\ \mu\forall\theta\,\mathcal{M}\circ\mathrm{d}\epsilon[/tex].
 
  • #13
CompuChip said:
don't forget, you can use the \text command if you [tex]\text{just want to make text, which looks better} than\ text\ with\ manual\ spacing\ in\ \mu\forall\theta\,\mathcal{M}\circ\mathrm{d}\epsilon[/tex].
Nice. Thanks. :smile: I think we can now make all posts look like textbooks.:biggrin:
 
  • #14
-Job- said:
I believe the reason for this is a security issue we had a while back.
We should be replacing single quote characters with & #39; (no space after the &) which renders as ' and is safe.

This is not an option without rewriting part of the vB code so that HTML escapes are preserved as escapes in quotes.

- Warren
 
  • #15
I think that won't be an issue if you do the replacement when displaying a post, rather than when posting.
 
  • #16
That won't work either, because JavaScript will actually interpet HTML escapes in statements being executed, too. They may be a way to turn that "feature" off, but, if there is, I don't know it.

- Warren
 
  • #17
neutrino said:
Nice. Thanks. :smile: I think we can now make all posts look like textbooks.:biggrin:

Indeed thanks a lot for all the answers. Now my latex will look polished :smile:
 
  • #18
chroot said:
This is not an option without rewriting part of the vB code so that HTML escapes are preserved as escapes in quotes.
Check here: [tex]f"[/tex], this replaces " with &quote; you could also simply replace ' with \' just before writing whatever is there after document.write(', or even change it to document.write(" since " are already escaped (that is, if there are no " in tags).

If you are willing to show us relevant parts of code, I might be able to suggest the most transparent fix.
 
Last edited:

1. What is LaTeX Pop-Ups: Copy-and-Pasteable Syntax?

LaTeX Pop-Ups: Copy-and-Pasteable Syntax is a tool that allows users to easily and accurately copy and paste LaTeX code from a pop-up window into their documents.

2. How does LaTeX Pop-Ups: Copy-and-Pasteable Syntax work?

The tool works by generating a pop-up window with the desired LaTeX code when the user clicks on a specific button or icon. The user can then simply copy and paste the code from the pop-up window into their document, eliminating the need for manual typing or copying from other sources.

3. Is LaTeX Pop-Ups: Copy-and-Pasteable Syntax compatible with all LaTeX editors?

Yes, the tool is compatible with all LaTeX editors as it simply generates the code and allows the user to copy and paste it into their document. It does not require any specific integration with a particular editor.

4. Can I customize the LaTeX code generated by the pop-up window?

Yes, the tool allows for customization of the generated code. Users can specify their preferred formatting, symbols, and equations within the pop-up window before copying the code.

5. Is LaTeX Pop-Ups: Copy-and-Pasteable Syntax free to use?

Yes, the tool is completely free to use and does not require any downloads or installations. It can be accessed through a web browser, making it easily accessible for all users.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
947
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
265
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
Replies
8
Views
147
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
210
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
10K
  • Advanced Physics Homework Help
Replies
7
Views
1K
Back
Top