Publish markup and the help command

4 ビュー (過去 30 日間)
Roger Rouse
Roger Rouse 2023 年 8 月 9 日
編集済み: Roger Rouse 2023 年 8 月 24 日
What to have markup for Publishing and help text in the same .m file. When I try that the markup is not interpreted by help and the result looks horrible. And, Publish treats the help text as 'body text' and also looks bad. Is it possible to have both markup and help text in the same .m file and have the Published result look good and the help output also look good. Thanks, Roger

回答 (1 件)

Praveen Reddy
Praveen Reddy 2023 年 8 月 22 日
Hi Roger,
I understand that you could not organize the help text and text for markup in the same “.m” file. I suggest you to include help text below the function definition line and a separate section for markup.
function c = addme(a,b)
% ADDME Add two values together.
% C = ADDME(A) adds A to itself.
% C = ADDME(A,B) adds A and B together.
%
%%
% $x^2+e^{\pi i}$
% Block Equation
%
% $$e^{\pi i} + 1 = 0$$
%
switch nargin
case 2
c = a + b;
case 1
c = a + a;
otherwise
c = 0;
end
Please refer to the images attached for the output of “help” command and published “.m” file.
To know more about help text for functions, markup and publishing, please refer to the following MATLAB documentations.
  1 件のコメント
Roger Rouse
Roger Rouse 2023 年 8 月 24 日
編集済み: Roger Rouse 2023 年 8 月 24 日
Thanks you for that example.
I'd prefer to have the published result look more 'polished' and not just include the code.
Also, I'd like to have that polished result without having to repeat the help that is already at the top of the function. I think this is the part that is hard to do.
Also, I'd like the title of the published page to be above the table of contents. I don't know how to do that without having the %% line appear as the first line in the file.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by