How to write the hyphen substitution of - by hyp on my preamble?How to use the standard - (hyphen) as the...

How long after the last departure shall the airport stay open for an emergency return?

Does the damage from the Absorb Elements spell apply to your next attack, or to your first attack on your next turn?

Why did Rep. Omar conclude her criticism of US troops with the phrase "NotTodaySatan"?

Crossed out red box fitting tightly around image

Is it acceptable to use working hours to read general interest books?

What does a straight horizontal line above a few notes, after a changed tempo mean?

Creating a chemical industry from a medieval tech level without petroleum

Drawing a german abacus as in the books of Adam Ries

Difficulty accessing OpenType ligatures with LuaLaTex and fontspec

Should the Product Owner dictate what info the UI needs to display?

Unknown code in script

Multiple options vs single option UI

Co-worker works way more than he should

Will I lose my paid in full property

Could moose/elk survive in the Amazon forest?

std::unique_ptr of base class holding reference of derived class does not show warning in gcc compiler while naked pointer shows it. Why?

Complex numbers z=-3-4i polar form

Double-nominative constructions and “von”

Is there a word for the censored part of a video?

What is this word supposed to be?

How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?

What does "function" actually mean in music?

How to keep bees out of canned beverages?

Older movie/show about humans on derelict alien warship which refuels by passing through a star



How to write the hyphen substitution of - by hyp on my preamble?


How to use the standard - (hyphen) as the hyp{} command from the hyphenat package?Why doesn't latexmk handle errors in the preamble?How to break a word at a given length (without a hyphen)?How to remove diaeresis after hyphenHow to create a short upper hyphenShould I emphasize the hyphen, here?How to center text not including hyphen?How can I avoid using hyphen at the linebreak to separate a word?Hyphen not done - how to fixHow to Make the Following CV template compileHow to use the standard - (hyphen) as the hyp{} command from the hyphenat package?













0















When I integrated this How to use the standard - (hyphen) as the hyp{} command from the hyphenat package? into my main document, I got errors about hyphen usage on translations packages:



Redoing nameref's sectioning
Redoing nameref's label
(D:UserDocumentslatextexmfsinstalltexlatexmicrotypemt-cmr.cfg) (D:UserDocumentslatextexmfsinstalltexcontextbasesupp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) ABD: EverySelectfont initializing macros (D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict
D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: Missing endcsname inserted
D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: ==> Fatal error occurred, no output PDF file produced!
Transcript written on D:thesissetupcachemain.log.
gross execution time: 8855 ms
user mode: 8625 ms, kernel mode: 125 ms, total: 8750

... on main.log
Package lastpage Info: Please have a look at the pageslts package at
(lastpage) https://www.ctan.org/pkg/pageslts
(lastpage) ! on input line 332.
c@lstlisting=count631
(D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict
Dictionary: translator-basic-dictionary, Language: English

D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: Missing endcsname inserted
Here is how much of TeX's memory you used:


Then, I included it like this in my document:



begin{document}

ExplSyntaxOn
cs_new:Npn hyphenfix_emdash:c {---}
...

Tests.

Encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding.

end{document}


And it worked!



Is there a way to include it on my preamble instead of the start of my document?



Update



As suggested on comment, I added AtBeginDocument{, but it did not work:



usepackage{expl3}
AtBeginDocument{%
ExplSyntaxOn
cs_new:Npn hyphenfix_emdash:c {---}
cs_new:Npn hyphenfix_endash:c {--}

cs_new:Npn hyphenfix_discardnext:NN #1#2{#1}


catcode`-=active

cs_new_protected:Npn -{
futurelethyphenfix_nexttokhyphenfix_i:w
}

cs_new:Npn hyphenfix_i:w {
cs_if_eq:NNTF{hyphenfix_nexttok}{-}{
%discard the next `-` token
hyphenfix_discardnext:NN{futurelethyphenfix_nexttokhyphenfix_ii:w}
}{
% from package hyphenat
hyp
}
}

cs_new:Npn hyphenfix_ii:w {
cs_if_eq:NNTF{hyphenfix_nexttok}{-}{
hyphenfix_discardnext:NN{hyphenfix_emdash:c}
}{
hyphenfix_endash:c
}
}
ExplSyntaxOff
}


Not throw another error:



Package microtype Info: Loading generic protrusion settings for font family
(microtype) `pcr' (encoding: T1).
(microtype) For optimal results, create family-specific settings.
(microtype) See the microtype manual for details.
main.tex:333: Missing $ inserted
Here is how much of TeX's memory you used:


On the line main.tex:333 I have begin{document}.










share|improve this question

























  • In your preamble, AtBeginDocument{ExplSyntaxOn cs_new:Npn hyphenfix_emdash:c {---}....}

    – Steven B. Segletes
    12 mins ago













  • I tried this but did not work. I updated the question with the details.

    – user
    2 mins ago











  • Could I put this in a command and run it manually after begin{document}?

    – user
    1 min ago
















0















When I integrated this How to use the standard - (hyphen) as the hyp{} command from the hyphenat package? into my main document, I got errors about hyphen usage on translations packages:



Redoing nameref's sectioning
Redoing nameref's label
(D:UserDocumentslatextexmfsinstalltexlatexmicrotypemt-cmr.cfg) (D:UserDocumentslatextexmfsinstalltexcontextbasesupp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) ABD: EverySelectfont initializing macros (D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict
D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: Missing endcsname inserted
D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: ==> Fatal error occurred, no output PDF file produced!
Transcript written on D:thesissetupcachemain.log.
gross execution time: 8855 ms
user mode: 8625 ms, kernel mode: 125 ms, total: 8750

... on main.log
Package lastpage Info: Please have a look at the pageslts package at
(lastpage) https://www.ctan.org/pkg/pageslts
(lastpage) ! on input line 332.
c@lstlisting=count631
(D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict
Dictionary: translator-basic-dictionary, Language: English

D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: Missing endcsname inserted
Here is how much of TeX's memory you used:


Then, I included it like this in my document:



begin{document}

ExplSyntaxOn
cs_new:Npn hyphenfix_emdash:c {---}
...

Tests.

Encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding.

end{document}


And it worked!



Is there a way to include it on my preamble instead of the start of my document?



Update



As suggested on comment, I added AtBeginDocument{, but it did not work:



usepackage{expl3}
AtBeginDocument{%
ExplSyntaxOn
cs_new:Npn hyphenfix_emdash:c {---}
cs_new:Npn hyphenfix_endash:c {--}

cs_new:Npn hyphenfix_discardnext:NN #1#2{#1}


catcode`-=active

cs_new_protected:Npn -{
futurelethyphenfix_nexttokhyphenfix_i:w
}

cs_new:Npn hyphenfix_i:w {
cs_if_eq:NNTF{hyphenfix_nexttok}{-}{
%discard the next `-` token
hyphenfix_discardnext:NN{futurelethyphenfix_nexttokhyphenfix_ii:w}
}{
% from package hyphenat
hyp
}
}

cs_new:Npn hyphenfix_ii:w {
cs_if_eq:NNTF{hyphenfix_nexttok}{-}{
hyphenfix_discardnext:NN{hyphenfix_emdash:c}
}{
hyphenfix_endash:c
}
}
ExplSyntaxOff
}


Not throw another error:



Package microtype Info: Loading generic protrusion settings for font family
(microtype) `pcr' (encoding: T1).
(microtype) For optimal results, create family-specific settings.
(microtype) See the microtype manual for details.
main.tex:333: Missing $ inserted
Here is how much of TeX's memory you used:


On the line main.tex:333 I have begin{document}.










share|improve this question

























  • In your preamble, AtBeginDocument{ExplSyntaxOn cs_new:Npn hyphenfix_emdash:c {---}....}

    – Steven B. Segletes
    12 mins ago













  • I tried this but did not work. I updated the question with the details.

    – user
    2 mins ago











  • Could I put this in a command and run it manually after begin{document}?

    – user
    1 min ago














0












0








0








When I integrated this How to use the standard - (hyphen) as the hyp{} command from the hyphenat package? into my main document, I got errors about hyphen usage on translations packages:



Redoing nameref's sectioning
Redoing nameref's label
(D:UserDocumentslatextexmfsinstalltexlatexmicrotypemt-cmr.cfg) (D:UserDocumentslatextexmfsinstalltexcontextbasesupp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) ABD: EverySelectfont initializing macros (D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict
D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: Missing endcsname inserted
D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: ==> Fatal error occurred, no output PDF file produced!
Transcript written on D:thesissetupcachemain.log.
gross execution time: 8855 ms
user mode: 8625 ms, kernel mode: 125 ms, total: 8750

... on main.log
Package lastpage Info: Please have a look at the pageslts package at
(lastpage) https://www.ctan.org/pkg/pageslts
(lastpage) ! on input line 332.
c@lstlisting=count631
(D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict
Dictionary: translator-basic-dictionary, Language: English

D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: Missing endcsname inserted
Here is how much of TeX's memory you used:


Then, I included it like this in my document:



begin{document}

ExplSyntaxOn
cs_new:Npn hyphenfix_emdash:c {---}
...

Tests.

Encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding.

end{document}


And it worked!



Is there a way to include it on my preamble instead of the start of my document?



Update



As suggested on comment, I added AtBeginDocument{, but it did not work:



usepackage{expl3}
AtBeginDocument{%
ExplSyntaxOn
cs_new:Npn hyphenfix_emdash:c {---}
cs_new:Npn hyphenfix_endash:c {--}

cs_new:Npn hyphenfix_discardnext:NN #1#2{#1}


catcode`-=active

cs_new_protected:Npn -{
futurelethyphenfix_nexttokhyphenfix_i:w
}

cs_new:Npn hyphenfix_i:w {
cs_if_eq:NNTF{hyphenfix_nexttok}{-}{
%discard the next `-` token
hyphenfix_discardnext:NN{futurelethyphenfix_nexttokhyphenfix_ii:w}
}{
% from package hyphenat
hyp
}
}

cs_new:Npn hyphenfix_ii:w {
cs_if_eq:NNTF{hyphenfix_nexttok}{-}{
hyphenfix_discardnext:NN{hyphenfix_emdash:c}
}{
hyphenfix_endash:c
}
}
ExplSyntaxOff
}


Not throw another error:



Package microtype Info: Loading generic protrusion settings for font family
(microtype) `pcr' (encoding: T1).
(microtype) For optimal results, create family-specific settings.
(microtype) See the microtype manual for details.
main.tex:333: Missing $ inserted
Here is how much of TeX's memory you used:


On the line main.tex:333 I have begin{document}.










share|improve this question
















When I integrated this How to use the standard - (hyphen) as the hyp{} command from the hyphenat package? into my main document, I got errors about hyphen usage on translations packages:



Redoing nameref's sectioning
Redoing nameref's label
(D:UserDocumentslatextexmfsinstalltexlatexmicrotypemt-cmr.cfg) (D:UserDocumentslatextexmfsinstalltexcontextbasesupp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) ABD: EverySelectfont initializing macros (D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict
D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: Missing endcsname inserted
D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: ==> Fatal error occurred, no output PDF file produced!
Transcript written on D:thesissetupcachemain.log.
gross execution time: 8855 ms
user mode: 8625 ms, kernel mode: 125 ms, total: 8750

... on main.log
Package lastpage Info: Please have a look at the pageslts package at
(lastpage) https://www.ctan.org/pkg/pageslts
(lastpage) ! on input line 332.
c@lstlisting=count631
(D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict
Dictionary: translator-basic-dictionary, Language: English

D:UserDocumentslatextexmfsinstalltexlatexbeamertranslatordictstranslator-basic-dictionarytranslator-basic-dictionary-English.dict:2: Missing endcsname inserted
Here is how much of TeX's memory you used:


Then, I included it like this in my document:



begin{document}

ExplSyntaxOn
cs_new:Npn hyphenfix_emdash:c {---}
...

Tests.

Encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding-encoding.

end{document}


And it worked!



Is there a way to include it on my preamble instead of the start of my document?



Update



As suggested on comment, I added AtBeginDocument{, but it did not work:



usepackage{expl3}
AtBeginDocument{%
ExplSyntaxOn
cs_new:Npn hyphenfix_emdash:c {---}
cs_new:Npn hyphenfix_endash:c {--}

cs_new:Npn hyphenfix_discardnext:NN #1#2{#1}


catcode`-=active

cs_new_protected:Npn -{
futurelethyphenfix_nexttokhyphenfix_i:w
}

cs_new:Npn hyphenfix_i:w {
cs_if_eq:NNTF{hyphenfix_nexttok}{-}{
%discard the next `-` token
hyphenfix_discardnext:NN{futurelethyphenfix_nexttokhyphenfix_ii:w}
}{
% from package hyphenat
hyp
}
}

cs_new:Npn hyphenfix_ii:w {
cs_if_eq:NNTF{hyphenfix_nexttok}{-}{
hyphenfix_discardnext:NN{hyphenfix_emdash:c}
}{
hyphenfix_endash:c
}
}
ExplSyntaxOff
}


Not throw another error:



Package microtype Info: Loading generic protrusion settings for font family
(microtype) `pcr' (encoding: T1).
(microtype) For optimal results, create family-specific settings.
(microtype) See the microtype manual for details.
main.tex:333: Missing $ inserted
Here is how much of TeX's memory you used:


On the line main.tex:333 I have begin{document}.







errors compiling hyphenation compilation-error hyphenat






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 mins ago







user

















asked 14 mins ago









useruser

1,31021131




1,31021131













  • In your preamble, AtBeginDocument{ExplSyntaxOn cs_new:Npn hyphenfix_emdash:c {---}....}

    – Steven B. Segletes
    12 mins ago













  • I tried this but did not work. I updated the question with the details.

    – user
    2 mins ago











  • Could I put this in a command and run it manually after begin{document}?

    – user
    1 min ago



















  • In your preamble, AtBeginDocument{ExplSyntaxOn cs_new:Npn hyphenfix_emdash:c {---}....}

    – Steven B. Segletes
    12 mins ago













  • I tried this but did not work. I updated the question with the details.

    – user
    2 mins ago











  • Could I put this in a command and run it manually after begin{document}?

    – user
    1 min ago

















In your preamble, AtBeginDocument{ExplSyntaxOn cs_new:Npn hyphenfix_emdash:c {---}....}

– Steven B. Segletes
12 mins ago







In your preamble, AtBeginDocument{ExplSyntaxOn cs_new:Npn hyphenfix_emdash:c {---}....}

– Steven B. Segletes
12 mins ago















I tried this but did not work. I updated the question with the details.

– user
2 mins ago





I tried this but did not work. I updated the question with the details.

– user
2 mins ago













Could I put this in a command and run it manually after begin{document}?

– user
1 min ago





Could I put this in a command and run it manually after begin{document}?

– user
1 min ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f487650%2fhow-to-write-the-hyphen-substitution-of-by-hyp-on-my-preamble%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f487650%2fhow-to-write-the-hyphen-substitution-of-by-hyp-on-my-preamble%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can't compile dgruyter and caption packagesLaTeX templates/packages for writing a patent specificationLatex...

Schneeberg (Smreczany) Bibliografia | Menu...

Hans Bellmer Spis treści Życiorys | Upamiętnienie | Przypisy | Bibliografia | Linki zewnętrzne |...