Skip to content

Commit

Permalink
TL sync dvipdfm-x, luatex
Browse files Browse the repository at this point in the history
  • Loading branch information
edocevoli committed Feb 5, 2025
1 parent 42ff841 commit 3c59104
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Admin/TPM/windows-x64/miktex-dvipdfmx-bin-x64.tpm.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TPM:Copyright owner="Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the DVIPDFMx project team" year="2002-2025"/>
<TPM:Copyright owner="Mark Wicks" year="1998,1999"/>
<TPM:License type="gpl"/>
<TPM:Version>20250202</TPM:Version>
<TPM:Version>20250205</TPM:Version>
<TPM:TargetSystem minVersion="@MIKTEX_MIN_TARGET_SYSTEM_VERSION@">windows-x64</TPM:TargetSystem>
<TPM:Date>@MIKTEX_DATETIME_STR@</TPM:Date>
<TPM:Description>
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
### Upgraded programs

* chktex 1.7.9
* dvipdfmx 20250202
* dvipdfmx 20250205
* dvips 2024.1
* dvisvgm 3.4.3
* hitex 2.1
* luatex 1.21.0
* pdftex 1.40.27
* texworks 0.6.10
* texworks 0.6.1020250205
* upmendex 1.10
* xetex 0.999997

Expand Down
12 changes: 11 additions & 1 deletion Programs/DviWare/dvipdfm-x/source/epdf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
Copyright (C) 2002-2020 by Jin-Hwan Cho and Shunsaku Hirata,
Copyright (C) 2002-2025 by Jin-Hwan Cho and Shunsaku Hirata,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by Mark A. Wicks <[email protected]>
Expand Down Expand Up @@ -119,6 +119,7 @@ pdf_include_page (pdf_ximage *ximage,
xform_info info;
pdf_obj *contents = NULL, *catalog;
pdf_obj *page = NULL, *resources = NULL, *markinfo = NULL;
pdf_obj *group = NULL;

pf = pdf_open(ident, image_file);
if (!pf)
Expand Down Expand Up @@ -151,6 +152,10 @@ pdf_include_page (pdf_ximage *ximage,
pdf_release_obj(tmp);
}

/*
* Handle page's Group
*/
group = pdf_deref_obj(pdf_lookup_dict(page, "Group"));
/*
* Handle page content stream.
*/
Expand Down Expand Up @@ -193,6 +198,9 @@ pdf_include_page (pdf_ximage *ximage,
pdf_add_dict(contents_dict, pdf_new_name("Resources"),
pdf_import_object(resources));
pdf_release_obj(resources);

if (group)
pdf_add_dict(contents_dict, pdf_new_name("Group"), group);
}

pdf_close(pf);
Expand All @@ -210,6 +218,8 @@ pdf_include_page (pdf_ximage *ximage,
pdf_release_obj(markinfo);
if (page)
pdf_release_obj(page);
if (group)
pdf_release_obj(group);
if (contents)
pdf_release_obj(contents);

Expand Down
2 changes: 1 addition & 1 deletion Programs/DviWare/dvipdfm-x/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ set(MIKTEX_COMP_MAJOR_VERSION 4)
set(MIKTEX_COMP_MINOR_VERSION 20)
set(MIKTEX_COMP_PATCH_VERSION 0)

set(MIKTEX_COMP_ORIG_VERSION_STR "20250202")
set(MIKTEX_COMP_ORIG_VERSION_STR "20250205")

set(MIKTEX_COMP_COPYRIGHT_STR "© 1998,1999 Mark Wicks, © 2002-2025 Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the DVIPDFMx project team")
2 changes: 1 addition & 1 deletion Programs/TeXAndFriends/luatex/source/luatex_svnversion.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef luatex_svn_revision_h
#define luatex_svn_revision_h
#define luatex_svn_revision 7653
#define luatex_svn_revision 7657
#endif
1 change: 1 addition & 0 deletions Programs/TeXAndFriends/luatex/source/tex/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ void initialize_commands(void)
primitive_luatex("mathdefaultsmode", assign_int_cmd, int_base + math_defaults_mode_code, int_base);
primitive_luatex("discretionaryligaturemode", assign_int_cmd, int_base + discretionary_ligature_mode_code, int_base);
primitive_etex("partokencontext", assign_int_cmd, int_base + partoken_context_code, int_base);
primitive_luatex("mathemptydisplaymode", assign_int_cmd, int_base + math_empty_display_mode_code, int_base);

/*tex
Expand Down
6 changes: 5 additions & 1 deletion Programs/TeXAndFriends/luatex/source/tex/equivalents.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ the |number_regs| \.{\\dimen} registers.

# define ignore_primitive_error_code 125 /*ignore some primitive/engine errors*/

# define math_option_code 126
# define math_empty_display_mode_code 126

# define math_option_code 127


# define mathoption_int_base_code (math_option_code+1) /* one reserve */
Expand Down Expand Up @@ -830,6 +832,8 @@ extern halfword last_cs_name;

#define show_stream_par int_par(show_stream_code)

#define math_empty_display_mode_par int_par(math_empty_display_mode_code)

/* */

#define math_use_current_family_code 7
Expand Down
2 changes: 1 addition & 1 deletion Programs/TeXAndFriends/luatex/source/tex/maincontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,7 @@ void end_graf(int line_break_context)
if (head == tail) {
pop_nest();
} else if (only_dirs(vlink(head))) {
flush_node(vlink(head));
flush_node_list(vlink(head));
pop_nest();
} else {
line_break(false, line_break_context);
Expand Down
104 changes: 48 additions & 56 deletions Programs/TeXAndFriends/luatex/source/tex/texmath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,18 @@ static boolean math_and_text_reversed_p(void)
*/

static int only_dirs(halfword n)
{
while (n) {
if (type(n) == local_par_node || type(n) == dir_node) {
n = vlink(n);
} else {
return 0;
}
}
return 1;
}

void enter_display_math(void)
{
/*tex new or partial |pre_display_size| */
Expand All @@ -1101,19 +1113,21 @@ void enter_display_math(void)
\.{\$\${ }\$\$}
*/
if (head == tail ||
(vlink(head) == tail &&
type(tail) == local_par_node && vlink(tail) == null)) {
if (vlink(head) == tail) {
/*tex
|resume_after_display| inserts a |local_par_node|, but if there
is another display immediately following, we have to get rid of
that node.
*/
flush_node(tail);
}
if (head == tail) {
pop_nest();
w = -max_dimen;
} else if ((vlink(head) == tail &&
type(tail) == local_par_node && vlink(tail) == null) ||
(math_empty_display_mode_par == 1 && only_dirs(vlink(head)))) {
/*tex
We ignore |null| paragraphs, that is those that only have a local par node,
for example because |resume_after_display| inserts a |local_par_node|.
If |\mathdisplayemptymode=1| paragraphs caontaining only local par node
and possibly a few dir nodes are ignored as well.
*/
flush_node_list(vlink(head));
pop_nest();
w = -max_dimen;
} else {
Expand Down Expand Up @@ -2510,7 +2524,7 @@ static void finish_displayed_math(boolean l, pointer eqno_box, pointer p)
if (type(p) == glue_node)
d = 0;
}
tail_append(new_penalty(pre_display_penalty_par,after_display_penalty));
tail_append(new_penalty(pre_display_penalty_par,before_display_penalty));

/* tex
By default the short skip detection is not adapted to r2l typesetting and that
Expand Down Expand Up @@ -2561,54 +2575,32 @@ static void finish_displayed_math(boolean l, pointer eqno_box, pointer p)
if (eqno_w != 0) {
r = new_kern(line_w - eq_w - eqno_w - d);
if (l) {
if (swap_dir) {
if (math_direction_par==dir_TLT) {
/*tex TRT + TLT + \eqno: (swap_dir=true, math_direction_par=TLT, l=true) */
s = new_kern(width(r) + eqno_w);
} else {
/*tex TLT + TRT + \eqno: (swap_dir=true, math_direction_par=TRT, l=true) */
s = new_kern(d);
}
try_couple_nodes(eqno_box,r);
try_couple_nodes(r,eq_box);
try_couple_nodes(eq_box,s);
if (math_direction_par==dir_TLT) {
/*tex TRT + TLT + \eqno: (swap_dir=true, math_direction_par=TLT, l=true) */
/*tex TLT + TLT + \leqno: (swap_dir=false, math_direction_par=TLT, l=true) */
s = new_kern(width(r) + eqno_w);
} else {
if (math_direction_par==dir_TLT) {
/*tex TLT + TLT + \leqno: (swap_dir=false, math_direction_par=TLT, l=true) */
s = new_kern(width(r) + eqno_w);
} else {
/*tex TRT + TRT + \leqno: (swap_dir=false, math_direction_par=TRT, l=true) */
s = new_kern(d);
}
try_couple_nodes(eqno_box,r);
try_couple_nodes(r,eq_box);
try_couple_nodes(eq_box,s);
/*tex TLT + TRT + \eqno: (swap_dir=true, math_direction_par=TRT, l=true) */
/*tex TRT + TRT + \leqno: (swap_dir=false, math_direction_par=TRT, l=true) */
s = new_kern(d);
}
try_couple_nodes(eqno_box,r);
try_couple_nodes(r,eq_box);
try_couple_nodes(eq_box,s);
eq_box = eqno_box;
} else {
if (swap_dir) {
if (math_direction_par==dir_TLT) {
/*tex TRT + TLT + \leqno: (swap_dir=true, math_direction_par=TLT, l=false) */
s = new_kern(d);
} else {
/*tex TLT + TRT + \leqno: (swap_dir=true, math_direction_par=TRT, l=false) */
s = new_kern(width(r) + eqno_w);
}
try_couple_nodes(s,eq_box);
try_couple_nodes(eq_box,r);
try_couple_nodes(r,eqno_box);
if (math_direction_par==dir_TLT) {
/*tex TRT + TLT + \leqno: (swap_dir=true, math_direction_par=TLT, l=false) */
/*tex TLT + TLT + \eqno: (swap_dir=false, math_direction_par=TLT, l=false) */
s = new_kern(d);
} else {
if (math_direction_par==dir_TLT) {
/*tex TLT + TLT + \eqno: (swap_dir=false, math_direction_par=TLT, l=false) */
s = new_kern(d);
} else {
/*tex TRT + TRT + \eqno: (swap_dir=false, math_direction_par=TRT, l=false) */
s = new_kern(width(r) + eqno_w);
}
try_couple_nodes(s,eq_box);
try_couple_nodes(eq_box,r);
try_couple_nodes(r,eqno_box);
/*tex TLT + TRT + \leqno: (swap_dir=true, math_direction_par=TRT, l=false) */
/*tex TRT + TRT + \eqno: (swap_dir=false, math_direction_par=TRT, l=false) */
s = new_kern(width(r) + eqno_w);
}
try_couple_nodes(s,eq_box);
try_couple_nodes(eq_box,r);
try_couple_nodes(r,eqno_box);
eq_box = s;
}
eq_box = hpack(eq_box, 0, additional, -1);
Expand Down

0 comments on commit 3c59104

Please sign in to comment.