Skip to content

Commit

Permalink
fix: hyperxmp
Browse files Browse the repository at this point in the history
  • Loading branch information
dmyersturnbull committed Jul 25, 2022
1 parent 97450a0 commit d897329
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 117 deletions.
126 changes: 16 additions & 110 deletions src/desert.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@

% layout control:
\@RP {fancyvrb} % _verbatim_ , etc.
\@RP [newcommands] {ragged2e} % full ragged environments; before: footmisc
\@RP {tarmac} % includes ragged2e, before footmisc
\@RP {newfloat} % declare new float environments
\@RP {geometry} % \geometry
\@RP [Export] {adjustbox} % resize boxes
Expand All @@ -1141,7 +1141,8 @@
% xindy and hyperref
\@LF [xindy] {imakeidx} % index; before: knowledge
\@RP {hyperxmp}
\@RP {hyperref} % AFTER xindy and geometry
\@RP [pdfa,pdfapart=3,pdfaconformance=u] {hyperref} % AFTER xindy and geometry
%\@RP [a-3u] {pdfx} % PDF/A compliance

% font control and math
\@PP {babel=true} {microtype}
Expand Down Expand Up @@ -1171,7 +1172,6 @@
\@RP {acro} % for all abbreviations (after: toclof)

% more layout and spacing
\@RP {tarmac}
\@RP {fancyhdr} % footer and header
\@RP {enumitem} % control spacing for lists
\@RP [hang] {footmisc} % footnote styling and counters (after: setspace)
Expand Down Expand Up @@ -1239,11 +1239,12 @@
% core
\@RP { tikz }
\@TZ { babel, fpu, calc, }
% TODO: fix
%\@TZ { external }
\hook_gput_code:nnn
{dez/after}
{dez/tikzexternalize}
{ \tikzexternalize }
%\hook_gput_code:nnn
% {dez/after}
% {dez/tikzexternalize}
% { \tikzexternalize }
% basic
\@TZ { scopes, backgrounds, positioning, intersections, through, chains, matrix, fit, }
% shapes and arrows
Expand Down Expand Up @@ -2349,96 +2350,13 @@
}


% like the other ragged2e commands
\let \Justifying \justifying

\NewDocumentEnvironment {Justify} {}
{ \begin {justify} }
{ \end {justify} }

\prop_const_from_keyval:Nn \c_dez__align_to_cmd_prop
{
left = RaggedRight ,
Left = RaggedRight ,
flushleft = RaggedRight ,
FlushLeft = RaggedRight ,
raggedright = RaggedRight ,
RaggedRight = RaggedRight ,
right = RaggedLeft ,
Right = RaggedLeft ,
flushright = RaggedLeft ,
FlushRight = RaggedLeft ,
raggedleft = RaggedLeft ,
RaggedLeft = RaggedLeft ,
center = Centering ,
Center = Centering ,
centering = Centering ,
Centering = Centering ,
centered = Centering ,
Centered = Centering ,
justify = justifying ,
Justify = justifying ,
justifying = justifying ,
Justifying = justifying ,
justified = justifying ,
Justified = justifying ,
}

\prop_const_from_keyval:Nn \c_dez__align_to_env_prop
{
flushleft = FlushLeft ,
FlushLeft = FlushLeft ,
left = FlushLeft ,
Left = FlushLeft ,
raggedright = FlushLeft ,
RaggedRight = FlushLeft ,
right = FlushRight ,
Right = FlushRight ,
flushright = FlushRight ,
raggedleft = FlushRight ,
RaggedLeft = FlushRight ,
FlushRight = FlushRight ,
center = Center ,
Center = Center ,
centering = Center ,
Centering = Center ,
centered = Center ,
Centered = Center ,
justify = justify ,
Justify = Justify ,
justifying = justify ,
Justifying = justify ,
justified = justify ,
Justified = justify ,
}

\cs_new_protected:Npn \dez_align:n #1
{
\prop_get:NnN \c_dez__align_to_cmd_prop {#1} \l_tmpa_tl
\cs_if_exist_use:N \l_tmpb_str
}
\cs_generate_variant:Nn \dez_align:n { V }

\cs_new_protected:Npn \dez__align_begin:n #1
{
\prop_get:NnN \c_dez__align_to_env_prop {#1} \l_tmpa_tl
\begin_:V \l_tmpa_tl
}
\cs_generate_variant:Nn \dez__align_begin:n { V }

\cs_new:Npn \dez__align_end:n #1
{
\prop_get:NnN \c_dez__align_to_env_prop {#1} \l_tmpa_tl
\end_:V \l_tmpa_tl
}
\cs_generate_variant:Nn \dez__align_end:n { V }

%\NewDocumentCommand \Aligning { m }
% { \dez_align:n {#1} }
% { \tarmac_align:n {#1} }

\NewDocumentEnvironment {Align} { m }
{ \dez__align_begin:n {#1} }
{ \dez__align_end:n {#1} }
{ \tarmac_align_begin:n {#1} }
{ \tarmac_align_end:n {#1} }




Expand Down Expand Up @@ -2483,16 +2401,16 @@
{ \HideLinks }
\tl_if_eq:NnF \l__align_tl {justify}
{ \hbadness=10000 }
\dez_align:V \l__align_tl
\tarmac_align:V \l__align_tl
\tl_if_eq:NnTF \l__at_tl {top}
{ \glue_par_addvspace:N \l__above_dim }
{ \vspace*{\fill} }
\begin_r:nV {minipage} \l__width_dim
\dez__align_begin:V \l__align_tl
\tarmac_align_begin:V \l__align_tl
\textiles_use_or_inline:VVn \l__textile_tl \l__style_tl {#1\par}
}
{
\dez__align_end:V \l__align_tl
\tarmac_align_end:V \l__align_tl
\end {minipage}
\tl_if_eq:NnTF \l__at_tl {bottom}
{ \glue_par_addvspace:N \l__below_dim }
Expand Down Expand Up @@ -4972,7 +4890,6 @@
final = true , % ignore global settings
draft = false ,
linktoc = all ,
colorlinks = true ,
linkcolor = ref ,
citecolor = cite ,
urlcolor = url ,
Expand All @@ -4981,18 +4898,7 @@
}
\bool_if:NTF \g_dez_color_no_bool
{ \hypersetup { colorlinks = false } }
{
\hypersetup
{
colorlinks = true ,
linkcolor = ref ,
citecolor = cite ,
urlcolor = url ,
filecolor = file ,
runcolor = run ,
}
}

{ \hypersetup { colorlinks = true } }

\hook_gput_code:nnn
{ begindocument/before }
Expand Down
14 changes: 7 additions & 7 deletions src/info.sty
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@
\prop_map_inline:Nn \g_info_prop
{
\str_if_in:NnTF \c_info_hyperxmp_str {##1,}
{ \str_put_right:Nn #1 {pdf##1~=~{##2}} }
{ \str_put_right:Nn #2 {##1~=~{##2}} }
{ \str_put_right:Nn #1 {pdf##1={##2},} }
{ \str_put_right:Nn #2 {##1={##2},} }
}
}

Expand All @@ -206,21 +206,21 @@
\info_split_hyperxmp_data:NN \l__tmp_hyperxmp_str \l__tmp_nonhyperxmp_str
\info__knownxmpdata_info:V \l__tmp_hyperxmp_str
\info__unknownxmpdata_info:V \l__tmp_nonhyperxmp_str
\exp_args:Nx \hypersetup {\l__tmp_hyperxmp_str, \l__tmp_nonhyperxmp_str}
\exp_args:Ne \hypersetup {\l__tmp_hyperxmp_str, \l__tmp_nonhyperxmp_str}
}

\cs_new_protected:Npn \info_set_hyperxmp_data: #1
{
\info_split_hyperxmp_data:NN \l__tmp_hyperxmp_str \l__tmp_nonhyperxmp_str
\info__knownxmpdata_info:V \l__tmp_hyperxmp_str
\exp_args:Nx \hypersetup {\l__tmp_hyperxmp_str}
\exp_args:Ne \hypersetup {\l__tmp_hyperxmp_str}
}

\cs_new_protected:Npn \info_set_non_hyperxmp_data: #1
{
\info_split_hyperxmp_data:NN \l__tmp_hyperxmp_str \l__tmp_nonhyperxmp_str
\info__unknownxmpdata_info:V \l__tmp_nonhyperxmp_str
\exp_args:Nx \hypersetup {\l__tmp_nonhyperxmp_str}
\exp_args:Ne \hypersetup {\l__tmp_nonhyperxmp_str}
}

\NewDocumentCommand \AddPdfHyperxmpData { }
Expand Down Expand Up @@ -384,7 +384,7 @@
\group_begin:
\keys_set:nn {info / single} {#2}
\info_get:nN {#1} \l_my_str
\tl_set:Nx \l_tmpa_tl { \text_titlecase_first:V \l_my_str }
\tl_set:Ne \l_tmpa_tl { \text_titlecase_first:V \l_my_str }
\info__format_single:V \l_tmpa_tl
\group_end:
}
Expand Down Expand Up @@ -495,7 +495,7 @@
\group_begin:
\keys_set:nn {info / list} {#2}
\info_get:nN {#1} \l_tmpa_tl
\tl_set:Nx \l_tmpa_tl { \text_titlecase_first:V \l_tmpa_tl }
\tl_set:Ne \l_tmpa_tl { \text_titlecase_first:V \l_tmpa_tl }
\clist_set:NV \l_tmpa_clist \l_tmpa_tl
\seq_set_from_clist:NN \l_tmpa_seq \l_tmpa_clist
\info__format_list:N \l_tmpa_seq
Expand Down

0 comments on commit d897329

Please sign in to comment.