質問用フォーラムです。ご質問の前に質問のしかたをご覧ください。

[uplatex] rensuji + macro

- K Shen の投稿

Apologies for posting in English.

I'm trying implement in footnote referring only to the line number and if the line number is the same as previous footnote, it's ignored. I save the line number in a counter using \setcounterref from refcount, and compare the counter with line number of the current footnote. 

A minimal working example is as follows. If I use \mynoteref seems work as expected, but \rensuji{\mynoteref{foo}} does not. 

Many thanks in advance. 

\documentclass{utarticle}
\usepackage{lineno}
\usepackage[para*]{manyfoot}
\usepackage{refcount}
\DeclareNewFootnote[para]{A}[alph]
\newcounter{mynotecounter}
\newcounter{mynoterefctr}
\setcounter{mynoterefctr}{0}

\newcommand{\mynote}[2][]{%
  \stepcounter{mynotecounter}%
  \def\temp{#1}% 
  \ifx\temp\empty%
  \FootnotetextA{}{#2}%
  \else%
  \FootnotetextA{}{{\linenumberfont\rensuji{#1}} #2}
  % \FootnotetextA{}{#1 #2} % This works! 
  \fi%
}

\newcommand{\mynoteref}[1]{%
\ifnum \getrefnumber{#1}=\value{mynoterefctr}%
\else%
\setcounterref{mynoterefctr}{#1}%
\ref{#1}%
\fi}

\begin{document}

\linenumbers
Lorem ipsum dolor\linelabel{n1}\mynote[\mynoteref{n1}]{note 1} sit amet, consectetur adipiscing elit\linelabel{n2}\mynote[\mynoteref{n2}]{note 2}. Etiam a urna lacinia\linelabel{n20}\mynote[\mynoteref{n20}]{note 20}, eleifend nulla vel, ullamcorper lectus. Ut gravida odio erat, sed facilisis arcu aliquet sit amet. Mauris venenatis, orci eu pulvinar aliquet, nibh lacus faucibus massa, vel iaculis arcu eros eget lectus. Aenean sed vestibulum orci, et euismod ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec in vulputate ligula. Phasellus euismod purus id dictum lobortis. \linelabel{n3}\mynote[\mynoteref{n3}]{note 3}

\end{document}

upLaTeX下のjlreq-deluxeで多書体化するとpxchfonでフォント変更ができない

- ya ra の投稿

環境

  • Windows11
  • TeX Live 2025
  • upLaTeX: e-upTeX 3.141592653-p4.1.2-u2.00-250202-2.6 (utf8.uptex)

生じる問題

upLaTeX+dvipdfmx 下で jlreq 文書クラスを用いて文書を作成しています。

ここで、jlreq のフォントメトリックを保ったまま多書体化するために、jlreq-deluxe を使用しました。
加えて、pxchfon を用いてフォントを 源ノ (sourcehan) に変更しました。

すると、次のような 16 のエラーメッセージ(以下は一部抜粋)と missfont.log が生成されました。(詳細は添付ファイルを参照してください)

Font JT2/hmc/m/n/10=zu-jlreq--upnmlminrn-v at 10.0pt not loadable: Metric (TFM/OFM) file not found.
Font JY2/hmc/m/n/10=zu-jlreq--upnmlminrn-h at 10.0pt not loadable: Metric (TFM/OFM) file not found.

missfont.log:

mktextfm zu-jlreq--upnmlminrn-v
mktextfm zu-jlreq--upnmlminrn-h
mktextfm zu-jlreq--upnmlminln-v
mktextfm zu-jlreq--upnmlminln-h
mktextfm zu-jlreq--upnmlminbn-v
mktextfm zu-jlreq--upnmlminbn-h
mktextfm zu-jlreq--upnmlgothrn-v
mktextfm zu-jlreq--upnmlgothrn-h
mktextfm zu-jlreq--upnmlgothbn-v
mktextfm zu-jlreq--upnmlgothbn-h
mktextfm zu-jlreq--upnmlgothebn-v
mktextfm zu-jlreq--upnmlgothebn-h
mktextfm zu-jlreq--upnmlmgothrn-v
mktextfm zu-jlreq--upnmlmgothrn-h
mktextfm zu-jlreq--upnmlminrn-v
mktextfm zu-jlreq--upnmlminrn-h

エラーを解消し、jlreq の下で源ノ+多書体化した文書を作成するにはどのようにすれば良いでしょうか。

補足

pxchfon が指定するフォントによってエラーの有無が変わることが分かっています。

  • エラー無く期待した結果を得る
    • haranoaji
    • ipa
    • ipaex
    • yu-win10
  • エラーが出る
    • sourcehan
    • noto-jp

sourcehannoto-jp 以外の追加フォントに関しては分かりません。


jlreq-deluxe を利用せずに otfdeluxe を使用すると、エラーとなることなく期待した PDF が出力されます。(フォントも適切に埋め込まれます)

最小再現例

実行:

ptex2pdf -u -l -ot -kanji=utf8 -interaction=nonstopmode -file-line-error test.tex

TeX ソース:

\documentclass[uplatex, dvipdfmx, paper=a4paper]{jlreq}
\usepackage{jlreq-deluxe}
%% jlreq-deluxe ではなく、
% \usepackage[deluxe]{otf} %% であれば成功する
\usepackage[sourcehan, unicode]{pxchfon}
\listfiles
\begin{document}

\textmc{\ltseries これは細い明朝体。}
\textmc{これは明朝体。}
\textmc{\bfseries これは太い明朝体。}

\textgt{これはゴシック体。}
\textgt{\bfseries これは太いゴシック体。}
\textgt{\ebseries これは極太ゴシック体。}

\textmg{これは丸ゴシック体。}

\end{document}

Texインストールについて

- dot k の投稿

Texインストールについて、下記リンク1のものです。インターネットインストールができなかったため、下記リンク2の記事を参考にして、コマンドプロンプトを用いてインストールを試みたところ、無事インストールが開始されました。

ところで、離席している間にプログラムのインストールが終了したのか、下記の画像のようになっていました(インストールログはこれ以外ありません)。

インストールが終了し最初のインストール画面に戻っただけだと思うのですが、インストールが終わっているとするならば、どのようにして確かめればよいのでしょうか?

加えて、Texの推奨パックをインストールするにはどうしたらよいでしょうか

ちなみにインストール時には「<I>start installation to hard disk」を実行しました。

よろしくお願いします。画像1

  1. https://okumuralab.org/tex/mod/forum/discuss.php?d=3989
  2. https://qiita.com/HayatoF/items/ac3bf4d64fb9a79a9f8d

LaTeXのインストールが始まる前にエラーが出る

- 花 花 の投稿
初めて投稿いたします。
数式を含む文書作成のためにLaTeXを使っています。
物理化学系ですが,パッケージの内容など,各ファイルの中身はほとんど理解していない,末端のユーザです。

新しく買ったコンピュータにLaTeXをインストールしようとしたところ,インストーラをダウンロードしたあと,インストールが始まる前にエラーが出てしまって進みません。
OSは,Windows11 24H2 です。

以下に,実際に行った手順を記します。

https://www.tug.org/texlive/acquire-netinstall.html
にアクセスして,
1.install-tl-windows.exeを実行
2.install-tl.zipをダウンロードして,batファイルを実行
の,両方をやってみました。
結果はどちらも同じでした。
なお,管理者でログインし,「管理者として実行」を選んでいます。

その後,TeXのキャラクタが走っているイラストが現れるところまでは行くのですが,ミラーサイトに行く前にエラーメッセージが出て,そこから進まなくなってしまいました。
エラーメッセージは以下の通りです。

--------------------------
Can't call method "schemes" on an undefined value at
C:/Users/.../AppData/Local/Temp/nsj3073.tmp/install-tl-20250901/tlpkg/installer/install-menu-extl.pl
line 68.
Compilation failed in require at
C:/Users/.../AppData/Local/Temp/nsj3073.tmp/install-tl-20250901/install-tl
line 697.
--------------------------

ここに出てきているinstall-menu-extl.plとinstall-tlを添付します。
どうか,よろしくお願いいたします。

jlreqの奇数ページの柱に表示される節について

- Yuki-AugMD の投稿

luaLaTeX+jlreqで学位論文を執筆しています.
クラスオプションにはbookを指定し,ページスタイルをheadingsとしたところ,偶数ページの柱に章の情報が,奇数ページの柱には節の情報が出力されています.

この節の出力内容を少し変えたいと考えています.
コード例のように奇数ページの途中で新しい節を挿入すると,デフォルトでは当該ページの柱には新しい節の情報が表示されるのですが,これを古い節(当該ページの先頭にある節)の情報が出力されるように変更したいです.
つまり,現行では3ページ目の柱に1.2 いいい のように表示されるのを 1.1 あああ としたいです.
可能な方法がありましたら教えていただけますと幸いです.

LaTeXで日常的に文章を作成しておりますが,マクロやクラスファイルの内容については詳しくありませんので,独力で変更箇所と内容を考えることができず困っています.

ディストリビューションとしてはTeXLive 2025 の最新版を使っております.

\documentclass[book,titlepage,paper=a4paper,fontsize=11pt,jafontscale=0.9247]{jlreq}

\begin{document}

\pagestyle{headings}

% 1ページ目
\chapter{hogehoge}
\section{あああ}
私はたいへんいい実験をしたいとさっき考えていたのだ。
するとほんとうにそうなんだが。

% 2ページ目
\newpage
私は倫理的に潔癖だという自分のお母さんの事であった。

% 3ページ目
\newpage
私は倫理的に潔癖だという自分のお母さんの事であった。

\section{いいい}
私はたいへんいい実験をしたいとさっき考えていたのだ。

\end{document}

英語論文の論文題目(タイトル)の各単語の1文字目を前置詞を除き、自動的に大文字にしたい

- hhh kkk の投稿

英語論文の論文題名(タイトル)の各単語の1文字目を前置詞を除き、
自動的に大文字にすることを考えています。

試しに作成したbstファイルの関連箇所は以下のようなものですが、
希望どおりには動作せず、論文題名がtitleエントリーに入力したまま表示されます。

希望の動作を行うようにするにはどうすればいいか、教えていただけませんでしょうか?

--------------------------

% 前置詞判定
FUNCTION {is.preposition}

  duplicate$ "of" = swap$
  duplicate$ "in" = or swap$
  duplicate$ "on" = or swap$
  duplicate$ "at" = or swap$
  duplicate$ "for" = or swap$
  duplicate$ "and" = or swap$
  duplicate$ "or" = or swap$
  duplicate$ "the" = or swap$
  duplicate$ "a" = or swap$
  duplicate$ "an" = or
}

% 先頭1文字大文字化 + 残りは小文字のまま
FUNCTION {capitalize.word}
{
  's :=
  s empty$
    { "" }
    {
      s #1 text.prefix$ "t" change.case$
      s text.length$ #2 <
        { "" }
        { s #2 global.max$ substring$ }
      if$
      *
    }
  if$
}

% 前置詞なら小文字化(全体をlowercase)
FUNCTION {lowercase.word}
{
  "l" change.case$
}

% タイトル大文字化処理(前置詞除外)
FUNCTION {capitalize.title}
{
  't :=            % 残りの文字列
  "" 'result :=    % 蓄積
  #1 'firstword := % 最初の単語フラグ

  { t "" = not }   % ループ条件
  {
    t " " split$   % left right
    't :=          % 残り
    'word :=       % 単語

    word empty$
      { }
      {
        firstword #1 =
          { word capitalize.word 'firstword := #0 'firstword := }
          {
            word is.preposition
              { word lowercase.word }
              { word capitalize.word }
            if$
          }
        if$

        result empty$
          { 'result := }
          { result " " * swap$ * 'result := }
        if$
      }
    if$
  }
  while$

  result
}

FUNCTION {format.title}
{ title empty$
    { "\textcolor{red}{title missing}" }
    { title capitalize.title}
  if$
}

----------------------------------------------

Texインストールについて

- dot k の投稿

texliveのインストールについて。

wikiに従い、install-tl-windows.exe をダウンロード市、インストールをしようとしたところ、班日経っても一枚目の画像から進まず、ファイルごと削除し、トライしたところ、今度はインストールが始まらないようになってしまいました(ミラー先の変更は試しました)(二枚目の画像)。

何が問題なのか、また、インストールするためにはどうしたらよいかわからない状況です。

よろしくおねがいします。

添付 1.jpg

pdfxのX4変換が地雷系すぎる

- KK TeX の投稿

LuaLaTeXを使って、acrobatの変換を経ずに直接X-4やX-1a形式のPDFを得る方法を模索しています。(そのテストでacrobatのプリフライトを使っているので本末転倒なのですが、それは一旦置いておくとして、)以下に問題のソース全文を載せます。

\begin{filecontents*}{\jobname.xmpdata}
\Title{あいうえお}
\Author{あいうえお}
\Language{ja-JP}
\Keywords{LaTeX}
\Publisher{あいうえお}
\end{filecontents*}

 \documentclass[8pt,b5paper,twoside]{ltjsreport}
\documentclass[luatex,fontsize=8pt,paper=b5,twoside,report]{jlreq}%今後はこっちメインで
\usepackage[top=18truemm,bottom=14truemm,left=14truemm,right=14truemm]{geometry}
 
\usepackage[x-4]{pdfx}
\begin{document}
あいうえおあいうえお
\end{document}
 
これをLuaでコンパイルしたものをプリフライトチェックにかけます。
 
すると
上の画像のようになりました。ならinfo側を強制的に変更してやろうと思ったので、

\directlua{
pdf.setinfo("Keywords", "LaTeX")
}

を追記したところ、

こうなりました。

お手上げです。

ちなみに、

\usepackage[x-1a]{pdfx}

とすると1a規格のプリフライトチェックをちゃんとパスします。

ここの不整合を修正するにはどのようにすれば良いでしょうか。

挿図の取り込み

- ueki ichiro の投稿

Windows11をのせた富士通ノートパソコンで論文を翻訳しています。原論文の挿図をスキャナーでjpgファイルとしたものを訳文のなかに取り込むため、美文書作成入門第8版124ページの7.2「LATEXでの図の読み込み方」の手順を実行したところエラーメッセージが出てうまくいきません。どこが間違っているのか教えてください。texworksで作成したプリアンブルと訳文は次の通りです。logファイルも添付します。

植木

\documentclass[dvipdfmx][11pt,fleqn,b5paper,twoside]{jsarticle}

\setlength{\textwidth}{37zw}

\setlength{\oddsidemargin}{2cm}

\setlength{\evensidemargin}{0cm}

\setlength{\topmargin}{0cm}

\setlength{\textheight}{19cm}

\setlength{\baselineskip}{20pt}

\usepackage{amsmath}

\usepackage{graphics}

%\pagenumbering{roman}

\usepackage{amsmath,amssymb}

%\setcounter{page}{67}

\begin{document}

流率に関する1666年の小論文

                 アイザック・ニュートン

Issac Newton, "The October 1666 Tract on FLuxions",

D. T. Whiteside編 Mathematical Papers of Isaac Newton, Vol.I, Cambridge at the University Press,1967,p.400 所収.

[1]

1666年10月。 「運動による問題を解くためには以下の命題で十分である」。

1 円または球 $ade$ の周上の物体 $a が中心 b$ の方向に動くとき、周上の各点 $(d, c, e)$ に向かう速度は、物体からこれらの点に引かれた弦 $(ad, ac, ae)$ に比例する。

\includegraphics{newtonfig1-2.jpg}

2 三角形 $adc, aec で ad = ec$ 等が(平面は異なっても)成り立ち、3箇の物体が点 $a$ から、第1の物体は $d$ に、第2の物体は $e$ に、第3の物体は $c$ に向かって一様に同じ時間で動くとき、第3の物体の運動は第1と第2の運動の合成である。

miktexを使ってtexstudioをアップデートしたらerrorが出るようになった

- mathema の投稿
\documentclass[]{beamer}
%\usepackage[utf8]{inputenc}
 
\newcommand{\maru}[1]{\ooalign{
\hfil\resizebox{.8\width}{\height}{#1}\hfil
\raise.1ex\hbox{\large$\bigcirc$}}}%encircle
\usepackage{fancybox}%about frame
\usepackage{luatexja}%japanese
%\usepackage{natbib}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{cd}%tikzcd
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{babel}
\usetikzlibrary{arrows}
\usepackage{xcolor}
\usepackage{graphics}%reverse
\usepackage{graphicx}%about scalebox
\usepackage{amsmath,amsfonts,amsthm,amssymb,amscd,ascmac}%in order to  higher formula and mathfrak and so on.
\usepackage{latexsym, mathtools}%arrow
\usepackage{textcomp}%※
\usepackage{bussproofs}%prooftree
\usepackage{pifont}
\usepackage{subfigure}
\usepackage{lscape}%%revolve
\usepackage{stmaryrd}%bracket
\usepackage{cancel}%diagonal line on a letter
\usepackage{hyperref}%reference
\usepackage{setspace}%
\usepackage{soul}%下線
\usepackage{comment}
\usepackage{wrapfig}%回り込み
\usepackage{qrcode}
\usepackage{luatexja-otf}%ajRightBArrow等
\usepackage{multicol}%itemize並列版
\usepackage{enumerate}
\usepackage{tikz-cd}
\usepackage{mathrsfs}%花文字(スクリプトフォント)
\usepackage{tasks}%itemize並列版
\usepackage{wrapstuff}%回り込み改良版
\usepackage{pb-diagram}%可換図式
\usepackage{bxdpx-beamer}% dvipdfmxなので必要
\usepackage{babel}
\usepackage{lmodern}
 
 
\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\kanjifamilydefault}{\gtdefault}
 
 
%beamerのproof環境を次ページまで伸ばす
\makeatletter
\newenvironment<>{proofs}[1][\proofname]{%
\par
\def\insertproofname{#1\@addpunct{.}}%
\usebeamertemplate{proof begin}#2}
{\usebeamertemplate{proof end}}
\makeatother
 
 
\tikzset{aneg/.style={
preaction={decorate},
decoration={markings, mark=at position 0.5 with {\draw[red, -] (-1mm,-1.5mm) -- (1mm,1.5mm);}}
}}%tikzの線の斜線
 
 
\newtheorem{proposition}[theorem]{Proposition}
 
 
\definecolor{deepskyblue}{rgb}{0.0, 0.75, 1.0}
\definecolor{dodgerblue}{rgb}{0.12, 0.56, 1.0}
\definecolor{aliceblue}{rgb}{0.94, 0.97, 1.0}
\definecolor{lavenderblue}{rgb}{0.8, 0.8, 1.0}
\definecolor{lavender(web)}{rgb}{0.9, 0.9, 0.98}
 
\setbeamercovered{transparent}
\setbeamertemplate{theorems}[numbered]
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}
 
\newcommand{\red}[1]{\textcolor{red}{#1}}
 
\renewcommand{\baselinestretch}{1.3}%Leave a space between lines
\renewcommand{\arraystretch}{1}%arrayの行間を変える
 
\deftranslation[to=japanese]{Theorem}{定理}
\deftranslation[to=japanese]{Corollary}{系}% ある
\deftranslation[to=japanese]{Lemma}{補題}
%\deftranslation[to=japanese]{Proposition}{命題}% ない!
\deftranslation[to=japanese]{Example}{例}
\deftranslation[to=japanese]{Examples}{例}
\deftranslation[to=japanese]{Definition}{定義}
\deftranslation[to=japanese]{Definitions}{定義}
\deftranslation[to=japanese]{Problem}{問題}
\deftranslation[to=japanese]{Solution}{解}
\deftranslation[to=japanese]{Fact}{事実}
\deftranslation[to=japanese]{Proof}{証明}
 
 
\parindent = 0pt%no indent
 
 
\usetheme{Madrid}%テーマは指定しなくともよい.
 
\usepackage[%
backend  = biber,
bibstyle = authoryear-comp,
citestyle= authoryear-comp
]{biblatex}
%
%\nocite{*}
\addbibresource{bib_name.bib}
 
\begin{document} 
\begin{frame}
\titlepage
\end{frame}
 
 
 
 
\begin{frame}[allowframebreaks]{Reference}
\printbibliography
\end{frame}
 
 
 
\end{document}

を入力したらALC_Presntation.tex: error: 122: Font \U/stmry/m/n/8=stmary8 at 8pt not loadable: metric data not found or bad. \end{frame}等のエラーが出てきました。

先ずmiktexをダウンロードしてhttps://youtu.be/Z-5QMBcjXAM?si=j6yF_H2E8XBy9zU8に沿ってアップデートを行いました。その前はエラーなく出力できました。しかし、その後にコンパイルをしたところ、このようなエラーが出るようになりました。
エラーの文を頼りに解決方を調べて色々試してみたのですが、うまくいきませんでした。

よろしければご教授お願いします。