Forgot password?
 Create new account
View 377|Reply 4

小于号 standalone

[Copy link]

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

hbghlyj Posted at 2022-2-5 13:06:53 |Read mode
Last edited by hbghlyj at 2022-2-5 21:27:00
  1. \documentclass{article}
  2. \begin{document}
  3. $$1<2$$
  4. \end{document}
Copy the Code
正常
  1. \documentclass{standalone}
  2. \begin{document}
  3. $$1<2$$
  4. \end{document}
Copy the Code
变成了反的感叹号

701

Threads

110K

Posts

910K

Credits

Credits
94157
QQ

Show all posts

kuing Posted at 2022-2-5 14:47:01
单美元正常,双美元好像是废的(相当于普通文本,而文本模式下的 < 就会变成反叹号),如果用 \\[ \\] 甚至报错。

这里 说改成 \documentclass[preview]{standalone} 就可以。

PS、注意论坛 bug:code 里的双美元会变成单美元。

3146

Threads

8493

Posts

610K

Credits

Credits
66158
QQ

Show all posts

 Author| hbghlyj Posted at 2022-2-5 21:29:42
我找到原因了:
parseurl("[code]$$[/code]")
结果为
'[code]$[/code]'
双美元变成单美元了
这个parseurl在common.js里面,相关的代码:
function parseurl(str, mode, parsecode) {
    if (isUndefined(parsecode))
        parsecode = true;
    if (parsecode)
        str = str.replace(/\s*\[code\]([\s\S]+?)\[\/code\]\s*/ig, function($1, $2) {
            return codetag($2);
        });
    str = str.replace(/([^>=\]"'\/]|^)((((https?|ftp):\/\/)|www\.)([\w\-]+\.)*[\w\-\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!]*)+\.(jpg|gif|png|bmp))/ig, mode == 'html' ? '$1' : '$1[img]$2[/img]');
    str = str.replace(/([^>=\]"'\/@]|^)((((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast):\/\/))([\w\-]+\.)*[:\.@\-\w\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!#]*)*)/ig, mode == 'html' ? '$1$2' : '$1[url]$2[/url]');
    str = str.replace(/([^\w>=\]"'\/@]|^)((www\.)([\w\-]+\.)*[:\.@\-\w\u4e00-\u9fa5]+\.([\.a-zA-Z0-9]+|\u4E2D\u56FD|\u7F51\u7EDC|\u516C\u53F8)((\?|\/|:)+[\w\.\/=\?%\-&~`@':+!#]*)*)/ig, mode == 'html' ? '$1$2' : '$1[url]$2[/url]');
    str = str.replace(/([^\w->=\]:"'\.\/]|^)(([\-\.\w]+@[\.\-\w]+(\.\w+)+))/ig, mode == 'html' ? '$1$2' : '$1[email]$2[/email]');
    if (parsecode) {
        for (var i = 0; i <= DISCUZCODE['num']; i++) {
            str = str.replace("[\tDISCUZ_CODE_" + i + "\t]", DISCUZCODE['html'][i]);
        }
    }
    return str;
}
function codetag(text) {
    DISCUZCODE['num']++;
    if (typeof wysiwyg != 'undefined' && wysiwyg)
        text = text.replace(/]*>/ig, '\n').replace(/<(\/|)[A-Za-z].*?>/ig, '');
    DISCUZCODE['html'][DISCUZCODE['num']] = '[code]' + text + '[/code]';
    return '[\tDISCUZ_CODE_' + DISCUZCODE['num'] + '\t]';
}
Last edited by hbghlyj at 2022-2-5 21:38:00

701

Threads

110K

Posts

910K

Credits

Credits
94157
QQ

Show all posts

kuing Posted at 2022-2-5 23:35:48
回复 3# hbghlyj


那怎么修复呢?

Comment

Discuz X 以后, 就好了  Posted at 2022-8-15 11:40

手机版Mobile version|Leisure Math Forum

2025-4-20 21:29 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list