Conditional Styles

Discuss functionality of QuarkXPress 2016 (excluding Digital Publishing)
For Digital Publishing functionality please refer to forums in the "Digital Publishing" group.
RGB
Posts: 0
Joined: 29 Nov 2014, 11:30

Conditional Styles

Post by RGB » 12 Jun 2018, 11:20

Try as I might, I can't get conditional styles to work. What I want to do is alternate between one text font/size and another all the way through a document.

Code: Select all

style1 text style1 text style1 text \r\n
style2 text style2 text style2 text \p

style1 text style1 text style1 text \r\n
style2 text style2 text style2 text \p
...and so on

I watched a couple of YouTube videos on how to do this, thought it looked straightforward, and tried my best to follow the instructions. Either all of my text looks like one of the styles that I want to apply, or the conditional style makes no difference.

As you can see from above, I've inserted conditional markers after soft returns. (At first, I just set character to \n, but that didn't seem to work.) I wrote the first conditional to apply style_sheet1 up to (or through) the soft return and the second conditional to apply style_sheet2 up to a hard return. Then, I set the conditional style to repeat for every paragraph, but no joy... I have tried every permutation of the options that I can think of: specifying the end of the paragraph with /p, choosing to make the conditional run backwards, setting the conditional to repeat after a certain character, using only one conditional, and so on.

Any help would be appreciated.

User avatar
MikeWenzloff
Posts: 329
Joined: 05 Jun 2013, 12:55

Re: Conditional Styles

Post by MikeWenzloff » 12 Jun 2018, 17:11

Hi RGB,

I'm not certain I understand fully.

Is this an every other word thing?
Or every other sentence thing?
Or every other paragraph thing?
Or something different than above?

Are there soft returns involved? All hard returns? A mix?

Rather than a text based example, it may help to see a screen shot of placeholder text formatted how you would like and also showing Invisibles.

They are possible, but may require the setting of a conditional marker to truly work out. Easy to do in any decent text editor capable of Perl/GREP expressions.

Mike

RGB
Posts: 0
Joined: 29 Nov 2014, 11:30

Re: Conditional Styles

Post by RGB » 14 Jun 2018, 16:40

Hi, Mike.
MikeWenzloff wrote:Is this an every other word thing?
Or every other sentence thing?
Or every other paragraph thing?
Or something different than above?
It's just that I want the text to alternate between styles. Sometimes one style can last a line, a sentence, a paragraph, depending on the content.
Are there soft returns involved? All hard returns? A mix?
Yeah, in the code above, I tried to show the soft returns as \n and the hard returns as \p. I don't know anything about Perl/GREP expressions, but I have tried setting conditional markers. I'll post a screenshot as soon as I can.
Last edited by RGB on 14 Jun 2018, 17:29, edited 1 time in total.

User avatar
MikeWenzloff
Posts: 329
Joined: 05 Jun 2013, 12:55

Re: Conditional Styles

Post by MikeWenzloff » 14 Jun 2018, 16:46

They say a picture is worth...

I'll keep an eye out for it. Thanks.

User avatar
MikeWenzloff
Posts: 329
Joined: 05 Jun 2013, 12:55

Re: Conditional Styles

Post by MikeWenzloff » 14 Jun 2018, 17:42

Normal is black, NormalPlus is magenta and has an indent.

The condition triggers on a line break. The Normal lines could be longer and break themselves at the frame edge or right indent but the condition will still kick in once the line break (just the \n) is found.
capture-001905.png
capture-001905.png (39.02 KiB) Viewed 801 times

RGB
Posts: 0
Joined: 29 Nov 2014, 11:30

Re: Conditional Styles

Post by RGB » 15 Jun 2018, 16:27

That looks more or less exactly like what I was trying (that and many variations on the same theme). I'm usually pretty good at taking logical steps to solve problems, which is why it's so frustrating. I was applying predefined style-sheets that contained changes to font and font-size. I'll try again and report back. Thanks!

User avatar
MikeWenzloff
Posts: 329
Joined: 05 Jun 2013, 12:55

Re: Conditional Styles

Post by MikeWenzloff » 15 Jun 2018, 16:55

No worries. If you get stuck, just give a shout.

In that event, it would be good to attach a sample with dummy text but with your styles and what you've tried as far as the conditional styles.

Do remember--and this has caught me out before--to use character styles for the second line else the whole paragraph which includes the first line will change because of the soft return.

Best regards, Mike

RGB
Posts: 0
Joined: 29 Nov 2014, 11:30

Re: Conditional Styles

Post by RGB » 15 Jun 2018, 17:55

^ Thanks! Yeah, if need be, I'll definitely post a document. Unfortunately, I haven't yet had access to my home computer for long enough to make one.
MikeWenzloff wrote: Do remember--and this has caught me out before--to use character styles for the second line else the whole paragraph which includes the first line will change because of the soft return.
I'm not quite sure that I follow, but that does sound as if it could be the answer; it might explain why the program seemed to go through an attempt to implement a procedure but with no discernible result. Are the first and second lines of the conditional are different somehow?

User avatar
MikeWenzloff
Posts: 329
Joined: 05 Jun 2013, 12:55

Re: Conditional Styles

Post by MikeWenzloff » 15 Jun 2018, 18:34

RGB wrote:...Are the first and second lines of the conditional are different somehow?
The issue is that without a hard return, it is all one paragraph.

So if one desires to format a part of a paragraph differently than the base paragraph style, one has to use a character style to do so.

In my screen shot, I am applying the Normal character style up to the soft return (the \n) and using the NormalPlus character style through to the end of the paragraph from the soft return. You would need to substitute "Normal" for whatever the first line is.

The first part, the first line of the conditional style I show doesn't really do anything. I could have used Go To the soft return and then applied the NormalPlus character style to the remainder of the paragraph.

The NormalPlus character style in the screen shot is the Magenta colored text.

But the main take away is in my second paragraph above. Which is that both of those lines, a black line followed by the Magenta line is all one paragraph and so need a character style to change the base attributes.

RGB
Posts: 0
Joined: 29 Nov 2014, 11:30

Re: Conditional Styles

Post by RGB » 16 Jun 2018, 05:58

MikeWenzloff wrote: So if one desires to format a part of a paragraph differently than the base paragraph style, one has to use a character style to do so.
That is most likely where I went wrong. I understood the rest of the syntax.
The first part, the first line of the conditional style I show doesn't really do anything. I could have used Go To the soft return and then applied the NormalPlus character style to the remainder of the paragraph.
Yeah, that was one of the permutations that I tried. I'll have another go when I'm back at the ranch. I appreciate your patience, Mike.

Post Reply

Return to “QuarkXPress 2016: General”