Preview will not update if the title starts with Japanese

When a title of note starts with Japanese, preview is not working properly.

I tried with my TBX files and it seems that the problem occurs when the first character of the title is Japanese (maybe a 2-byte character).

If I select it while in preview view, either a preview of the previously selected note is displayed or the focus is shifted to the top-level note at the moment of selection.

If I set the first letter to alphabetical, it appears fine, but any way to work around it would be helpful.

Tinderbox 9.6 Poster example.tbx (489.5 KB)

Thanks.

Do you have more than one note in the container with the same name?

Preview assumes that two sibling notes with the same name are interchangeable.

Hmm…this is interesting. What is beyond this assumption? Should the $ID number not be the uniqueness of a note, not the $Name?

Preview was intended to Preview the HTML that will be exported when the document is exported to HTML. By definition, the path of an export note must be unique, because that path becomes the URL of the exported page.

I know you use it effectively for something else. That’s great.

No, I do not anticipate that $ID or $IDString will replace $Name and $Path as the preferred way to identify notes.

Takeshi Otsuka様
貴君のtbxファイルを試しましたが、何の問題もなく指定箇所から
プレヴューできますが?小生の環境はMac OS11.7.9 BigSur
Tinderbox ver.9.6.0(b632) Mac mini (late2014)です。若松久仁光拝
追伸
初回はクリックしてから少々時間が必要でした(ホンの1〜2秒ですが)

Mr. Takeshi Otsuka
I tried your tbx file, and from the specified place without any problems.
My environment is Mac OS11.7.9 BigSur
Tinderbox ver.9.6.0(b632) Mac mini (late2014).
Sincerely yours, WAKAMATSU
P.S.
The first time I clicked, it took a little time (but,1-2 seconds).

Takeshi Otsuka様
午後にもう一度トライしましたが、
Previewでの表示は貴君のご指摘の通り
ジャンプして表示できませんでした。
以前の書き込みを訂正させていただきます。若松久仁光拝
I tried again in the afternoon,
The display in Preview is as you pointed out
Couldn’t jump to view.
I will correct my previous post.

Takeshi Otsuka様
Tinderboxの内部で何が起きているかは考えずに
色々回避策を実験してみました。
1時間の実験での結果では
 「空白」エスケープ文字を使用して『タイトル』にするのが
目下の最善策でしょうか?
タイトルの字配りが変更されることもなく表示できます。
HTMLでファイル名、フォルダ名に使用する文字で許可されている「 - 」「 _ 」を
先頭に配置すれば正常にプレヴューも機能しています。
半角「 _ 」「 - 」を先頭に挿入すると『正しく日本語』が表示されますが、
その他の「半角文字」先頭挿入では機能してくれません。
不思議な現象ですね。
半角[%]に変更しても「 _ 」を記憶していて
プレヴューも『_ポスターのサンプル』と再表示されるのみです。
半角のカナもダメでした。

LaTeXでの禁則文字の「 _ 」を使用するには躊躇します。
今後pandocなどでLaTeX経由などのエキスポートを実施する可能性が
ある場合には避けたい『書き込み方』だと思います。若松久仁光拝
Without thinking about what’s going on inside Tinderbox
I tried various workarounds.
As a result of the one-hour experiment,
Using the “whitespace” escape character[ & n b s p ; ] to make it a “title” is
Is it the best solution at the moment?
It can be displayed without changing the layout of the title.
‘-’ and ’ _ ’ that are allowed in the characters used for file names and folder names in HTML
If you place it at the beginning, the preview is also functioning normally.
If you insert half-width " _ " and “-” at the beginning, “Correctly Japanese” will be displayed,
Other “half-width characters” leading insertion will not work.
It’s a strange phenomenon.
" _ " is remembered even if it is changed to half-width [%]
The preview will only be redisplayed as “_poster sample”.
Half-width kana was also useless.

I am hesitant to use the illegal character “_” in LaTeX.
In the future, there is a possibility of exporting via LaTeX with pandoc etc.
I think that it is a “writing method” that you want to avoid in some cases.
Sincerely yours, WAKAMATSU

1 Like

Thank you for your reply.
There are no multiple notes with the same name in the container.
$Path+$Name is an unique string.
(I’m sorry if I didn’t understand the intent of your question.)

若松 久仁光様
色々と試していただき、ありがとうございます。
何かしら半角英数字を入れる方法しかないようですね。

もう少し挙動を確認したところ、韓国語でも同じ現象が起きました。
選択が移動してしまう場所は、正確には親ノートではありませんでした。
トップレベルのノートかつ2バイト文字のタイトルで一番上方のポジションにあるノートに選択がジャンプするようです。

Mr. Kunimitsu Wakamatsu
Thank you for trying various methods.
It seems that the only way is to insert some half-width alphanumeric characters.

I checked the behavior some more and found the same phenomenon in Korean.
The place where the selection would move was not exactly the parent note.
It seems that the selection jumps to the note in the uppermost position in the top-level note with 2-byte character title.

That is good., thanks.

For those interested:

So, in this continent is not the Name that provides the uniqueness but the $HTMLExportFilename. To be clear, if the $HTMLExportFilename is not populated, then it defaults to $Name; ergo that the idea of a note with the same name could create a conflict. In my files, I have TBX use the note’s $ID for $HTMLExportFilename; that way it is guaranteed to be unique and so that I can use note name with the same name, e.g. ‘$HMTLExportFilename=$ID’. I’ve build some conditions around this for optimization.

OK: if no HTMLExportFileName is provided, Tinderbox chooses a default file name based on the note $Name. The method is uses was designed to meet limitations of early Web servers, which did not support file names in Japanese at all. We lifted that restriction in part, but it’s not very effective.

This will be addressed in the next release.

Temporary workaround: In the interim, if you don’t actually intend to export to HTML, Michael Becker’s approach will work. If $Name is unique, just set $HTMLExportFilename to $Name. If not, set $HTMLExportFileName to $IDString.

1 Like

Takeshi Otsuka様

音楽家としての取り組み方・習慣から別な角度から実験してみました。
楽譜は正しく書かれている。これが演奏する時の大前提です。
此処ではTinderboxのプログラムは正しく記述されている。と言う意味です。
その方法が作曲家の意図からズレていないか?細心の注意を払って、演奏いたします。
余りわかり易い説明になっていないかも知れませんが、Tinderboxでの書き込みに
何らかの問題は無いのか?を少々検証してみました。
以下を追試していただけませんでしょうか?
No01 : 貴君のtbxファイルの「t_plotly」の中の
$ScreenHeight-20を$ScreenHeight-40に変更して「スターのサンプル」下の
「plotly」をプレヴュー実行

No02 : これまでの『潰れて見えない』グラフ表示が、正常な形状になりますか?

No03 : No02で正常な表示だったら、次に「今回の問題となっている」
日本語タイトル『ポスターのサンプル』の出力が正常に修正されていませんか?

当方の環境では、スクリーン高さを40に変更したら、日本語タイトル『ポスターのサンプル』の
冒頭に『半角文字の挿入』をしなくても、プレヴュー実行は正常に機能しました。

P.S.
Mathjax単体でのプレヴュー実行はまだ出来ていません。
この辺にも原因が隠れているのかも知れません。
Tinderbox9.3 では本文のコピーを作成して配置すると
プレヴューが機能します。
(但しplotlyでのプレヴューはグラフ潰れはそのままですが。)

Dear Takeshi Otsuka,
I tried experimenting from a different angle from the approach and habits as a musician.
The sheet music is written correctly. This is a major premise when playing.
The Tinderbox program is correctly described here. That means.
Isn’t the method deviating from the composer’s intention? We will play it with utmost care.
It may not be a very easy-to-understand explanation, but for writing on Tinderbox
Are there any problems? I tested a little.
Could you please try the following?

No01 : In “t_plotly” of your tbx file
” Change $ScreenHeight-20 to $ScreenHeight-40 and add
Preview “plotly”
No02 : Will the graph display that has been [collapsed and invisible]
become a normal shape?

No03: If the display is normal in No02, then “This is the problem”
Has the output of the Japanese title “Poster Sample” been properly corrected?

In my environment, if the screen height is changed to 40, the Japanese title
“Poster Sample”
The preview run worked fine without “inserting half-width characters”
at the beginning.
P.S.
It is not yet possible to run a preview with Mathjax alone.
There may be a hidden cause here.
In Tinderbox 9.3, if you create a copy of the text and place it
Preview works.
(However, the preview in plotly leaves the graph collapsed as it is.)
August 15, 2023 10:22:41 JST

1 Like

No01&No02: the graph is displayed correctly.
No03: Unfortunately, the preview display is not improved.
Preview of Mathjax is because HTMLExportTemplate was set to a normal HTML template.
(グラフは正しく表示されましたが、残念ながらプレビューの表示は改善されませんでした。
Mathjaxのプレビューは、HTMLExportTemplateが通常のHTMLテンプレートが設定されているためでした。)

Thank you very much for trying different methods.
The method Mr. Mark Bernstein gave me above solved the problem.
(色々と試していただき、ありがとうございました。
上のマークバーンスタイン氏が教えてくれた方法で解決しました。)

This method solved the problem.
Now that I know the cause and workaround, I would like to set the HTMLExportFileName appropriately for my application.
The modified file is attached for your reference.
Tinderbox 9.6 Poster example.tbx (541.6 KB)

Thank you for your advice.

Dear Takeshi Otsuka, eastgate & Michael Becker,
I am really glad the issue was resolved.
Thanks to eastgate and Michael Becker for their help.
yours, WAKAMATSU

1 Like

BTW, I export files all the time with my approach, it just results in non-human readable (i.e., a bunch of numbers) file names. But, as I don’t need to read the paths, that is just fine for my purpose, or if I do need to I know the numbers, but looking at TBX, what path to follow.

Will $IDString always work in this case? I thought $IDString would sometime generate a characters, e.g. “/”, that is not conducive to being in a path.

This workaround will not be needed in the future (probably not after 9.6.1)

I believe that $IDString will always work. I’ll check that it does.

FWIW, I exported all of aTbRef’s $IDString values and after stripping tbx; and alphanumerics all I see is forward slashes / and plus signs +.

If $IDString is, tbx:Bj/YCi, for example, setting $HTMLExportFileName to $IDString would export “tbx:Bj/YCi.html” as the filename is set explicitly and so bypasses Tinderbox’s normal filtering of unhelpful characters which looks like a page with the filename “YCi.html”.

For an export filename, $ID seems a better choice albeit making the meaning hard to read ‘by eye’. Such usage is a key part of the method used to make PDFs from a single multi-source-note HTML page exported from a TBX.

1 Like